Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Executing BAPI Multiple Times

Hello Everyone,

I am trying to execute BAPI_ACC_DOCUMENT_POST multiple times in an application. My requirement is to post multiple documents in one click. The Context is as follows.

--Context

-


BAPI_ACC_DOCUMENT_POST(model node)---cardinality(0..1)

-


Accountgl(model node)---cardinality(0..n)

-


AccountPayable(model node)---cardinality(0..n)

-


Currencyamount(model node)---cardinality(0..n)

-


DocumentHeader(model node)---cardinality(0..1)

-


Output(model node)---cardinality(0..1)

-


-Document(Value Node)-cardinality(0..n)

I have create the Value node Document and I am trying to get few values from the user and assigning it to the model nodes during runtime. The BAPI should execute depending on the number of rows in the Document Table that the user decides at the runtime.

Could anyone give me some basic idea about how to acheive this requirement. I hope you can understand my requirement and please do let me know if you need any further explanation. I would greatly appreciate your help.

Regards,

Gopal.

Former Member
Former Member replied

Hi Gopal,

As per my understanding -Document(Value Node) size will decide the BAPI calls.

Then try this out:

for (int i=0; i<wdContext.nodeDocument().size();i++)
{
//access value node attribute here and set them to model e.g.
// declare model node element use setter methods
wdContext.nodeDocument().getDocumentElementAt(i).get<attributename>();
// like get all attribute and set 

// execute BAPI here
}

Let me know if you are not clear yet.

Regards,

Siva

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question