Creating text elements dynamically by program

Hi all,
Do you know how I can create text symbols or selection texts dynamically by program? (calling a FM or editing a table?)
What's the table for text elements?
Thanks in advance,
Mathieu

Hi,
Not sure of FM. But programically u can do.
Check the statement
INSERT TEXTPOOL PROGRAM FROM TAB LANGUAGE
SY-LANGU.
This creates the text elements in the specifies program and in specified language.
Not only text elements but also list headings u can create.
Check below sample code given by SAP.
DATA: PROGRAM(8) VALUE 'PROGRAM',
      TAB LIKE TEXTPOOL OCCURS 50 WITH HEADER LINE.
TAB-ID = 'T'. TAB-KEY = SPACE.  TAB-ENTRY = 'Sales'.
APPEND TAB.
TAB-ID = 'I'. TAB-KEY = '200'.  TAB-ENTRY = 'Tax'.
APPEND TAB.
TAB-ID = 'H'. TAB-KEY = '001'.  TAB-ENTRY = 'Name   Age'.
APPEND TAB.
TAB-ID = 'S'. TAB-KEY = 'CUST'. TAB-ENTRY = 'Customer'.
APPEND TAB.
TAB-ID = 'R'. TAB-KEY = SPACE.  TAB-ENTRY = 'Test program'.
APPEND TAB.
SORT TAB BY ID KEY.
INSERT TEXTPOOL PROGRAM FROM TAB LANGUAGE SY-LANGU.
eg:TAB-ID = 'I'.                 For Text elements
TAB-KEY = '200'.             Text element number
TAB-ENTRY = 'Tax'.        Actual text
But use it only for new developments. Bucause it may overwrite the existing texts.
Thanks,
Vinod.
Edited by: Vinod Reddy Vemuru on Aug 8, 2008 2:48 PM

