Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Insert events in Shipment document

Former Member
0 Likes
2,550

Hello,

Have you ever create an event in shipment document with TSEG_INSERT_EVEN function?

I used before TSEG_INIT, and  TSEG_READ and  TSEG_INSERT_EVEN doesn't generate error in other case it fail.

But still it doesn´t work, because the event is not created in shipment document.

I called TSEG_INSERT_EVEN function in an user exit for the shipment and as well in a function z but doesnt work in any case.

Someone has been sucessfull with this topic? and can help me?

Thanks a lot.

Li Eli

Hello,

Have you ever create an event in shipment document with TSEG_INSERT_EVEN function?

I used before TSEG_INIT, and  TSEG_READ and  TSEG_INSERT_EVEN doesn't generate error in other case it fail.

But still it doesn´t work, because the event is not created in shipment document.

I called TSEG_INSERT_EVEN function in an user exit for the shipment and as well in a function z but doesnt work in any case.

Someone has been sucessfull with this topic? and can help me?

Thanks a lot.

Li Eli

6 REPLIES 6
Read only

Former Member
0 Likes
1,573

Hi Li,

I haven't worked with those FMs.

Check if sample code in below link helps:

http://scn.sap.com/thread/787922

Regards,

Nisha Vengal.

Read only

0 Likes
1,573

Hi Nisha,

Thank you very much for your answer.

In my case I need to insert an event in the shipment

and Iam calling 'TSEG_READ' previous to TSEG_INSERT_EVEN'

but I dont know if Iam right with WSHDRVTTK'. Because not generate error but, not insert the event in the shipment.

  data: v_hdrvttk type tsegobjhdr value 'WSHDRVTTK'.


  call function 'TSEG_READ'
    exporting
      if_object                = v_hdrvttk
      is_object_wa             = lw_vttk.

  call function 'TSEG_INSERT_EVEN'
    exporting
      if_handle   = lw_vttk-handle
      if_even     = lv_event_tm.

Cheers.

Li

Read only

0 Likes
1,573

Hi Li,

Try this FM 'TSEG_WRITE_UPD'.

Also always remember to keep the 'EXCEPTIONS' part in  CALL FUNCTION 'XXX' statement.

Regards,

Nisha Vengal.

Read only

0 Likes
1,573

Hi Nisha,

Thank you for your answer.

Is working when is used the transaction vl02n directly or call transaction but with the Bapi

BAPI_SHIPMENT_CHANGE doesnt work.

Maybe Iam not giving the enough data, Iam calling the bapi in this way:

* Shipment number
  lw_header-shipment_num  = lv_ship_doc.
  lw_header-text_1 = v_status.
  lw_headeraction-text_1 = 'C'.

* Delivery number
  lw_item-delivery        = lv_del_doc.
  append lw_item to li_item.

  lw_itemaction-delivery  = c_change.
  lw_itemaction-itenerary = c_change.
  append lw_itemaction to li_itemaction.


* Change Shipment document
  call function 'BAPI_SHIPMENT_CHANGE'
    exporting
      headerdata       = lw_header
      headerdataaction = lw_headeraction
    tables
      itemdata         = li_item
      itemdataaction   = li_itemaction
      return           = li_return.

The process going through the implementation where the TSEG_INSERT_EVEN' function is, but, with the bapi doesn´t work, did you use bapi or call transaction ?

Regards

Li

Read only

0 Likes
1,573

Hi Li,

Thanks for the details..

Sorry, but I think I am confused.

I have not worked with these TSEG FMs before.

Can you post the full relevant code.

Is BAPI and 'TSEG_INSERT_EVEN' both in your code now ?

How did BAPI suddenly come into picture ? Any relation to TSEG FM ?

Did you get a chance to try 'TSEG_WRITE_UPD' FM ?

Regards,

Nisha Vengal.

Read only

0 Likes
1,573

Hi, Nisha,

You are right, you have not worked before with these functions, Iam so sorry,

But , just I wanted to tell you, that now is working, The function is inserted in a shipment badi implementation, so when a call transaction is executed, the function is executed and therfore the event is inserted but with the shipment change bapi is executed the event is not working, but doesnt matter with it, is enough for me.

Thanks a lot for your kind attention.

Regards

Li