Skip to Content
-2

Save Long Text in SAP Custom DB Table

Jun 19, 2017 at 07:44 PM

206

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

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

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.

Share
10 |10000 characters needed characters left characters exceeded
Matthew Billingham
Jun 20, 2017 at 07:57 AM
1

Why not save it in a field type string?

Share
10 |10000 characters needed characters left characters exceeded
Richard Harper Jun 20, 2017 at 09:13 AM
0

I Would go with @A. Minneman

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jun 20, 2017 at 07:28 PM
0

Thanks Minneman .! for your sharing the information.

Share
10 |10000 characters needed characters left characters exceeded