cancel
Showing results for 
Search instead for 
Did you mean: 

Save Long Text in SAP Custom DB Table

Former Member

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..!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

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.

Answers (3)

Answers (3)

matt
Active Contributor

Why not save it in a field type string?

Former Member
0 Kudos

Thanks Minneman .! for your sharing the information.

former_member182550
Active Contributor
0 Kudos

I Would go with @A. Minneman