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

Problem processing Idoc with FM IDOC_INPUT_DELVRY

Former Member
0 Likes
1,678

    Hi gurus.

    I need help. I am using a Z funcion module copy of IDOC_INPUT_DELVRY FM to process Inbound Idocs. It works fine, perfect but after the  IDOC_INPUT_DELVRY FM I call the BAPI 'BAPI_OUTB_DELIVERY_CHANGE' To modify some filed in the delivery taht we cannot modify with the idoc processing. The problem is the BAPI dosen´t update sometimes this fileds. I think its a block problem because the IDOC_INPUT_DELVRY its executed in update task so sometimes when the bapi its going to uodate the delivery the IDOC_INPUT_DELVRY its modifying it and the BAPI dosen´t run. I' am checking the delivery blocks before updating the delivery with the BAPI but it never gives any block .

   So how can I be sure the IDOC_INPUT_DELVRY have finished the update to start the BAPI_OUTB_DELIVERY_CHANGE?

    Can you tell me anything??

   Thanks a lot.

6 REPLIES 6
Read only

Former Member
0 Likes
1,149

Hi Jorge,

yes you are right, it seems to be caused by the processing in update task, but why do you want to change the incoming delivery this way?

Is it not possible to implement all necessary changes within the function for inbound processing before posting?

You can use very easily UserExit V55K0030.

KR

Robert

Read only

former_member189779
Active Contributor
0 Likes
1,149

You can try calling your BAPI BAPI_OUTB_DELIVERY_CHANGE in Background task.

Read only

Former Member
0 Likes
1,149

  Hi gurus again.

  First of all , thanks for your replies.

  Second:

    Robert, yes we are using that user to modify some fileds of the delivery head, but we have to modify filelds like the partner name and other things we coluldn´t do it there because the  IDOC_INPUT_DELVRY calls internally to the delivery_update_2 and in case of picking it dosen´t use some structures to call the delivery_update_2.

    Vinit, why in background task?

    Thinking about the issue maybe the best option before calling the bapi could be getting the updating tasks pending and if there is any update task pending for the delivery wait till this update task is processed. What do you think about??  The table storing that update task information I think its VBHDR, do you know any fm to read the update tasks pending?

     Other posibility could be make a WAIT big betwen the idoc processing and the BAPI execution, something like 30 seconds or 60 , because every idoc is processed in background so we don´t need it to be fast.

    What do you think friends?

  

    Thanks and Regards.

Read only

0 Likes
1,149

Hi Jorge,

OK If it is like this than I would recomend to do as follow:

- encapsulate the BAPI in update FM

- within this FM check within loop and periodic times (100 ms) the existance of the relevant infos on Database.

- if they are exist, than run the BAPI

- do not forget to implement a mechanism to leave the loop in case of failure

KR

Robert

Read only

0 Likes
1,149

BACKGROUND  Task will be executed after the update task is finished if this is registered after update task.

http://help.sap.com/saphelp_nw04/helpdata/en/8f/53b67ad30be445b0ccc968d69bc6ff/content.htm

When executing the COMMIT WORK statement, the function modules registered for the current SAP LUW are started in the sequence in which they were registered.

So your BAPI should ideally executed after finish of Update Task. if its still start same time (Not 100% sure) You can put small delay but that will be last option.

Read only

Former Member
0 Likes
1,149

Hi Jorge,

You can put a WAIT statement say for 5 or 10 seconds and then call the BAPI.

Regards,

Felix