Skip to Content
author's profile photo Former Member
Former Member

Lauching the SCRIPT editor

Hi All,

Can you suggest me if there is any function module which is going to open SCRIPT editor. On passing the THEAD the contents for that object should be displayed in the editor. The user should be able to edit it and SAVE it.

Thanks & Regards,

Rahul.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 27, 2005 at 11:10 AM

    Hi Sri,

    Thank you for your response.

    After calling the EDIT_TEXT function module do we need to call any other function module as the modified text is not getting reflected.

    Thanks & Regards,

    Rahul.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi

      I agree with Sri, I forgot those parameter, if you set SAVE, fm EDIT_TEXT call directly fm SAVE_TEXT, the problem is this fm is called without to set the parameter SAVEMODE_DIRECT, so probably you need a commit.

      You can try to do this code:

      CALL FUNCTION 'EDIT_TEXT'

      ............

      SAVE = SPACE

      .............

      CALL FUNCTION 'SAVE_TEXT'

      ...........

      SAVEMODE_DIRECT = 'X'

      .......

      Max

  • author's profile photo Former Member
    Former Member
    Posted on Nov 27, 2005 at 09:36 AM

    Hi,

    You can use EDIT_TEXT fm. Do a where-used list on the fm to understand how it can be called.

    Also take a look at the following sample code,

    DATA: ls_thead LIKE thead,

    lt_lines LIKE TABLE OF tline.

    ls_thead-tdname = 'ZTESTTEXT'.

    ls_thead-tdobject = 'TEXT'.

    ls_thead-tdid = 'ST'.

    ls_thead-tdspras = sy-langu.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    • CLIENT = SY-MANDT

    id = ls_thead-tdid

    language = sy-langu

    name = ls_thead-tdname

    object = ls_thead-tdobject

    • ARCHIVE_HANDLE = 0

    • LOCAL_CAT = ' '

    IMPORTING

    header = ls_thead

    TABLES

    lines = lt_lines

    EXCEPTIONS

    id = 1

    language = 2

    name = 3

    not_found = 4

    object = 5

    reference_check = 6

    wrong_access_to_archive = 7

    OTHERS = 8.

    IF sy-subrc NE 0.

    ****Create New Text

    ****Initialize Text - Get TTXOB settings like line size

    CALL FUNCTION 'INIT_TEXT'

    EXPORTING

    id = ls_thead-tdid

    language = sy-langu

    name = ls_thead-tdname

    object = ls_thead-tdobject

    IMPORTING

    header = ls_thead

    TABLES

    lines = lt_lines

    EXCEPTIONS

    id = 1

    language = 2

    name = 3

    object = 4

    OTHERS = 5.

    ENDIF.

    CALL FUNCTION 'EDIT_TEXT'

    EXPORTING

    display = space

    • EDITOR_TITLE = ' '

    header = ls_thead

    • PAGE = ' '

    window = ' '

    save = 'X'

    • LINE_EDITOR = ' '

    • CONTROL = ' '

    • PROGRAM = ' '

    • LOCAL_CAT = ' '

    IMPORTING

    • FUNCTION =

    newheader = ls_thead

    • RESULT =

    TABLES

    lines = lt_lines

    EXCEPTIONS

    id = 1

    language = 2

    linesize = 3

    name = 4

    object = 5

    textformat = 6

    communication = 7

    OTHERS = 8.

    IF sy-subrc <> 0.

    • MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno

    • WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    • EXIT.

    ENDIF.

    Hope this helps..

    Sri

    Message was edited by: Srikanth Pinnamaneni

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 27, 2005 at 09:55 AM

    Hi Sri,

    We can use EDIT_TEXT if we want to do it programatically. I want to lauch the SCRIPT editor on clicking on a button so that the user can type his text and SAVE it.

    Thanks & Regards,

    Rahul.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Rahul,

      Purpose of Function module EDIT_TEXT is to call SCRIPT Editor only. The only prerequisite is to give a name to the text that will be entered by user. User can still type his text once the editor appears and then save it too.

      So I think on clicking your button, you can prompt user for a text name (this TDNAME you have to save some where if user can also change it afterwards) and then call EDIT_TEXT to take him to the script editor.

      The sample code I gave you works for both create case and then change case (if user wants to change the text that is saved already).

      Hope this helps..

      Sri

      Message was edited by: Srikanth Pinnamaneni

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.