2008 Feb 17 5:43 AM
hi all,
data: BEGIN OF it_summ OCCURS 0.
INCLUDE STRUCTURE yapn_summary.
data: END OF it_summ.
data : wa_demo1 type yapn_summary.
clear wa_demo1.
wa_demo1-sumr = 'hai'.
append wa_Demo1 to it_summ.
WRITE: it_summ-sumr.
its not get output..
i want to display for hai using it_summ.
donot use work area.
how to change it.?
reply me soon,
s.suresh.
hi all,
data: BEGIN OF it_summ OCCURS 0.
INCLUDE STRUCTURE yapn_summary.
data: END OF it_summ.
data : wa_demo1 type yapn_summary.
clear wa_demo1.
wa_demo1-sumr = 'hai'.
append wa_Demo1 to it_summ.
WRITE: it_summ-sumr.
its not get output..
i want to display for hai using it_summ.
donot use work area.
how to change it.?
reply me soon,
s.suresh.
2008 Feb 17 6:14 AM
You can't write out an internal table - you can only write out a line (or components of a line) of an internal table. So you MUST use a work area. If you use OCCURS 0 then you've a table with a headerline, and so don't need a workarea. However, later versions of ABAP discourage tables with headerline, and it is preferred to define a specific work area. So, either:
data: BEGIN OF it_summ OCCURS 0.
INCLUDE STRUCTURE yapn_summary.
data: END OF it_summ.
clear it_summ.
it_summ-sumr = 'hai'.
append wa_Demo1 to it_summ.
LOOP AT it_summ.
WRITE: it_summ-sumr.
ENDLOOP.Now, you see here that at some points it_summ refers to the table, and at others to the header-line. This is ambiguous, and therefore BAD. It's better to define the table and work area seperately.
data: it_summ TYPE STANDARD TABLE OF yapn_summary WITH NON-UNIQUE KEY table_line.
data : wa_demo1 type yapn_summary.
clear wa_demo1.
wa_demo1-sumr = 'hai'.
append wa_Demo1 to it_summ.
LOOP AT it_summ INTO wa_demo1.
WRITE: wa_demo1-sumr.
ENDLOOP. matt
2008 Feb 17 6:17 AM
Hi,
inorder to get data in the internal table u have to loop the\at table write like this.
loop at it_summ.
WRITE: it_summ-sumr.
endloop.
if u have any further query u can contact me on [email protected]
2008 Feb 17 11:55 AM
Hi
if u want to get the data using internal table then u should use itab only dont use workarea.
it_demo1-sumr = 'hai'.
append it_summ.
WRITE: it_summ-sumr.
in u r program u have 2 use
WRITE: wa_summ-sumr, 2 get the output.
2008 Feb 18 5:55 AM
Hi,
Internal table with OCCURS and HEADER-LINE are not supported in the latest versions, those are obsolete. :
ans to your query:
data: BEGIN OF it_summ OCCURS 0.
INCLUDE STRUCTURE yapn_summary.
data: END OF it_summ.
it_summ[]-sumr = 'hai'.
append it_summ[].
WRITE: it_summ-sumr.
regards,
Renjith Michael.
2008 Feb 18 8:02 AM
data: BEGIN OF it_summ OCCURS 0.
INCLUDE STRUCTURE yapn_summary.
data: END OF it_summ.
data : wa_demo1 type yapn_summary.
clear wa_demo1.
wa_demo1-sumr = 'hai'.
append wa_Demo1 to it_summ.
LOOP at it_summ.
WRITE:/ it_summ-sumr.
ENDLOOP.
2008 Feb 18 8:41 AM
Hi Suresh,
If you don't want to use work area to display your output, you can look into the following code :
DATA: BEGIN OF it_summ OCCURS 0.
INCLUDE STRUCTURE yapn_summary.
DATA: END OF it_summ.
it_summ-sumr = 'hai'.
APPEND it_summ.
LOOP AT it_summ.
WRITE:/ it_summ-sumr.
ENDLOOP.
Here, it_summ is an internal table with header line.Using this,you can ignore the use of work area.
Note: Declaring internal tables using header line or OCCURS is now obsolete.
Regards,
Kaveri.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |