Quantcast
Channel: SCN : Unanswered Discussions - Supply Chain Management (SAP SCM)
Viewing all articles
Browse latest Browse all 5579

Fetch Document Flow of a TOR

$
0
0

Hi Experts,

 

Need your help in fetching the document flow of multiple FOs.

 

Presently I am fethcing document flow for single FO at a time, and calling the same method inside a loop as shown below to fetch document flow for multiple FOs obtained from Query method.

 

But fetching the document flow for each FO in a loop has degraded the performance of the report.

 

Please suggest how can I get the document flow for all the FOs  by calling the method only once, outside loop.

 

Also when I will fetch all the document flow at same time by passing all the FOs in the method 'Get_Doc_flow', how will I distinguish between the documents obtained in table 'lt_df_root' ?? (ie. which document corresponds to which FO )  

 

   *** Fetching TOR Root Data
  CALL METHOD lo_srvmgr->query
    EXPORTING
      iv_query_key            = /scmtms/if_tor_c=>sc_query-root-root_elements
      it_selection_parameters = lt_sel_par
      iv_fill_data            = abap_true
    IMPORTING
      et_data                 = lt_root
      et_key                  = lt_key.


* Document Flow Factory Instance
  CALL METHOD /scmtms/cl_doc_flow_factory=>get_instance
    EXPORTING
      iv_bo_key   = /scmtms/if_tor_c=>sc_bo_key
    RECEIVING
      ro_doc_flow = lw_doc_flow.

  LOOP AT lt_root INTO ls_root.
    REFRESHlt_frw_key, lt_trq_fr_tor.
    ls_frw_key-key = ls_root-key.
    APPEND ls_frw_key TO lt_frw_key.

    REFRESH: lt_df_root, lt_df_root_relation.

    CALL METHOD lw_doc_flow->get_doc_flow
      EXPORTING
        iv_direction         = 'A'
        iv_node_key          = /scmtms/if_tor_c=>sc_node-root
        it_key               = lt_frw_key

      CHANGING
        ct_doc_flow          = lt_df_root
        ct_doc_flow_relation = lt_df_root_relation.

 

ENDLOOP.

 

Thanks and regards,

Ashish


Viewing all articles
Browse latest Browse all 5579

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>