Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table in SAPScript

Former Member
0 Likes
1,223

Hi,

In SAMRTFORMS there is a direct facility to put data in table format.

How do I do create table in SAPSCript ?

Tushar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,036

Hi Tushar,

The TABLE refered is just element name. You can not not pass any table to Script. The loop is inside your ABAP Driver program and for each row of internal table, call write_form to write data in sap script.

regards,

Gagan

7 REPLIES 7
Read only

Former Member
0 Likes
1,036

In Sapscript, you have to define TABS in paragraph format and use that while writing variables.

Read only

0 Likes
1,036

Gagan is correct, in your main page you define an element.

<b>/E</b> TABLE

<b>PF</b> &itab-fielda&,,&itab-fieldb&,,&itab-fieldc&

In your paragraph format "PF", make tabs.

In your driver program, do a loop at your table and write out each line.

LOOP at ITAB.
CALL FUNCTION 'WRITE_FORM'
   exporting
       element 'TABLE'.
ENDLOOP.

Regards,

Rich Heilman

Read only

0 Likes
1,036

Thanks for prompt reply.

I got this point but how do I get lines inside the table ?

Tushar.

Read only

0 Likes
1,036

? What do you mean? It's just like any internal table.

In the above example, ITAB has 3 fields, fielda, fieldb, and feildc.

You fill this internal table like any other.

Then, you loop at the internal table and write out(WRITE_FORM) for each line in the internal table.

Regards,

Rich Heilman

Read only

0 Likes
1,036

hi,

write &uline(80)& in the SAP SCript after the following lines.

/E TABLE

PF &itab-fielda&,,&itab-fieldb&,,&itab-fieldc&

Read only

Former Member
0 Likes
1,037

Hi Tushar,

The TABLE refered is just element name. You can not not pass any table to Script. The loop is inside your ABAP Driver program and for each row of internal table, call write_form to write data in sap script.

regards,

Gagan

Read only

0 Likes
1,036

Please remember to reward points for helpful answers. Thanks.

Regards,

Rich Heilman