cancel
Showing results for 
Search instead for 
Did you mean: 

Storing the output of BAPI for further use in Webdynpro application

Former Member
0 Kudos

Hi,

In my webdynpro application, a BAPI_A is called multiple times from a backend.

All the previous outputs of the BAPI_A need to be stored in the webdynpro application as they serve as a complete set of input parameters for BAPI_B at the end.

Can anybody shed light on this temporary storage mechanism of the outputs of the BAPI_A.

Regards

Meesum

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Create Context with the same structure as that of the BAPIModel.

You are going to call BAPI multipletimes with differentset of values(inputs).

So Create context as follows

BAPINode

Result

---> Attrib1

---> Attrib2

...........

InputParam1

InputParam2

Here "BAPINode" is valuenode contains another valuenode "Result" which contains the actual output.

You can store inputparameters in "InputParam1" and "InputParam2".

While executing the BAPI eachtime populate the above context.

Regards, VIP

Former Member
0 Kudos

Hi,

To describe the application more precisely, the input to the BAPI_A is to be provided during the runtime over some view. As mentioned this is done multiple times.

Every time the BAPI is freshly called, the ValueNode attributes are overwritten with new output values from the BAPI.

But I require these old output values for future use(no immediate usage).

Is it a good idea to create a text file and append to it the output values everytime the BAPI is called?

Or any other idea?

Former Member
0 Kudos

Hi

I am throwing a wague Idea

For the first time have all the values in a value node that are returned from BAPI with Some Unique INdex and after second run of BAPI just have the INDEX incremented and store the VALUES so while retrieving latter u can have the old values with the INDEX number u want.

or u can do like this also if u dont want to differentiate between the first and the Second run of BAPI

Dont invalidate the node and have the output appended to it everytime u run the BAPI. u can test this by giving this node as datasource to a table UI Element whether u are able to store the data or not

With Wishes

Krishna kanth

Message was edited by: krish kanth

Former Member
0 Kudos

Hi Meesum,

1. Create a value node (vnBAPI_A) with cardinality 0:n

2. Create value attributes (same as vnBAPI_A import parameters) under vnBAPI_A.

3. Create a another value node under vnBAPI_A as "vnResult" with cardinality 0:n

4. Create a value attributes under vnResult (same as BAPI_A output structure)

5. After each execution of BAPI_A, populate the data in vnBAPI_A --> vnResult

As the cardinality of vnBAPI_A is 0:n, you will be able to store multiple output values of BAPI_A.

Hope this helps, if you require any clarification reply back.

Regards,

Santhosh.C

Former Member
0 Kudos

Hi,

Those were valuable suggestions. Will test them as soon as our development infrastructure is up & running.

Hi Santosh,

The cardinality 0..n in the results node would ensure that the node is populated with one or more set of results(as u suggested). But all these results will be generated as a result of a single call to the BAPI.

Every fresh call to the BAPI would reset the Node(be it singleton or non-singleton) and fill it with fresh values. (old set of result sonce again lost)

Think abt it. or correct when i am wrong

Thnx

Meesum

Message was edited by: Meesum Kirmani

Former Member
0 Kudos

Hi Meesum,

Your BAPI structure

BAPI_A

--Output (0..n)

-


Field1

-


Field2

-


Field3

-


Field4

Value node structure

vnBAPI_A (0..n)

--vnResult (0..n)

-


vaField1

-


vaField2

-


vaField3

-


vaField4

1. Declare objVnBAPI_A (between begin and end)

2. Initialize in the vnBAPI_A in the wdDoInit()

3. After each execution of the BAPI (BAPI_A), create the vnResult and populate the fields of vnResult (from the BAPI_A --> output)

4. Add the vnResult object to objVnBAPI_A

Hope this should help you.

Regards,

Santhosh.C

Former Member
0 Kudos

Hi Meesum,

I have been working on an application on the similar lines wherein I need to store the output of a BAPI for further use in the application.

Just wondering if you were able to work around this issue, and if yes, I would really appreciate if you'd throw some light on it?

Thanks in advance,

Vicky

Former Member
0 Kudos

Hi

Create a Value Node and after execution of Bapt the resultant Values u can store in this Value Node. which u can use for latter purpose. and send the same values to BAPI_B as import parameters.

Wishes

Krishna Kanth