‎2008 Mar 24 7:00 AM
Hi All,
Is it possible to use 'Headderless Internal Table' and 'Internal table with header line' in Smartform.
Which one of the two option is convinient to use in Smartform and Why?
Regards,
Deepak.
‎2008 Mar 24 7:25 AM
Hi Deepak,
It depends up on the condition. What is the use if ur not using internal table with headerline? u need internal table with header line to read the values from the internal talbe . If you are using loop condition with out header line how can u display values? i suggest internal table with headerlines is useful if you want to print the values in the table. Internal table with out header line is used in cases where u want to read values.
itab is a internal table
It_wa is header line of table itab.
u can user like this
Ex; loop at itab into it_wa.
write : it_wa-field1, it_wa-field2.
endloop.
this is one case. where u can use header line. so u decide wht kind of coding ur using what is useful to you.
<b>reward if useful</b>
Regards,
sunil kairam.
‎2008 Mar 24 7:25 AM
Hi Deepak,
It depends up on the condition. What is the use if ur not using internal table with headerline? u need internal table with header line to read the values from the internal talbe . If you are using loop condition with out header line how can u display values? i suggest internal table with headerlines is useful if you want to print the values in the table. Internal table with out header line is used in cases where u want to read values.
itab is a internal table
It_wa is header line of table itab.
u can user like this
Ex; loop at itab into it_wa.
write : it_wa-field1, it_wa-field2.
endloop.
this is one case. where u can use header line. so u decide wht kind of coding ur using what is useful to you.
<b>reward if useful</b>
Regards,
sunil kairam.
‎2008 Mar 24 8:19 AM
Hi Deepak,
Yes it is possible to make use of both internal tables with and without header line in a smartform.
For an internal table without header line simply mention the name of the internal table (whose data you want to display in the table node) and the explicitly created work area in the Data tab of the table node.
To use an internal table with header line, create an internal table with header line in your driver program and populate this internal table with data. Now pass this internal table to your smartform. In the Data tab of the table node mention this internal table name for both internal table and into. There also might be some other way of using internal table with header line in a smartform, I am just stating one of them.
You need to choose the option which is more convenient to you. To help you decide better here is an excerpt from help.sap.com:
Using the header line as a work area means that you can use shorter statements; however, they are not necessarily easier to understand, since you cannot immediately recognize the origin and target of the assignment. Furthermore, the fact that the table and its header line have the same name can cause confusion in operations with entire internal tables. To avoid confusion, you should use internal tables with differently-named work areas.
Hope it helps you.
Regards,
Priyanka.