cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve TOR_ITEM details with TRQ_ITEM keys

joseph_manjiyil
Participant
0 Kudos

Hi All,

I am trying to retrieve TOR_ITEM (Freight unit) details using TRQ_ITEM keys. I am not able to retrieve the information by using retrieve by Association. I am working on TM 8.0 release. Below is the code which I have written to achieve this functionality, code does not dump. But it does not return any value.

 
              lo_srvmgr_trq->retrieve_by_association(

              EXPORTING

               iv_node_key         = /scmtms/if_trq_c=>sc_node-item

               it_key                    = lt_trq_item_shl_key

               iv_association     = /scmtms/if_trq_c=>sc_association-item-tor_item

               iv_fill_data           = abap_true

               iv_before_image  = abap_true  

              IMPORTING

               et_data                 = lt_tor_item_fu

               et_key_link           = lt_tor_item_fu_link

               et_target_key        = lt_tor_item_fu_key ).

Please help me in arriving at the solution.

Update: The above association works perfectly when written in a report program. But I am using this association inside scheduling. As per my understanding the relationship between TRQ and FU is broken when coming to TM system for simulate scheduling.

Regards,

Joseph M

Accepted Solutions (0)

Answers (2)

Answers (2)

joseph_manjiyil
Participant
0 Kudos

Hi Selva,

That option does not work in this case.

Regards,

Joseph M

selvakumar_mohan
Active Participant
0 Kudos

Hi,

I am definitely not sure how this will work? Even in the report the item you are seeing is that of the TRQ not TOR.

To get the FU item from the TRQ BO is not possible directly.

You need to determine the FU keys from the TRQ key. Once done, you have to create an instance for the FU(TOR) pass the TOR key, do the above retrieve by association with references to the TOR constant interface- /scmtms/if_tor_c.

Please let me know if you need more information


joseph_manjiyil
Participant
0 Kudos

Hi Selvakumar,

It is possible to retrieve the Freight unit item from TRQ item key. If I navigate to TRQ ROOT and traverse to FU ROOT, I wont be able to determine which line item in TRQ has created which Freight unit. There can be multiple FUs attached to single TRQ(e.g each line item in TRQ creates a FU).The reason the code was not working, is because in the Scheduling call which happens from Sales order or Stock transport order while creation is due to the fact; scheduling call creates temporary Freight unit and temporary FOR key. All the existing FU and FOR is not considered.

Regards,

Joseph M

selvakumar_mohan
Active Participant
0 Kudos

Hi Joseph,

My bad, took the wrong understanding. Can you please try, in your code the following change

"iv_before_image  = abap_false".

Let me know if it works

-Selvakumar M.