11-14-2007 8:56 AM
Hi,
I have an ITAB that have the following Header:
First_Name
Last_Name
Contact
I have an WA that only have component:
Contact
Is it possible to Loop at ITAB and assgin the corresponding field into WA ?
What the code look like?
Regards,
Rayden
11-14-2007 8:59 AM
Hi,
I think no becoz work area conatins only one record at a time.
Regards,
Prashant
11-14-2007 9:02 AM
hi,
whenever you read the content from the ITAB, the WA structure should be same as the ITAB header. you cannot corresponding fields from itab into WA.
Regards,
11-14-2007 9:08 AM
Hi Rayden,
Declare WA as another internal table lets say itab2.
itab1 contains FNAME LNAME and Contact.
itab2 contains only contact...
then
Loop at itab1.
*clear itab2-contact.
itab2-contact = itab1-contact
append itab2.
Endloop.
Hope it will solve ur problem
<b>Reward points if useful</b>
Thanks & Regards
ilesh 24x7
11-14-2007 9:17 AM
Hi,
U can try to concatenate First_Name
Last_Name INTO CONTACT .
U can just have contact field in the internal table .
Regards,
Subha
11-14-2007 9:39 AM
if you internal table is having header line...then
you can do like below...
loop at itab.
wa-contact = itab-contact.
endloop.
Otherwise use wa as field symbol with casting keyword.
field-symbols: <fs> like wa.
loop at itab assigning <fs> casting.
endloop.
11-14-2007 9:48 AM
HI
it is not possible for the above requirement
You need to creat a work area of same size or same fields