‎2007 Apr 29 10:11 AM
‎2007 Apr 29 10:38 AM
‎2007 Apr 29 12:32 PM
data : itab type standard table of mara.
data : wa_itab1 like itab,
wa_itab2 like itab.
‎2007 Apr 29 4:46 PM
how to create a work area.
data : begin of wa,
f1(10),
end of wa.
data : it like table of wa.
creating internal table from standard table.
data : it like table of mara with header line.
creating work area from internal table.
data : wa like it.
‎2007 Apr 30 9:46 AM
data : begin of it_mara,
matnr like mara - matnr,
enum like mara - enum,
end of it_mara.
data : wa_mara like it_mara.
in this program since this program is internal tables with headerline.
it_mara is work area
it_mara[] is internal table
one is implicit workarea which is automatically created.
ie : it_mara.
and the other one is wa_mara which we have declared.
So there are two work areas for a single internal table
if u r convinced with this answer reward with points
‎2007 Apr 30 9:53 AM
Hi,
data : i_tab type standard table of mseg.
data : wa1 like i_tab,
wa2 like i_tab.
<b>plz reward points if helpful or if it solves ur query.</b>
Thanks
Chinmay
‎2007 Apr 30 10:06 AM
Hi Balu,
I have created an example for you which I think will be of help to your question.
REPORT z_aris_test_11.
TABLES: vbak. "Work area 1
TYPES: BEGIN OF t_vbak,
vbeln TYPE vbak-vbeln,
erdat TYPE vbak-erdat,
END OF t_vbak.
DATA: gt_vbak TYPE STANDARD TABLE OF t_vbak,
wa_vbak LIKE LINE OF gt_vbak. "Work area 2
FIELD-SYMBOLS: <fs_vbak> LIKE LINE OF gt_vbak. "Work area 3
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: r1 RADIOBUTTON GROUP grp1,
r2 RADIOBUTTON GROUP grp1,
r3 RADIOBUTTON GROUP grp1.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
*Using Work area 1
IF r1 = 'X'.
WRITE: / 'Using work area 1...'.
SELECT vbeln erdat
FROM vbak
INTO (vbak-vbeln, vbak-erdat).
WRITE: / vbak-vbeln,
vbak-erdat.
ENDSELECT.
*Using work area 2
ELSEIF r2 = 'X'.
WRITE: / 'Using work area 2...'.
SELECT vbeln erdat
FROM vbak
INTO TABLE gt_vbak.
LOOP AT gt_vbak INTO wa_vbak.
WRITE: / wa_vbak-vbeln,
wa_vbak-erdat.
ENDLOOP.
REFRESH gt_vbak.
*Using Work area 3
ELSEIF r3 = 'X'.
WRITE: / 'Using work area 3...'.
SELECT vbeln erdat
FROM vbak
INTO TABLE gt_vbak.
LOOP AT gt_vbak ASSIGNING <fs_vbak>.
WRITE: / <fs_vbak>-vbeln,
<fs_vbak>-erdat.
ENDLOOP.
REFRESH gt_vbak.
ENDIF.
As you can see from my example, you can use the table(VBAK) itself as work area, or you can define an explicit work area or even a field-symbol if you prefer.
Hope it helps...
P.S. Please award points if it helps...