‎2012 Apr 21 10:03 AM
Hi Friends,
I've concatenate around 10 strings, if any one of the string is empty then it concatenate the space also
For example:
CONCATENATE w_report-bukrs w_report-year w_report-month w_report-matnr w_report-orgcom
w_report-orggeo w_report-destcom w_report-destgeo w_report-units INTO l_output SEPARATED BY '^'.
Current Output is: 6038^2012^03^9000000200^000^100^^9900^0000000000010
Expecting result is: 6038^2012^03^9000000200^000^100^ ^9900^0000000000010
Thanks & Regards,
Vallamuthu
‎2012 Apr 21 10:28 AM
Vallamuthu,
I think it's not possible with concatenate statement. But try with ASCII codes ie in place of 'space' use alt+32.
Regards,
Phani.
‎2012 Apr 21 10:28 AM
Vallamuthu,
I think it's not possible with concatenate statement. But try with ASCII codes ie in place of 'space' use alt+32.
Regards,
Phani.
‎2012 Apr 21 10:56 AM
Hi Phani,
Can you provide the example code.
Thanks & Regards,
Vallamthu M
‎2012 Apr 21 12:34 PM
Hi Sony,
Use the code as below:
T1 type string value '001',
T2 type string value '002',
TR type string. " result
concatenate t1 'perss alt button and hold press number 32(This will create spce)' t2 into tr.
*If it fails then take a dummy variable(extra) t3 type string value ' D' " remember before D there should be spaces.
concatenate t1 t3 t2 into tr.
replace all occurances of 'D' in TR with space.
Regards,
Phani.
‎2012 Apr 21 11:14 AM
Hi Vallamuthu,
Are you only concatenating numbers? If yes, maybe you can do this:
Regards,
Karl
‎2012 Apr 21 11:29 AM
Hi Karl,
Thanks for your reply, I Tried that logic also, but it gives the same result.
6038^2012^03^9000000200^000^100^^9900^0000000000010
Thanks & Regards,
Vallamuthu
‎2012 Apr 21 11:33 AM
Hi Vallamuthu,
Use RESPECTING BLANKS addition of concatenate statement.
Many Thanks,
Jitendra
‎2012 Apr 21 12:03 PM
Hi Jitendra,
Thanks for your reply, RESPECTING BLANKS give space inbetween all the variables. I need to concatenate the blank variable as blank.
Thanks & Regards,
Vallamuthu M
‎2012 Apr 21 12:01 PM
HI,
if replacing blanks dont work, you can do the following things.
for all your strings before concatinate do
TRANSLATE ur string name USING ' #'.
After concatinate do this for the reculted string,
TRANSLATE The Result String USING '# '.
This worked for me.
hope this helps.
‎2012 Apr 21 5:02 PM
DATA: l_output TYPE string.l_output = w_report.
WRITE: l_output.TYPES: BEGIN OF ts_report,
bukrs(4) TYPE c,
dummy1 TYPE c,
year(4) TYPE c,
dummy2 TYPE c,"...END OF ts_report.DATA: w_report type ts_report.w_report-dummy1 = w_report-dummy2 = ... = '^'.