GET_TEXT_AS_R3TABLE

Dear expert,
                  I am using the method "GET_TEXT_AS_R3TABLE" for "CL_GUI_TEXTEDIT" CONTROL. By using that Its reading the data from the control but the sy-subrc goes to 4 , and it says "POTENTIAL_DATA_LOSS "
Can u confirm why sy-subrc goes to 4. Please let me know if there are any other approch.
Thanks a lot

Hi,
check this piece of code
  CREATE OBJECT editor
    EXPORTING
      wordwrap_mode              = cl_gui_textedit=>wordwrap_at_fixed_position
      wordwrap_position          = '55'  " my container length is 60
      wordwrap_to_linebreak_mode = cl_gui_textedit=>true
      parent                     = container
    EXCEPTIONS
      error_cntl_create      = 1
      error_cntl_init        = 2
      error_cntl_link        = 3
      error_dp_create        = 4
      gui_type_not_supported = 5
      OTHERS                 = 6.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  CALL METHOD editor->get_text_as_r3table
     EXPORTING
       only_when_modified     = ' '
    IMPORTING
      table                  = it_body
    EXCEPTIONS
      error_dp               = 1
      error_cntl_call_method = 2
      error_dp_create        = 3
      potential_data_loss    = 4
      others                 = 5
  IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
Cheers,
jose.

