Skip to Content
Nov 30, 2009 at 12:07 PM

MIGO after commit Exit needed


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
    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


I need other logic to retrieve data from table adrc.

Please let me know as soon as possible.