2010 Jun 15 3:05 PM
Hello,
I am using the below code snippet to get the ASCII code for a character. This code works for all systems where the OS is AIX but for systems where the OS is LINUX I am getting a junk value. Please let me know if there is any solution to the problem.
DATA: l_f_off TYPE sy-fdpos,
l_f_len TYPE i,
l_f_ascii TYPE i.
FIELD-SYMBOLS: <fs> TYPE x.
l_f_len = STRLEN( i_f_text ).
l_f_len = l_f_len - 1.
WHILE l_f_off <= l_f_len.
ASSIGN i_f_text+l_f_off(1) TO <fs> CASTING.
l_f_ascii = <fs>.
IF l_f_ascii < 32 OR l_f_ascii > 126.
e_f_flag = 'X'.
ENDIF.
l_f_off = l_f_off + 1.
ENDWHILE.
Hello,
I am using the below code snippet to get the ASCII code for a character. This code works for all systems where the OS is AIX but for systems where the OS is LINUX I am getting a junk value. Please let me know if there is any solution to the problem.
DATA: l_f_off TYPE sy-fdpos,
l_f_len TYPE i,
l_f_ascii TYPE i.
FIELD-SYMBOLS: <fs> TYPE x.
l_f_len = STRLEN( i_f_text ).
l_f_len = l_f_len - 1.
WHILE l_f_off <= l_f_len.
ASSIGN i_f_text+l_f_off(1) TO <fs> CASTING.
l_f_ascii = <fs>.
IF l_f_ascii < 32 OR l_f_ascii > 126.
e_f_flag = 'X'.
ENDIF.
l_f_off = l_f_off + 1.
ENDWHILE.
2010 Jul 02 2:00 PM
I have found the solution to the problem. The problem is happening since the Linux OS is little endian and the hex value has a different byte ordering than the value in the AIX OS.