How to execute a BADI in BAPI_ACC_DOCUMENT_POST from C#?

3.7k views Asked by At

I have to pass data to BAdI acc_document in parameter extension1 of BAPI bapi_acc_document_post, but I don't know how to do that using SAP .NET connector.

Any suggestions?

Regards, Devinder

1

There are 1 answers

0
mjturner On

BAPI extension parameters are pretty much free-form - as you can see, for BAPI_ACC_DOCUMENT_POST parameters EXTENSION1 and EXTENSION2 are defined as tables with character fields.

You can store whatever data you want to into them and use them as you do any other BAPI parameters, the key is that you need to interpret the values in your enhancement. For example, if the caller stores an external document number into a row of EXTENSION1, just interpret it as a document number when you use it in your BADI. If you're passing a structure in the extension parameter it can be a little trickier (as you have multiple fields to deal with), but the same principle applies.