1. Set RF warning messages
/Scwm/cl_rf_bll_srvc => message (
Iv_msg_view = '1'
Iv_flg_continue_flow = 'X'
Iv_msgid = '/scwm/who'
Iv_msgty = 'W'
Iv_msgno = '20140901 ').
2. query Products
Try.
Call function'/scwm/material_read_single'
Exporting
Iv_matid = ls_stock-matid
Iv_langu = sy-Langu
Importing
Es_mat_global = ls_mat_global
Et_mat_uom = lt_mat_uom.
Catch/scwm/cx_md.
Endtry.
Screen input itemCode
Data lv_matean type/scwm/de_rf_ean11.
Call function'/scwm/rf_product_input'
Exporting
Input = selection-matnr40
Importing
Ev_matid = iv_matid
Ev_matnr = selection-matnr40
Ev_matean = lv_matean.
If iv_matid is initial.
* Product doesn' t exists
Message e195 (/scwm/rf_en ).
Endif.
.
* Get the product details
Call function'/scwm/select_stock'
Exporting
Iv_lgnum = lv_lgnum
It_matid = lt_matid
It_guid_lgpla = lt_guid_loc
Importing
Et_huitm = lt_huitm
Exceptions
Others = 2.
Get product guid
Call function 'conversion _ exit_mdlpd_input'
Exporting
Input = ZEWM_HUHDR_HP-HUMATID
Importing
Output = lv_matid
.
3. RF screen parameter code
* Initiate screen Parameter
/Scwm/cl_rf_bll_srvc => init_screen_param ().
* Set screen Parameter
/Scwm/cl_rf_bll_srvc => set_screen_param ('ct _ inq_st_loop ').
****************************
/Scwm/cl_rf_bll_srvc => set_screen_param ('cs _ inq_st_prd ').
* Transfer table name into RF framework
/Scwm/cl_rf_bll_srvc => set_screen_param ('/scwm/tt_rf_inq_st_loop ').
Call method/scwm/cl_rf_bll_srvc => set_line
Exporting
Iv_line = 1.
Call method/scwm/cl_rf_bll_srvc => set_screen_param
Exporting
Iv_param_name = 'ls _ inq_st_loop '.
4. Set code debugging
Break-point ID/scwm/rf_inquiry.
5. obtain user resources
Call function'/scwm/rsrc_resource_memory'
Exporting
Iv_uname = sy-uname
Changing
Cs_rsrc = ls_rsrc.
6. Convert the date and time Fields
* ********* Conversion of Timestamp into Date and Time Field
Append: lt_lagp-idatu to lt_timestamp,
Lt_lagp-cleared_at to lt_timestamp,
Lt_lagp-moved_at to lt_timestamp.
Call function'/scwm/convert_timestamp'
Exporting
Iv_lgnum = lv_lgnum
It_timestamp = lt_timestamp
Importing
Et_date_time = lt_timedate
Exceptions
Input_error = 1
Data_not_found = 2
Others = 3.
Loop at lt_timedate into ls_timedate.
Case sy-tabix.
When 1.
Write ls_timedate-date dd/mm/yy to cs_inq_st-idatu_d.
Move ls_timedate-time to cs_inq_st-idatu_t.
When 2.
Write ls_timedate-date dd/mm/yy to cs_inq_st-cleared_d.
Move ls_timedate-time to cs_inq_st-cleared_t.
When 3.
Write ls_timedate-date dd/mm/yy to cs_inq_st-moved_d.
Move ls_timedate-time to cs_inq_st-moved_t.
Endcase.
Endloop.
7. Obtain the function code
Lv_fcode type/scwm/de_fcode,
Lv_fcode =/scwm/cl_rf_bll_srvc => get_fcode ().
8. Set the Warehouse Number
Call method/scwm/cl_tm => set_lgnum (ls_rsrc-lgnum ).
9. query source Hu Information
Call function'/scwm/to_read_src'
Exporting
Iv_lgnum = ls_rsrc-lgnum
Iv_huident = Selection-huident
Importing
Et_ordim_o = lt_ordim_o
Et_ordim_c = lt_ordim_c.
10. query the current Hu Information
Call function'/scwm/to_read_des'
Exporting
Iv_lgnum = ls_rsrc-lgnum
Iv_huident = Selection-huident
Importing
Et_ordim_o = lt_ordim_o
Et_ordim_c = lt_ordim_c.
Call function'/scwm/to_read_hu'
Exporting
Iv_lgnum = ls_rsrc-lgnum
Iv_huident = Selection-huident
Importing
Et_ordim_o_src = lt_ordim_o
Et_ordim_o_des = lt_ordim_o_des
Et_ordim_c_src = lt_ordim_c
Et_ordim_c_des = lt_ordim_c_des.
11. RF confirmation dialog box
Call method/scwm/cl_rf_bll_srvc => popup_to_confirm (
Iv_title = '',
Iv_text =''
Iv_flg_cancel = 'x ',
Rv_answer = rv_answer)
/Scwm/cl_rf_dynpro_srvc => display_message (
Iv_msgid = sy-msgid
Iv_msgno = sy-msgno
Iv_msgty = 'Q'
Iv_msgv1 = sy-msgv1
Iv_msgv2 = sy-msgv2
Iv_msgv3 = sy-msgv3
Iv_msgv4 = sy-msgv4) =/scwm/cl_rf_bll_srvc => c_answer_yes