Similar Messages

  • How to create Invisible Element Dynamically?

    Dear All,
    I am trying to create a Form dynamically and for aligment prupose i need to create one InvisbleElement also dynamically.But i dont know why that is not reflecting in the Screen .The code is deploying properly without error but the Invisible Element is not getting created .The code i used is
    IWDInvisibleElement Invis1=(IWDInvisibleElement)view.createElement(IWDInvisibleElement.class,null);
    Invis1.setEnabled(true);
    Invis1.setVisible(WDVisibility.VISIBLE);
    thetransparent.addChild(Invis1);
    Can anyone please tell me if i need to set any property or if the method i am creating is wrong .Please guide me in the correct way.
    Thanks and Regards,
    Nishita Salver

    Hi,
    check "Dynamic Programming" part in below library file
    http://help.sap.com/saphelp_nw70/helpdata/EN/0f/f08841e3af1609e10000000a155106/frameset.htm
    or else,
    still you are getting Problem, create any other ui element and set its visibility to false. (dont know how far it will help you)
    regards,
    Pradeep
    Edited by: pradeep bondla on Jun 25, 2008 3:20 PM

  • Create multiple elements dynamically at one time

    Hi,
    I need to create some links dynamically.
    Below is my code... but I need to know instead of multiple steps.. is there a way to create dynamic elements together using one method itself....  or once i create the elements can i embed all these links together in the view?
      lr_lta = cl_wd_link_to_action=>new_link_to_action(
      id = 'LNK_CREATE'
      on_action = 'ON_NAVIGATE'
      text = 'Create'
      view = lr_view ).
      cl_wd_matrix_data=>new_matrix_data( element = lr_lta ).
      lr_container->add_child( the_child = lr_lta ).
      lr_lta = cl_wd_link_to_action=>new_link_to_action(
      id = 'LNK_HISTORY'
      on_action = 'ON_NAVIGATE'
      text = 'Hitory'
      view = lr_view ).
      cl_wd_matrix_data=>new_matrix_data( element = lr_lta ).
      lr_container->add_child( the_child = lr_lta ).
    Any help will be grateful.
    Regards and Thanks
    Tenzin

    Hi,
    This is a sample code for doing it using loop.
    I just refined the code to make it most amenable to your requirement.
    The code gives two different links at the same time with two different actions.
    method WDDOMODIFYVIEW .
    IF first_time eq abap_true.
    data lr_ref type ref to cl_wd_link_to_action.
    data lr_cont_ref type ref to cl_wd_uielement_container.
    data lr_layo_ref type ref to cl_wd_flow_data.
    data lv_times type i value 2.
    data lv_count type i value 1.
    lr_cont_ref ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    do lv_times times. "decide how many times you want the link
    case lv_count.     "decide what link to action with what action should be defined
    when 1.
    CALL METHOD cl_wd_link_to_action=>new_link_to_action
       EXPORTING
         enabled             = ABAP_TRUE
         image_first         = ABAP_TRUE
         on_action           = 'First_Action'
         text                = 'First Link' "to display 'Gangtok' when clicked
       receiving
         control             = lr_ref
       CALL METHOD cl_wd_flow_data=>new_flow_data
       EXPORTING
         element                = lr_ref
       receiving
         control                = lr_layo_ref
    CALL METHOD lr_cont_ref->add_child
      EXPORTING
        index     = 1   "this is to set link to action in first place
        the_child = lr_ref
    When 2.
      CALL METHOD cl_wd_link_to_action=>new_link_to_action
       EXPORTING
         enabled             = ABAP_TRUE
         image_first         = ABAP_TRUE
         on_action           = 'Second_Action' "to display 'Kolkata' when clicked
         text                = 'Second Link'
       receiving
         control             = lr_ref
      CALL METHOD cl_wd_flow_data=>new_flow_data
       EXPORTING
         element                = lr_ref
       receiving
         control                = lr_layo_ref
    CALL METHOD lr_cont_ref->add_child
      EXPORTING
        index     = 2   "this is to set the link to action in 2nd place
        the_child = lr_ref
    endcase.
    lv_count = lv_count + 1.
    enddo.
    endif.
    endmethod.
    Regards,
    Prosenjit.
    Edited by: prosenjit chaudhuri on Feb 16, 2009 12:48 PM

  • Directly creating text elements from eclipse

    Hi,
    I just came into the situation, that I'd like to translate some strings in my source code.
    The fastest solution in SAP GUI was to just double click on the string and create the corresponding text element.
    In eclipse I can navigate into existing text elements, but not create them.
    Now my question:
    Can I create those text elements right from eclipse?
    And if not (what I think is the case):
    Why?
    Because it is just not implemented yet, or because this way of translating text elements is obsolete and I missed something?
    Regards David

    Hi David,
    we want to provide this feature via the Quick Fix functionality in Eclipse.
    That means in future you can position the cursor on the Number and yyou press CTRL-1 (Quick Fix).
    In the upcoming popup you can choose 'Create Textelement' and the element will be created.
    This kind of functionality already exists for creating classes, methods or function modules directly from the usage position.
    We are currently working oin this little improvement so that I'm optimistic to ship this feature with one of the next versions.
    Regards,
    Thomas.

  • Create UI elements dynamically in AppleScript Studio?

    I'd like to create an applescript studio app that can create UI elements (radio buttons, checkboxes, etc) dynamically based on certain other criteria. I've been writing applescripts for a while but am somewhat new to applescript studio, so I don't know where to look for this, other than here. Any help would be greatly appreciated.

    that's what I thought. Unfortunately I'd like to have the ability to have no prior knowledge of what UI elements are needed, and call them into being at any time. So I'm gonna infer that that just isn't possible.
    Related question: can I set up a UI element, let's say a checkbox, and dynamically tell the UI element how many checkboxes I need and what their names/values should be? Or once again do I need to have prior knowlege of how many checkboxes I need?

  • How can i create text elements in business object?

    is dis possible to crete text elements in business objects...if any body knows please give me the idea...

    Hello,
    are we talking about the BEx Text elements that are also available in the BEx Analyzer ? if so then this is right now only possible in Analysis, OLAP Edition and Analysis, Edition for Microsoft Office.
    Ingo

  • ABAP: Create UI element dynamically

    Hello,
    I have a need create a UI element (dropDown, inputField, etc.) dynamically.
    How would I approach this problem? What classes correspond to this?
    Thank you.

    This topic has been covered quite nicely in a series of weblogs by Thomas Szuecs:
    /people/thomas.szcs/blog/2005/12/28/dynamic-programming-in-web-dynpro-abap--introduction-and-part-i-understanding-ui-elements
    /people/thomas.szcs/blog/2006/01/03/dynamic-programming-in-web-dynpro-abap--part-ii-handling-viewelements
    /people/thomas.szcs/blog/2006/02/22/dynamic-programming-in-web-dynpro-abap--part-iii-aggregations-and-ddic-binding-of-viewelements

  • Problem: Create SO with BAPI_SALESORDER_CREATEFROMDAT2 & Head-Text Elements

    Hi all,
    I hape that sb can help me with my problem.
    I have created a ABAP-Program to create sales-orders with the function module:
    BAPI_SALESORDER_CREATEFROMDAT2
    Everythiunk works fine but I can not create text-elements (from the head) with this bapi.
    I know that I have to use the table "ORDER_TEXT" but I do not know how to fill this table.
    Can anybody help me?
    Best regards,
    pb974

    Hi,
    yes, you have to fill the order_text table. The following fields you have to fill:
    DOC_NUMBER   
    -> not to fill, let it blank
    ITM_NUMBER     
    -> if you want to create a header-text then fill ITM_NUMBER with '000000'
    -> if you want to create a position-text then fill the related position-number '000010' or '000020'....
    TEXT_ID
    -> fill this field with the text-id for which you want to create the text.
    -> The text-id must be defined in your customizing
    LANGU
    -> set the language for the text: 'E' or 'D' or......
    LANGU_ISO
    -> let it blank
    FORMAT_COL
    -> set a star (*) if you want to have the standard-format. If you have a special format defined in SapScript or in a Style you can set this one.
    TEXT_LINE
    -> fill in the text
    FUNCTION
    -> let it blank
    see below:
    data: i_text     LIKE bapisdtext  OCCURS 0 WITH HEADER LINE.
    Texte...
            CLEAR i_text.
            i_text-itm_number  = '000010'.    "Text for Position 10
            i_text-text_id         = 'ZA10'.        "Defined Text-ID
            i_text-langu           = 'D'.             "Language German
            i_text-format_col    = '*'.              "Standardformat
            i_text-text_line       = 'This is text for Pos. 10 - line 2'.   "the text
            APPEND i_text.
    ...if your text has more then one row... the same one to do...
            i_text-itm_number  = '000010'.    "Text for Position 10
            i_text-text_id         = 'ZA10'.        "Defined Text-ID
            i_text-langu           = 'D'.             "Language German
            i_text-format_col    = '*'.              "Standardformat
            i_text-text_line       = 'This is text for Pos. 10 - line 2'.   "the text
            APPEND i_text.
    ...and so one...
    and now text for position 20...
            CLEAR i_text.
            i_text-itm_number  = '000020'.    "Text for Position 20
            i_text-text_id         = 'ZA10'.        "Defined Text-ID
            i_text-langu           = 'D'.             "Language German
            i_text-format_col    = '*'.              "Standardformat
            i_text-text_line       = 'Text für Pos. 20 - Zeile 1'.   "the text
            APPEND i_text.
    ...and now the text for position in englisch
            i_text-itm_number  = '000020'.    "Text for Position 20
            i_text-text_id         = 'ZA10'.        "Defined Text-ID
            i_text-langu           = 'E'.             "Language German
            i_text-format_col    = '*'.              "Standardformat
            i_text-text_line       = 'This is text for Pos. 20 - line 1'.   "the text
            APPEND i_text.
    I hope it's a help for you.
    Erhard

  • Create colum headings using text elements

    Hi Experts,
    I want to create column heading of a report using text element, how can i create create column headings using text elements and how can i use in the top-of-page event.
    Thanks

    Hi,
    1 For Creating Text Element,
    go to Se38 -
    > Write Name of the Program - > Click Change button - > Then go to GoTo on Menu Bar--> text Elements
    > Select Text Symbol
    In First Column( Sym)  Write any Number which is not used  like 001, 002.....
    In Second Column (Text) write in text or description .... like Sales Order....
    U can use this text Symbol in code -
    >  text-001, text-002.....
    2 In order to insert a report heading in to the ALV grid you need to perform the following steps:
                        1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'top-of-page' FORM
                    2. Create 'top-of-page' FORM
    3 In order to add event functionality such as 'END_OF_PAGE' to the ALV grid you need to setup the
      IT_EVENTS option of the ALV function module. Also depending on which event you are using you
       may also need to setup the print parameters by activating the IS_PRINT option. Please note for events
      such as end_of_page, end_of_list etc they will not be displayed on screen but only in the printed
       output.
            Step 1. Add data declaration for events and print parameters
            Step 2. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include parameter 'it_events' and 'is_print'
            Step 3. Add code to setup events table and print parameters
            Step 4. Create event FORM(s), which are executed when event is triggered
    Thanks & Regards,
    ShreeMohan

  • Dynamic text element (Text Symbols)

    Hi,
    How can we make text element dynamic?
    Ex:
    If I want a text "Consider date g_date" where g_date is populated from program. Can I pass g_text like <b>text-001 g_text</b>?
    Thanks.

    If you need it for a message, just use a predefined generic one, i.e
    MESSAGE s000(0k) WITH 'Consider date' gdate '' ''.
    Then you don't even have to define 'Consider date' as a text-symbol. But you can. Then it is
    MESSAGE s000(0k) WITH text-001 gdate '' ''.
    Regards,
    Clemens

  • Use of text element in function module

    hi friends what is the use of text element i.e list headings, selection texts,text symbols in a function module. where a can see these things after giving some text into it and activated.
                                        kumar.

    hi
    <b>Text Symbols</b>
    A text symbol is a named data object that is generated when you start the program from the texts in the text pool of the ABAP program. It always has the data type c. Its field length is that of the text in the text pool.
    Text symbols, along with the program title, list headings, and selection texts, belong to the text elements of a program. Text elements allow you to create language-independent programs. Any text that the program sends to the screen can be stored as a text element in a text pool. Different text pools can be created for different languages. When a text element is changed or translated, there is no need to change the actual program code. Text elements in an ABAP program are stored in the ABAP Editor (see Text Element Maintenance).
    In the text pool, each text symbol is identified by a three-character ID. Text symbols have a content, an occupied length, and a maximum length.
    Examples for text symbols in an ABAP program:
    ID
    Contents
    Occupied length
    Maximum length
    010
    Text symbol 010
    15
    132
    030
    Text symbol 030
    15
    100
    AAA
    Text symbol AAA
    15
    15
    In the program, you can address text symbols using the following form:
    text-###
    This data object contains the text of the text symbol with ID ### in the logon language of the user. Its field length is the same as the maximum length of the text symbol. Unfilled characters are filled up with spaces. You can address text symbols anywhere in a program where it is also possible to address a variable.
    If there is no text symbol ### in the text pool for the logon language, the name text-### addresses the predefined data object space instead.
    You can also address text symbols as follows:
    ... 'textliteral'(###) ...
    If the text symbol ### exists in the text pool for the logon language, this is the same as using text-###. Otherwise, the literal 'textliteral' is used as the contents of the text symbol. This is only possible at positions in the program where a variable can occur. You can create a text symbol for any text literal by double-clicking the literal in the ABAP Editor and replacing the literal with the text symbol.
    You should use text symbols in your program whenever they need to be language-specific - for example, in a WRITEstatement.
    If you program a list whose layout depends on field lengths, you should be careful, since the field length of text symbols will be different in different languages. You should therefore set the maximum field length of the field symbol so that there is enough space to translate it into other languages. For example, the English word 'program' has seven letters, but its equivalent German translation 'Programm' has eight.
    The following example shows the use of text symbols in WRITE statements.
    SET BLANK LINES ON.
    WRITE:   text-010,
           / text-aaa,
           / text-020,
           / 'Default Text 030'(030),
           / 'Default Text 040'(040).
    If the text symbols of the above screen shots are linked to this program, the output looks as follows:
    Text symbols 020 and 040 have no text symbols. For text symbol 020, the system displays a space. This is only displayed in this case because the blank line suppression has been turned off (see Creating Blank Lines).
    regards
    ravish
    <b>plz reward if helpful</b>

  • Text-element in main window

    Hello together,
    is it sorrect, that text-elements can only be used in the main window?
    Is there any chance to use text-elemnts in a new-created window?
    an example that does not work:
    new window: TABLE
    call in print-program:
    CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              element = 'ITEM_GR'
              window  = 'TABLE'.
    Unfortunately i need a new window with a possibility to print several text-elements.
    Thanks a lot for help.

    Hi Marcel,
    In one of my developments, i've created text elements in the windows other than MAIN window. But it worked properly. I think there might be some other reasons for ur failure. Try to trace that.
    Or else u just try by changing the Window type as CONST.
    Try this out & let me know in case of any other concrens..
    Reward if useful.
    Pavan.

  • Text elements creation in user exit

    Hi All,
    I have written code in user exit MV45AFZZ(include program ) ,now i need to create text elements.
    The above include is in standard program SAPMV45A,which will ask access key for creating text elements.
    Can any one give me some inputs,like,can i go ahead using accesskey or any alternative procedure exists for enhancing text elements without accesskey?
    Thanks & Regards
    Seshagiri.

    Hi
    Create one message class or use any created message class(custom). In that write ur text elements and use that in include.
    In same program and same include which u r telling, we created one message class called Z_SDRQC and using text elements from this message class in this include. check below sample code for that.
    Reward if it is helpful.
    Thanks
    Siva Kumar
    IF SY-TCODE = c_tcode1.
              MESSAGE a006(z_sdrqc).
            ELSEIF SY-TCODE = c_tcode2 OR SY-TCODE = c_tcode3.

  • Regarding Text Elements

    Hi Kiran,
    Thanks For u r reply.My pblm is i have one sap script form in tat output i have to get the text element through report program.I written the code like this. .
    Data : extn(10)  type c.
    Extn = text-001.
    Actually when we r leaving the report program it is saying tat it will be maintained in DE Language.after tat i created the text element and i saved it and my report program also.but in my output tat text symbol is not displaying.
    Thanks,
    Swapna.M

    hi
    good
    did you copy your standard program to the z* program , if yes than change the language from DE to EN and than try the same , i hope it ll work.
    thanks
    mrutyun^

  • How to remove  'Empty Demarcation'  in Text Elements.

    Dear All,
    To remove 'Empty demarcation' in the WAD output, I had modified the standard program - SAPLRSSV (for this i took  access key from SAP). 
    The text element : 301 was changed to blank  and it worked.
    Recently we had a support package upgrade to SAPKW70018. With this upgrade my previous change to the program got reverted back and so i need to do the change again.
    However,  I'm not able to retrieve the list of Text elements for this program (SAPLRSSV). I open the program and when i go to Text element,  following message is displayed :
    "Untranslated texts from master language DE will  also be displayed"
    But no list (no text elements) is displayed.
    My question : How do i retrieve this list  and can i use the same acess key again or do i need to take another one from SAP.
    Regards,
    Nagendra.

    Sorry, I was referring to the incorrect program SAPLRSSV instead of SAPLRRSV.  The problem has been resolved.
    Regards,
    Nagendra.

Maybe you are looking for