Monday, September 30, 2013

Splitting strings to tabs

Greetings,

in my previous post you will find on help.sap.com some horrendous code to split a binary string into a internal table. Which is funny, since they provide this wonderful function:

    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
        buffer     l_binary_string
      TABLES
        binary_tab it_binary_content.


The function analyze the size of the table you provide and does all the heavy lifting.

The counterpart for regular strings to a text table is here:

    CALL FUNCTION 'SCMS_STRING_TO_FTEXT'
      EXPORTING
        text      l_text_string
      TABLES
        ftext_tab it_text_content.

No comments:

Post a Comment