DATA: ls_vbsk LIKE vbsk,
es_vbsk LIKE vbsk,
lt_spe_vbfs TYPE TABLE OF /spe/vbfs,
ls_spe_vbfs TYPE /spe/vbfs,
lt_komdlgn TYPE TABLE OF komdlgn,
ls_komdlgn TYPE komdlgn,
lt_vbfs TYPE TABLE OF vbfs,
ls_vbfs TYPE vbfs,
lt_vbls TYPE TABLE OF vbls,
ls_vbls TYPE vbls.
DATA: lt_prop TYPE STANDARD TABLE OF wuebs,
ls_prop TYPE wuebs.
DATA: l_nrnr TYPE inri-nrrangenr.
DATA: ls_tvsa TYPE tvsa.
CLEAR:ls_vbsk,lt_spe_vbfs,ls_spe_vbfs,lt_komdlgn,ls_komdlgn,lt_vbfs,ls_vbfs,lt_vbls,ls_vbls,
lt_prop,ls_prop,l_nrnr,ls_tvsa.
ls_komdlgn-lfart = 'ZEL'.
ls_komdlgn-vgtyp = 'V'.
ls_komdlgn-kzazu = 'X'.
ls_komdlgn-lfdat = gs_inbound-lfdat.
ls_komdlgn-wadat = gs_inbound-wadat_ist.
ls_komdlgn-vstel = 'NL10'.
ls_komdlgn-vgbel = gs_inbound-ebeln.
ls_komdlgn-vgpos = gs_inbound-ebelp.
ls_komdlgn-lifnr = gs_inbound-lifnr.
ls_komdlgn-lfimg = gs_inbound-lfimg.
"ls_komdlgn-vgpos = 10.
ls_komdlgn-matnr = gs_inbound-matnr.
ls_komdlgn-werks = gs_inbound-werks.
ls_komdlgn-lgort = gs_inbound-lgort.
ls_komdlgn-vrkme = gs_inbound-meins.
ls_komdlgn-meins = gs_inbound-meins.
ls_komdlgn-lifex = gs_inbound-ebeln.
ls_komdlgn-lifexpos = gs_inbound-ebelp.
ls_komdlgn-zz_etoporto = gs_inbound-zz_etoporto.
ls_komdlgn-zz_etdport = gs_inbound-zz_etdport.
ls_komdlgn-zz_atdport = gs_inbound-zz_atdport.
ls_komdlgn-zz_etaport = gs_inbound-zz_etaport.
ls_komdlgn-zz_ataport = gs_inbound-zz_ataport.
ls_komdlgn-zz_disport = gs_inbound-zz_disport.
"ls_komdlgn-zz_empret = gs_inbound-zz_empret.
APPEND ls_komdlgn TO lt_komdlgn.
ls_vbsk-mandt = sy-mandt.
ls_vbsk-ernam = sy-uname.
ls_vbsk-erdat = sy-datum.
ls_vbsk-uzeit = sy-uzeit.
ls_vbsk-smart = 'L'.
SELECT SINGLE * INTO ls_tvsa
FROM tvsa WHERE smart = ls_vbsk-smart.
l_nrnr = ls_tvsa-numki.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = l_nrnr
object = 'RV_SAMMG'
IMPORTING
number = ls_vbsk-sammg
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'GN_DELIVERY_CREATE'
EXPORTING
vbsk_i = ls_vbsk
IMPORTING
vbsk_e = ls_vbsk
* ET_SPLITPROT =
* ET_VBADR =
* ET_VBPA =
TABLES
xkomdlgn = lt_komdlgn
xvbfs = lt_vbfs
xvbls = lt_vbls
et_spe_vbfs = lt_spe_vbfs.
LOOP AT lt_spe_vbfs INTO ls_spe_vbfs WHERE msgty CA 'EAX'.
MESSAGE ID ls_spe_vbfs-msgid TYPE ls_spe_vbfs-msgty
NUMBER ls_spe_vbfs-msgno
INTO lv_message
WITH ls_spe_vbfs-msgv1 ls_spe_vbfs-msgv2
ls_spe_vbfs-msgv3 ls_spe_vbfs-msgv4.
IF lv_message_all IS INITIAL.
lv_message_all = lv_message.
ELSE.
CONCATENATE lv_message_all lv_message INTO lv_message_all SEPARATED BY ';'.
ENDIF.
ENDLOOP.
核心BAPI:GN_DELIVERY_CREATE
下面列一下如何增强字段
首先给下图的结构appen 增强字段
然后去实施对应的BADI:LE_SHP_GN_DLV_CREATE
根据需要去传输给LIPS还是LIKP