Sign up to join our community!
Please sign in to your account!
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Function module/BAPI/Class for Cancel pick in SAP EWM
Try following code, It will work FUNCTION zewm_f_cancel_pick. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(IV_LGNUM) TYPE /SCWM/LGNUM *" VALUE(IT_DOCID) TYPE /SCWM/DLV_DOCID_ITEM_TAB *" VALUE(IV_QNAME) TYPE TRFCQNAM *"-----------Read more
Try following code, It will work
FUNCTION zewm_f_cancel_pick.
*”———————————————————————-
*”*”Local Interface:
*” IMPORTING
*” VALUE(IV_LGNUM) TYPE /SCWM/LGNUM
*” VALUE(IT_DOCID) TYPE /SCWM/DLV_DOCID_ITEM_TAB
*” VALUE(IV_QNAME) TYPE TRFCQNAM
*”———————————————————————-
WAIT UP TO 2 SECONDS.
DATA: lo_hu_mon TYPE REF TO zcl_ewm_cancpick_mon.
DATA: lv_noexecute TYPE sy-input.
DATA: lt_ret TYPE bapirettab.
DATA: lv_msg TYPE msgtx.
*–Append message for queue start
MESSAGE s171 INTO lv_msg.
PERFORM add_message TABLES lt_ret
USING lv_msg.
*–Get HU List
TRY.
DATA(lo_dlv) = /scwm/cl_dlv_management_prd=>get_instance( ).
DATA(ls_read_options) = VALUE /scwm/dlv_query_contr_str( data_retrival_only = abap_true ). “lock_result = abap_true
DATA(ls_include) = VALUE /scwm/dlv_query_incl_str_prd( head_status = abap_true ).
lo_dlv->query(
EXPORTING
iv_doccat = /scdl/if_dl_c=>sc_doccat_out_prd
it_docid = it_docid
is_read_options = ls_read_options
is_include_data = ls_include
IMPORTING
et_headers = DATA(lt_headers)
et_hu_headers = DATA(lt_hu_headers)
et_hu_items = DATA(lt_hu_items)
eo_message = DATA(lo_message) ).
CATCH /scdl/cx_delivery INTO DATA(lx_dlv).
ENDTRY.
*–Cancelpick Delivery
lo_hu_mon = zcl_ewm_cancpick_mon=>get_instance( ).
lo_hu_mon->/scwm/if_mon_hu~cancel_hu_pick(
EXPORTING
iv_lgnum = iv_lgnum
it_data = lt_hu_headers
).
DATA(lt_return) = lo_hu_mon->get_message( ).
*–Append message for queue ending
MESSAGE s172 INTO lv_msg.
PERFORM add_message TABLES lt_ret
USING lv_msg.
*–form return table for the queue
IF lt_ret[] IS NOT INITIAL.
APPEND LINES OF lt_ret TO lt_return.
ENDIF.
IF VALUE #( lt_return[ type = ‘E’ ]-type OPTIONAL ) = ‘E’.
/spe/cl_qrfc_services=>end_queue_processing(
EXPORTING
it_message = lt_return ” Table with BAPI Return Information
).
ENDIF.
/spe/cl_qrfc_services=>end_queue_processing(
EXPORTING
it_message = lt_return ” Table with BAPI Return Information
).
*create Queue FM for update
CALL FUNCTION ‘TRFC_SET_QIN_PROPERTIES’
EXPORTING
qin_name = iv_qname
no_execute = lv_noexecute
EXCEPTIONS
invalid_queue_name = 1
OTHERS = 2.
CALL FUNCTION ‘ZEWM_F_CANCEL_PICK_MOVE’
IN BACKGROUND TASK AS SEPARATE UNIT
DESTINATION ‘NONE’
EXPORTING
iv_lgnum = iv_lgnum
it_hu_hdr = lt_hu_headers
it_hu_itm = lt_hu_items.
COMMIT WORK AND WAIT.
/spe/cl_qrfc_services=>end_queue_processing(
See lessEXPORTING
it_message = lt_return ” Table with BAPI Return Information
).
ENDFUNCTION.
How to Pallet Packing in SAP ECC
How to Do Pallet Packing in SAP ECC (Nesting an Outer Box HU into a Pallet HU) Question I need to pack an already-built outer box (a lower-level Handling Unit) onto a pallet HU in SAP ECC using standard function modules. What's the correct sequence, and how do I build the packing request so the boxRead more
How to Do Pallet Packing in SAP ECC (Nesting an Outer Box HU into a Pallet HU)
Question
I need to pack an already-built outer box (a lower-level Handling Unit) onto a pallet HU in SAP ECC using standard function modules. What’s the correct sequence, and how do I build the packing request so the box gets nested inside the pallet? Below is the approach I used.
Answer
The concept here is HU nesting — like Russian nesting dolls: the product sits in a box, and that box (the outer box HU) sits on a pallet (the pallet HU). This routine performs one nesting step: placing the outer box into the pallet.
The key is to follow the standard sequence in order — Refresh → Get/Lock HUs → Pack → Post. Skipping any step (especially the refresh or the lock) is the usual cause of packing that “works once then silently fails.”
Building the packing request (
ls_pack_req):venum/exidv→ the target pallet HU (what you pack into)sub_hu_venum/sub_hu_exidv→ the content outer box HU (what gets packed)pagew→ weight,veanz = 1→ one unit,velin = 3→ item category for HU-in-HU (packing a whole HU, not loose material)The four SAP standard function modules used:
HU_PACKING_REFRESHHU_GET_HUSHU_PACKING_AND_UNPACKINGHU_POST(if_commit = 'X')After each call,
sy-subrcis checked. On failure, the SAP message is captured into the status field and the routine exits; on success, the record is stamped with status, date, time, and user.Code
How to delete Outbound Delivery in EWM using ABAP
Thank you, It worked
Thank you, It worked
See lessFM to Get task from a delivery
Hi Marianne, You can get it. follow these steps. Get DOCID from /SCDL/PROCH_I or /SCDL/PROCH_O table by passing document number Pass DOCID in /SCWM/ORDIM_O and /SCWM/ORDIM_C table and get all open/confirmed tasks. let me know if you need further help on this.
Hi Marianne,
You can get it. follow these steps.
Get DOCID from /SCDL/PROCH_I or /SCDL/PROCH_O table by passing document number
Pass DOCID in /SCWM/ORDIM_O and /SCWM/ORDIM_C table and get all open/confirmed tasks.
let me know if you need further help on this.
See lessWhat is the simplest way to read HU in EWM using classes not Query
Here is the sample code to read HU Create Instance for /scwm/cl_wm_packing class *--Get docid from the source HU CALL METHOD /scwm/cl_wm_packing=>get_instance IMPORTING eo_instance = DATA(lo_wm_pack). * --init warehouse,application CALL METHOD lo_wm_pack->init_pacRead more
Here is the sample code to read HU
See lessCreate TU in SAP Extended Warehouse Management – EWM
This is Working Code
This is Working Code
See lessCreate Multiple ALVs in single container(SALV)
Above code is working!!
Above code is working!!
See less