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

Mapping a string

Former Member
0 Likes
623

Hi,

I have to mapp a variable matnr = 123-456-789 to matnr = 123456789

what I am suppose to do?

Thanks for your help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
594

data : matnr type matnr .

data : a(3) , b(3), c(3).

matnr = '123-456-789' .

split matnr at '-' into a b c .

clear matnr .

concatenate a b c into matnr.

write : matnr.

reward if helpful

4 REPLIES 4
Read only

Former Member
0 Likes
595

data : matnr type matnr .

data : a(3) , b(3), c(3).

matnr = '123-456-789' .

split matnr at '-' into a b c .

clear matnr .

concatenate a b c into matnr.

write : matnr.

reward if helpful

Read only

Former Member
0 Likes
594

Write as ...

replace all occurrences of '-' in matnr with ''.

condense matnr.

Read only

Former Member
0 Likes
594

Hi,

Split the string at any special characters found and concatenate the rest of characters into another string.

Once the final string is prepared, move it into a numeric field .

Hope it helps.

Disha

Read only

former_member784222
Active Participant
0 Likes
594

Hi,

If '-' occurs inside the variable, then you can use

REPLACE ALL OCCURANCES OF '-' WITH SPACE INTO <VARIABLE>.

This will remove '-'. Then you can use CONDENSE <VARIABLE> to remove the spaces.

You need to use convert_exit function module to pad 0 to the variable.

After this you may check the variable againt material master.

Thanks and regards,

S. Chandramouli.