DATA: ls_vbkok TYPE vbkok.
DATA: lt_vbkok TYPE STANDARD TABLE OF vbpok.
DATA: lv_flg TYPE char1.
IF it_item[] IS INITIAL.
RETURN.
ENDIF.
SELECT * INTO TABLE @DATA(lt_lips) FROM lips
FOR ALL ENTRIES IN @it_item
WHERE vbeln = @it_item-vbeln
AND posnr = @it_item-posnr.
IF sy-subrc <> 0.
RETURN.
ENDIF.
READ TABLE lt_lips INTO DATA(ls_lips) INDEX 1.
LOOP AT lt_lips ASSIGNING FIELD-SYMBOL(<ls_lips>).
READ TABLE it_item INTO DATA(ls_item) WITH KEY vbeln = <ls_lips>-vbeln posnr = <ls_lips>-posnr.
IF sy-subrc = 0.
<ls_lips>-lfimg = ls_item-lfimg.
ENDIF.
ENDLOOP.
SELECT vbelv,posnv,vbeln,posnn INTO TABLE @DATA(lt_vbfa) FROM vbfa
FOR ALL ENTRIES IN @lt_lips
WHERE vbelv = @lt_lips-vbeln
AND vbtyp_n = 'Q'.
ls_vbkok = VALUE #(
vbeln_vl = ls_lips-vbeln
wabuc = space
).
LOOP AT lt_vbfa INTO DATA(ls_vbfa).
lt_vbkok = VALUE #( BASE lt_vbkok (
vbeln_vl = ls_vbfa-vbelv
posnr_vl = ls_vbfa-posnv
vbeln = ls_vbfa-vbeln
posnn = ls_vbfa-posnn
sernr_del = abap_true
)
).
ENDLOOP.
IF lt_vbfa[] IS NOT INITIAL AND lt_vbkok[] IS NOT INITIAL.
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
vbkok_wa = ls_vbkok
commit = abap_true
if_error_messages_send_0 = space
delivery = ls_lips-vbeln
update_picking = abap_true
TABLES
vbpok_tab = lt_vbkok.
WAIT UP TO '0.5' SECONDS.
ENDIF.
FREE lt_vbkok.
lt_vbkok = VALUE #(
FOR wa IN lt_lips (
vbeln_vl = wa-vbeln
posnr_vl = wa-posnr
vbeln = sy-datum
posnn = '000010'
pikmg = wa-lfimg" * wa-umvkz / wa-umvkn
)
).
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
vbkok_wa = ls_vbkok
commit = abap_true
if_error_messages_send_0 = space
delivery = ls_lips-vbeln
update_picking = abap_true
TABLES
vbpok_tab = lt_vbkok.
修改交单数量-WS_DELIVERY_UPDATE
最新推荐文章于 2023-12-22 17:00:12 发布