May9

EWM related

PPF:

/SCDL/ACTION_DEF

/SCDL/ACTION_CONF

SPPFP

SAAB


  1. VA01 - Create Sales Order

  2. VKM4 - Release Credit Block of SO

  3. VL01N - Create DO, assign SLoc then DO will dispatch to EWM. Input Shipment- MeansTransType / Means of Transite

  4. /SCWM/TU - Create new TU and assign the DO to TU

  5. /SCWM/PRDO -

    1. Warehouse Task - Default - Input Source Bin

    2. Confirm - confirm in foreground Source Bin ( get from /SCWM/MON - Available Stock )

  6. /SCWM/TU

    1. Action - Checkpoint - Arrive

    2. Goods Issue

    3. Action - Checkpoint - Departure


DATA:
  lo_bom     TYPE REF TO /scwm/cl_sr_bom,
  lo_tu      TYPE REF TO /scwm/cl_sr_bo_tu,
  lo_sr_err  TYPE REF TO /scwm/cx_sr_error,
  ls_key     TYPE /scwm/s_tu_sr_act_num,
  ls_tu_data TYPE /scwm/s_bo_tu_data,
  lt_tu_dlv  TYPE /scwm/tt_bo_tu_dlv_no_sort,
  ls_tu_dlv  TYPE /scwm/s_bo_tu_dlv,
  lv_tunum   TYPE /scwm/de_tu_num,
  lv_tuact   TYPE /scwm/de_tu_sr_act_num,
  lv_tuext   TYPE /scwm/de_tu_num_ext.

DATA:
  ls_readopt TYPE /scwm/dlv_query_contr_str,
  lt_d1      TYPE /scwm/tt_bo_tu_dlv,
  lt_d2      TYPE /scwm/tt_bo_tu_dlv,
  lt_d3      TYPE /scwm/tt_bo_tu_dlv,
  lt_d4      TYPE /scwm/tt_bo_tu_dlv.

TYPE-POOLS:
  wmesr.


DATA:
  lt_bapiret TYPE bapiret2.

PARAMETERS:
  p_tuext TYPE /scwm/de_tu_num_ext OBLIGATORY.

ls_readopt-mix_in_object_instances abap_true.
ls_readopt-data_retrival_only abap_true.
ls_readopt-lock_result abap_false.

* TU: LORS05052999

lv_tuext p_tuext.

* GET TU NUM FROM /SCWM/TUNIT
SELECT SINGLE tu_num
  INTO lv_tunum
  FROM /scwm/tunit
 WHERE tu_num_ext lv_tuext.

CHECK sy-subrc 0.

SELECT SINGLE tu_sr_act_num
  INTO lv_tuact
  FROM /scwm/tu_sr_act
 WHERE tu_num lv_tunum.

ls_key-tu_num lv_tunum.
ls_key-tu_sr_act_num lv_tuact.

*ls_key-tu_num = '000000000020000071'.
*ls_key-tu_sr_act_num = '0000000076'.

TRY.
    lo_bom /scwm/cl_sr_bom=>get_instance).
    lo_tu lo_bom->get_bo_tu_by_key(  is_tu_sr_act_num ls_key ).
    DATA(lv_tu_guidlo_tu->get_id).
    WRITE:'TU GUID: 'lv_tu_guid.

*   Get DLV OF TU

*    CALL METHOD lo_tu->get_tu_dlv
*      EXPORTING
**        iv_direct_asgn_only   = ABAP_FALSE
**        iv_check_cross_hu     = ABAP_TRUE
**        iv_delete_duplicates  = ABAP_TRUE
*        iv_completness_check  = abap_true
*        iv_dlv_data_retrieval = abap_true
**       iv_gr_hu              = ABAP_FALSE
*      IMPORTING
*       et_bo_tu_dlv_dlv      = lt_d1
*       et_bo_tu_dlv_item     = lt_d2
*       et_bo_tu_dlv_hu       = lt_d3
*       et_bo_tu_dlv          = lt_d4
*      .

*DATA:
*   LT_A TYPE /SCWM/DLV_HEADER_OUT_PRD_TAB,
*   LT_B TYPE /SCWM/DLV_ITEM_OUT_PRD_TAB.
*
*
*CALL METHOD lo_tu->get_tu_dlv_data
*  EXPORTING
**    iv_direct_asgn_only = ABAP_TRUE
**    is_excl_fd_data     = abap_true
**    is_excl_prd_data    =
*    is_read_options     = ls_readopt
**    is_fd_read_options  =
**    iv_no_txt_item      = ABAP_FALSE
*    iv_head_status_dyn  = abap_true
**    iv_item_qty         =
*  IMPORTING
*    et_prd_hdr          = LT_A
**    et_fd_hdr           =
*    et_prd_item         = LT_B
**    et_fd_item          =
**    et_fd_item_map      =
**    et_fd_hu_top        =
**    et_fd_hu_hdr        =
**    et_fd_hu_item       =
**    et_fd_item_prd_to   =
**    et_prd_hu_top       =
**    et_prd_hu_hdr       =
**    et_prd_hu_item      =
**    et_prd_item_to      =
**    et_huhdr_int        =
**    et_fd_hu_prd        =
**    et_prd_hu_prd       =
*    .

    DATAlt_dls      TYPE /scwm/tt_bo_tu_dlv.


*    CALL METHOD lo_tu->set_tu_status_change
*      EXPORTING
**        iv_check_only           = abap_true
**       iv_action_only          = ABAP_FALSE
*        iv_activity             = wmesr_act_check_out
**       iv_reason               =
*      IMPORTING
*        ev_activity_not_allowed = lv_rs.



    CALL METHOD lo_tu->set_goods_movement
      EXPORTING
*        iv_check_only   = abap_true
*       iv_action_only  = ABAP_FALSE
*       iv_lgnum        =
        iv_activity     wmesr_act_post_goods_issue
*       iv_lgtyp        =
*       iv_skip_gm      = ABAP_FALSE
*       iv_lgpla        =
      IMPORTING
        et_bo_tu_dlv_gm lt_dls.


    WRITE:'GI IS OK'.

    lo_bom->save).
*
    COMMIT WORK AND WAIT.

    CALL METHOD lo_tu->/scwm/if_sr_bo~check_in_out
      EXPORTING
*        iv_check = abap_true
*       iv_lgnum =
*       iv_chkpt =
        iv_act   wmesr_act_check_out
*       iv_tstmp =
*       iv_call  =
*       iv_switch =
      .

    lo_bom->save).

    COMMIT WORK AND WAIT.

*    CALL METHOD lo_tu->/scwm/if_sr_bo~check_in_out
*      EXPORTING
**        iv_check = abap_true
**       iv_lgnum =
**       iv_chkpt =
*        iv_act   = wmesr_act_check_in
**       iv_tstmp =
**       iv_call  =
**       iv_switch =
*      .
*
*    lo_bom->save( ).
*
*    COMMIT WORK AND WAIT.


    DATAlv_act_st TYPE /scwm/de_sr_act_state.

    lv_act_st lo_tu->get_sr_act_state).



    WRITE:'active status: 'lv_act_st.

  CATCH /scwm/cx_sr_error INTO lo_sr_err.
    WRITE/ lo_sr_err->get_text).
    ROLLBACK WORK.
    /scwm/cl_tm=>cleanup).
    EXIT.
ENDTRY.

本篇文章已有0条评论