HEADER: ADD Customer Fields to structure of IMKPF and BAPI_TE_XMKPF.
Items: ADD Customer Fields to structure of IMSEG and BAPI_TE_XMSEG.
Implements the Badi:
Line 417 of Function BAPI_GOODSMVT_CREATE .
TRY.
call badi lo_mb_bapi_goodsmvt_create->extensionin_to_matdoc
EXPORTING
EXTENSION_IN = EXTENSIONIN[]
CHANGING
CS_IMKPF = S_IMKPF
CT_IMSEG = T_IMSEG[]
CT_RETURN = return.
CATCH cx_badi_initial_reference. "#EC NO_HANDLER
ENDTRY.
METHOD IF_EX_MB_BAPI_GOODSMVT_CREATE~EXTENSIONIN_TO_MATDOC.
DATA:
c_lenstruc TYPE i VALUE 30,
wa_bapi_mb_header TYPE bapi_te_xmkpf,
wa_bapi_mb_item TYPE bapi_te_xmseg,
wa_extension_in TYPE bapiparex.
FIELD-SYMBOLS:
<fs_imseg> TYPE imseg.
CHECK NOT extension_in[] IS INITIAL.
* Analyze IMSEG for document structure and assign LINE_IDs if necessary
CALL METHOD cl_mmim_line_id_manager=>analyze_mb_create
CHANGING
ct_imseg = ct_imseg[]
EXCEPTIONS
duplicate_line_id = 1
OTHERS = 2.
LOOP AT extension_in INTO wa_extension_in.
CASE wa_extension_in-structure.
* extension of MKPF
WHEN 'BAPI_TE_XMKPF'.
MOVE wa_extension_in+c_lenstruc TO wa_bapi_mb_header.
MOVE-CORRESPONDING wa_bapi_mb_header TO cs_imkpf.
* extension of MSEG
WHEN 'BAPI_TE_XMSEG'.
MOVE wa_extension_in+c_lenstruc TO wa_bapi_mb_item.
READ TABLE ct_imseg
WITH KEY line_id = wa_bapi_mb_item-matdoc_itm
ASSIGNING <fs_imseg>.
IF sy-subrc EQ 0.
MOVE-CORRESPONDING wa_bapi_mb_item TO <fs_imseg>.
ENDIF.
ENDCASE.
ENDLOOP.
ENDMETHOD.
订阅:
博文评论 (Atom)
Customer Characteristic
Characteristic Descriptions are stored in the table - CABNT - Language - SPRAS - Characteristic description - ATBEZ Characteristic Values ...
-
REPORT ZBPADD2 . DATA : L_PARTN_CAT TYPE BAPIBUS1006_HEAD - PARTN_CAT , LS_CENTRAL TYPE BAPIBUS1006_CENTRAL , ...
-
HEADER: ADD Customer Fields to structure of IMKPF and BAPI_TE_XMKPF. Items: ADD Customer Fields to structure of IMSEG and BAPI_TE_XMSEG....
-
FUNCTION:SD_SALESDOCUMENT_CREATE Append fiels to Structure below. BAPE_VBAP BAPE_VBAPX VBAPKOZ VBAPKOZX No need to append fields to Struc...
没有评论:
发表评论