Application Development 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: 

Table in SAPScript

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

Thanks for prompt reply.

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

Tushar.

0 Kudos

? 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

0 Kudos

hi,

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

/E TABLE

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

Former Member
0 Kudos

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

0 Kudos

Please remember to reward points for helpful answers. Thanks.

Regards,

Rich Heilman