Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenate

Former Member
0 Kudos

Hi I want to concatenate

data : v_date like sy-datum,

v_time like sy-uziet,

v_sess_name type D0100_MAPN.

Concatenate 'RB40' v_date4(4) v_time0(4)into v_sess_name.

CONCATENATE '0' V_SESS_NAME_NEW SY-MANDT

'ADMIN ' ' ' ' ' '/'

INTO WA_BGR00.

I want 7 spaces after ADMIN,

8 spaces for date

1 space for Keep as is in BGR00 table...

but when I concatenate my output is for e.g.

0RB4010130845200ADMIN/

IT IS NOT CONSIDERING THE SPACES IN BETWEEN. How do I get the spaces in the final output ??

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Please use offset addition. It will resolve your problem.

Eg:


data:
  l_text1(10) type c value 'first',
  l_text2(10) type c value 'next',
  l_out(20)   type c.

  concatenate l_text1 l_text2 into l_out.
  write:/ l_out. " ---> Output: firstnext

  concatenate l_text1 l_text2 into l_out separated by space.
  write:/ l_out.  "---> Output: first next

  move: l_text1 to l_out.
  l_out+15 = l_text2.
  write:/ l_out. "----> Output: first          next

Hope this helps you.

Kind Regards

Eswar

Message was edited by: Eswar Rao Boddeti

8 REPLIES 8

Former Member
0 Kudos

Please use offset addition. It will resolve your problem.

Eg:


data:
  l_text1(10) type c value 'first',
  l_text2(10) type c value 'next',
  l_out(20)   type c.

  concatenate l_text1 l_text2 into l_out.
  write:/ l_out. " ---> Output: firstnext

  concatenate l_text1 l_text2 into l_out separated by space.
  write:/ l_out.  "---> Output: first next

  move: l_text1 to l_out.
  l_out+15 = l_text2.
  write:/ l_out. "----> Output: first          next

Hope this helps you.

Kind Regards

Eswar

Message was edited by: Eswar Rao Boddeti

0 Kudos

Offset ... how do I use offset ... when I want concatenate ...Can you please specify more

0 Kudos

Please check my examples in above post.

Copy paste to a temporary program to check on the same.

Kind Regards

Eswar

0 Kudos

Hi Eswar... Thanks a lot ... My problem is solved now...

Thank You once again

0 Kudos

Hi Eswar.. while rewarding the points I am clicking on Solved problem radiobutton and I am getting an error message...

0 Kudos

Maybe the points system is down now, Please try when the sytem is back.

Glad could help you.

Kind Regards

Eswar

0 Kudos

Thanks Eswar ... I have rewarded the points...

Former Member
0 Kudos

hi sb,

try giving like this and check...

CONCATENATE '0' V_SESS_NAME_NEW SY-MANDT

'ADMIN ' ' ' ' ' '/'

INTO WA_BGR00 <b>separated by space</b>.

hope this helps,

do reward if it helps,

priya.