Application Development 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: 

Document update in user-exit / badi

Former Member
0 Kudos

Hi experts,

I have a question regarding a situation encountered in user-exit/badi developement.

In user-exit or badi I have to call a function/bapi to update the document being created.

But at lasts user-exits & badis called test, the document is not yet created in database.

So my function returns that "document xxx does not exist".

How it is possible to achieve this document modification in this case ?

I heard that we could use the call of a function "in update task" in this kind of situation , could it help ?

Or other solution ?

Thx.

S.N

1 REPLY 1

marius_greeff
Active Participant
0 Kudos

Hi,

I would search for a way change the value of the fields that needs updating that will be saved with the document by SAP.

Then again, the same kind of problem have ended up on my desk.

So that what you planned to start a function module in update task then setting it with a delayed start is all that I can think of. Also in the function module do something like this,

* check that the docment not locked, once unlocked by SAP then change

do while lf_locked = true.

* Try and lock the document

  call function 'ENQUEUE?doc?'

  if sy-subrc = 0.

     lf_locked = false.

     call function 'DEQUEUE?doc?

  elseif lf_count GE 100.

    give some sort of error using a e-mail

  else.

    wait up to 1 second.

   endif.

   add 1 to lf_count.

endwhile.

Any other way I would also like to hear about.

Happy coding