Similar Messages

  • CALL METHOD g_editor- get_text_as_r3table

    Hi everyone!!!,
    I have some problems with CALL METHOD g_editor->get_text_as_r3table, I can't retrieve the text from my custom editor. Can anyone please help me with this issue?.
    DATA: g_mytable(line_length) TYPE c OCCURS 0.
                CALL METHOD g_editor->get_text_as_r3table
                  IMPORTING
                    table              = g_mytable.
                CALL METHOD cl_gui_cfw=>flush
                  EXCEPTIONS
                    OTHERS = 1.
                IF sy-subrc NE 0.
    add your handling
                ENDIF.
    Regards...

    Check this code...
    data:
          dockingleft  type ref to cl_gui_docking_container,
          text_editor    type ref to cl_gui_textedit,
          repid type syrepid.
    data: itext type table of tline-tdline,
          xtext type tline-tdline.
    parameters: p_check.
    at selection-screen output.
      repid = sy-repid.
      create object dockingleft
                  exporting repid     = repid
                            dynnr     = sy-dynnr
                            side      = dockingleft->dock_at_left
                            extension = 1070.
      create object text_editor
                  exporting
                       parent     = dockingleft.
      xtext = 'http:\\www.sap.com'.
      append xtext to itext.
      call method text_editor->set_text_as_r3table
         exporting
               table              = itext
         exceptions
               others             = 1.
    start-of-selection.
      call method text_editor->get_text_as_r3table
         importing
               table              = itext
         exceptions
               others             = 1.
      loop at itext into xtext.
        write:/ xtext.
      endloop.
    Kindly stolen from Rich Heilman -;)
    Greetings,
    Blag.

  • Texteditor - get_text_as_r3table only copies the first line into the itab.

    Hi Folks.
    I have a Texteditor from which i want to copie the entered text into an itab.
    i defined my itab like this:
    DATA: BEGIN OF txt_tab OCCURS 0,
    line(250) ,
    END OF txt_tab.
    but now if someone writes into the Texteditor:
    Blablablabla, blabla
    blebleblebleble.
    It only copies "Blablablabla, blabla" into the txt_tab. Do i have to do it now this way?
    DATA: BEGIN OF txt_tab OCCURS 0,
    line1(250) ,
    line2(250) ,
    line3(250) ,
    line4(250) ,
    END OF txt_tab.
    or is there another way? thx for all answers!

    solved the problem by myself... damn i was stupid ^^
    i just had to loop over the itab like this x(
    CALL METHOD obj_texteditor1->get_text_as_r3table
        IMPORTING
          table                  = txt_tab[]
        EXCEPTIONS
          error_dp               = 1
          error_cntl_call_method = 2
          error_dp_create        = 3
          potential_data_loss    = 4.
      IF sy-subrc <> 0 AND sy-subrc <> 4.
        MESSAGE 'Fehler' TYPE 'E' DISPLAY LIKE 'I'.
      ENDIF.
      LOOP AT txt_tab INTO wa_txt_tab.
        CONCATENATE wa_fftxt-reason wa_txt_tab-line INTO wa_fftxt-reason SEPARATED BY space.
      ENDLOOP.
    so sorry for robbing your time
    Edited by: rafe b. on Nov 19, 2009 3:37 PM

  • Display data in a custom container

    Hi All,
    My requirment is to just display data in a custom container.
    I could able to display data in change mode but not display mode.Can you please let me now how can i do that.
    Thanks in Advance
    KV

    Im using cl_gui_custom_container.
    In PBO
    here is my code whihc is fine for Change/Edit mode.
      create control container
        CREATE OBJECT g_editor_container
            EXPORTING
                container_name = 'DISP_CONT'
            EXCEPTIONS
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
        do nothing
        ENDIF.
      create calls constructor, which initializes, creats and links
       a TextEdit Control
        CREATE OBJECT g_editor
          EXPORTING
             parent = g_editor_container
             wordwrap_mode =  cl_gui_textedit => wordwrap_at_fixed_position
             wordwrap_to_linebreak_mode = cl_gui_textedit=>TRUE
          EXCEPTIONS
              OTHERS = 1.
        IF sy-subrc NE 0.
        do nothing
        ENDIF.
    In PAI
    CALL METHOD g_editor->get_text_as_r3table
        IMPORTING
          table  = Text_table
        EXCEPTIONS
          OTHERS = 1.
      IF sy-subrc NE 0.
      ENDIF.
    Text_table contains messages which r supposed to be displayed.
    Based on certain logical operations i will display the messages.

  • How to save the text in module pool

    am working with screen exit for QM01 tcode . I created one subscreen . created 2 text editors in that screen . now I want to save the text in that text editors. am using save_text , but its not working . can any one guide me regarding this with code. and tell me wht parameters I shd pass to that FM.
    its very urgent.

    Hi ,
    Please check the format below since it is based on a working code
    **************data declarations
    data: int_line type table of  tline with header line.
    data: gw_thead like thead.
    data: int_table type standard table of ty_editor.
    ****************fill header..from SO10 t-code
    GW_THEAD-TDNAME   =  loc_nam.   " unique key for the text
    GW_THEAD-TDID     = 'ST'.                " Text ID
    GW_THEAD-TDSPRAS  =  SY-LANGU.
    GW_THEAD-TDOBJECT = 'ZXXX'.   "name of the text object created
    *Read Container and get data to int_table
      CALL METHOD EDITOR ->GET_TEXT_AS_R3TABLE
        IMPORTING
          TABLE                  = int_table
        EXCEPTIONS
          ERROR_DP               = 1
          ERROR_CNTL_CALL_METHOD = 2
          ERROR_DP_CREATE        = 3
          POTENTIAL_DATA_LOSS    = 4
          others                 = 5.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    loop data from int_table and save to int_line-tdline appending it.
    *save the text
        CALL FUNCTION 'SAVE_TEXT'
          EXPORTING
            HEADER   = GW_THEAD
          TABLES
            LINES    = InT_LINE
          EXCEPTIONS
            ID       = 1
            LANGUAGE = 2
            NAME     = 3
            OBJECT   = 4
            OTHERS   = 5.
        IF SY-SUBRC <> 0.
        ENDIF.
    The code shown above is ok and working fine for save also,hope that the above sample with helps you solve the problem
    Please check and revert,
    Reward if helpful
    Regards
    Byju

  • How to display  LONG TEXT STRING in Module Pool Screen ?

    Hi Experts,
    I want to display long text string, on screen designed through module pool(SE51). I tried to display through input/output field , but it displays it in SINGLE LINE and i have to scroll all through to view all string.
    I want to display it in rectangular format . It doesnt allow me to set HEIGHT of component.
    Please provide solution.
    Thanks in advance.
    Regards
    Deepak

    This is the program where u can get the WA_THEAD from other program like report and trying to display and modifying that text. U can do instead of WA_THEAD u can generate here itself and use also
    *& Module pool       ZMP_LTEXT                                         *
    PROGRAM  ZMP_LTEXT                               .
    TABLES: STXL.
    *&      Module  STATUS_9000  OUTPUT
    MODULE STATUS_9000 OUTPUT.
    CONSTANTS:line_length type i value 132.
    DATA:g_editor type ref to cl_gui_textedit,
         g_editor_container type ref to cl_gui_custom_container,
         CONT1 type scrfname value 'CONT1',
         g_repid like sy-repid,
         g_ok_code like sy-ucomm,
         g_mytable(132) type c occurs 0,
         g_mycontainer(30) type c ,
         v_result(256) type c,
         g_head like thead,
         it_line type table of tline with header line,
         wa_stxl type stxl.
    DATA : BEGIN OF IT_THEAD1,
           ICON TYPE ICON-ID.
           INCLUDE STRUCTURE STXL.
    DATA : END OF IT_THEAD1.
    DATA : IT_THEAD LIKE TABLE OF IT_THEAD1,
           WA_THEAD LIKE LINE OF IT_THEAD.
    IMPORT WA_THEAD FROM MEMORY ID 'ABCD'.
    select SINGLE * from STXL into wa_stxl
                     where tdname = '00006000156500000002'.
    SELECT SINGLE * from STXL into wa_stxl
                      where tdname = WA_THEAD-TDNAME
                      AND TDID = WA_THEAD-TDID
                      AND TDOBJECT = WA_THEAD-TDOBJECT
                      AND TDSPRAS = WA_THEAD-TDSPRAS.
    IF SY-SUBRC NE 0.
    MESSAGE 'NO RECORD EXIST' TYPE 'E'.
    ENDIF.
    MOVE-CORRESPONDING WA_STXL TO G_HEAD.
    SET PF-STATUS 'STATUS'.
    SET TITLEBAR '001'.
      if g_editor is initial.
         CREATE OBJECT G_EDITOR_CONTAINER
           EXPORTING
            PARENT                      =
             CONTAINER_NAME              = CONT1
            STYLE                       =
            LIFETIME                    = lifetime_default
            REPID                       =
            DYNNR                       =
            NO_AUTODEF_PROGID_DYNNR     =
           EXCEPTIONS
            CNTL_ERROR                  = 1
            CNTL_SYSTEM_ERROR           = 2
            CREATE_ERROR                = 3
            LIFETIME_ERROR              = 4
            LIFETIME_DYNPRO_DYNPRO_LINK = 5
             others                      = 6.
         IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
         CREATE OBJECT G_EDITOR
           EXPORTING
            MAX_NUMBER_CHARS       =
            STYLE                  = 0
       WORDWRAP_MODE          = cl_gui_textedit=>wordwrap_at_fixed_position
    for to fix number of characters in row to 132 characers
             WORDWRAP_POSITION      = line_length
             WORDWRAP_TO_LINEBREAK_MODE = cl_gui_textedit=>true
    for the word to break to next line if it don’t fit in line
            FILEDROP_MODE          = DROPFILE_EVENT_OFF
             PARENT                 = G_EDITOR_CONTAINER
            LIFETIME               =
            NAME                   =
           EXCEPTIONS
            ERROR_CNTL_CREATE      = 1
            ERROR_CNTL_INIT        = 2
            ERROR_CNTL_LINK        = 3
            ERROR_DP_CREATE        = 4
            GUI_TYPE_NOT_SUPPORTED = 5
             others                 = 6  .
         IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
      REFRESH g_mytable.
         MOVE: WA_THEAD-TDNAME TO STXL-TDNAME,
               WA_THEAD-TDID TO STXL-TDID,
               WA_THEAD-TDOBJECT TO STXL-TDOBJECT,
               WA_THEAD-TDSPRAS TO STXL-TDSPRAS.
        CALL FUNCTION 'READ_TEXT'
        EXPORTING
        CLIENT                        = SY-MANDT
          ID                            = wa_stxl-tdid
          LANGUAGE                      = wa_stxl-tdspras
          NAME                          = wa_stxl-tdname
          OBJECT                        = wa_stxl-tdobject
        ARCHIVE_HANDLE                = 0
        LOCAL_CAT                     = ' '
      IMPORTING
        HEADER                        =
        TABLES
          LINES                         = it_line
      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 <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    LOOP AT IT_LINE INTO V_RESULT.
       APPEND V_RESULT TO G_MYTABLE.
    ENDLOOP.
    CALL METHOD G_EDITOR->SET_TEXT_AS_R3TABLE
       EXPORTING
         TABLE           = G_MYTABLE
       EXCEPTIONS
         ERROR_DP        = 1
         ERROR_DP_CREATE = 2
         others          = 3.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
       endif.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9000  INPUT
    MODULE USER_COMMAND_9000 INPUT.
    CASE SY-UCOMM.
    REFRESH G_MYTABLE[].
    REFRESH IT_LINE[].
    CLEAR V_RESULT.
      WHEN 'SAVE'.
         CALL METHOD G_EDITOR->GET_TEXT_AS_R3TABLE
          EXPORTING
            ONLY_WHEN_MODIFIED     = FALSE
            IMPORTING
              TABLE                  = G_MYTABLE
            IS_MODIFIED            =
          EXCEPTIONS
            ERROR_DP               = 1
            ERROR_CNTL_CALL_METHOD = 2
            ERROR_DP_CREATE        = 3
            POTENTIAL_DATA_LOSS    = 4
            others                 = 5
         IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
    LOOP AT G_MYTABLE INTO V_RESULT.
       APPEND V_RESULT TO IT_LINE.
    ENDLOOP.
    CLEAR V_RESULT.
        CALL FUNCTION 'SAVE_TEXT'
          EXPORTING
            CLIENT                = SY-MANDT
            HEADER                = G_HEAD
            INSERT                = ' '
            SAVEMODE_DIRECT       = 'X'
          OWNER_SPECIFIED       = ' '
          LOCAL_CAT             = ' '
        IMPORTING
          FUNCTION              =
          NEWHEADER             =
          TABLES
            LINES                 = IT_LINE
        EXCEPTIONS
          ID                    = 1
          LANGUAGE              = 2
          NAME                  = 3
          OBJECT                = 4
          OTHERS                = 5
       IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    REFRESH G_MYTABLE[].
    REFRESH IT_LINE[].
    CLEAR V_RESULT.
    WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
    LEAVE TO SCREEN '0'.
    *CALL SCREEN '0'.
    WHEN OTHERS.
    ENDCASE.
    *G_OK_CODE = SY-UCOMM.
    *CLEAR SY-UCOMM.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT

  • How to call a text editor from a module pool program

    Hi All,
    I want to call the text editor from my modulepool program. Enter my text in it and save it.This text needs to be saved in a Z-program with 2 fields as primary keys. The next time while I call this same record from this z table, I need to fetch the existing text and display it.
    The user now can put in additional text and can again save it. This process thus goes on..
    If anyone has worked in this type of scenario, then please help me in doing this.
    Useful answers will surely be rewarded.
    Thanks,
    Susanth.

    Hi Sushanth,
    We save the text not as fields in a ztable directly but as a text.Please check the format below since it is based on a working code....
    first you need to create a text in s010 transaction...
    there should be some key based on which you plan to save the text..imagine it is Purchase order then..PO+item numner is always unique.eg:0090010(900PO/item10).so in the code you can append these two and they will be unique..so you can always retrieve them,overwrite,save them anytime you need
    **************data declarations
    TYPES: BEGIN OF TY_EDITOR,
    EDIT(254) TYPE C,
    END OF TY_EDITOR.
    data: int_line type table of tline with header line.
    data: gw_thead like thead.
    data: int_table type standard table of ty_editor.
    ****************fill header..from SO10 t-code..when you save you need the unique key..youfill it here and pass it in save_text function module
    GW_THEAD-TDNAME = loc_nam. " unique key for the text -> our unique key to identify the text
    GW_THEAD-TDID = 'ST'. " Text ID from SO10
    GW_THEAD-TDSPRAS = SY-LANGU. "current language
    GW_THEAD-TDOBJECT = 'ZXXX'. "name of the text object created in SO10
    *To Read from Container and get data to int_table
    CALL METHOD EDITOR ->GET_TEXT_AS_R3TABLE
    IMPORTING
    TABLE = int_table
    EXCEPTIONS
    ERROR_DP = 1
    ERROR_CNTL_CALL_METHOD = 2
    ERROR_DP_CREATE = 3
    POTENTIAL_DATA_LOSS = 4
    others = 5.
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    loop data from int_table and save to int_line-tdline appending it.
    *save the text
    CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
    HEADER = GW_THEAD
    TABLES
    LINES = InT_LINE
    EXCEPTIONS
    ID = 1
    LANGUAGE = 2
    NAME = 3
    OBJECT = 4
    OTHERS = 5.
    IF SY-SUBRC 0.
    ENDIF.
    *To pass to Container
    CALL METHOD EDITOR ->SET_TEXT
    hope that the above sample with helps you solve the problem
    Please check and revert,
    Reward if helpful
    Regards
    Byju

  • Possible to do "grant" sql statement in Native SQL?

    We have a need to do a grant of access from one of our systems out for various applications.  In order for this to work we need to run a grant access command on the table and are trying to put a wrapper around this so we can use an abap.  Below is the code I am unit testing.  Two questions.  First, can a grant be done via native SQL in abap?  Second, if it can be done, what is the error with the logic where I am trying to put in the table name via a parameter.
    REPORT  ZLJTEST2.
    tables dd02l.
    DATA scarr_carrid TYPE dd02l-tabname.
    SELECT-OPTIONS s_carrid for dd02l-tabname no intervals.
    DATA s_carrid_wa LIKE LINE OF s_carrid.
    DATA name TYPE c LENGTH 20.
    TRY.
        EXEC SQL.
          CREATE FUNCTION selfunc( input CHAR(20) )
            RETURNING char(20);
            DEFINE output char(20);
            set schema sapr3;
            grant select on table input to group infouser;
            RETURN output;
            END FUNCTION;
        ENDEXEC.
        LOOP AT s_carrid INTO s_carrid_wa
                         WHERE sign = 'I' AND option = 'EQ'.
          TRY.
             EXEC SQL.
                EXECUTE PROCEDURE selfunc( IN  :s_carrid_wa-low,
                                           OUT :name )
              ENDEXEC.
              WRITE: / s_carrid_wa-low, name.
            CATCH cx_sy_native_sql_error.
              MESSAGE `Error in procedure execution` TYPE 'I'.
          ENDTRY.
        ENDLOOP.
        EXEC SQL.
          DROP FUNCTION selfunc;
        ENDEXEC.
      CATCH cx_sy_native_sql_error.
        MESSAGE `Error in procedure handling` TYPE 'I'.
    ENDTRY.

    Hi,
    Yes it is posible.
    I made one program like you want. But it need very long code.
    Here I explain the idea:
    1. Create Screen with input TEXT EDIT CONTROL.
        This is for input SQL Statement.
    2. Get SQL Statement from Text Edit Control using method <b>get_text_as_r3table</b>.
    3. Now we need to separate SQL Statement into different table.
        We Separate SELECT, FROM, WHERE, GROUP, HAVING, ORDER, etc.
    4. We need dynamic internal table to store the data.
    5. Select the data according SQL statement.
          SELECT (IT_SELECT)
            into corresponding fields of table  <dyn_table>
          FROM (IT_FROM)
          WHERE (IT_WHERE)
          GROUP BY (IT_GROUP)
          HAVING (IT_HAVING)
          ORDER BY (IT_ORDER).
    6. Display our data using ALV GRID
    Hopefully it will help you.
    Regards,

  • Issue with length of text field - READ_TEXT & SAVE_TEXT

    Hi,
        I need to allow user to enter max 400 char in one field and that needs to be updated in the VA02 for the corresponding sales order.
        I can able to save the text max 132 chars since TLINE-TDLINE will allow max 132 chars in both READ_TEXT & SAVE_TEXT.
        So here i am looking for the solutions for the below...
    1) How to design one input field to take 400 chars at one shot .... do i need to use table control ?
    2) Once i get the 400 char may be i will split in to 3-4 lines and i can append 130130130... like that through those FM... if not possible can you tell me the alternative.
    regards
    jaya

    You need to use class CL_TEXT_EDIT....
    Kindly stolen from Rich Heilman -:)
    report zrich_0001 .
    data:
          dockingleft  type ref to cl_gui_docking_container,
          text_editor    type ref to cl_gui_textedit,
          repid type syrepid.
    data: itext type table of tline-tdline,
          xtext type tline-tdline.
    parameters: p_check.
    at selection-screen output.
      repid = sy-repid.
      create object dockingleft
                  exporting repid     = repid
                            dynnr     = sy-dynnr
                            side      = dockingleft->dock_at_left
                            extension = 1070.
      create object text_editor
                  exporting
                       parent     = dockingleft.
      xtext = 'http:\www.sap.com'.
      append xtext to itext.
      call method text_editor->set_text_as_r3table
         exporting
               table              = itext
         exceptions
               others             = 1.
    start-of-selection.
      call method text_editor->get_text_as_r3table
         importing
               table              = itext
         exceptions
               others             = 1.
      loop at itext into xtext.
        write:/ xtext.
      endloop.
    You can use <b>RKD_WORD_WRAP</b> to wrap the text into an internal table -;)
    Greetings,
    Blag.

  • Urgent clearing data in container for free text

    I HAVE A CONTAINER FOR FREE TEXT.
    I HAVE A CREATE BUTTON IN MY SCREEN EWHEN I PRESS CREATE IT ASKD FOR ID AND FREE TEXT THEN I SAVE  AND IT GETS SAVED IN A ZTALE TABLE.
    WHEN AFTER SAVING IT I GO TO INITIAL SCREEN AND PRESS CREATE AGAIN THEN IT ASKS FOR ID AND IN THE CONTAINER I SEE THE FPREVIOUS TEXT.
    CAN YOU GUYS LET ME KNOW AS TO WHAT I NEED TO DO.
    I TREID CLEARING AND REFRESHING MYTABLE WHICH I HAVE USED IN THE FOLLOWING CODE.
    pbo
    if editor is initial.
    CREATE OBJECT TEXTEDIT_CUSTOM_CONTAINER
    EXPORTING
    CONTAINER_NAME = 'TEXTEDITOR1'
    EXCEPTIONS
    CNTL_ERROR = 1
    CNTL_SYSTEM_ERROR = 2
    CREATE_ERROR = 3
    LIFETIME_ERROR = 4
    LIFETIME_DYNPRO_DYNPRO_LINK = 5.
    IF SY-SUBRC NE 0.
    add your handling
    ENDIF.
    CREATE OBJECT EDITOR
    EXPORTING
    PARENT = TEXTEDIT_CUSTOM_CONTAINER
    WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
    WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>FALSE
    EXCEPTIONS
    OTHERS = 1.
    refresh mytable.
    call METHOD editor->SET_TOOLBAR_MODE
    EXPORTING TOOLBAR_MODE = 0.
    *call METHOD editor->SET_ENABLE
    *EXPORTING ENABLE = ' '.
    CALL METHOD editor->set_readonly_mode
    EXPORTING
    readonly_mode = 1.
    ENDIF.
    CLEAR MYTABLE.
    FREE MYTABLE.
    endif.
    IF SY-SUBRC NE 0.
    CALL FUNCTION 'POPUP_TO_INFORM'
    EXPORTING
    TITEL = V_REPID "--> program name
    TXT2 = SPACE
    TXT1 = 'Error in flush'.
    ENDIF.
    tHANKS
    let me know
    swathi

    For example, this program works really well with saving long text using the SAVE_TEXT function.  Here you need to create the object/id in SE75.  For this program you enter the id on the right like 999999 and enter the text on the left, execute and the text is saved, now change the id to 999998 and hit enter, notice the text is blank, now enter 999999 again, notice the text for this id has come back,  this is because the program uses READ_TEXT to retrieve the text.
    report zrich_0001.
    data:
          dockingleft  type ref to cl_gui_docking_container,
          text_editor    type ref to cl_gui_textedit,
          repid type syrepid.
    data: begin of header.
            include structure thead.
    data: end of header.
    data: begin of lines occurs 0.
            include structure tline.
    data: end of lines.
    data: textlines type table of tline-tdline,
          wa_text type tline-tdline.
    data: xthead type thead.
    parameters: p_id(10) type c.
    at selection-screen.
      if p_id is initial.
        message e001(00) with 'Enter an ID'.
      endif.
    at selection-screen output.
      repid = sy-repid.
      if dockingleft is initial.
        create object dockingleft
                    exporting repid     = repid
                              dynnr     = sy-dynnr
                              side      = dockingleft->dock_at_left
                              extension = 300.
        create object text_editor
                    exporting
                         parent     = dockingleft.
      endif.
      if p_id <> space.
        xthead-tdobject = 'ZPT_DET'.
        xthead-tdid     = 'Z001'.
        xthead-tdname = p_id.
        clear lines. refresh lines.
        call function 'READ_TEXT'
          exporting
            id                            = xthead-tdid
            language                      = sy-langu
            name                          = xthead-tdname
            object                        = xthead-tdobject
          tables
            lines                         = lines
         exceptions
           id                            = 1
           language                      = 2
           name                          = 3
           not_found                     = 4
           object                        = 5
           reference_check               = 6
           wrong_access_to_archive       = 7
           others                        = 8.
        clear textlines.
        loop at lines.
          wa_text = lines-tdline.
          append wa_text to textlines.
        endloop.
      endif.
      call method text_editor->set_text_as_r3table
         exporting
               table              = textlines
         exceptions
               others             = 1.
    start-of-selection.
      call method text_editor->get_text_as_r3table
         importing
               table              = textlines
         exceptions
               others             = 1.
    * Set SAPscript Header
      clear header.
      header-tdname =  p_id .         "Name
      header-tdobject = 'ZPT_DET'.       "Object
      header-tdid = 'Z001'.              "Id
      header-tdspras = sy-langu.
    * Move text from container to function module table
      clear  lines.  refresh lines.
      loop at textlines into wa_text .
        lines-tdline = wa_text.
        append lines .
      endloop.
      call function 'SAVE_TEXT'
           exporting
                client   = sy-mandt
                header   = header
           tables
                lines    = lines
           exceptions
                id       = 1
                language = 2
                name     = 3
                object   = 4
                others   = 5.
    Yes, this is implemented using a selection screen, but the same principals apply and this can  be easily converted to a dynpro application.
    Regards,
    Rich Heilman

  • Try to use CL_GUI_TEXTEDIT

    Hi all,
    i try to use CL_GUI_TEXTEDIT (thanks to Duraifaj) in
    this little report:
    REPORT Z065_TEST2.
    PARAMETERS: P_PERNR LIKE PA0000-PERNR.
    DATA: DOCKING TYPE REF TO CL_GUI_DOCKING_CONTAINER,
          EDITOR  TYPE REF TO CL_GUI_TEXTEDIT.
    DATA: TEXTLINES TYPE TABLE OF TLINE-TDLINE,
          WA_TEXT   TYPE TLINE-TDLINE.
    AT SELECTION-SCREEN OUTPUT.
      DATA: REPID LIKE SY-REPID.
      DATA: FILE_NAME LIKE SAPB-SAPFILES,
            FILE_TYPE LIKE BDN_CON-MIMETYPE.
      REPID = SY-REPID.
      IF DOCKING IS INITIAL.
        CREATE OBJECT DOCKING
          EXPORTING
            REPID = REPID
            DYNNR = SY-DYNNR
            SIDE  = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_BOTTOM
            EXTENSION = '300'
          EXCEPTIONS
            CNTL_ERROR                  = 1
            CNTL_SYSTEM_ERROR           = 2
            CREATE_ERROR                = 3
            LIFETIME_ERROR              = 4
            LIFETIME_DYNPRO_DYNPRO_LINK = 5.
      ENDIF .
      IF EDITOR IS INITIAL.
        CREATE OBJECT EDITOR
          EXPORTING
            PARENT            = DOCKING
            WORDWRAP_MODE     = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
            WORDWRAP_POSITION = 256
            MAX_NUMBER_CHARS  = 100000.
      ENDIF .
      WA_TEXT = 'First  Line'. APPEND WA_TEXT TO TEXTLINES.
      WA_TEXT = 'Second Line'. APPEND WA_TEXT TO TEXTLINES.
      CALL METHOD EDITOR->SET_TEXT_AS_R3TABLE
        EXPORTING
          TABLE  = TEXTLINES
        EXCEPTIONS
          OTHERS = 1.
    START-OF-SELECTION.
      CALL METHOD EDITOR->GET_TEXT_AS_R3TABLE
        IMPORTING
          TABLE                  = TEXTLINES
        EXCEPTIONS
          ERROR_DP               = 1
          ERROR_CNTL_CALL_METHOD = 2
          ERROR_DP_CREATE        = 3
          POTENTIAL_DATA_LOSS    = 4
          OTHERS                 = 5.
      IF SY-SUBRC <> 0.
        EXIT.
      ENDIF.
      WRITE: / P_PERNR.
      LOOP AT TEXTLINES INTO WA_TEXT.
        WRITE: / WA_TEXT.
      ENDLOOP.
    END-OF-SELECTION.
    My problem is, that i will position the editor
    on a special point an the screen in an special size.
    For example X = 10 10, Y = 20 100.
    Is that Possible?
    regards, Dieter

    Hi,
    i have tried it in this way,
      IF DOCKING IS INITIAL.
        CREATE OBJECT DOCKING
          EXPORTING
            REPID = REPID
            DYNNR = SY-DYNNR
            SIDE  = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_BOTTOM
            EXTENSION = '300'
          EXCEPTIONS
            CNTL_ERROR                  = 1
            CNTL_SYSTEM_ERROR           = 2
            CREATE_ERROR                = 3
            LIFETIME_ERROR              = 4
            LIFETIME_DYNPRO_DYNPRO_LINK = 5.
      ENDIF .
      CALL METHOD DOCKING->SET_HEIGHT
        EXPORTING
          HEIGHT = 150.
      CALL METHOD DOCKING->SET_WIDTH
        EXPORTING
          WIDTH = 500.
      CALL METHOD DOCKING->SET_TOP
        EXPORTING
          TOP = 50.
      CALL METHOD DOCKING->SET_LEFT
        EXPORTING
          LEFT = 200.
      EXIT.
    but the set.. haven't the right effect. it's only
    set on left, buttom ... But not on the position which i whant. I think there is no solution.
    thanks for help.
    Regards, Dieter

  • Populate CL_GUI_TEXTEDIT editor with text for user to modify

    Hi, What method of class CL_GUI_TEXTEDIT can I use to prepopulate the onscreen editor for someone to modify?  Also, an example would be greatly appreciated!
    Thanks
    I am using this program to maintain a string field URL in a table.  If you have a better way it would be greatly appreciated!
    REPORT  ZDW_1ST_RX_LINK_MAINT.
    DATA: DOCKINGLEFT TYPE REF TO CL_GUI_DOCKING_CONTAINER.
    DATA: TEXT_EDITOR TYPE REF TO CL_GUI_TEXTEDIT.
    DATA: REPID       TYPE SYREPID.
    DATA: TEXTLINES   TYPE TABLE OF TLINE-TDLINE.
    DATA: WA_TEXT     TYPE TLINE-TDLINE.
    DATA: REPORT_URL  TYPE STRING.
    DATA: TEXT_ITAB   TYPE TABLE OF SOLISTI1.
    DATA: TEXT_ITAB2  LIKE LINE OF TEXT_ITAB.
    PARAMETERS: P_REPGRP TYPE ZDWRPTGRP.         " Report
    PARAMETERS: P_SFORCE TYPE /BIC/OIZDWSFORCE.  " Report Qualifier
    PARAMETERS: P_REPDES TYPE C LENGTH 60.
    PARAMETERS: P_ACTION TYPE C.                 " Action
    AT SELECTION-SCREEN OUTPUT.
      REPID = SY-REPID.
      CREATE OBJECT DOCKINGLEFT
         EXPORTING REPID = REPID
         DYNNR           = SY-DYNNR
         SIDE            = DOCKINGLEFT->DOCK_AT_BOTTOM
         EXTENSION       = 280.
      CREATE OBJECT TEXT_EDITOR
         EXPORTING PARENT     = DOCKINGLEFT.
    START-OF-SELECTION.
      CALL METHOD TEXT_EDITOR->GET_TEXT_AS_STREAM
        IMPORTING
          TEXT   = TEXT_ITAB
        EXCEPTIONS
          OTHERS = 1.
      LOOP AT TEXT_ITAB INTO TEXT_ITAB2.
        CONCATENATE REPORT_URL TEXT_ITAB2-LINE INTO REPORT_URL.
      ENDLOOP.
      DATA: S_SFURL TYPE ZDW_SFURL.
      S_SFURL-REPORT_GROUP = P_REPGRP.
      S_SFURL-SALES_FORCE  = P_SFORCE.
      S_SFURL-REPORT_URL   = REPORT_URL.
      CASE P_ACTION.
        WHEN 'I'.
          INSERT ZDW_SFURL FROM S_SFURL.
        WHEN 'D'.
          DELETE FROM ZDW_SFURL
             WHERE REPORT_GROUP = P_REPGRP
               AND SALES_FORCE  = P_SFORCE.
        WHEN 'U'.
          UPDATE ZDW_SFURL FROM S_SFURL.
      ENDCASE.

    Or you can use the methods in this example.
    report zrich_0001 .
    data:
          dockingleft  type ref to cl_gui_docking_container,
          text_editor    type ref to cl_gui_textedit,
          repid type syrepid.
    data: itext type table of tline-tdline,
          xtext type tline-tdline.
    parameters: p_check.
    at selection-screen output.
      repid = sy-repid.
      create object dockingleft
                  exporting repid     = repid
                            dynnr     = sy-dynnr
                            side      = dockingleft->dock_at_left
                            extension = 1070.
      create object text_editor
                  exporting
                       parent     = dockingleft.
      xtext = 'http:\www.sap.com'.
      append xtext to itext.
      call method text_editor->set_text_as_r3table
         exporting
               table              = itext
         exceptions
               others             = 1.
    start-of-selection.
      call method text_editor->get_text_as_r3table
         importing
               table              = itext
         exceptions
               others             = 1.
      loop at itext into xtext.
        write:/ xtext.
      endloop.
    Regards,
    RIch Heilman

  • Control of Text box in Dialog programming

    Hai Friends
    i am having problem in controlling the Text box in PAI of Screen. For eg. if it is command button with the use of Function name i can able to check or do validation in PAI.
    As in the case of Textbox how to give the name for the text box and how to handle it in PAI for Validation.
    Please
    Badhri.

    Are you talking about a text editor?  IF so,  what is the validation that you want to perform.  Do you want to check to make sure that the user has entered something in the text editor?
    If so, then just get the text from the text editor into an internal table, and check that internal table to make sure that something is in it.
        call method editor->get_text_as_r3table
           exporting
                 only_when_modified = c_textedit_control=>false
           importing
                 table              = textlines
           exceptions
                 others             = 1.
    <b>    if textlines[] is initial.
          message e014.
        endif.</b>
    Regards,
    Rich Heilman

  • Saving ID to database

    I have these codes:
    MODULE USER_COMMAND_9000 INPUT.
       CASE SY-UCOMM.
       WHEN 'SAVE'.
        retrieve table from control
          CALL METHOD CODE_EDITOR->get_text_as_r3table
              IMPORTING
                  table = DYN_CODE_TABLE
              EXCEPTIONS
                  OTHERS = 1.
    LOOP AT DYN_CODE_TABLE INTO wa_lv.
         MOVE wa_lv-Line TO WA_PROGRAM-PROGRAM_LINE.
          MOVE wa_lv-LINE TO WA_PROGRAM-PROGRAM_CODE.
         APPEND WA_PROGRAM TO ITAB_PROGRAM.
    ENDLOOP.
          IF sy-subrc NE 0.
            CALL FUNCTION 'POPUP_TO_INFORM'
                 EXPORTING
                      titel = g_repid
                      txt2  = space
                      txt1  = text-003.
          ENDIF.
    This is my codes for the save function. Whenever I clicked on the save button, the system will auto generate an ID number and save to my database.
    For eg, when I click the first time of the save button, the ID will be 1 and second time is 2. However, after I exit my application and come back again, the ID will be 3 automatically.
    Please give me code examples as I am very new to ABAP.

    use snro create number range such as 'ALE_CP'
    CALL FUNCTION 'NUMBER_RANGE_ENQUEUE'
        EXPORTING
          object           = 'ALE_CP'
        EXCEPTIONS
          foreign_lock     = 1
          object_not_found = 2
          system_failure   = 3
          OTHERS           = 4.
      IF sy-subrc = 0.
        CALL FUNCTION 'NUMBER_GET_NEXT'
                 EXPORTING
                   nr_range_nr                 = '01'
                   object                      = 'ALE_CP'
               QUANTITY                    = LV_CPIDENTCOUNT
                 IMPORTING
                   number                      = im_cpidentmax
               QUANTITY                    = LV_QUANTITY
               RETURNCODE                  = LV_RETURNCODE
                EXCEPTIONS
                  interval_not_found          = 1
                  number_range_not_intern     = 2
                  object_not_found            = 3
                  quantity_is_0               = 4
                  quantity_is_not_1           = 5
                  interval_overflow           = 6
                  OTHERS                      = 7
        IF sy-subrc <> 0.
           * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CALL FUNCTION 'NUMBER_RANGE_DEQUEUE'
          EXPORTING
            object           = 'ALE_CP'
          EXCEPTIONS
            object_not_found = 1
            OTHERS           = 2.
      ENDIF.

  • In need of a pushbutton event handler for a cl_gui_custom_container

    Greetings Experts:
    Here is the situation...
    I have two cl_gui_custom_containers. Container1 has a double click event reciever that when fired displays longtext using the READ_TEXT function module displaying in Container2.  I am trying to add a pushbutton to Container2 to print contents of the screen (but not the Container1 ALV).
    It seems I am in a bit of a stand still and am in need of some advice.
    Thanks in advance.
    - Dan -

    Here is a little example program, it is not a 100% solution, but you should be able to get the idea here.  It is implemented into a docking container, so that this example is a cut/paste example.  Here we are splitting the docking container into two parts, buttom is the text editor, the top is our toolbar, notice the only button there is Print,  if you click this this will fire an event and will write out what you have typed into the text editor control.
    report zrich_0001.
    type-pools: icon.
    data:
          dock_sub_cont1   type ref to cl_gui_container,
          dock_sub_cont2   type ref to cl_gui_container,
          splitter         type ref to cl_gui_splitter_container,
          dockingleft      type ref to cl_gui_docking_container,
          text_editor      type ref to cl_gui_textedit,
          gui_tb           type ref to cl_gui_toolbar,
          repid type syrepid.
    data: itext type table of tline-tdline,
          xtext type tline-tdline.
    *       CLASS lcl_event_handler DEFINITION
    class lcl_event_handler definition.
      public section.
        class-methods:
        handle_pushbutton_click
                   for event function_selected
                           of cl_gui_toolbar importing fcode.
    endclass.
    *       CLASS lcl_event_handler IMPLEMENTATION
    class lcl_event_handler implementation.
      method  handle_pushbutton_click.
        case fcode.
          when 'PRINT'.
            call method text_editor->get_text_as_r3table
               importing
                     table              = itext
               exceptions
                     others             = 1.
            leave to list-processing.
            loop at itext into xtext.
              write:/ xtext.
            endloop.
        endcase.
      endmethod.
    endclass.
    parameters: p_check.
    at selection-screen output.
      repid = sy-repid.
      check dockingleft is initial.
      create object dockingleft
                  exporting repid     = repid
                            dynnr     = sy-dynnr
                            side      = dockingleft->dock_at_left
                            extension = 1070.
      create object splitter
                            exporting parent = dockingleft
                                      rows    = 2
                                      columns = 1.
      call method:
                      splitter->get_container
                        exporting row            = 1
                                  column         = 1
                                  receiving container = dock_sub_cont1,
                      splitter->set_row_height
                        exporting id             = 1
                                  height         = '3',
                      splitter->get_container
                        exporting row            = 2
                                  column         = 1
                                  receiving container = dock_sub_cont2.
      perform create_toolbar.
      create object text_editor
                  exporting
                       parent     = dock_sub_cont2.
      set handler:
                   lcl_event_handler=>handle_pushbutton_click for gui_tb.
    start-of-selection.
    *       FORM create_toolbar                                           *
    form create_toolbar.
      data: event type cntl_simple_event,
           events type cntl_simple_events.
    * Create the toolbar object
      create object gui_tb
        exporting
          parent             = dock_sub_cont1
        exceptions
          cntl_install_error = 1
          cntl_error         = 2
          cntb_wrong_version = 3
          others             = 4.
    * Set up events  for toolbar
      clear event. refresh events.
      event-appl_event = 'X'.
      event-eventid = gui_tb->m_id_function_selected.
      append event to events.
    * Register the events
      call method gui_tb->set_registered_events
        exporting
          events = events
        exceptions
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
    * Add Buttons to toolbar
      call method gui_tb->add_button
        exporting
          fcode            = 'PRINT'
          icon             = icon_print
          butn_type        = '0'
          text             = '  Print'
        exceptions
          cntl_error       = 1
          cntb_btype_error = 2
          cntb_error_fcode = 3
          others           = 4.
    endform.
    Regards,
    RIch Heilman

Maybe you are looking for

  • Time Machine loses backups after a full restore.

    Greetings (Possibly due to parallels, my Imac was running so slow or hanging. As a result,) I ran a full system restore from Time Machine. It worked well. Then I thought I would try a better restore date and used that. After this successful restore,

  • My bluetooth keyboard is not working properly.

    I know that there are several posts about bluetooth keyboards messing up, but I could not find a post that was specific to my issue. I was wiping my keyboard off earlier this evening, and afterwards some of the keys are very messed up. Whenever I typ

  • 2LIS_03_BF Error

    Hi All, We are in the process of upgrading 3.0b to Netweaver 2004s and while extracting the data from 2LIS_03_BF DataSource we are getting the error  in RSMO "Material XXXXX does not exist or is not activated (Message no. M3305) ".This LO extraction

  • Black update from Nokia (when will we get it?)

    Everyone else is getting the Black update for Lumia. When will verizon be giving us the black update?

  • Want to save data

    Hello Experts, I have created an interactive form for test, it has one text field and one numc field. I have created structure with fields one text and one numc. I have created form using SFP.  I want to save the data in the structure if user enters