cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Issue

Former Member
0 Kudos

Gurus

Could anyone help me how to make ZCTACN 6749CT to ZCTNUM only 6749 .

Please give me code gurus.

Thankyou for all help so far gurus.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can just create a formula and use Substring Function.

Substring(ZCTACN, 0, 4) assuming all the incoming values would be 4digitsand and followed by account.

For more do F1 on the functionality.

Answers (2)

Answers (2)

Former Member
0 Kudos

But you can also take only the first 4 chars (this would be 1 line of code), if this is alwas the same logic:

move XXXXX(4) to result.

Best regards,

Frank

Former Member
0 Kudos

The following example should work. Its an example of a trans rule:

data: l_allowchar type rsallowchar,

l_string(125) type c.

data: l_length type i,

l_act type i.

data:wtxz01(40) type c.

move '0123456789' to l_string.

wtxz01 = TRAN_STRUCTURE-XXXXXXX.

if wtxz01 co l_string.

RESULT = wtxz01.

  • nothing to do in this case.

else.

  • there is at least 1 character which is not allowed.

l_length = strlen( wtxz01 ).

l_act = 0.

do l_length times.

if wtxz01+l_act(1) na l_string. " cn instead of na

wtxz01+l_act(1) = ''.

endif.

l_act = l_act + 1.

enddo.

RESULT = wtxz01.

endif.

Best regards,

Frank