cancel
Showing results for 
Search instead for 
Did you mean: 

Loop on output table rows

Former Member
0 Kudos

Hi everybody,

is it possible to loop on output tables row?

That's my problem (is an example!):

In table "A" I've customers and each customer have one or more entries in table "B". I've two BAPIs, the first gives me the list of customer (in a range) the second one the entries for a customer.

I'd like to call the 1st bapi (with a rang) and, putting the output in the 2nd one, get the whole entries for the given customer.

Just a bit complicated to explain.....

Thanks a lot

Massimiliano

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi again!

OK, I see. Not quite sure if one can do this just by using VC only.

However, here is a workaround.

1) Create remote-enabled function module in R/3.

2) As input parameter let it be table of all customers.

3) Loop trough all customer input table and call other "details-BAPI" each time.

4) Save all these details: customer + customer details in another internal table X;

5) Return parameter: internal table X.

6) Now in VC call BAPI which returns all customers;

7) Save results in table view Y;

😎 Drag in VC above created function-module

9) Connect table-view-Y to input port (flip port to be input port) of function-module

10) The output port of function-module will return your necessary info;

Cheers,

--- Kaspars

Former Member
0 Kudos

Let me try to explain:

I need all open items for all my customers in my company like what I get with transaction FBL5N.

There's a system BAPI (BAPI_AR_ACC_GETOPENITEMS) that gives me all open items for a single customer.

I also have a BAPI that gives me all customers for a company.

Now what I need is execute the BAPI_AR_ACC_GETOPENITEMS for all customers I get and, as a result, have a tebles like

customer A, item1

customer A, item2

customer B, item1

...

...

With the solution suggested by Kaspars I think I can get open items for the selected customer only.

Thanks a lot!

Massimiliano

Former Member
0 Kudos

Hi there!

If I see that correctly, then you would like to have as a result for BAPI2 only those entries, which have corresponding ones in BAP1. If so, then

1) just call BAPI1 first

2) then using BAPI1 table view, submit it to the input port of BAPI2 using appropriate input parameters as for BAPI2 (on connection line you can map necesary BAPI1 table view data to BAPI2 parameter names).

3) And you should be all set.

Hope this will help.

--- Kaspars

Former Member
0 Kudos

Hi Massimiliano,

I don't understand your question, but it must be possible, that you can forward the output of BAPI1 into the input of BAPI2, or not?

Best Regards,

Marcel