Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

EDIT_TEXT

Former Member
0 Likes
3,449

Hi SDN,

Can any tell me in detail how to use the Function Module EDIT_TEXT, what is the HEADER in the import parameters and what needed to be passed.

I am using this FM to create LT and Save it, just like as it appears in SAPscript editor, can any one gimme the related info?

Thanks

Pratyusha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,665

hi Pratyusha,

Yes you can use this method to achieve your functionality or else you can use SAVE_TEXT along with read table ..

Check ..

Regards,

Santosh

17 REPLIES 17
Read only

Former Member
0 Likes
2,665

hi,

Check out these threads..

http://help.sap.com/saphelp_40b/helpdata/en/d6/0dc169494511d182b70000e829fbfe/applet.htm

Regards,

Santosh

Message was edited by: Santosh Kumar P

Read only

dani_mn
Active Contributor
0 Likes
2,665

HI,

see the example code below first use read_text function module to get value for header and then use edit_text

*...data needed for text display

DATA: BEGIN OF HTEXT,
        TDOBJECT     LIKE THEAD-TDOBJECT VALUE 'CCSS',
        TDID         LIKE THEAD-TDID,
        TDNAME       LIKE THEAD-TDNAME,
        TDSPRAS      LIKE THEAD-TDSPRAS,
      END OF HTEXT.

DATA: BEGIN OF TLINETAB OCCURS 0.
        INCLUDE STRUCTURE TLINE.
DATA: END OF TLINETAB.

DATA: L_THEAD LIKE THEAD,
      L_FUNCTION.


CALL FUNCTION 'READ_TEXT'
     EXPORTING
          ID       = HTEXT-TDID
          LANGUAGE = HTEXT-TDSPRAS
          OBJECT   = HTEXT-TDOBJECT
          NAME     = HTEXT-TDNAME
     IMPORTING
          HEADER   = L_THEAD
     TABLES
          LINES    = TLINETAB
     EXCEPTIONS
          OTHERS   = 1.

IF SY-SUBRC = 0.
  CALL FUNCTION 'EDIT_TEXT'
       EXPORTING
            HEADER    = L_THEAD
            DISPLAY   = 'X'
       IMPORTING
            NEWHEADER = L_THEAD
            FUNCTION  = L_FUNCTION
       TABLES
            LINES     = TLINETAB
       EXCEPTIONS
            OTHERS    = 1.

ENDIF.

REgards,

Read only

Former Member
0 Likes
2,665

Hi Santosh & HRA,

Can i use the FM EDIT_TEXT to achieve the functionality just like in transaction

IW32 - > Operations TAb - > LT. (LONG TEXT)

this LT is a button in the table control, when the user clicks on the LT button it goes to SAPScript editor, where in user can enter LT in multiple lines.

Please help,its urgent.

Points for SURE

Pratyusha

Read only

dani_mn
Active Contributor
0 Likes
2,665

HI pratyu,

yes you can use EDIT_TEXT to achieve this functionality.

It will open the lines same as sapscript editor.

just check and run the following program in 'SE38'. and you will be very clear about 'EDIT_TEXT'

<b>RFMAIL01</b>

OR copy and paste below test program for 'EDIT_TEXT'.

report z_test2.


DATA: LS_HEAD LIKE THEAD.

DATA: LT_LINES TYPE STANDARD TABLE OF TLINE
         WITH HEADER LINE.

DATA: LS_RESULT LIKE ITCER.
DATA: LS_CONTROL LIKE ITCED.
DATA: LD_TEXT(30) TYPE C.

START-OF-SELECTION.
*----- Maintain existing texts? ----------------------------------------
  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      ID                            = '0001'
      LANGUAGE                      = SY-LANGU
      NAME                          = 'ASSIGNAR'
      OBJECT                        = 'FB15'
    IMPORTING
      HEADER                        = LS_HEAD
    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.
    LD_TEXT = TEXT-001.
*----- ... no, create header entry in table stxh -----------------------
    CALL FUNCTION 'INIT_TEXT'
         EXPORTING
              ID       = '0001'
              LANGUAGE = SY-LANGU
              NAME     = 'ASSIGNAR'
              OBJECT   = 'FB15'
         IMPORTING
              HEADER   = LS_HEAD
         TABLES
              LINES    = LT_LINES
         EXCEPTIONS
              OTHERS   = 1.
  ELSE.
    LD_TEXT = TEXT-002.
  ENDIF.
  LS_CONTROL-USERTITLE = 'X'.
  CALL FUNCTION 'EDIT_TEXT'
    EXPORTING
*   DISPLAY             = ' '
   EDITOR_TITLE        = LD_TEXT
      HEADER              = LS_HEAD
*   PAGE                = ' '
*   WINDOW              = ' '
*   SAVE                = ' '
*   LINE_EDITOR         = ' '
   CONTROL             = LS_CONTROL
*   PROGRAM             = ' '
*   LOCAL_CAT           = ' '
    IMPORTING
*   FUNCTION            =
*   NEWHEADER           =
      RESULT              = LS_RESULT
    TABLES
      LINES               = LT_LINES
    EXCEPTIONS
      OTHERS              = 8.

