cancel
Showing results for 
Search instead for 
Did you mean: 

How do i check BAPI has data after execution

Former Member
0 Kudos

Hi All,

I am executing BAPI function. But it has no return structure. I do i check the BAPI has data or not after execution.

Please give me the solution ASAP.

Thanks

Karri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravi,

You can check the node size to ensure that it has data or not.

for eg: If the node name is Sales, then wdContext.nodeSales.size() returns the number of rows.

Hope this helps you.

Thanks,

Shiva

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Ravi,

You can check it with the help of size() method.

for ex: if u have the node name Z_Employee_Output which is created in the context to get the output of the BAPI.

Now u can use the follwing code, it will give the size of the return structure.

wdcontext.nodeZ_Employee_Output().size();

regards

karthik

Former Member
0 Kudos

Hi Ravi

As mentioned by Maksim if u add input parameters to instance of (rfm)_Input and then execute the modelobject. the (rfm)_Output is child of this node.

And once u invalidate output, you can check for the size of the output.

Thanks

Srikant

Former Member
0 Kudos

As far as I know, all BAPI's have return structure, especially the ones which saves data in R/3.

Is this a custom remote function module or a BAPI ?

Nevertheless, if you are function module has a table (table can be both input and output),and you put values in the table as part of input, you may try this:

a) If there is a problem in execution of the function module, the Output structure - that particular node (table) in Web Dynpro will be empty.

However, this is not an ideal way but only a workaround(an that too not a good one).

Regards,

Subramanian V.

former_member182372
Active Contributor
0 Kudos

Hi Karri,

If an RFM requires input parameters, these must be supplied to the instance of class _Input. Then the _Input.execute() method can be called.

Once the RFM has executed, and instance of _Output will be available as a child of _Input.

So every executable model class contains "Output" relation

which can be used to fetch result of BAPI call.

Best regards, Maksim Rashchynski.