Application Development 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: 

Converting SSN Number

Former Member
0 Kudos

can anybody tell me the logic to convert ssn number 421648951 to 421-64-8951.Plz answer urgently,points will be awarded undoubtedly.

1 ACCEPTED SOLUTION

kiran_k8
Active Contributor
0 Kudos

Ajay,

*421648951 to 421-64-8951

DATA:TEST1(20) type C VALUE '421648951',

TEST2(20) type c,

TEST3(20) type c,

TEST4(20) type c,

TEST5(25) TYPE C.

move test1+0(3) to test2.

move test1+3(2) to test3.

move test1+5(6) to test4.

concatenate test2 '-' test3 '-' test4 into test5.

write:/ test5.

K.Kiran.

4 REPLIES 4

Former Member
0 Kudos

hi,

concatenate ssn0(3) ssn3(2) ssn+5 into ssn1 separated by '-'.

Regards,

Subramanian

kiran_k8
Active Contributor
0 Kudos

Ajay,

*421648951 to 421-64-8951

DATA:TEST1(20) type C VALUE '421648951',

TEST2(20) type c,

TEST3(20) type c,

TEST4(20) type c,

TEST5(25) TYPE C.

move test1+0(3) to test2.

move test1+3(2) to test3.

move test1+5(6) to test4.

concatenate test2 '-' test3 '-' test4 into test5.

write:/ test5.

K.Kiran.

Former Member
0 Kudos

Hi,

Check this forms in the standard program MP00024U_CE.

CONVERT_SSN_TO_PERID

CONVERT_SSN

cheers,

Jack.

Former Member
0 Kudos

hi,

Data:

TEST1(20) type C VALUE '421648951',

TEST2(5) type c,

TEST3(5) type c,

TEST4(5) type c,

TEST5(15) TYPE C.

test2 = test1+0(3) .

test3 = test1+4(2) .

ttest4 = test1+6(9) .

concatenate test2 test3 test4 into test5 separated by '-'.

write:/ test5.