Skip to Content
avatar image
-2
Former Member

Save Long Text in SAP Custom DB Table

Need help for one of my requirement.

When Long text entered in frontend (UI5/Web Application). Long text needs to be saved in Cutom Table in one Field in ECC System.

Is it possible to save it using Text ID(STXH-TDID) and Text Obj(STXH-TDOBJECT) ?

Please proved your inputs.

Thanks..!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 20, 2017 at 08:39 AM

    If you really need explicitly in ONE field than you'll have to use a string type variable, however string data elements are not recommended in tables as then value would have different length on the DB. Also these fields are performance killers during a HANA conversion.

    I would try to squeeze the process into standard SAP:

    convert string into TLINE format, this might require some testwork in order to keep layout correct, if needed, e.g. context-specific example:

      FIELD-SYMBOLS: <lf_stream> TYPE string.
        IF NOT et_tline IS INITIAL. CLEAR et_tline. ENDIF.
        lf_stream = if_text_string.
        "Can't find a function for this.
        REPLACE ALL OCCURRENCES OF '\n' IN lf_stream WITH cl_abap_char_utilities=>newline.
        REPLACE ALL OCCURRENCES OF '\N' IN lf_stream WITH cl_abap_char_utilities=>newline.
        SPLIT lf_stream AT cl_abap_char_utilities=>newline INTO TABLE lt_stream.
        CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'
          EXPORTING
            stream_lines = lt_stream[]
            lf           = 'X'
          TABLES
            itf_text     = et_tline[].
        FREE lt_stream.

    and then use a text object such as an SO10 text, go to SO10, create text and display header, e.g.

    Text Name Z228382

    Language EN

    Text ID ST Standard text

    Text Object TEXT SAPscript standard texts

    use that for creation with the TEXT_SAVE/INSERT ... modules.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 20, 2017 at 07:57 AM

    Why not save it in a field type string?

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 20, 2017 at 09:13 AM

    I Would go with @A. Minneman

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 20, 2017 at 07:28 PM

    Thanks Minneman .! for your sharing the information.

    Add comment
    10|10000 characters needed characters exceeded