2008 Nov 06 12:36 PM
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
2008 Nov 06 1:16 PM
Try like this;
Condense char6_field.
Char10_field+5(4) = char6_field.Regards
Karthik D
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
2008 Nov 06 12:40 PM
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.
2008 Nov 06 12:41 PM
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 )
2008 Nov 06 12:41 PM
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
2008 Nov 06 1:16 PM
Try like this;
Condense char6_field.
Char10_field+5(4) = char6_field.Regards
Karthik D
2008 Nov 06 3:23 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |