Thursday, October 14, 2021

SAP IBP error: RETURN WITHOUT GOSUB

 

in EXCEL , press ALT+F11, and go to the menu,

 Change the vba setting to:





Wednesday, February 3, 2021

Nginx reverse proxy for fava beancount

location /beancount_joe/ {
        proxy_pass http://192.168.1.254:5000/joe/;
         }

location /joe/ {
        proxy_pass http://192.168.1.254:5000/joe/;
        }

location ~ /static/ {
         proxy_pass http://192.168.1.254:5000;
        }



#"joe" is the account title.

Tuesday, April 2, 2019

SAP: Change default selection for SM37

In the simple job selection, system will default select release ready active finished and cancelled jobs.
But I usually just want select active jobs.
I tried use SHD0 but not works.
So I got solutions:
1 GUIXT can works .
2 change Default value set in FM: BP_JOB_SELECT_SM37B subroutine:
 INIT_DEFAULT_SELECTION.

  DEFAULT_SELECTION-SCHEDUL   ''.
  DEFAULT_SELECTION-READY     ''.
  DEFAULT_SELECTION-RUNNING   'X'.
  DEFAULT_SELECTION-FINISHED  ''.
  DEFAULT_SELECTION-ABORTED   ''.

Thursday, January 31, 2019

SAP APO CIF: No location 1000 exists for mapping entry

APO CIF error:
   No location 1000 exists for mapping entry

Use below program fix it, you own the risk.

*&---------------------------------------------------------------------*
*& Report  ZUPDATE_LOCATION
*& This report used to fix the error message like:
*&    No location 0000001002 exists for mapping entry 0000001002 of cat. 1011 B
*&  this is due to you CIFed location data before you implement BADI SMOD_APOCF001,
*&  locno in /SAPAPO/LOCMAP and /SAPAPO/LOC missed prefix as a result.
*&  but this program can only correct location with internal number.
*&---------------------------------------------------------------------*
REPORT ZUPDATE_LOCATION.
TABLES/SAPAPO/LOCMAP.
DATALT_LOCMAP TYPE STANDARD TABLE OF /SAPAPO/LOCMAP WITH HEADER LINE,
      LT_LOC    TYPE STANDARD TABLE OF /SAPAPO/LOC WITH HEADER LINE,
      PREFIX    TYPE                   /SAPAPO/C_LOCTYPE.

* method: IF_EX_SMOD_APOCF001~EXIT_/SAPAPO/SAPLCIF_LOC_001
SELECT-OPTIONSS_LOCNO FOR /SAPAPO/LOCMAP-LOCNO.

SELECT FROM /SAPAPO/LOCMAP  INTO TABLE LT_LOCMAP WHERE LOCNO IN S_LOCNO
                                                    " WHERE LOCNO LIKE '0%'.
CHECK SY-SUBRC EQ 0.
LOOP AT LT_LOCMAP.
  " FIND FIRST OCCURRENCE OF REGEX '[0-9]' IN LT_LOCMAP-LOCNO(1).
    PERFORM DETERMINE_PREFIX USING LT_LOCMAP-LOCTYPE CHANGING PREFIX.
  IF LT_LOCMAP-LOCNO(2<> PREFIX.
    CONCATENATE PREFIX LT_LOCMAP-EXT_LOCNO INTO LT_LOCMAP-LOCNO.
    MODIFY LT_LOCMAP.
    MODIFY /SAPAPO/LOCMAP FROM LT_LOCMAP.  " start to update system table.
    UPDATE /SAPAPO/LOC SET LOCNO LT_LOCMAP-LOCNO WHERE LOCID LT_LOCMAP-LOCID.
    NEW-LINE.
    write/ SY-TABIX' Location changed to 'LT_LOCMAP-LOCNO'GUID'LT_LOCMAP-LOCID.
  ELSE.
    DELETE LT_LOCMAP.
  ENDIF.
ENDLOOP.
GET TIME.


FORM DETERMINE_PREFIX USING LV_LOCTYPE TYPE /SAPAPO/C_LOCTYPE CHANGING PREFIX TYPE /SAPAPO/C_LOCTYPE.
  CLEAR PREFIX.
  CASE LV_LOCTYPE.
    WHEN '1001'.
      PREFIX 'PL'.              " Plant
    WHEN '1002'.
      PREFIX 'DC'.              " Distribution Center
    WHEN '1003'.
      PREFIX 'SP'.              " Shipping Point
    WHEN '1005'.
*       Transportation zone numbers look always like:
*         US-1234567890           -> These are already 13 characters
*       Adding @XXXNNN (XXX = BSG, NNN = client) we have 20 characts.
*       So we can't add a prefix like TZ -> Transp.zones have no prefix!
      CLEAR PREFIX.               " Transportation Zone
    WHEN '1007'.
      PREFIX 'MR'.              " MRP Area
    WHEN '1010'.
      PREFIX 'CU'.              " Customer
    WHEN '1011'.
      PREFIX 'SU'.              " Supplier
    WHEN '1020'.
      PREFIX 'CA'.              " Carrier
    WHEN '1040'.
      PREFIX 'ST'.              " Store
  ENDCASE.
ENDFORM.

Thursday, November 8, 2018

Ubuntu frozen after running hours


This is caused by ACPI power management.
It's can be turn off in grub.
Go to Ubuntu terminator.
sudo vi /etc/default/grub
Modify the line and add acpi=off
and use command:
sudo update-grub
sudo reboot









Tuesday, October 23, 2018

Change source system name after transport


Thanks to Robert. 

You are not able to import the TR correctly due the table is not maintained properly.

 SM30 TABLE: RSLOGSYSMAP

Machine generated alternative text:
SAP NetWeaver 
Gateway 
Gateway Service Enablement 
UI Technologies 
D General settings 
Mobile Infrastructure 
Business Warehouse 
D General Settings 
Performance Settings 
D Links to Other Source Systems 
LIDI Settings by Purpose 
D Automated Processes 
ranspot Settings