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

MIGO after commit Exit needed

former_member221838
Participant
0 Likes
1,505

Hi Experts,

I need to populate outbound Idoc in my development for the same I am using Method: MB_DOCUMENT_BEFORE_UPDATE.

But in the same I need to populate field called 'adrc-regiogroup', I am using below logic to populate >>

first get material document number then use it to retrieve ser03obknr, then use it for objkobknr which inturn will give objkequnr, then use it to find equzequnr then equziloan, from it iloailoan then from it iloaadrnr then adrcaddrnumber and from then retrieve 'adrc-regiogroup'.


  SELECT ser03~mblnr
         adrstreet~strt_code
         adrc~regiogroup
    INTO TABLE lt_rgroup
    FROM adrstreet AS adrstreet
    JOIN adrc AS adrc ON adrc~streetcode = adrstreet~strt_code
     AND adrc~country = adrstreet~country
    JOIN iloa AS iloa ON iloa~adrnr = adrc~addrnumber
    JOIN equz AS equz ON equz~iloan = iloa~iloan
    JOIN objk AS objk ON objk~equnr = equz~equnr
    JOIN ser03 AS ser03 ON objk~obknr = ser03~obknr
     FOR ALL ENTRIES IN xt_xmseg
   WHERE ser03~mblnr = xt_xmseg-mblnr
     AND ser03~mjahr = xt_xmseg-mjahr
     AND ser03~zeile = xt_xmseg-zeile.

but problem with this is that BADI gets triggered before COMMIT of sap database, so basically SER03 table is not updated with respective material document entry.

so I need either exit which gets triggered after sap commit, so that I will be able to execute above code

or

I need other logic to retrieve data from table adrc.

Please let me know as soon as possible.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,237

use MB_DOCUMENT_UPDATE method of the same BADI. Its triggered in update task.

9 REPLIES 9
Read only

Former Member
0 Likes
1,237

You can try out

Business object BUS2017

event GoodsMovement.created Created

Check if its useful

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,237

Read only

Former Member
0 Likes
1,238

use MB_DOCUMENT_UPDATE method of the same BADI. Its triggered in update task.

Read only

0 Likes
1,237

Hi Rajesh,

I tried to put breakpoint in MB_DOCUMENT_UPDATE, but its not getting triggered.

are you sure? or am i doing anything wrong?

Thanks.

Read only

0 Likes
1,237

this method is triggered in update task.

Put a break-point inside the method. Excute the Tcode in debug mode. while debugging goto Settings menu in the same session and click Update debugging. At the bottom you can see the message update debugging switched on.

Points :

You cannot write any code in method which is called in update task which contains implicit or explicit commit ex call transaction , call screen , commit work etc.

Workarounds :

you can wrap you code in a FM and call that FM in update task or starting new task.

Read only

0 Likes
1,237

Hi All,

Thanks for your quick response.

Yes, my code is wrapped in FM only. This BADI gets triggered before SAP Commit. I want to retrieve data from SER03 corresponding to material document number intiated in MIGO.

So current flow is --> MIGO --> INPUT DATA --> SAVE --> BADI triggered (my FM wrapped in it) --> SAP COMMIT (SER03 updated) .

But I want flow --> MIGO --> INPUT DATA --> SAVE --> SAP COMMIT (SER03 updated) --> BADI or ANYTHING triggered (my FM wrapped in it)

I want something which is after SAP commit.

I checked BUS2017 and it is not working for me.

or any other solution/suggestion would be really useful.

Thanks.

Edited by: Nikhil Jathar on Nov 30, 2009 9:18 AM

Read only

0 Likes
1,237

did you try calling the FM in update task or starting new task in the method I suggested earlier. It works .

Read only

0 Likes
1,237

Ok, I am trying again. I will update this thread.

Thanks.

Read only

0 Likes
1,237

Hi Rajesh, it does work.

Actually when I tried to execute it in debugging mode it wasn't working, but later I tested it on some custom tables to check whether it populates any after commit value/s, it worked. Great.

Thanks.