Hello,

Sign up to join our community!

Welcome Back,

Please sign in to your account!

Forgot Password,

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask a question.

You must login to ask a question.

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.

  1. 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(
    EXPORTING
    it_message = lt_return ” Table with BAPI Return Information
    ).
    ENDFUNCTION.

    See less
  2. 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)
    • pagewweight, 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:

    Function ModulePurpose
    HU_PACKING_REFRESHClears the HU work buffer for a clean start
    HU_GET_HUSReads and locks both HUs for exclusive access
    HU_PACKING_AND_UNPACKINGPerforms the actual packing in the buffer
    HU_POST (if_commit = 'X')Saves and commits the result to the database

    After each call, sy-subrc is 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

    ls_pack_req-venum = ls_vekp_pal-venum.
    ls_pack_req-exidv = ls_vekp_pal-exidv.

    *–Fill Outerbox as lower level HU
    ls_pack_req-sub_hu_venum = ls_vekp_out-venum.
    ls_pack_req-sub_hu_exidv = ls_vekp_out-exidv.

    *–Fill quantity
    ls_pack_req-pagew = ls_pallet-pallet_wt.
    ls_pack_req-veanz = ‘1’.
    ls_pack_req-velin = ‘3’.

    ls_venom-venum = ls_vekp_out-venum.
    append ls_venom to lt_venom.
    clear ls_venom.
    ls_venom-venum = ls_vekp_pal-venum. “gs_pallet-venum.
    append ls_venom to lt_venom.
    clear ls_venom.
    *–Refresh
    call function ‘HU_PACKING_REFRESH’.
    *–Get HU headers
    call function ‘HU_GET_HUS’
    exporting
    if_object = ’04’
    if_lock_hus = ‘X’
    it_venum = lt_venom
    importing
    et_header = lt_header
    exceptions
    hus_locked = 1
    no_hu_found = 2
    fatal_error = 3
    others = 4.
    *–Do the packing
    if sy-subrc eq 0.
    call function ‘HU_PACKING_AND_UNPACKING’
    exporting
    is_packing_request = ls_pack_req
    exceptions
    missing_data = 1
    hu_not_changeable = 2
    not_possible = 3
    customizing = 4
    weight = 5
    volume = 6
    serial_nr = 7
    fatal_error = 8
    others = 9.

    if sy-subrc = 0.
    call function ‘HU_POST’
    exporting
    if_synchron = ‘X’
    if_commit = ‘X’.

    <lfs_data>-status = text-020.
    <lfs_data>-error_msg = text-s01.
    <lfs_data>-idate = sy-datum.
    <lfs_data>-itime = sy-uzeit.
    <lfs_data>-iuser = sy-uname.
    else.
    <lfs_data>-status = text-019.
    message id sy-msgid
    type sy-msgty
    number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
    into <lfs_data>-error_msg.
    lv_error = abap_true.
    lv_msg = <lfs_data>-error_msg.
    exit.
    endif.
    else.
    <lfs_data>-idate = sy-datum.
    <lfs_data>-itime = sy-uzeit.
    <lfs_data>-iuser = sy-uname.
    <lfs_data>-status = text-019.
    message id sy-msgid
    type sy-msgty
    number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
    into <lfs_data>-error_msg.
    lv_error = abap_true.
    lv_msg = <lfs_data>-error_msg.
    exit.
    endif.

    See less
  3. 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 less
  4. 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

    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_pack
            EXPORTING
              iv_badi_appl = 'WME'
              iv_lgnum     = is_ltap-lgnum
            EXCEPTIONS
              error        = 1
              OTHERS       = 2.
    
    
    
    * --get hu data, in this case only item data
          CALL METHOD lo_wm_pack->get_hu
            EXPORTING
              iv_guid_hu = is_ltap-sguid_hu                 " Unique Internal Identification of a Handling Unit
            IMPORTING
              et_huitm   = DATA(lt_huitm)                   " Material Items in the HU
            EXCEPTIONS
              not_found  = 1
              OTHERS     = 2.

     

    See less