cancel
Showing results for 
Search instead for 
Did you mean: 

BRF+: Nested table as result data object possible?

cyclingfisch_
Active Contributor
0 Kudos

Hi experts,

I have the following requirement:

based on an input table I have to fill three different tables. To determine the values of the output tables, all the entries of the input tables need to be analyzed. As it is not possible to add three result data objects, I defined a structure with three nested table as result object.

Within a loop I want to insert the data to the nested tables of the result data object. But BRF+ doesn't offer me the nested table as target for the insert.

Are there any other ways of achieving this?

As all this is regarded as one rule from a functional point of view, I don't want to create three functions. If I create three functions, one could call them separately which would lead to a wrong result.

Thanks in advance for any help & cheers!

Martin

Accepted Solutions (1)

Accepted Solutions (1)

Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Martin,

You don't need to have 3 result data objects.  Just put all 3 tables into your context and then you can choose which context parameters you treat  as importing, changing, or exporting.

Typically in complex BRFplus functions like this we name the context parameters I_xxxx for importing, E_xxxxxx for exporting etc.

Hope that helps

Jocelyn

christianlechne
Active Contributor
0 Kudos

Hi Martin,

Jocelyn's proposal is quite cool as this avoids the handling of nested tables in the result parameter, so its easier to handle in the BRF+ workbench.

If you go this way (which I would do) just keep in mind to create the code template for the ABAP call in the backend in the proper way, namely tick the option "Return Changed Context Values" in order to receive the manipulated context values:

BR

Christian

carsten_ziegler
Active Contributor
0 Kudos

It is also possible to create a result structure wwith three components, each a table.

cyclingfisch_
Active Contributor
0 Kudos

Finally I could create the result structure with three components. But I don't know why it didn't work (the buttons were disabled) first.

Thanks all for the replies!

Answers (1)

Answers (1)

0 Kudos

Hi Martin,

One way to do it would be to create table variables , filling them up with data , and then looping through each such variable and inserting each line to the target attribute of the result object which represents the same table.

X is the table variable filled up with data.

Loop at X.

insert values into Result_Object-attribute from x_wa.

Regards,

Indranil.