Skip to Content

save_text

i m using sav_text function as below.. but my long text is not visible in tcode CT04.. when i select characteristics and double click on individual values in value tab.. a text editor gets open.. but text is not visible.. and sometimes i get error "No documentation exists"

CLEAR WA_HEAD.

SORT IT_E1CAWNM BY SEGNUM.

SORT IT_E1CAWTM BY SEGNUM.

SORT IT_E1TXTL1 BY SEGNUM.

LOOP AT IT_E1CAWNM INTO WA_E1CAWNM.

CLEAR LV_TABIX.

LV_TABIX = SY-TABIX.

CLEAR WA_HEAD.

WA_HEAD-TDOBJECT = 'FEATURE'.

CONCATENATE 'JAG_OTH_S' 'XYZ1' INTO WA_HEAD-TDNAME SEPARATED BY '_'.

WA_HEAD-TDID = 'VALU'.

WA_HEAD-TDTITLE = 'TEST'.

WA_HEAD-TDFORM = 'SYSTEM'.

WA_HEAD-TDFUSER = SY-UNAME.

WA_HEAD-TDVERSION = '00001'.

WA_HEAD-TDFRELES = '700'.

WA_HEAD-TDFDATE = SY-DATUM.

WA_HEAD-TDLUSER = SY-UNAME.

WA_HEAD-TDLDATE = SY-DATUM.

WA_HEAD-TDLINESIZE = '999'.

WA_HEAD-TDTXTLINES = '00001'.

WA_HEAD-TDMACODE1 = 'WE19SAPMSED7'.

READ TABLE IT_E1CAWTM INTO WA_E1CAWTM INDEX LV_TABIX.

IF SY-SUBRC = 0.

WA_HEAD-TDSPRAS = WA_E1CAWTM-SPRAS.

REFRESH IT_STXH.

SELECT TDOBJECT

TDNAME

TDID

TDSPRAS

FROM STXH

CLIENT SPECIFIED

INTO TABLE IT_STXH

WHERE MANDT = SY-MANDT

AND TDOBJECT = WA_HEAD-TDOBJECT

AND TDNAME = WA_HEAD-TDNAME

AND TDID = WA_HEAD-TDID

AND TDSPRAS = WA_E1CAWTM-SPRAS.

IF SY-SUBRC = 0.

DELETE FROM STXH CLIENT SPECIFIED

WHERE MANDT = SY-MANDT

AND TDOBJECT = WA_HEAD-TDOBJECT

AND TDNAME = WA_HEAD-TDNAME

AND TDID = WA_HEAD-TDID

AND TDSPRAS = WA_E1CAWTM-SPRAS.

IF SY-SUBRC = 0.

COMMIT WORK.

ENDIF.

ENDIF.

ENDIF.

CLEAR WA_LINES.

REFRESH GT_LINES.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = WA_HEAD-TDID

LANGUAGE = WA_HEAD-TDSPRAS

NAME = WA_HEAD-TDNAME

OBJECT = WA_HEAD-TDOBJECT

ARCHIVE_HANDLE = 0

LOCAL_CAT = ' '

IMPORTING

HEADER = WA_HEAD

TABLES

LINES = GT_LINES

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

READ TABLE IT_E1TXTL1 INTO WA_E1TXTL1 INDEX LV_TABIX.

IF SY-SUBRC = 0.

CLEAR WA_LINES.

WA_LINES-TDFORMAT = '*'.

WA_LINES-TDLINE = WA_E1TXTL1-TDLINE.

APPEND WA_LINES TO GT_LINES.

CLEAR WA_E1TXTL1.

ENDIF.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

CLIENT = SY-MANDT

HEADER = WA_HEAD

INSERT = C_MARK

SAVEMODE_DIRECT = C_MARK

TABLES

LINES = GT_LINES

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OBJECT = 4

OTHERS = 5.

IF SY-SUBRC EQ 0.

CALL FUNCTION 'COMMIT_TEXT'

EXPORTING

OBJECT = WA_HEAD-TDOBJECT

NAME = WA_HEAD-TDNAME

ID = WA_HEAD-TDID

LANGUAGE = WA_HEAD-TDSPRAS

SAVEMODE_DIRECT = 'X'

KEEP = ' '

LOCAL_CAT = ' '.

COMMIT WORK.

ENDIF.

CLEAR : WA_E1CAWNM,WA_E1CAWTM,WA_E1TXTL1.

ENDLOOP.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 21, 2012 at 12:33 PM

    hi Santhsh,

    it just straight forward, please have a look at my code which i have done and works when i update the text.

    before you use SAVE_TEXT get the HEADER DETAILS. i just used and it is working i dint even use Commit work still works.

    let me know if you have any issues.

    data : x_header TYPE thead.

    DATA : l_text_tab LIKE tline OCCURS 100 WITH HEADER LINE.


    x_header-tdobject = 'C_SHES_INP'.

    x_header-tdname = lt_name . "

    x_header-tdid = '0001'.

    x_header-tdspras = 'E'.

    CALL FUNCTION 'SAVE_TEXT'

    EXPORTING

    CLIENT = SY-MANDT

    HEADER = X_HEADER

    * INSERT = ' '

    SAVEMODE_DIRECT = 'X'

    * OWNER_SPECIFIED = ' '

    * LOCAL_CAT = ' '

    * IMPORTING

    * FUNCTION =

    * NEWHEADER =

    TABLES

    LINES = l_text_tab"IT_TLINES

    EXCEPTIONS

    ID = 1

    LANGUAGE = 2

    NAME = 3

    OBJECT = 4

    OTHERS = 5

    .

    IF SY-SUBRC <> 0.

    *--ERROR.

    ELSE.

    *--SUCCESS.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 21, 2012 at 12:12 PM

    Hi Santosh,

    Better try with CREATE_TEXT function module. This may solve your problem.

    Regards,

    Bharathkumar.MG

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.