|
<< Click to Display Table of Contents >> Navigation: All About ABAP Technique > Indonesia > Function Module Examples Code > Check Recursive Material BOM |
Objective |
Pengetahuan menggunakan Function Module Standard SAP untuk checking material BOM yang rekursif |
Support |
|
Contributor |
Albertus Reinandang ( reinandang@yahoo.com ) |
CS_RC_RECURSIVITY_CHECK : BOMs: recursiveness check
Contoh :
REPORT ztest_fm1101.
PARAMETERS : pa_matnr LIKE mara-matnr DEFAULT '000000000051200027'.
START-OF-SELECTION.
DATA: BEGIN OF tmc29u OCCURS 0.
INCLUDE STRUCTURE mc29u.
DATA: END OF tmc29u.
DATA: BEGIN OF tma29v OCCURS 0.
INCLUDE STRUCTURE ma29v.
DATA: END OF tma29v.
DATA: BEGIN OF tpre03 OCCURS 0.
INCLUDE STRUCTURE pre03.
DATA: END OF tpre03.
tpre03-matnr = pa_matnr.
APPEND tpre03.
CALL FUNCTION 'MATERIAL_READ_DISST'
TABLES
ima29v = tma29v
ipre03 = tpre03.
LOOP AT tma29v.
MOVE-CORRESPONDING tma29v TO tmc29u.
APPEND tmc29u.
ENDLOOP.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'CS_RC_RECURSIVITY_CHECK'
EXPORTING
eidnrk = '000000000051200002'
emode = '1'
e_rec_stlnr = 'INTERNAL'
e_rec_stlal = '01'
e_rec_stlty = 'M'
e_rec_matnr = '000000000051200027'
TABLES
headertab = tmc29u
EXCEPTIONS
call_invalid = 1
recursivity_found = 2
OTHERS = 3.
IF sy-subrc = 2.
WRITE : / 'Recursif'.
ENDIF.