2007 Feb 19 9:22 PM
Hi,
I am trying to concatenate 22 fields of an ITAB into another single field of ITAB1 ,... all the fields seperated by | (pipe symbol).
Can anyone tell me if this is the only way I can do it or is there any simple way.
<b>loop at itab into wa.
concatenate wa-f1 wa-f2......wa-f22 into itab1 seperated by '|' .
( DO I HAVE TO WRITE AN APPEND FOR ITAB1 ? )
endloop.</b>
Thanks in advance?
Message was edited by:
ramana peddu
2007 Feb 19 9:27 PM
Hi,
Using the concatenate statement is the simple way and please try this.
loop at itab into wa.
concatenate wa-f1 wa-f2......wa-f22 into itab1-field1 seperated by '|' .
append itab1.
endloop.
or
data: wa_string type string.
loop at itab into wa.
concatenate wa-f1 wa-f2......wa-f22 into wa_string seperated by '|' .
append wa_string to itab.
endloop.
Regards,
Ferry Lianto
Hi,
I am trying to concatenate 22 fields of an ITAB into another single field of ITAB1 ,... all the fields seperated by | (pipe symbol).
Can anyone tell me if this is the only way I can do it or is there any simple way.
<b>loop at itab into wa.
concatenate wa-f1 wa-f2......wa-f22 into itab1 seperated by '|' .
( DO I HAVE TO WRITE AN APPEND FOR ITAB1 ? )
endloop.</b>
Thanks in advance?
Message was edited by:
ramana peddu
2007 Feb 19 9:27 PM
Hi,
Using the concatenate statement is the simple way and please try this.
loop at itab into wa.
concatenate wa-f1 wa-f2......wa-f22 into itab1-field1 seperated by '|' .
append itab1.
endloop.
or
data: wa_string type string.
loop at itab into wa.
concatenate wa-f1 wa-f2......wa-f22 into wa_string seperated by '|' .
append wa_string to itab.
endloop.
Regards,
Ferry Lianto
2007 Feb 19 9:28 PM
This is the simple way to do..
<i>* Reward each useful asnwer</i>
Raja T
2007 Feb 19 9:37 PM
Hey hii
This is the simplest method available. please use following for code efficiency.
data: wa_string type (data_element name of itab1-fieldname).
loop at itab into wa.
concatenate wa-f1 wa-f2......wa-f22 into wa_string seperated by '|' .
append wa_string to itab.
endloop.
by declaring the type as data element, it will not arise any inconsistency issue later.
Reward if u find it useful.
bbye tac care
Ashwani
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |