‎2009 Feb 05 8:38 AM
Hi,
I my coding have written as
concatenate gv_mtext gv_text5 gv_text6 into gv_mtext separated by space.
gv_mtext ,gv_text 5 gv_text 6 has some text fields.Now my problem the contents of gv_mtext should be in the first line in the next line the contents of gv_text5 and gv_text6 should be there.How to do this.
Edited by: saranya srithar on Feb 5, 2009 9:38 AM
‎2009 Feb 05 8:45 AM
Hi,
Test the following code may help you in this way i think you can't do using single CONCATENATE.
DATA: s1 TYPE string,
s2 TYPE string,
s3 TYPE string,
string TYPE string.
s1 = 'aaaa'.
s2 = 'bbbb'.
s3 = 'cccc'.
WRITE: s1.
CONCATENATE s2 s3 INTO string SEPARATED BY space.
WRITE: / string.Kind Regards,
Faisal
‎2009 Feb 05 8:45 AM
Hi,,
u want the output like this:
gv_mtext
gv_mtext gv_text 5
gv_mtext gv_text 5 gv_text6
pl.clarify
thanks\
Mahesh
‎2009 Feb 05 8:46 AM
If you want the data of text 5 and text 6 in next line why are you concatenating it with gv_mtext.
concetenate text 5 and text 6 into some temporary variable (gv_temptext) then write gv_mtext and in the next line write gv_temptext
‎2009 Feb 05 8:46 AM
Hi,,
Below is the code ..
DATA:
gv_mtext(50) TYPE c VALUE 'Hi',
gv_text5(10) TYPE c VALUE 'Heloo',
gv_text6(10) TYPE c VALUE 'Welcome'.
CONCATENATE gv_mtext gv_text5 gv_text6 INTO gv_mtext SEPARATED BY space.
DO 2 TIMES.
WRITE:
/ gv_mtext.
ENDDO.This is working Fine......
Thanks
Kalyan B
‎2009 Feb 05 8:48 AM
Hi,
Try like this
write 😕 gv_mtext.
concatenate gv_mtext gv_text5 gv_text6 into gv_mtext separated by space.
write 😕 gv_mtext.
Regards,
Nagaraj
‎2009 Feb 05 8:49 AM
‎2009 Feb 05 8:57 AM
Hi,
and if you want to do like the following you must be very clear about the length of the all strings, other wise you will face dumps
data: s1 type string,
s2 type string,
s3 type string,
string type string.
s1 = 'aaaa'.
s2 = 'bbbb'.
s3 = 'cccc'.
*WRITE: s1.
concatenate s1 s2 s3 into string separated by space.
write: string+0(3),
/ string+5(8).Kind Regards,
Faisal
‎2009 Feb 05 8:58 AM
Hi,
I think you need to use SPLIT <c> AT <del> INTO <c1> ... <cn>.
example
data
DEL(1) VALUE ' '.
SPLIT STRING AT DEL INTO P1 P2 P3 P4.
WRITE / P1.
WRITE / P2.
WRITE / P3.
WRITE / P4.
Hope this helps!
Thanks
Viquar Iqbal
‎2009 Feb 05 9:06 AM
Hi,
Check out this may work.
DATA: gv_mtext TYPE string,
gv_text5 TYPE string,
gv_text6 TYPE string.
gv_mtext = 'sap'.
gv_text5 = 'abap'.
gv_text6 = 'basics'.
WRITE: / gv_mtext.
CONCATENATE gv_text5 gv_text6 into gv_mtext SEPARATED BY space.
WRITE: / gv_mtext.
‎2009 Feb 05 9:09 AM
Hi saranya srithar,
CONCATENATE GV_MTEXT GV_TEXT5 GV_TEXT6 INTO GV_MTEXT SAPARTATED BY SPACE.
WRITE: GV_MTEXT.
Regards,
N.Neelima.
‎2009 Feb 05 9:13 AM
Hi saranya,
Please provide the brief details about requirement and the structure you want as the output so that it will be easy for the team to give you the proper solution. All the solutions provided to your thread will be wel enough to resolve your issue.
Once clarified please close the thread.
Regards,
‎2009 Feb 05 9:30 AM
Hi Saranya,
try it this way:
Data:
gv_mtext type string,
gv_text5 type string,
gv_text6 type string.
gv_mtext = 'textbcd efscd'.
gv_text5 = 'text5abc defscd'.
gv_text6 = 'text6abc defscd'.
condense gv_mtext no-gaps.
condense gv_text5 no-gaps.
condense gv_text6 no-gaps.
concatenate gv_mtext gv_text5 gv_text6 into gv_mtext separated by space.
split gv_mtext at space into gv_mtext gv_text5 gv_text6.
write:
/ gv_mtext,
/ gv_text5,
gv_text6.With luck,
Pritam.