Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete NULL characters from XML file saved into FB03

Jimmy21
Participant
0 Kudos

Hi guys.

I'm looking the solution for several weeks. I'm creating a XML file into Tcode FB03 (attachment), but when I open my file I see characters NULL (notepad ++). like this:

This is my code:

lv_my_rawstring = '3C627265616B666173745F6D656E753E3C666F6F643E3C6E61'.
DATA: lt_content TYPE SOLI.

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
      buffer        = lv_my_rawstring
    IMPORTING
      output_length = lv_filesize
    TABLES
      binary_tab    = lt_content.

CALL FUNCTION 'SO_CONVERT_CONTENTS_BIN'
    EXPORTING
      it_contents_bin = lt_content
    IMPORTING
      et_contents_bin = lt_content.

CALL FUNCTION 'SO_CONVERT_CONTENTS_BIN'
      TABLES
        objcont       = lt_content<br>

lt_content return data in format chineese (TX SNLS) like this:

I tried convert this to string and deleting '#' characters with REPLACE, but don't working. There are bit null and I read the convertion hex to binary can generate bit null.

Please gurus really I need you help.

Jimmy.

2 REPLIES 2

0 Kudos

Hi Jimmy, How did you resolve this issue as I am facing the same issue with one of the XML that is generated by my custom program

Jimmy21
Participant

Hi Raj.

I used the nexts FM:

  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
      buffer     = lv_binario64
    TABLES
      binary_tab = ltd_solix.


  CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
    EXPORTING
      region                = 'B'
    IMPORTING
      folder_id             = wa_fol_id
    EXCEPTIONS
      communication_failure = 1
      owner_not_exist       = 2
      system_failure        = 3
      x_error               = 4
      OTHERS                = 5.


  CALL FUNCTION 'SO_DOCUMENT_INSERT_API1'
    EXPORTING
      folder_id     = wa_fol_id
      document_data = wa_obj_data
      document_type = wa_extension "'EXT'
    IMPORTING
      document_info = wa_obj_id
    TABLES
      object_header = ltd_objhead
      contents_hex  = ltd_solix.


    CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
      EXPORTING
        obj_rolea      = wa_target_bo
        obj_roleb      = wa_note
        relationtype   = 'ATTA'
      EXCEPTIONS
        no_model       = 1
        internal_error = 2
        unknown        = 3
        OTHERS         = 4.

Best regards.

Jimmy.