cancel
Showing results for 
Search instead for 
Did you mean: 

Re:Dynamic table in SAP Script.

Former Member
0 Kudos

hi,

I have one internal table with 5 columns,(register id, business area, amount1, amount2,total) , now i want to pass this data to SAP script main window table, here is the condition ,if for the particular business area there is no data (amount and total are equal to 0.) that business area row is not displayed in table, that means in table rows are dynamic.And after displaying all rows i want to display totals row.

These all rows are dispaly in lines means , header.|

-


| -


row1. |

-


|----


row2 |

-


|----


totals row

-


I tried to put the IF condition in text editor, but it is not working.

Can any one please let me know the solution.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

First, in the driver program just before you call this window you need to delete all the entries from the internal table where amount and total are equal to 0.This will give you entries which are required to be populated in the script. You can also use IF statement like

IF &AMOUNT& NE 0 OR &TOTAL& NE 0.

...

ENDIF.

In case of rows, you can use LOOP-ENDLOOP.

Hope this solves your query.

Reward helpful answers

Regards,

Subodh

Former Member
0 Kudos

hi,

In your text editor use the if command like this

if &amount& ne 0 or &total& ne 0

&amount&,,&total&..... so on

&sapscript-counter_01(+0)&

endif.

&sapscript-counter_01& is a counter variable we can have upto 10 starting from 0 to 9.

after displaying all the records you can display the total number of records using

&sapscript-counter_01&

This would solve your issue.

reward points if useful

regards

padma

Answers (0)