REgards,

Read only

Former Member
0 Likes
2,666

hi Pratyusha,

Yes you can use this method to achieve your functionality or else you can use SAVE_TEXT along with read table ..

Check ..

Regards,

Santosh

Read only

0 Likes
2,665

Hi

thanks for ur immediate replies,

once more clarification.

here i am doing a customised screen(say RFQ1), which is creation of RFQ's. and i save the data entered on the screen RFQ1 into Z tables, and LT is one of the field, for now the LT is CHAR50 , <b>so how do i save it to the customised table</b>. because user can enter multiple lines in SAP Script editor.

and thre is one more screen (say RFQ2) for viewing or changing the RFQ's. so user can change or only view RFQ, in this screen also i placed the LT button in tab ctrl, so in order to display the LT in RFQ2 screen should i use READ_TEXT.Please confirm?

if you can tell how me to <b>SAVE</b> the LT in Screen RFQ1 i can handle the other thing.

Thanks alot for ur support n time

Pratyusha

Read only

0 Likes
2,665

go through this program <b>RM07METI</b>. u can find all the function modules related to ur requirement.

Regards

Gopi

Read only

0 Likes
2,665

And one more thing, every time i get the Script editor i dont see it in LINES format, i have to GOTO -> Change Editor.

How to avoid it every time? How can i see the editor in LINES format?

Thanks in advance

Read only

0 Likes
2,665

hi Pratyuhsa,

Logon in the change mode to avoid that..

REgards,

Santosh

Read only

0 Likes
2,665

HI,

use the menu 'GOTO--->Configure Editor.

and uncheck on the 'Graphical PC Editor'.

Regards,

Read only

0 Likes
2,665

Hi <b>HRA n Santosh</b>

thanks for ur immediate replies,

once more clarification.

here i am doing a customised screen(say RFQ1), which is creation of RFQ's. and i save the data entered on the screen RFQ1 into Z tables, and LT is one of the field, for now the LT is CHAR50 , so how do i save it to the customised table. because user can enter multiple lines in SAP Script editor.

and thre is one more screen (say RFQ2) for viewing or changing the RFQ's. so user can change or only view RFQ, in this screen also i placed the LT button in tab ctrl, so in order to display the LT in RFQ2 screen should i use READ_TEXT.Please confirm?

if you can tell how me to SAVE the LT in Screen RFQ1 i can handle the other thing.

Thanks alot for ur support n time

Pratyusha

PLEASE HELP

Read only

0 Likes
2,665

HI Pratyu,

For Saving of your long text you don't need to use your ztable because it will make it difficult to handle.

Instead save the following information about text in your table

<b> ID = '0001'

LANGUAGE = SY-LANGU

NAME = 'ASSIGNAR'

OBJECT = 'FB15'</b>

and by using the above four you will be able to read long text form system.

For displaying long text i am not clear because there is no such Function module available.

I think the 'READ_TEXT' may work.

Regards,

Read only

0 Likes
2,665

Hi HRA,

So how do i handle the LT into my ztable? I have to do it.

can u plz explain me the code in bold?

<b>Instead save the following information about text in your table

ID = '0001'

LANGUAGE = SY-LANGU

NAME = 'ASSIGNAR'

OBJECT = 'FB15'</b>

Thanks

Pratyusha

Read only

0 Likes
2,665

HI,

this information is about long text which is saved in sap with some id and this id is needed to identify the long text.

means we can identify long text from sap system by using these fields.

ID, LANGUAGE, NAME, OBJECT

Look into 'READ_TEXT' function module. what fields we need to read text. So if we have this information available we can read our long text from sap system.

So when you are creating long text generate a unique id for each text and save this id in ztable.

and then use this id to read text.

CALL FUNCTION 'READ_TEXT'

EXPORTING

<b> ID = '0001'

LANGUAGE = SY-LANGU

NAME = 'ASSIGNAR'

OBJECT = 'FB15'</b>

IMPORTING

HEADER = LS_HEAD

TABLES

LINES = LT_LINES.

Hope i am clear.

REgards,

Read only

0 Likes
2,665

So how do i generate the Unique ID and related it to my ztable.

Hope u got my requirement right?

Please help me in getting it done.

Thanks

Pratyusha

Read only

dani_mn
Active Contributor
0 Likes
2,665

HI,

it depends on you. what scheme may suits you.

you just need to generate NAME field for each of your text.

LIKE

for first text.

ID = '0001'

LANGUAGE = SY-LANGU

<b> NAME = '1'</b>

OBJECT = 'FB15'

for second text

ID = '0001'

LANGUAGE = SY-LANGU

<b> NAME = '2'</b>

OBJECT = 'FB15'

select the maximum name assigned and increment 1 into it.

REgards,

Read only

Former Member
0 Likes
2,665

No it did not solve the issue, my main problem is how to save the LT related to a RFQ and its items,

RFQ is the header

RFQ items are in table control and i need to maintain LT for each item. so how do i save the LT for each item in Z table?

Or else plz suggest me some other possibility.

Thanks alot for ur patience.

Pratyusha