cancel
Showing results for 
Search instead for 
Did you mean: 

Rule for complex table

Former Member
0 Kudos

Hello Experts,

I have a problem with rule which should display multiple records in text field.

Complex table look like this:

structure:

and i would like to display column "line" which will be group be column "name".

I created this rule but it showing only the latest record from column.

Data should be displayed like this. For "name" TEST_PAWEL field text name should show date like this:

one

two

three

test text

thanks and best regards,

Mateusz Owcarz

Accepted Solutions (0)

Answers (1)

Answers (1)

jason_latko
Advisor
Advisor
0 Kudos

Mateusz,

Complex table rules do not behave like that.  You will only get a single row returned.  You could change your output field to be a complex table list screen control.  Then you would need to add an IndexByName index to keep the rows in order.  Also provide a value for the parent field value(TEST_PAWEL in your case).  This will display all rows in a grid for TEST_PAWEL in the correct sort order by index.

If you needed this to display in a string field, you would need to run a sub-action that loops over the complex table using the same index, providing TEST_PAWEL as the parent again.  The loop should run a transaction that uses CONCATENATE to add the current row to a string property somewhere for storage.  Adding a NEWLINE character after each row will format the data properly.  You need to Apply after each loop iteration to save the data.  This can be a slow process on some devices and isn't very efficient.  Make sure also that your string screen field allows multi-line display.  This approach is much more complicated.  I would recommend using the CT List control.

Jason Latko - Senior Product Developer at SAP.