SAP
[EWM][ABAP] Canceled GI HU 조회
DevInvestor
2025. 2. 18. 17:28
반응형
select a~*
from /scwm/ordim_c as a
inner join /scdl/db_proci_o as b
on a~lgnum = @iv_wh_info
and a~rdocid eq b~docid
and a~ritmid eq b~itemid
and a~trart eq '6'
and a~rdoccat eq b~doccat
and b~doccat eq 'PDO'
and b~doccat eq a~doccat
inner join @tt_odlv_info as c
on a~tostat eq 'C' " GI HU만 찾는다. VLENR
and right( b~docno , 10 ) eq c~dvbeln
and right( b~itemno , 6 ) eq c~dvbelp
order by a~vlenr, a~rdocid, a~ritmid, confirmed_at_wh descending
into table @data(lt_confwt).
"최신 GI WT만 남김
delete adjacent duplicates from lt_confwt comparing vlenr rdocid ritmid.
* read Goods issued HU
call function '/SCWM/HUMAIN_REFRESH'.
call method /scwm/cl_hu_appl_ewm=>hu_by_gmdoc
exporting
iv_lgnum = conv /scwm/lgnum( iv_wh_info )
it_ordim = corresponding #( lt_confwt )
importing
et_huhdr = lt_hu_headers
et_huitm = lt_hu_items.
catch /scwm/cx_core.
os_return-mtype = zgcm1_bapi_mtype-e.
os_return-message = text-004.
return.
반응형