BAPI_OUTB_DELIVERY_CHANGE - BAPI for Change to Outbound Delivery
BAPI_INB_DELIVERY_SAVEREPLICA - Create Inbound Delivery
RV_DELIVERY_CREATE - Create Delivery
GN_DELIVERY_CREATE - Create an Outbound Delivery
Код:
FORM xkomdlgn_fill USING p_open_qty LIKE ekpo-menge
p_eindt LIKE eket-eindt
p_licha LIKE eket-licha
p_charg LIKE eket-charg
p_uzeit LIKE eket-uzeit.
STATICS: h_grkor LIKE lips-grkor,
h_bsmng LIKE ekpo-menge.
CLEAR t_xkomdlgn.
CHECK t_ekpo-uptyp NE '5' " Lot
AND t_ekpo-uptyp NE '6' " Display
AND t_ekpo-uptyp NE '7' " VK-Set
AND t_ekpo-uptyp NE 'H'. " GT-Stuckliste
IF t_ekpo-uebpo IS INITIAL AND t_ekpo-upvor CA '1I'.
CHECK 1 = 2.
ENDIF.
IF NOT ekko-lifnr IS INITIAL.
CALL FUNCTION 'VENDOR_MASTER_DATA_SELECT_12'
EXPORTING
pi_lifnr = ekko-lifnr
pi_ekorg = ekko-ekorg
IMPORTING
pe_lfm1 = lfm1
EXCEPTIONS
no_entry_found = 1
OTHERS = 2.
t_xkomdlgn-vsbed = lfm1-vsbed.
ELSE.
CLEAR t_xkomdlgn-vsbed.
ENDIF.
t_xkomdlgn-adrnr_li = ekko-adrnr.
t_xkomdlgn-lifnr = ekko-lifnr.
t_xkomdlgn-inco1 = ekko-inco1.
t_xkomdlgn-inco2 = ekko-inco2.
t_xkomdlgn-exnum = ekko-exnum.
t_xkomdlgn-bukrs_best = ekko-bukrs.
t_xkomdlgn-matnr = t_ekpo-matnr.
t_xkomdlgn-werks = t_ekpo-werks.
*IF STORAGE LOCATION IS MISSING APPEND
*FG01 As storage location
IF t_ekpo-lgort IS INITIAL .
t_xkomdlgn-lgort = 'FG01' .
ELSE .
t_xkomdlgn-lgort = t_ekpo-lgort.
ENDIF.
xkomdlgn-charg = ?
T_XKOMDLGN-VRKME = T_EKPO-MEINS.
t_xkomdlgn-meins = t_ekpo-lmein.
t_xkomdlgn-umvkz = t_ekpo-umrez.
t_xkomdlgn-umvkn = t_ekpo-umren.
IF t_ekpo-matnr EQ space.
t_xkomdlgn-meins = t_ekpo-meins.
t_xkomdlgn-umvkz = 1.
t_xkomdlgn-umvkn = 1.
ENDIF.
t_xkomdlgn-insmk = t_ekpo-insmk.
t_xkomdlgn-kzfme = t_ekpo-kzfme.
t_xkomdlgn-kzvbr = t_ekpo-kzvbr.
t_xkomdlgn-lfimg = p_open_qty.
t_xkomdlgn-lfdat = p_eindt.
t_xkomdlgn-lfuhr = p_uzeit.
xkomdlgn-vstel = ?
XKOMDLGN-VKORG = ?
xkomdlgn-vtweg = ?
XKOMDLGN-SPART = ?
t_xkomdlgn-traid = t_ekpo-traid."CARRIER CODE
t_xkomdlgn-lifex = t_ekpo-lifex."External ID
t_xkomdlgn-bolnr = t_ekpo-bolnr."Bill Of Lading
t_xkomdlgn-xabln = t_ekpo-xabln."Goods Receipt/Issue Slip Number
t_xkomdlgn-vgbel = t_ekpo-ebeln.
t_xkomdlgn-vgpos = t_ekpo-ebelp.
t_xkomdlgn-lfart = gf_dlv_type.
t_xkomdlgn-vgtyp = 'V'.
t_xkomdlgn-kzazu = 'X'.
t_xkomdlgn-knttp = t_ekpo-knttp.
t_xkomdlgn-sobkz = t_ekpo-sobkz.
SELECT * FROM t163g WHERE bstae EQ t_ekpo-bstae
AND ebtyp EQ gf_ebtyp.
EXIT.
ENDSELECT.
IF sy-subrc = 0.
prufen, ob lieferavis we-zuordnung hat (vorauss. fur we uber vl32)
und wepos prufen
if t163g-wezuo eq space or t_ekpo-wepos eq space.
t_xkomdlgn-nowab = 'X'.
ELSE.
CLEAR t_xkomdlgn-nowab.
ENDIF.
ENDIF.
IF t_ekpo-matnr IS INITIAL OR t_ekpo-pstyp = '6'.
t_xkomdlgn-posar = 'B'.
ENDIF.
t_xkomdlgn-ematn = t_ekpo-ematn.
t_xkomdlgn-mfrnr = t_ekpo-mfrnr.
t_xkomdlgn-mfrpn = t_ekpo-mfrpn.
t_xkomdlgn-emnfr = t_ekpo-emnfr.
t_xkomdlgn-cuobj = t_ekpo-cuobj.
t_xkomdlgn-uebto = t_ekpo-uebto.
t_xkomdlgn-untto = t_ekpo-untto.
t_xkomdlgn-uebtk = t_ekpo-uebtk.
t_xkomdlgn-lichn = p_licha.
t_xkomdlgn-charg = p_charg.
t_xkomdlgn-bwtar = t_ekpo-bwtar.
t_xkomdlgn-kdmat = t_ekpo-idnlf.
t_xkomdlgn-arktx = t_ekpo-txz01.
t_xkomdlgn-mfrgr = t_ekpo-mfrgr.
t_xkomdlgn-gewei = t_ekpo-gewei.
t_xkomdlgn-voleh = t_ekpo-voleh.
t_xkomdlgn-ntgew = t_ekpo-ntgew * t_xkomdlgn-lfimg.
t_xkomdlgn-brgew = t_ekpo-brgew * t_xkomdlgn-lfimg.
t_xkomdlgn-volum = t_ekpo-volum * t_xkomdlgn-lfimg.
t_xkomdlgn-ean11 = t_ekpo-ean11.
t_xkomdlgn-podrel = t163l-podrel.
t_xkomdlgn-aktnr = t_ekpo-aktnr.
t_xkomdlgn-abeln = t_ekpo-abeln.
t_xkomdlgn-abelp = t_ekpo-abelp.
xkomdlgn-ltssf = only SORT criteria IN vl31n
T_XKOMDLGN-AUREL = T_EKPO-AUREL.
t_xkomdlgn-idnlf = t_ekpo-idnlf.
t_xkomdlgn-matkl = t_ekpo-matkl.
leergut-stuckliste ubernehmen
clear t_xkomdlgn-grkor.
CLEAR t_xkomdlgn-kmpmg.
CLEAR t_xkomdlgn-uepos.
CLEAR t_xkomdlgn-uepvw. "549736
IF t_ekpo-upvor CA '3X'.
h_grkor = h_grkor + 1.
t_xkomdlgn-grkor = h_grkor.
h_bsmng = t_ekpo-menge.
ENDIF.
IF NOT t_ekpo-uebpo IS INITIAL AND
t_ekpo-uptyp CA '3X'.
t_xkomdlgn-uepvw = 'G'. "549736
t_xkomdlgn-uepos = t_ekpo-uebpo.
t_xkomdlgn-grkor = h_grkor.
IF h_bsmng NE 0.
t_xkomdlgn-kmpmg = t_ekpo-menge / h_bsmng.
ENDIF.
ENDIF.
IF t_ekpo-pstyp EQ '2'.
t_xkomdlgn-sobkz = 'K'.
ENDIF.
kontierungsfelder
if t_ekpo-sobkz eq 'E' or t_ekpo-sobkz eq 'Q'.
CALL FUNCTION 'MMPUR_EKKN_READ_EBELN_EBELP'
EXPORTING
pi_ebeln = t_ekpo-ebeln
pi_ebelp = t_ekpo-ebelp
pi_bypassing_buffer = pi_refresh_buffer
=
tables
pto_ekkn_po = xekkn
EXCEPTIONS
no_records_requested = 1
OTHERS = 2.
IF sy-subrc EQ 0.
READ TABLE xekkn INDEX 1.
t_xkomdlgn-ps_psp_pnr = xekkn-ps_psp_pnr.
t_xkomdlgn-vbelv = xekkn-vbeln.
t_xkomdlgn-posnv = xekkn-vbelp.
ENDIF.
ENDIF.
APPEND t_xkomdlgn.
ENDFORM. "xkomdlgn_fill
LOOP AT t_xkomdlgn.
- set default parameter
t_xkomdlgn-vgtyp = 'V'.
t_xkomdlgn-kzazu = 'X'.
IF t_xkomdlgn-lfart IS INITIAL.
t_xkomdlgn-lfart = 'EL'.
ENDIF.
MODIFY t_xkomdlgn.
ENDLOOP.
SELECT SINGLE * FROM tvsa WHERE smart = xvbsk-smart.
IF sy-subrc 0.
- Error Handling To be Done
- Meldung ins Protokoll
ENDIF.
l_nrnr = tvsa-numki.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = l_nrnr
object = 'RV_SAMMG'
IMPORTING
number = xvbsk-sammg
EXCEPTIONS
OTHERS = 1.
IF sy-subrc 0.
error hadling tbd
meldung ins protokoll
endif.
CALL FUNCTION 'GN_DELIVERY_CREATE'
EXPORTING
- no_commit = 'X'
vbsk_i = xvbsk
- if_no_deque = 'X'
- IF_MASS_READ_MAT_SW = 'X'
-
- vbls_pos_rueck = 'X'
TABLES
xkomdlgn = t_xkomdlgn
xvbfs = xvbfs
xvbls = xvbls
xxlips = xlips.
BAPI PURCHAGE ORDER GET DETAIL SAMPLE CODE
fico internal summery report sap abap
sap finance cost center summery report
SAP FICO cost center actual line items report
Cost center overview sap fico report
Vendor balance in local currency report
No comments:
Post a Comment