Monday, December 21, 2015

2LIS_03_BF/BX

Inventory



Deleting Setup Tables : LBWG(03)
Filling Setup Tables    : OLI1BW
Setup Table Job           : RMCBNEUA

Tables
MKPF
MSEG

TCodes
MB01/02/03



SAP Notes
492828 - Determining the transaction key for 2LIS_03_BF + 2LIS_03_UM


Wednesday, November 11, 2015

2LIS_06_INV

Filling Setup Tables : OLI6BW
Delete Setup Tables : LBWG - Application 06
Setup Table : MC06M_0ITMSETUP

When running setup tables, the selection screen parameters are mandatory, even  the screen doesn’t say so.
With out the selections the job would give the error

Enter Doc number, Year and Comp Code and run the setup tables. It ran fine few times, but twice I had duplicate error. So I deleted the setup tables (LBWG) and ran them again with only Doc Number and Year.

My Notes:
This datasource is used to get the invoiced data. The requirement is to replicate 'MB5S' tcode from ECC. Users wanted the data from EKBE table which shows Invoiced Quantities BEWTP = Q and 'E' delivered quantities.

The entries from EKBE with BEWTP = 'Q' can be extracted using this datasource, given that we extract records where EBELN, MENGE,MATNR are not inital (my assumption and it worked fine).

The BEWTP = 'E' is extracted from 2LIS_03_BF.

Issues:

  • Difference in amounts of MSEG-DMBTR and EKBE-DMBTR
    • EKBE table has Purchase Order History data and MSEG has Document Segment: Material data in it. When using a Join of 2LIS_03_BF ( for Good Movement (E) from MSEG data ) and 2LIS_06_INV ( for Invoice (Q) from EKBE data ) ; In general the DBMTR is same in MSEG and EKBE, but there are few scenarios when they are different. Below is the explanation.
    • http://scn.sap.com/thread/1895345
    • For the below example the $0 value in MSEG is due to the fact that the std price for that material in table MBEW is $0 - this is the value that would post to inventory.  The value that appears in EKBE for where value = "E" is the amount the vendor is invoicing us.  So it appears that EKBE is using the invoiced amount as the value for DMBTR.





SAP Link

APD

APD - Analysis Process Designer

TCode: RSANWB

Debugging APDs
https://blogs.sap.com/2014/03/04/steps-to-debug-apd-routine-code/

Duplicates in APD

  • Go the step and do an intermediate result.
    • This will generate a temporary table with results from that stage.
    • The table is be visible in SE11/SE16 as regular table
    • See if you can find the duplicates from the set
  • Delete the intermediate result table again.



Some known issues
  • APD connecting lines are missing
    • If the connecting lines between the APDs are missing.
      • This issue happened after SAP 7.4 GUI update/
      • Check Note 2227956

  • APD taking long time to run
    • Uncheck 'Process Data in Memory' to improve the APD performance. It is checked by default.
      • GoTo -> Performance Settings

Differences

Difference between REFRESH; FREE; CLEAR
REFRESH : If REFRESH is applied on an internal table  then the entries in the table will be deleted but the memory allocated to that table still exists.

FREE : If FREE is applied on an internal table then the memory allocated to that table will not exist and that memory can be used by some other variable/object.In this case both the entries and the memory do not exist anymore.

CLEAR : pplied on If CLEAR is generally used for workareas and also, if the internal table is defined with header line, clear can be applied to clear the header line. The memory allocated to it is not removed.

Difference between CHECK and IF
if the IF condition is not satisfied control will go to the next statements. Here when the IF condition is used, and the condition is not satisfied, control looks for remaining executable lines inside the loop.

in case of CHECK if the condition is not satisfied control will; not go further.Here when the CHECK condition is used, and the condition is not satisfied, control comes outside the loop.

Unwanted Characters

Method 1
*** Removing unwanted characters.
DATA: var_str(100) VALUE
‘QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890-_’  ,
var_custpo TYPE /BIC/OIZCCUSTPO,
var_temp TYPE /BIC/OIZCCUSTPO,
var_len(3) TYPE c.
CLEAR: var_custpo,
var_len,
var_temp.
var_custpo = source_fields-/bic/zccustpo.
var_len = strlen( var_custpo ).
DO var_len TIMES.
SUBTRACT 1 FROM var_len.
IF var_str CS var_custpo+var_len(1).
CONCATENATE var_custpo+var_len(1) var_temp INTO var_temp.
ENDIF.
ENDDO.
RESULT = var_temp.

Method 2

CONSTANTS: c_allowed(100) TYPE C value
‘ #{}[]!”%&”()*+,-./:;<=>?_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcd’ &
‘efghi’ &
‘jklmnopqrstuvwxyz ‘.
DATA : var_EANUPC TYPE /BI0/OIEANUPC,
var_len TYPE i,
var_error TYPE sy-subrc,
var_offset TYPE sy-index.
CLEAR: var_EANUPC.
var_EANUPC = SOURCE_FIELDS-EANUPC.
TRANSLATE var_EANUPC TO UPPER CASE.
CLEAR: var_error.
CALL FUNCTION ‘RSKC_CHAVL_CHECK’
EXPORTING
I_CHAVL                     = var_EANUPC
IMPORTING
E_ERR_SUBRC                 = var_error.
IF var_error NE 0.
CLEAR: var_len.
var_len = strlen( var_EANUPC ).
DO var_len TIMES.
CLEAR:var_offset.
var_offset = sy-index – 1.
IF var_EANUPC+var_offset(1) CO c_allowed.
ELSE.
var_EANUPC+var_offset(1) = ”.
ENDIF.
ENDDO.
ENDIF.
* result value of the routine
RESULT = var_EANUPC.