01-28-2006 1:48 PM
hi
i have a logic prob in sap abap.
from serial 279360 to .....
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.
IF U FIND TIME PLSE TRY THIS.
WITH REGARDS
AARYAA.
01-28-2006 4:25 PM
Hi Madhu,
Pl try the following code..
*&---------------------------------------------------------------------*
*& Report ZGETNEXT *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
report zgetnext .
data: w_text(4) value 'AAAA',
offset type i.
write:/ w_text.
while w_text+3(1) ne 'Z'.
search sy-abcde for w_text+3(1) and mark.
offset = sy-fdpos + 1.
w_text+3(1) = sy-abcde+offset(1).
write:/ w_text.
endwhile.
while w_text+2(1) ne 'Z'.
search sy-abcde for w_text+2(1) and mark.
offset = sy-fdpos + 1.
w_text+2(1) = sy-abcde+offset(1).
write:/ w_text.
endwhile.
while w_text+1(1) ne 'Z'.
search sy-abcde for w_text+1(1) and mark.
offset = sy-fdpos + 1.
w_text+1(1) = sy-abcde+offset(1).
write:/ w_text.
endwhile.
while w_text+0(1) ne 'Z'.
search sy-abcde for w_text+0(1) and mark.
offset = sy-fdpos + 1.
w_text+0(1) = sy-abcde+offset(1).
write:/ w_text.
endwhile.
Regards,
Suresh Datti