on 2020 Jun 14 9:56 AM
Hi ABAP Experts,
I have a requirement to CONCATENATE '0MATERIAL' transformation .
I have Material code starting number & character, where I have starting number I need to Add " C " in front of the code.
Eg: Material Code i have length 8, 12345678. I need the result like this C12345678.
I rote the below code, it is giving the result like this C00000000012345678 .
for business , it is very difficult to enter in selection screen.
How to get the result like this " C12345678 "
IF SOURCE_FIELDS-MATERIAL CO '0123456789'.
CONCATENATE 'C' SOURCE_FIELDS-MATERIAL+1(17) INTO RESULT.
ELSE.
RESULT = SOURCE_FIELDS-MATERIAL.
ENDIF.
Regards,
Jameel
Request clarification before answering.
Thanks Ahmed. I will try.
since Material field length is 18 Char in BW, how the result will save in Table.
I am expecting leading zeros also , like this.
000000000C12345678
00000000C123456789
00000C123456789012
Regards,
Jameel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Initially remove leading zero and concatenate with 'C' and then add leading zero (or use a conversion routine).
SHIFT <field> LEFT DELETING LEADING '0'.
CONCATENATE 'C' <field> INTO <final>.
Adding leading zeros again, you can do a conversion routine.
CONVERSION_EXIT_<name>_INPUT
Eg:-
CONVERSION_EXIT_MATN1_INPUT
CONVERSION_EXIT_ALPHA_INPUT.
Note: You can also keep in mind about future S/4HANA migration and code accordingly (so when the material length changes you don't have to re-adjust your code again).
Warm Regards,
User | Count |
---|---|
75 | |
30 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.