¡Caminando hacia el éxito!

Aprende en Comunidad

Avalados por :

Como converter um valor hexadecimal em uma cadeia de texto usando ABAP - Guia passo a passo

  • Creado 01/03/2024
  • Modificado 01/03/2024
  • 12 Vistas
0
Cargando...

Olá ABAP Gurus...

Gostaria de converter um valor hexadecimal em uma string de texto.

Existe algum módulo de função para converter um valor hexadecimal em uma string de texto?

Agradeço antecipadamente.

Chintan

Pedro Pascal
Se unió el 07/03/2018
Pinterest
Telegram
Linkedin
Whatsapp

4 Respuestas

0
Cargando...

fazer uso de Field-symbols.

field-symbols : <n> type x.
field-symbols : <pn> type c.
field-symbols : <dn1> type x.
data : rn type i.
data : rn1(4) type c.
data : n type c.

describe field P_I_UPLOAD type _c.
if _c eq 'u'.
_l = strlen( P_I_UPLOAD ).
_i = _l div 2.

do _l times.
a = sy-index - 1.
a1 = P_I_UPLOAD+a(1).
assign a1 to <n> casting.
move <n> to rn.
if rn = 32.
continue.
endif.
*Para Prod rn1 deve ser 3(1) e para QAS rn1 deve ser 0(1)
*rn = rn - chave.
*rn = rn - 12  .
rn = rn - ( P_DATE+4(2) + P_DATE+6(2) ).
assign rn to <pn> casting.
move <pn> to rn1.
*se rn1+0(1) EQ '#'.
n = rn1+3(1).
*a1 = n.
*ELSE.
*N = RN1+0(1).
A1 = n.
*ENDIF."PRABHU ON 4.1.2005
*SUBSTITUA TODAS AS OCORRÊNCIAS DE '#' EM rn1 POR ' '.
P_I_UPLOAD+a(1) = A1.

enddo.
endif.<
        
Respondido el 15/04/2024
LUCIANO RIOJA GHIOTTO
Se unió el 13/07/2019
0
Cargando...

tente usando Fm -

STPU1_HEX_TO_CHAR

Respondido el 15/04/2024
LUCIANO RIOJA GHIOTTO
Se unió el 13/07/2019
0
Cargando...

Olá Chintan

Se estiver procurando por caracteres como Tab ou Linefeed, podemos usar CL_ABAP_CHAR_UTILITIES.

data: tab(1) type c value cl_abap_char_utilities=>horizontal_tab.

Alternativamente,

data: tab(1) type X value '09',
      str type string.

move tab to str.
write:/ str.

Cumprimentos

Eswar

Respondido el 15/04/2024
LUCIANO RIOJA GHIOTTO
Se unió el 13/07/2019
0
Cargando...
Teste este código.

data: char(3) type c,
hex(4) type x.

field-symbols <fs> type any.

hex = '414243'.
assign hex to <fs> casting type c.

char = <fs>.
write:/ char.
Respondido el 15/04/2024
LUCIANO RIOJA GHIOTTO
Se unió el 13/07/2019

contacto@primeinstitute.com

(+51) 1641 9379
(+57) 1489 6964

© 2024 Copyright. Todos los derechos reservados.

Desarrollado por Prime Institute

¡Hola! Soy Diana, asesora académica de Prime Institute, indícame en que curso estas interesado, saludos!
Hola ¿Puedo ayudarte?