cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching of Freight Unit data based on locations

Former Member
0 Kudos

Hi All,

I am trying to fetch the Freight Units which are not planned based on locations , but I am getting only Freight units which are already to some FO/FB.

   IF s_fu_loc IS NOT INITIAL.
REFRESH lt_selpar.

ls_selpar-attribute_name = /scmtms/if_tor_c=>sc_query_attribute-stop-query_by_attributes-log_locid.
ls_selpar-option = s_fu_loc-option.
ls_selpar-sign = s_fu_loc-sign.
ls_selpar-low = s_fu_loc-low.
ls_selpar-high = s_fu_loc-high.
APPEND ls_selpar TO lt_selpar.
CLEAR : ls_selpar.

* Use method QUERY of the service manager to start the query
lo_srv_mgr->query( EXPORTING iv_query_key = /scmtms/if_tor_c=>sc_query-stop-query_by_attributes
  it_selection_parameters = lt_selpar
IMPORTING eo_message = lo_msg
  es_query_info = ls_query_inf
et_key = lt_key_root ).

lo_srv_mgr->retrieve(
EXPORTING
iv_node_key   = /scmtms/if_tor_c=>sc_node-stop
it_key        = lt_key_root
iv_edit_mode  = /bobf/if_conf_c=>sc_edit_read_only
iv_fill_data  = abap_true
IMPORTING
eo_message    = lo_msg
et_data       = lt_stop_fu ).


DELETE lt_stop_fu WHERE stop_seq_pos NE 'F'.
lt_key_stop[] = lt_stop_fu[].

REFRESH lt_key_root.

CALL METHOD lo_srv_mgr->retrieve_by_association
EXPORTING
iv_node_key    = /scmtms/if_tor_c=>sc_node-stop
it_key         = lt_key_stop
iv_association = /scmtms/if_tor_c=>sc_association-stop-assigned_capa_tor_root
iv_fill_data   = abap_true
iv_edit_mode   = /bobf/if_conf_c=>sc_edit_read_only
IMPORTING
et_data        = lt_root
et_target_key  = lt_key_root.

CALL METHOD lo_srv_mgr->retrieve_by_association
EXPORTING
iv_node_key    = /scmtms/if_tor_c=>sc_node-root
it_key         = lt_key_root
iv_association = /scmtms/if_tor_c=>sc_association-root-assigned_fus
iv_fill_data   = abap_true
IMPORTING
eo_message     = lo_msg
et_data        = lt_root_fu.
*      et_target_key  = lt_key_root.
REFRESH lt_key_root.
lt_key_root[] = lt_root_fu[].
IF lt_key_root IS NOT INITIAL.
APPEND LINES OF lt_key_root TO lt_key_root_fu.
ENDIF.

ENDIF.



please help me out how to fetch the FU's which are not in planned state

Thanks,

Arun

Accepted Solutions (0)

Answers (1)

Answers (1)

rohit3611
Contributor
0 Kudos

Hi Arun,

There is a planning Status PLAN_STATUS_ROOT, Can you check the planning status.

There is a action also,

    io_modify->do_action(

           EXPORTING

             iv_act_key    = /scmtms/if_tor_c=>sc_action-root-determine_Plan_status

             it_key        = lt_key_root

           IMPORTING

             eo_message    = lo_msg

             et_failed_key = lt_failed_key ).


You can use this and filter the unplanned orders.


Rohit

Former Member
0 Kudos

Hi Rohit,

I need to pick the unplanned FU's by giving the SOURCE LOCATION as a input in selection options but I don't have any FU keys use that do_action method Rohit.

Thanks,

Arun

rohit3611
Contributor
0 Kudos

In you ls_selpar pass the tor Type for FU and get the FU's and process those.


Why you need the Freight order and then Assigned FU. I have not get the complete requirement, can you share it as only reading Fu's should help you.

Best regards,

Rohit

Former Member
0 Kudos

Hi Rohit,

I need to develop a report program in that SOURCE_LOCATION, which is one of selection parameter in SELECT_OPTIONS .I need to fetch all the FU's related to SOURCE_LOCATION but that FU's should be unplanned(01) and not assigned to any FO .

Thanks,

Arun

rohit3611
Contributor
0 Kudos

Hi Arun,

This can be done using.

TABLES : /scmtms/d_torrot.

DATA : lt_tor_key TYPE /bobf/t_frw_key.

SELECTION-SCREEN  BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS : shippid FOR /scmtms/d_torrot-shipperid.

SELECTION-SCREEN END OF BLOCK b1.

SELECT db_key INTO TABLE lt_tor_key

               FROM /scmtms/d_torrot

               WHERE shipperid   IN shippid

               AND   plan_status_root = '01'

               AND tor_cat = 'FU'.


Best regards,

Rohit Mahajan

NiteshSaluja1
Advisor
Advisor
0 Kudos

Hi Arun,

Would you like to only display the data or perform an action on it?

Best Regards

Nitesh