ABAP - funcion de abap

 
Vista:

funcion de abap

Publicado por Veronica (1 intervención) el 31/01/2006 18:52:25
Gente:
Alguien conoce de una funcion en abap que ingresando un caracter me devuelva su corre´pondiente valor Ascci.
Muchas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:funcion de abap

Publicado por Johnny Frank (1 intervención) el 28/12/2007 23:23:36
Te paso un código de una función Z.

FUNCTION Z_CHARACTER_TO_ASCII_CODE.
*"----------------------------------------------------------------------
*" Interfase local
*" IMPORTING
*" REFERENCE(FI_CHARACTER) TYPE C
*" EXPORTING
*" REFERENCE(FE_ASCII_CODE_DEC) TYPE I
*" REFERENCE(FE_ASCII_CODE_HEX) TYPE C
*"----------------------------------------------------------------------

field-symbols <FS> type x.

*Have to use CASTING here to purposely force SAP to convert the
*character to an equivalent HEX value (using ASCII chart).
*Note that CASTING feature is not available prior release 4.6
assign fi_character(1) to <FS> casting.
*The type of the destination field will cause SAP to determine which
*type (Decimal/Hexadecimal) of ASCII code should be converted:
* X -> I gives Dec value
* X -> C gives Hex value

fe_ascii_code_dec = <FS>.
fe_ascii_code_hex = <FS>.

ENDFUNCTION.

Espero te ayude.
Saludos cordiales,

Johnny Frank.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar