2019年5月6日星期一
Add append fields to bapi BAPI_OUTB_DELIVERY_CHANGE
1.add apend fields to structure vbkok and vbpok
2.implement badi:SMOD_V50B0001 method EXIT_SAPLV50I_010
METHOD IF_EX_SMOD_V50B0001~EXIT_SAPLV50I_010.
CONSTANTS:
LC_VBKOK TYPE CHAR5 VALUE 'VBKOK', "出荷ヘッダ(拡張項目ZXX含まれる)
LC_VBPOK TYPE CHAR5 VALUE 'VBPOK', "出荷明細(拡張項目ZXX含まれる)
LC_CS_VBKOK TYPE CHAR8 VALUE 'CS_VBKOK'.
DATA:
LV_ITEM TYPE POSNR_VL,
LW_EXTENSION2 TYPE BAPIEXT.
FIELD-SYMBOLS:
<LFS_FIELDNAME> TYPE ANY,
<LFS_VBKOK> TYPE ANY,
<LFS_VBPOK> TYPE ANY.
LOOP AT EXTENSION2 INTO LW_EXTENSION2.
CASE LW_EXTENSION2-PARAM.
WHEN LC_VBKOK. "LIKPの拡張項目
ASSIGN (LC_CS_VBKOK) TO <LFS_VBKOK>.
IF <LFS_VBKOK> IS ASSIGNED.
ASSIGN COMPONENT LW_EXTENSION2-FIELD OF STRUCTURE <LFS_VBKOK> TO <LFS_FIELDNAME>.
IF <LFS_FIELDNAME> IS ASSIGNED.
<LFS_FIELDNAME> = LW_EXTENSION2-VALUE.
ENDIF.
ENDIF.
WHEN LC_VBPOK. "LIPSの拡張項目
MOVE LW_EXTENSION2-ROW TO LV_ITEM.
READ TABLE CT_VBPOK ASSIGNING <LFS_VBPOK> WITH KEY POSNR_VL = LV_ITEM.
IF SY-SUBRC = 0.
ASSIGN COMPONENT LW_EXTENSION2-FIELD OF STRUCTURE <LFS_VBPOK> TO <LFS_FIELDNAME>.
IF <LFS_FIELDNAME> IS ASSIGNED.
<LFS_FIELDNAME> = LW_EXTENSION2-VALUE.
ENDIF.
ENDIF.
ENDCASE.
2.implement badi:SMOD_V50B0001 method EXIT_SAPLV50I_010
METHOD IF_EX_SMOD_V50B0001~EXIT_SAPLV50I_010.
CONSTANTS:
LC_VBKOK TYPE CHAR5 VALUE 'VBKOK', "出荷ヘッダ(拡張項目ZXX含まれる)
LC_VBPOK TYPE CHAR5 VALUE 'VBPOK', "出荷明細(拡張項目ZXX含まれる)
LC_CS_VBKOK TYPE CHAR8 VALUE 'CS_VBKOK'.
DATA:
LV_ITEM TYPE POSNR_VL,
LW_EXTENSION2 TYPE BAPIEXT.
FIELD-SYMBOLS:
<LFS_FIELDNAME> TYPE ANY,
<LFS_VBKOK> TYPE ANY,
<LFS_VBPOK> TYPE ANY.
LOOP AT EXTENSION2 INTO LW_EXTENSION2.
CASE LW_EXTENSION2-PARAM.
WHEN LC_VBKOK. "LIKPの拡張項目
ASSIGN (LC_CS_VBKOK) TO <LFS_VBKOK>.
IF <LFS_VBKOK> IS ASSIGNED.
ASSIGN COMPONENT LW_EXTENSION2-FIELD OF STRUCTURE <LFS_VBKOK> TO <LFS_FIELDNAME>.
IF <LFS_FIELDNAME> IS ASSIGNED.
<LFS_FIELDNAME> = LW_EXTENSION2-VALUE.
ENDIF.
ENDIF.
WHEN LC_VBPOK. "LIPSの拡張項目
MOVE LW_EXTENSION2-ROW TO LV_ITEM.
READ TABLE CT_VBPOK ASSIGNING <LFS_VBPOK> WITH KEY POSNR_VL = LV_ITEM.
IF SY-SUBRC = 0.
ASSIGN COMPONENT LW_EXTENSION2-FIELD OF STRUCTURE <LFS_VBPOK> TO <LFS_FIELDNAME>.
IF <LFS_FIELDNAME> IS ASSIGNED.
<LFS_FIELDNAME> = LW_EXTENSION2-VALUE.
ENDIF.
ENDIF.
ENDCASE.
ENDLOOP.
3. implement badi (enhancement spot) LE_SHP_DELIVERY_UPDATE
method IF_EX_LE_SHP_DELIVERY_UPDATE~UPDATE_HEADER.
CS_LIKP-ZZ1_TEST_TOSS_NO_DLH = IS_VBKOK-ZZ2_TEST_TOSS_NO_DLH.
endmethod.
CS_LIKP-ZZ1_TEST_TOSS_NO_DLH = IS_VBKOK-ZZ2_TEST_TOSS_NO_DLH.
endmethod.
method IF_EX_LE_SHP_DELIVERY_UPDATE~UPDATE_ITEM.
endmethod.
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...