‎2007 Nov 15 5:17 PM
hi all,
i have a internal table ITAB with field ITYPE.it has 3 records as follows-----
ITAB-ITYPE = A
ITAB-ITYPE = B
ITAB-ITYPE = C.
i have another internal table JTAB with field JTYPE.it has 1 record as follows-----
JTAB-JTYPE = D.
now, my requirement i want all records of ITAB into JTAB as follows.
JTAB-JTYPE = D,A,B,C.
i used following code, but its not working--
loop at itab.
concatenate itab-itype into jtab-jtype seperated by ','.
endloop.
plz help me .
itz very urgent.
thanks,
Shivaa.
‎2007 Nov 15 5:23 PM
hi Shiva,
LOOP AT jtab.
LOOP AT itab.
CONCATENATE jtab-jtype itab-itype INTO jtab-jtype SEPARATED BY ','.
ENDLOOP.
MODIFY jtab.
ENDLOOP.
hope this helps
ec
‎2007 Nov 15 5:23 PM
Try this:
concatenate jtab_jtype itab-itype into jtab-jtype seperated by ','.
‎2007 Nov 15 5:34 PM
Hey dude !!!
Loop at Itab.
read jtab index 1/ with key Id.( as per requirement)
concatenate jtab-jtype itab-itype into jtab-itype separated by ','.
append Jtab.
endloop.
For more on read operations , place cursor on read and press F1.
As far as my knowledge is, Using loop inside a loop is not a good programing practice.
This would solve your problem.
CHEERS
‎2007 Nov 15 6:00 PM
hi,
Loop at Itab.
read jtab index 1 key (what are the other requirement)
concatenate jtab-jtype itab-itype into jtab-jtype separated by ','.
append Jtab.
endloop.
i hope it will help
regards,
mae
‎2007 Nov 15 6:28 PM
Try this:
read jtab index 1. "just one record in jtab
loop at Itab.
concatenate jtab-jtype itab-itype into jtab-jtype separated by ','.
endloop.
modify jtab.
I hope it will help
best regards,
‎2007 Nov 15 6:52 PM
Try this code
DATA: w_itype TYPE string.
LOOP AT itab.
CONCATENATE w_itype
itab-itype
INTO w_itype SEPARATED BY ','.
ENDLOOP.
READ TABLE jtab INDEX 1 TRANSPORTING jtype.
IF sy-subrc EQ 0.
CONCATENATE jtab-jtype
w_itype
INTO jtab-jtype.
ENDIF.
CLEAR w_itype.
‎2007 Nov 15 6:57 PM
Hi,
I think you need to have following code:
data: l_str type string.
loop at jtab. "If more than one records.
concatenate l_str jtab-jtype into l_str.
endloop.
loop at itab.
concatenate l_str itab-itype into l_str.
endloop.
Regards,
Dharitree
‎2007 Nov 16 10:33 AM
Hi shiva,
Try this :
loop at itab.
read table jtab[] index 1.
concatenate itab-itype into jtab-jtype seperated by ','.
modify table jtab[] from jtab index 1.
endloop.
hope this helps you.
reward points if this helps.