cancel
Showing results for 
Search instead for 
Did you mean: 

BOPF Enhancement to pass data from Z table to Freight Unit Item level

Former Member
0 Kudos

Dear TM Experts,

I am new to SAP TM developments. I have gone through SAP Transportation Management 8.0 / 8.1 & 9.0.

We have a requirement where we need to pass data from Z table to TURES_ID of Freight Unit structure.

We have configured automatic creation of freight unit at FUBR level. We have configured standard PI interfaces with which whenever STO or Sale order is created in ECC, OBTR is created in SAP TM which is as per our requirements.

Now, due to this FUBR configuration, Freight Units are created automatically. During this creation of Freight Unit we need to find a point for enhancing to built our own logic for picking data from Z table and passing it to Freight Unit Item structure at run time.

I tried with Determination Enhancement option with pattern B Derive Dependent Data Before Saving for BO - /SCMTMS/TOR for Create/Update and delete Nodes. When I try this from transaction - /BOBF/TEST_UI break-point stops but when I test this using Tcode - SPROXY using payload of inbound proxy our breakpoint do not stops.

I would like to know below 3 points:

1. The approach of Determination Enhancement is better approach for passing data to freight unit structure at run time from Z table or their any other better approach using which we can achieve passing data to freight unit from Z table during instance of PI interface

2. Why our breakpoint is not stopping when we are testing from Inbound proxy from SPROXY with payload data in SAP TM

3. Is their any other option where we can debug PI interface and reach to freight unit level other then SPROXY

Please refer to the attachment for details of Determination enhancement.

Please share your experience on this topic.

Thanks in advance.

Regards,

Md.Rafi

Accepted Solutions (1)

Accepted Solutions (1)

bharath_k6
Active Participant
0 Kudos

Dear Rafi,

Please go through the below threads in which similar questions were asked and answered by me and other fellow members.

https://scn.sap.com/message/15148955#15148955

https://scn.sap.com/message/15040150#15040150

Let me know if you still need any specific help.

Thanks,

Bharath.K

Former Member
0 Kudos

Hi Bharat,

Thanks for the reply. Your provided links are very helpful for me.

In my case I am using Determination Enhancement option. I cannot use BADI provided at TM as we need to get data from Z table on FIFO basis and allocate that to Freight Units from TM side.

I cannot pass this data from ECC I need to trigger this somewhere at TM at ITEM node of TRQ. Good thing is that I was able to reach my BREAK-POINT from SPROXY. The issue was I had done enhancement earlier at /SCMTMS/TOR. I created a new enhancement at /SCMTMS/TRQ & my BREAK-POINT got stopped.

BREAK-POINT issue is resolved. But I would like to know approach that I am using of Determination Enhancement is a best approach or their is some other better approach to pass data at ITEMNODE of TRQ while end to end execution of Interface.

Also, I need to takecare if their are any change or deletion done at Freight Unit using (Edit Freight Units option from NWBC) this need to be replicated back to transaction.

Regards,

Md.Rafi

bharath_k6
Active Participant
0 Kudos

Dear Rafi,

You can use either BADI or determination enhancement approach. Both are good choices but depending on your scenario and availabilty of class signature you can choose any.

Depending on the property change trigger ''Create/Update/Delete'' of node, detemination shall be executed and if the written code is correct it should work fine during SAVE as well. But only thing is make sure you update the buffer properly with required parameters while writing the code.

Thanks,

Bharath.K

Former Member
0 Kudos

Hi Bharath,

Would like to try this with Determination and will see how it ends up.

Thanks for sharing your skills on SAP TM, you are really awesome in SAP TM developments.

Regards,

Md.Rafi

Former Member
0 Kudos

Dear Bharath,

I am trying to update Container ID Field  (TURES_ID) using determination at /SCMTMS/TOR root node. But does it require Modify method to be used in the method EXECUTE of Determination class? or standard Determination Create/Update/Delete will take care of this. My changes are not getting replicated at FU->Cargo Tab Container column.

