Application Development and Automation 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: 
Read only

Concatenate

Former Member
0 Likes
1,217

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
Read only

Former Member
0 Likes
1,134

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

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
Read only

Former Member
0 Likes
1,135

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

Read only

0 Likes
1,134

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

Read only

0 Likes
1,134

Please check my examples in above post.

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

Kind Regards

Eswar

Read only

0 Likes
1,134

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

Thank You once again

Read only

0 Likes
1,134

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

Read only

0 Likes
1,134

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

Glad could help you.

Kind Regards

Eswar

Read only

0 Likes
1,134

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

Read only

Former Member
0 Likes
1,134

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.