on 01-09-2008 8:25 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.