cancel
Showing results for 
Search instead for 
Did you mean: 

Two decision tables into one Result table

Former Member
0 Kudos

Good day all,

Please suggest the best way how to collect information from 2 different decision tables that have a Key field into one result table.

for example

DT_1 have columnt A and column B(key column).

DT_2 have column B(key column) and column C

Now i have itab_table that need to be filled with A and C columns.

I tried to loop at DT_1 insert value column A to itab_table.

then tried in rules of first loop i tried to loop at DT_2 with condition column B = (don't know how to give this value dynamycally from 1st loop at DT_1).

Rg Dan

Accepted Solutions (1)

Accepted Solutions (1)

christianlechne
Active Contributor
0 Kudos

Hi Dan,

I do not know if this is the best way, but one that should work 🙂

You loop over DT_1 using a loop expression. This way you get a structure of the type "line of DT_1" with field A and B. WIthin the loop you create a rule that calls a tables expression. WIthin the table expression you read the line specifing the key column B. Here you can use the structure namely the field B. As a result you have a second structure of the type "line of DT_2" with the fields B and C.

Now you can move the fields of the two structures to your target structure with line type A and C and append/insert this structure to your itab_table.

BR

Christian

Former Member
0 Kudos

Thanks Christian,


Solved by myself.

what i did is LOOP at DT_1 get A and B

maked 2 rules

1st assign values of A and B to structure type of itab_table

2nd rule loop at DT_2

Here im assigning last column C to to structure type of itab_table

and Inserting this structure to itab_tabl.


So in final i got all i need from DT_1 with matches from DT_2.


Happy that i did by myself


Rg Dan

christianlechne
Active Contributor
0 Kudos

Congrats ... it's always a good feeling when mastering this table manipulation tasks in BRFplus 🙂

BR Christian

Answers (0)