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

problem in concatenating fields in to a variable.

Former Member
0 Likes
738

Hi friends,

I have a requiremnt.

i have 3 fields

vbap-matnr = '670000123'

vbap-vkorg = 4000

vbap-vtweg = 10

now i need to concatenate this 3 values into a single variable in the below format.

l_var = 670000123 400010

i need 9 spaces in between 670000123 400010

Regards,

Priyanka.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
710
REPORT  ZAMIT.


data: matnr type matnr VALUE '670000123',

vkorg TYPE vkorg VALUE '4000',

vtweg TYPE vtweg VALUE '10',
temp type char31.

CONCATENATE matnr ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' vkorg INTO temp SEPARATED BY space.
CONCATENATE  temp vtweg into temp.
write:temp.
6 REPLIES 6
Read only

Former Member
0 Likes
710

Hi

Concatenate vbap-matnr ' ' vbap-vkorg ' ' vbap-vtweg into Variable.

Inbetween ' ' you give spaces.

Regards

Neha

Edited by: Neha Shukla on Nov 28, 2008 10:41 PM

Read only

0 Likes
710

still not able to get...

i need 9 spaces in between vbap-matnr and vbak-vkorg.

Read only

0 Likes
710

Hi,

Try the code below:

DATA: L_SPACES(9) TYPE C.

CONCATENATE vbap-matnr l_spaces vbap-vkorg vbap-vtweg INTO l_var RESPECTING BLANKS.

Regards.

Read only

0 Likes
710

you give 9 space between this ' ' ,

Regards

Neha

Read only

Former Member
0 Likes
710

Hi

Please try as follows:

DATA: l_str type string.

l_str = vbap-matnr.

SHIFT l_str 9 PLACES LEFT. "9 trailing spaces will be added

CONCATENATE l_str vbap-vkorg vbap-vtweg into l_str.

Now the contents should complete your requirement.

Regards,

Prasanth

Read only

Former Member
0 Likes
711
REPORT  ZAMIT.


data: matnr type matnr VALUE '670000123',

vkorg TYPE vkorg VALUE '4000',

vtweg TYPE vtweg VALUE '10',
temp type char31.

CONCATENATE matnr ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' vkorg INTO temp SEPARATED BY space.
CONCATENATE  temp vtweg into temp.
write:temp.