‎2007 Apr 18 6:38 AM
Hi,
I am very new to abap. can anyone help me with this program.
data: begin of it_lfa1 occurs 10,
lifnr like lfa1-lifnr,
land1 like lfa1-lifnr,
end of it_lfa1.
data: begin of it_lfb1 occurs 10,
lifnr like lfb1-lifnr,
bukrs like lfb1-bukrs,
end of it_lfb1.
data: wa_lfa1 like line of it_lfa1,
wa_lfb1 like line of it_lfb1.
wa_lfa1-lifnr = '1000'.
wa_lfa1-land1 = 'india'.
append wa_lfa1 to it_lfa1.
write:/ sy-tabix.
loop at it_lfa1 into wa_lfa1.
write:/ it_lfa1-lifnr,
it_lfa1-land1.
endloop.
when i am executing this code the value of it_lfa1-lifnr and it_lfa1-land1 is not displayed.
please help me in resolving this issue.
regards
vivek
‎2007 Apr 18 6:40 AM
change to this
loop at it_lfa1 into wa_lfa1.
write:/ <b>wa_lfa1-lifnr,
wa_lfa1-land1.</b>endloop.
‎2007 Apr 18 6:40 AM
change to this
loop at it_lfa1 into wa_lfa1.
write:/ <b>wa_lfa1-lifnr,
wa_lfa1-land1.</b>endloop.
‎2007 Apr 18 6:43 AM
Hi,
thank you very much for resolving this issue. can you please explain me this concept of loop, what we have used in this internal table. and why loop is required.
thanks and regards
vivek
‎2007 Apr 18 6:48 AM
When there are multiple records u need to loop at the it_lfa1 and pass each record to workarea and then write
loop at it_lfa1 into wa_lfa1. "<--- Each record is passed to workarea
write:/ wa_lfa1-lifnr, "< details of each record is stored in wa_lfa1
wa_lfa1-land1.
endloop.
‎2007 Apr 18 6:51 AM
hi,
thank you chandershekhar and everyone who helped me.
regards vivek
‎2007 Apr 18 6:42 AM
Hi,
data: begin of it_lfa1 occurs 10,
lifnr like lfa1-lifnr,
land1 like lfa1-land1,
bukrs like lfb1-bukrs,
end of it_lfa1.
data: wa_lfa1 like line of it_lfa1.
wa_lfa1-lifnr = '1000'.
wa_lfa1-bukrs = '2000'.
wa_lfa1-land1 = 'india'.
append wa_lfa1 to it_lfa1.
loop at it_lfa1 into wa_lfa1.
write:/ wa_lfa1-lifnr, wa_lfa1-land1,wa_lfa1-bukrs.
endloop.
reward points if useful
regards,
Anji
Message was edited by:
Anji Reddy Vangala
‎2007 Apr 18 6:43 AM
Hi..,
change this loop..
loop at it_lfa1 into wa_lfa1.
write:/ wa_lfa1-lifnr,
wa_lfa1-land1.
endloop.
regards,
sai ramesh
‎2007 Apr 18 6:43 AM
or u can even change to this (remove the into <b>wa_lfa1</b>)
loop at it_lfa1.
write:/ it_lfa1-lifnr,
it_lfa1-land1.
endloop
‎2007 Apr 18 6:45 AM
HI
use the following
<b>loop at it_lfa1 into wa_lfa1.
write:/ wa_lfa1-lifnr,
wa_lfa1-land1.
endloop.</b>
HOPE THIS WILL DEFINITELY WORK FOR U
<b>u have to use loop because ur table contains multiple records. u have to put one record from table into work area which contains single record and write that record.</b>
regards
ravish
<b>plz dont forget to reward points if helpful</b>
Message was edited by:
ravish goyal
‎2007 Apr 18 6:45 AM
Hi
Try using work area name instead of table name in loop. I tried the same and it worked.
<b>please reward if useful</b>
‎2007 Apr 18 6:45 AM
hi,
You are not reading the values into header line but into work area .You are trying to write those values.
regards,
veeresh
‎2007 Apr 18 6:49 AM
Hi veereshbabu,
thank you very much for resolving my problem. can u please explain me how the concept of work area works. is it always necessary to use work area to display the output of an internal table.
thanks and regards
vivek
‎2007 Apr 18 6:45 AM
‎2007 Apr 18 6:48 AM
As you are taking data from an itab to work area, the contents will be populated in work area. so use the work area to display the contents.
loop at it_lfa1 into wa_lfa1.
write:/ wa_lfa1-lifnr,
wa_lfa1-land1.
endloop.
Thanks
Sandeep
Reward if helpful
‎2007 Apr 18 8:06 AM
Hi,
Is it possible to run two transactions in session method?and is it possible to set timing in calltransaction method(i.e i want that report in bet 10pm to something)
thax in advance