cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create new Item charge element under charge Item

Former Member
0 Kudos

Hello all,

I need to create new Item charge element under charge Item.

I have used below code.

        lst_modify-node                = lst_assoc_itemele-target_node_key.
       lst_modify-change_mode = /bobf/if_frw_c=>sc_modify_create
       lst_modify-source_node   = lst_assoc_chrgitm-target_node_key.
       lst_modify-association     = l_assoc_itemele.
       lst_modify-root_key         = lst_charge_item-root_key.   "TRQ-KEY
       lst_modify-source_key     = lst_charge_item-key. "root-KEY
      lst_modify-key                = lr_srv_mgr->get_new_key( ).

       lst_charge_element-key      = lst_modify-key.
       lst_charge_element-tcet084 = 'ZLEGACY'.
       lst_charge_element-rate_amount = '100'.
       lst_charge_element-currcode016 = 'EUR'. 
       lst_charge_element-item_desc = 'Duty description'.
      lst_charge_element-item_id   = 'Charge Description'.
       GET REFERENCE OF lst_charge_element INTO lst_modify-data.
       INSERT lst_modify INTO TABLE li_modify.
       lr_srv_mgr->modify(
       EXPORTING
         it_modification = li_modify
         ).

     Above code is not creating new entry, but if i use same code for updating the existing item charge element it is working.So please do let me know if we can use any other way to create item charge element.

Accepted Solutions (0)

Answers (1)

Answers (1)

tarunkumar
Active Participant
0 Kudos

Hi Sunil,

If you are creating new itemchargelement from some action or determination then you can try calling END_MODIFY of /BOBF/IF_FRW_MODIFY interface, but if you are doing it externally then try calling SAVE of /BOBF/IF_TRA_TRANSACTION_MGR after MODIFY call.

Can you share more details(what is the context) if it doesn't work.

Regards,

Tarun Kumar