Skip to Content

BAdI or User Exit for changing document type of accounting document

Mar 27 at 04:47 PM


avatar image

During MIGO or MIRO transaction, an accounting document is created (table

BKPF & ACCIT) with a certain document type (field BLART) and I need to change this type to 'ZB' for some of them.

I've already tried without success:

- BAdI FAGL_SET_SEGMENT => changes on document type doesn't work

- BAdI AC_DOCUMENT => no access to document type

- Some user exit (don't remember)

I've looked at those question without success: (no answer...) (not triggered by MIGO)

I have no problem using two user exit (one for MIGO, one for MIRO), but for the moment I didn't found anything working for MIGO.

William Mateille

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raymond Giuseppi
Mar 28 at 06:58 AM

Did you consider a substitution rule (tr. OBBH)

Show 3 Share
10 |10000 characters needed characters left characters exceeded

I didn't know OBBH was a thing, I'm looking into it thanks.


For the mods, I don't have any "reply" button, I tried to edit my last comment but I can't (clicking on submit don't do anything). I'm on IE maybe that is the problem but I can't use another browser, I have only the possibility to "share", "accept" or "alert moderator" for a comment.
Is there something I'm doing wrong ?

Anyway, I want to answer that to Raymond: "By creating a substitution rule I must associate an exit because I need to make this substitution only if the purchasing group of the document is in a custom table. But this does only report the problem, now which exit can I use ? If I create one, will my code be executed each time I go through MIGO & MIRO, or it depends on the exit ?"

Sorry for the unconvenience...

Put a condition in OBBH, e.g. BKPF-AWTYP = 'MKPF' OR BKPF-AWTYP = 'RMRP' then execute the substitution if code required in an User Exit defined in the Substitution/Validation/Rules, it will be called if and only if MIGO OR MIRO transactions, or related BAPI, are executed.