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

type conversion CHAR06 TO CHAR10

Former Member
0 Likes
1,407

Dear experts,

I have an ABAP problem what really drive me nuts and which is absolutly no problem in any sensible programming language.

I want to make a type conversion from CHAR06 to CHAR10.

So far so good...

I have a field with the content "_1001_" (6 digits) and I need it in following format "_____1001_" (10 digits)

When I assign the Char06-Field to the Char10-Field, I get the result : 1001____"

How can I achive "_____1001_"?

Thank you for any helpful answers.

Regards

Thomas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,269

Try like this;

Condense char6_field.
Char10_field+5(4) = char6_field.

Regards

Karthik D

It works...

Thanx to everybody for the support.

King Regards

5 REPLIES 5
Read only

Former Member
0 Likes
1,269

Hello,

Try to put the field from char 6 field according to the offset value, it will put the value in the desired position.

For eg.

data: w_data1(6) type c value 'Test',

w_data2(10) type c.

Now I want the test to be displayed as ' Test ' in my char 10 field.

then, w_data2+4(4) = w_data1.

Hope it helps.

Thanks,

Jayant.

Read only

Former Member
0 Likes
1,269

After assigning, get the position of last character with STRLEN()... (say 6).

then subtract that from 10 (ans 4)

thenuse SHIFT command.

SHIFT <var> RIGHT 4 PLACES... (I don't kno the exact extensions... sorry for that )

Read only

Former Member
0 Likes
1,269

Hi,

You can use

write: v_char6 to v_char10 right-justified.

or use the shift command to move a field left or right.

Darren

Read only

Former Member
0 Likes
1,270

Try like this;

Condense char6_field.
Char10_field+5(4) = char6_field.

Regards

Karthik D

Read only

Former Member
0 Likes
1,269

It works...

Thanx to everybody for the support.

King Regards