2006 Jan 30 5:19 AM
hi
i have a logic prob in sap abap.
convert the numbers to alpha sequences from serial number > 279360 like
279360 = AAAA.
279361 = AAAB
279362 = AAAC ....
the sequence of alpha code r like
AAAA -AAAZ, AABA- AABZ,... AZAA-AZZZ.
BAAA- BAAZ,BABA-BABZ,.....BZAA - BZZZ,
CAAA- CAAZ,CABA-CABZ,.....CZAA-CZZZ,.....
ZAAA-ZAAZ,ZABA-ZABZ,.......ZZAA-ZZZZ.
Plse help me
With Regards
AARYAA.
Here is an idea..
convert the alpha sequence to ASCII sequence and increment the ASCII and convert back to Alpha. Am not sure how the code looks like...I'm trying it
2006 Jan 30 5:28 AM
Try this . It works.
PARAMETERS p_i TYPE i.
DATA d_i1 TYPE i.
DATA d_i2 TYPE i.
DATA d_i3 TYPE i.
DATA d_i4 TYPE i.
DATA code(4).
p_i = p_i - 279360.
d_i4 = p_i MOD 26.
p_i = p_i DIV 26.
d_i3 = p_i MOD 26.
p_i = p_i DIV 26.
d_i2 = p_i MOD 26.
p_i = p_i DIV 26.
d_i1 = p_i MOD 26.
code+0(1) = sy-abcde+d_i1(1).
code+1(1) = sy-abcde+d_i2(1).
code+2(1) = sy-abcde+d_i3(1).
code+3(1) = sy-abcde+d_i4(1).
WRITE code.Ps: Reward points if helpful.
2006 Jan 30 6:09 AM
2006 Jan 30 6:15 AM
2006 Jan 30 5:36 AM
Here is an idea..
convert the alpha sequence to ASCII sequence and increment the ASCII and convert back to Alpha. Am not sure how the code looks like...I'm trying it
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |