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

Update delivery using IDoc

Former Member
0 Likes
1,702

Hi All,

I have a requirement to update the external delivery number in the delivery with the tracking number.

For this I'm following a approach of updating it by creation of the IDoc through code. Due to technical reason cannot update the same using the FM available.

Please let me know how can I create the IDoc through the code and same in the case as it come from the external system(Inbound) and get processed.

Thanks in advance

10 REPLIES 10
Read only

Former Member
0 Likes
1,414

Hi Nilesh,

Please answer the below questions!

1. You want to update the tracking number and external delivery for inbound or outbound

2. From where you need to get the information! Manually or any other tables?

3. Why you want to do it in IDOC, user-exits are available? is there any reason?

Provide me specific details before answering your question!

Rg, Kiran

Read only

0 Likes
1,414

Hi Kiran,

Just to give you a background.

When the delivery is PGI'ed there is a output type which gets triggered, the routine attached to this output type (nace) get the data which needs to be sent to the external system and sends the same to the Proxy. As the proxy is Synchronous we get the response and in this response we get the Tracking ID and other details.

Now, earlier I had written code in the same routine for updating delivery, creatign shipment and Shipping cost document, but as the Delivery is locked when output type is processed I cannot do this activities in this routine.

I had pondered on the option of creating Z table and storing the response and processing the same Sheduling bacth job but they want to restrict use of Z tables.

I hopes above answers all the three questions.

Thanks

Read only

0 Likes
1,414

Hi Nilesh

if you have the functuon module for the same you can use the fm to be called in background task. It will get triggered once all locks are released

Nabheet

Read only

0 Likes
1,414

Hi Nilesh,

- You are connected to PGI! it means it will create the material document ( MKPF,MSEG) - I don't think so it will lock the delivery tables ( LIKP and LIPS).  After delivery completion you are creating the PGI.

- After NAST protocol you are trying to update!

- Please check delivery updates should be happend back ground task, if you want use the BAPI- delivery change again.

- before creation of shipment.  better to enque the MKPF table

call function 'ENQUEUE_EZ_MKPF'
     exporting
       mode_mkpf      = 'X'
       mandt          = sy-mandt
       mblnr          = belnr
       mjahr          = gjahr


- I have checked in my system - the delivery is not locking once break point triggered in NAST protocol at the time of PGI.


Your Proposal:


* You want to create the IDOC for delivery updates, How you want to process the IDOCs?

* how will you do the shipment creation?


Rg, Kiran

Read only

0 Likes
1,414

Hi Nabheet,

Didn't work. When I tried to update delivery in the background task, it was triggering the same output type again in a rescursion and finally terminated wit a dump.

Thanks.

Read only

0 Likes
1,414

Hi Nliesh

First of all why is your output type getting triggered again..? Please check in output type configuration it should not.  If that is corrected it will work..

Nabheet

Read only

0 Likes
1,414

Hi Kiran,

I'm doing the PGI without saving the delivery.

VA02 -> Deliver -> Picking -> PGI. In that case I'm finding that while processing the output type delivery remains locked.

Also, it moves into update task.

I want to create the IDoc and there will be a background job which will process the IDoc after some delay.

Thanks

Read only

0 Likes
1,414

Oh! I have checked the PGI from Delivery

I understand that you will create the TO and shipment subsequently. After that you will fill the delivery change to IDOC!

Check this! IDOC_OUTPUT_DESADV01

Read only

0 Likes
1,414

Kiran isn't it should be inbound..? 

Read only

0 Likes
1,414

Ha! Confused!

Should be IDOC_INPUT_DESADV1!

Rg,Kiran