Then I tried using MODIFY method to modify the field TURES_ID of ITEM_TR node but still i am not able to update Container Field of ITEM_TR node.

I have attached the code can you please let me know where I am going wrong.

Thanks in advance.

Regards,

Md.Rafi

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear Rafi...

The modify is needed in determination and commit work will be handle by BOPF framework.

please follow the below to update the TURES_ID on FU item

Create a determination on TRQ item to update the TURES_ID on TRQ item and logically it should flow to FU item automatically. Please let me know if this not works.

If you want to update the TURES_ID directly on FU item, in that case i will suggest you to create an additional strategy and assign it on FU type config.

Thanks,

Nitesh Jaiswal

Former Member
0 Kudos

Hi Nitesh,

Thanks for reply.

In my requirement when Freight order is saved after accepting the Transportation proposal from Transportation Cockpit I need to pick data from Z table and pass that to TURES_ID (Container) of freight unit.

I am able to reach break point while saving freight order (Transportation Cockpit ->Accept Transportation proposal -> Save) and after that I am using below methods:

*retrieve - To retreive Roor node of TOR

* Get an instance of a service manager for e.g. BO tor

  lo_srv_tor = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( /scmtms/if_tor_c=>sc_bo_key ).

* Use method RRETRIEVE to retrieve ROOT data

  lo_srv_tor->retrieve(

  EXPORTING

    iv_node_key = /scmtms/if_tor_c=>sc_node-root

    it_key = it_key

    iv_edit_mode = /bobf/if_conf_c=>sc_edit_read_only

    IMPORTING

      eo_message = lo_message

      et_data = lt_root

      et_failed_key = lt_failed_key ).

*retrieve_by_association - to retrieve ITEM_TR data

* Use method Retrieve by Association to retrieve ITEM node data

  lo_srv_tor->retrieve_by_association(

  EXPORTING

    iv_node_key = /scmtms/if_tor_c=>sc_node-root

    it_key = it_key

    iv_association = /scmtms/if_tor_c=>sc_association-root-item_tr

    iv_fill_data = abap_true

    iv_edit_mode = /bobf/if_conf_c=>sc_edit_read_only

    IMPORTING

      eo_message = lo_message

      et_data = lt_item

      et_key_link = lt_link

      et_target_key = lt_item_key

      et_failed_key = lt_failed_key ).

Then, using modify to modify changed data of ITEM_TR node as below:

  ls_changed_field    LIKE LINE OF lt_changed_fields.

  ls_mod-change_mode        = /bobf/if_frw_c=>sc_modify_update.

  ls_mod-node               = /scmtms/if_tor_c=>sc_node-item_tr. "root.

  ls_mod-key                = /scmtms/if_tor_c=>sc_association-root-item_tr. "Node key for which you want to update

  CREATE DATA ls_mod-data TYPE /scmtms/s_tor_item_tr_k.

  FIELD-SYMBOLS: <ls_item_tr> TYPE /scmtms/s_tor_item_tr_k.

  ASSIGN ls_mod-data->* TO <ls_item_tr>.

  <ls_item_tr>-tures_id = 'OOCLTEST'.

  APPEND /scmtms/if_tor_c=>sc_node_attribute-item_tr-tures_id TO ls_mod-changed_fields.

  APPEND ls_mod TO lt_mod.

  lo_srv_tor->modify(

EXPORTING

  it_modification = lt_mod

  IMPORTING

    eo_change = lo_chg

    eo_message = lo_message ).

But still my data is not getting saved at transactions or table.

I think i am missing some thing at code or determination level can you please help me out what i am missing on it.

Thanks in advance.

Regards,

Md.Rafi

0 Kudos

Hi Rafi,

Do you able figure out how to pass the data.
If yes can you help me ?

Thanks in Advance

Ravi