Difference between revisions of "SAP ABAP XSTRING"
From SapWiki
Line 55: | Line 55: | ||
==[[SAP_ABAP_VARIOS#Leer_archivo_XML|Leer archivo XML]]== | ==[[SAP_ABAP_VARIOS#Leer_archivo_XML|Leer archivo XML]]== | ||
==[[SAP_ABAP_VARIOS#desde_un_string_en_BASE64_obtener_PDF_binario|desde un string en BASE64 obtener PDF binario]]== | ==[[SAP_ABAP_VARIOS#desde_un_string_en_BASE64_obtener_PDF_binario|desde un string en BASE64 obtener PDF binario]]== | ||
+ | ==[[SAP_ABAP_VARIOS#Leer_Arhivo_PDF_y_Visualizarlo|Leer Arhivo PDF y Visualizarlo]]== |
Revision as of 22:31, 17 February 2021
Contents
Leer atchivo de texto como binario
DATA: lo_c2x TYPE REF TO cl_abap_conv_out_ce. DATA l_string TYPE string. DATA l_string2 TYPE string. DATA l_xstring TYPE xstring. DATA l_filename TYPE string. CALL METHOD cl_faa_tenv_services=>gui_upload_xstring EXPORTING id_fullpath = l_filename IMPORTING ed_xstring = l_xstring. " convert xstring to string for output cl_abap_conv_in_ce=>create( input = l_xstring )->read( IMPORTING data = l_string ). WHILE l_string IS NOT INITIAL. SPLIT l_string AT cl_abap_char_utilities=>cr_lf INTO l_string2 l_string. IF NOT l_string2 CO cl_abap_char_utilities=>cr_lf. MOVE l_string2 TO it_entrada. APPEND it_entrada. ENDIF. ENDWHILE.
string to xstring => xstring to string
- ejemplo 1
lo_c2x = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ). lo_c2x->convert( EXPORTING data = l_string IMPORTING buffer = l_xstring ). l_xstring = cl_abap_codepage=>convert_to( source = l_string codepage = 'UTF-8' ).
- ejemplo 2
lo_c2x = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ). lo_c2x->convert( EXPORTING data = l_string IMPORTING buffer = l_xstring ). CALL METHOD cl_http_utility=>if_http_utility~decode_utf8 EXPORTING encoded = l_xstring RECEIVING unencoded = l_string.