‎2008 Apr 08 5:42 AM
Hello ppl,
Can anyone tell me how to add data to internal table.
I created a work area. added values to the work area. Then appended to internal table.But it did not work.
Can someone give me the code extract ?
Thanks in advance,
Chithra.
‎2008 Apr 08 5:47 AM
chk following code...
data : ls_vbak like VBAK,
lt_vbak type table of vbak.
clear ls_vbak.
ls_vbak-vbeln = '1234'.
ls_vbak-mandt = sy-mandt.
append ls_vbak to lt_vbak.
‎2008 Apr 08 5:45 AM
Hi,
After appending the data to the internal table clear the work area.Also,check whether u have that internal table already filled.If it is already filled then use 'MODIFY' statement
‎2008 Apr 08 5:45 AM
hi,
do this way ...
data : wa_mara like mara,
it_mara like mara occurs 0 with header line.
wa_mara-matnr = '00000000001'.
it_mara = wa_mara.
append it_mara.
clear it_mara.
‎2008 Apr 08 5:47 AM
chk following code...
data : ls_vbak like VBAK,
lt_vbak type table of vbak.
clear ls_vbak.
ls_vbak-vbeln = '1234'.
ls_vbak-mandt = sy-mandt.
append ls_vbak to lt_vbak.
‎2008 Apr 08 5:48 AM
Hi,
Can you plz post your code here? Then I let you know whats the error.
Regards,
Raghu
‎2008 Apr 08 5:59 AM
Hi,
After appending the data to work area ,
use
appned work area to internal table.
Ex:
data : wa_vbak like vbak,
it_vbak like vbak occurs 0 with header line.
wa_vbak-vbeln = '00000000001'.
it_vbak = wa_vbak.
append it_vbak.
clear it_vbak.
Pls. reward for useful answers.
‎2008 Apr 08 6:04 AM
Hi
this is sample code..check this...
parameter p_x type i. "no of records
types : begin of st_knc1,
kunnr type knc1-kunnr, "Customer Number
bukrs type knc1-bukrs, "Company Code
um01u type knc1-um01u, "Sales In Posting Period
end of st_knc1.
data : it_knc1 type standard table of st_knc1,
wa_knc1 type st_knc1 .
start-of-selection.
clear it_knc1[].
if p_x is not initial.
select kunnr bukrs um01u
from knc1
into table it_knc1
up to p_x rows.
wa_knc1-kunnr = 1111.
wa_knc1-bukrs = 1200.
wa_knc1-um01u = '1000.50'.
append wa_knc1 to it_knc1.
write:/ text-004.
loop at it_knc1 into wa_knc1 .
write:/ wa_knc1-kunnr, wa_knc1-bukrs,wa_knc1-um01u currency 'INR'.
endloop.