Creating buttons dynamically in module pool screen

Hi friends,
I have one screen .
It has two input fields .
Say : Sales order no & Bin no .
based on this i found some batches from database table using select query .
Now the number of buttons depends on the no of batches i found .
If I get 5 batches , then I will create 5 Push Buttons on screen .
Please let me know , How to create these buttons dynamically on screen .
Regards ,
Manoj

Hey ,
I tried using custom container and then a toolbar in it .
But this toolbar create buttons either vertically OR horizonatally .
I want buttons all over the screen to be created dynmically .
Please help ...

Similar Messages

  • How to disable the inputfield using radio button dynamically in module pool

    How to disable the inputfield on the screen using radio button dynamically in module pool.
    Please suggest .
            Thanks.
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:20 PM

    I got it thank you.
    LOOP AT SCREEN.
        if  screen-GROUP1 = 'LA1'.
           If RADIO1 = 'X'.
            SCREEN-INPUT = '0'.
            MODIFY SCREEN.
         ELSEIF RADIO2 = 'X'.
           screen-input = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:51 PM

  • How to creat select-option on module pool screen???

    Hi All,
       please tell me how to creat select-option on module pool screen???
    Regards
    Deepak

    Hi Deepak Kumar Sharma,
    There are Two ways to achieve it...
    1) How to create a select-options in a module pool screen.
    Method 1
    a) Create a subscreen area in your screen layout where you want to create the select options.
    b) In the top include of your module pool program declare a selection screen as a subscreen e.g.
    SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
    select-options s_matnr for mara-matnr.
    SELECTION-SCREEN END OF SCREEN.
    c) In the PBO and PAI of the main screen where the select options needs to be created do a call subscreen of the above screen (100).
    CALL SUBCREEN sub_area INCLUDING <program> <screen>
    This call subscreen statement is necessary for transport of values between screen and program.
    Note: All validations of the selection screen fields e.g. the s_matnr field created above should be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection screen validations etc should be done in the top include only.
    Method 2
    a) Create 2 separate fields in your screen layout - one for the low value and one for the high value. Insert an icon beside the high value which will call the multiple selections popup screen on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.
    struc_tab_and_field-fieldname = con_cust. " 'KUNNR'
    struc_tab_and_field-tablename = con_kna1. " 'KNA1'.
    CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
    EXPORTING
    TITLE = ' '
    text = g_titl1 " 'Customers'
    tab_and_field = struc_tab_and_field
    TABLES
    RANGE = rng_kunnr
    EXCEPTIONS
    NO_RANGE_TAB = 1
    CANCELLED = 2
    INTERNAL_ERROR = 3
    INVALID_FIELDNAME = 4
    OTHERS = 5.
    IF NOT rng_kunnr[] IS INITIAL.
    Read the very first entry of the range table and pass it to
    dynpro screen field
    READ TABLE rng_kunnr INDEX 1.
    IF sy-subrc = 0.
    g_cust = rng_kunnr-low.
    ENDIF.
    You can use the return table rng_kunnr to populate your own internal range table with the values entered by the user. Basically here you are just simulating the work of a select-options parameter by module pool screen elements.
    Also have a look on below threads
    how to make select option in module pool
    select option in module pool program
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7

  • Expand/collapse button functionality on module pool screen

    Hi ,
    I want to design a module pool screen with a expand/collapse button on it.
    The desired functionality associated with this button would be something similiar to that available in ME21N screen. When the expand button is clicked it should open up a section of screen that allows the user to enter some parameter. Based on this parameter some selections from DB can be perfomed and then displayed below it.
    Any pointers on how to achieve this? Any kind of help would be appreciated.
    Regards-
    Harmeet Singh.

    example for three pushbutton with expand collapse .
    First of all define your push button as output field with icon tick in the pushbutton characteristick,
    then define this pushbutton in top_include
    include <icon>.
    data : push_a1 like icons-l4,
             push_a2 like icons-l4,
             push_a3 like icons-l4.
    data : a1 ,
             a2,
             a3.
    in pai of the screen
    suppose i had assign function code a1 ,a2 , a3 for repective pushbutton
    module user_command_9002 input.
      okcd = ok_code.
      clear ok_code.
      case okcd.
        when 'A1'.
          if a1 is initial.
            a1 = 'X'.
          else.
            clear a1.
          endif.
        when 'A2'.
          if a2 is initial.
            a2 = 'X'.
          else.
            clear a2.
          endif.
        when 'A3'.
          if a3 is initial.
            a3 = 'X'.
          else.
            clear a3.
          endif.
      endcase.
    endmodule.                 " USER_COMMAND_9002  INPUT
    define three seprate screen -group for three pushbutton say a1 a2 a3
    during pbo you can directly assign name of icon .
    if a1 is initial.
        push_a1 = icon_collapse.
      else.
        push_a1 = icon_expand.
      endif.
      if a2 is initial.
        push_a2 = icon_collapse.
      else.
        push_a2 = icon_expand.
      endif.
      if a3 is initial.
        push_a3 = icon_collapse.
      else.
        push_a3 = icon_expand.
      endif.
    loop at screen.
        if screen-group1 = 'A1'.
          if a1 = 'X'.
            screen-invisible = 1.
            screen-input = 0.
            modify screen.
          else.
            screen-active = 1.
            screen-invisible = 0.
            screen-input = 1.
          endif.
        elseif screen-group1 = 'A2'.
          if a2 = 'X'.
            screen-invisible = 1.
            screen-input = 0.
            modify screen.
          else.
            screen-active = 1.
            screen-invisible = 0.
            screen-input = 1.
          endif.
        elseif screen-group1 = 'A3'.
          if a3 = 'X'.
            screen-invisible = 1.
            screen-input = 0.
            modify screen.
          else.
            screen-active = 1.
            screen-invisible = 0.
            screen-input = 1.
          endif.
        endif.
      endloop.
    regards,
    Alpesh
    Edited by: Alpesh on May 28, 2009 10:28 AM

  • How to create select-options on module pool screen

    Hi all
    I want get a range of values from the user from the module pool screen.
    Is there any element available on module pool screen like select options on the selection screen of reports.
    reply me ASAS.
    Thanks.

    hi krishna
    actually I want to display the details of PO numbers from 45000100 to 45000150. user will enter this range on the module pool screen just as we enter on the selection screen of report. My question is do we have a button like select-option on the module pool screen.
    Plz . reply me ASAP.
    Thanks.

  • How to change the text of a button dynamically in module pool

    hi gurus,
    how to change the text of button dynamically

    Hi ,
    Declare a variable in TOP Include with your button name.
    Example : P_BUTTON(20) TYPE C.
    Place button with name P_BUTTON on you screen. Do not forget to mark it as "Output Field". [ Double click on button, Attributes --> Program tab --> tick "Output Field".
    In you PBO / PAI , whereever you want to change your text -
    Assign value to P_BUTTON.
    Example -
    iF COND1..
    P_BUTTON = 'EDIT'.
    ELSEIF COND2.
    P_BUTTON = 'DISPLAY'.
    ENDIF.
    Regards,
    Mohaiyuddin

  • Variants for module pool screena

    Hi,
    I tried creating a variant for module pool screen by using the FM : RS_CREATE_VARIANT.
    For this i created a dummy report which has the same parameters as the fields in the screen.
    CALL FUNCTION 'RS_VARIANT_CONTENTS'
            EXPORTING
              report                      = gc_dummy_rep
              variant                     = 'variant5'
            MOVE_OR_WRITE               = 'W'
            NO_IMPORT                   = ' '
            EXECUTE_DIRECT              = ' '
          IMPORTING
            SP                          =
            tables
            L_PARAMS                    =
            L_PARAMS_NONV               =
            L_SELOP                     =
            L_SELOP_NONV                =
              valutab                     = lt_params
            OBJECTS                     =
            FREE_SELECTIONS_DESC        =
            FREE_SELECTIONS_VALUE       =
          EXCEPTIONS
            VARIANT_NON_EXISTENT        = 1
            VARIANT_OBSOLETE            = 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.
    but when i try to retrieve the values stored in the variant using FM : RS_VARIANT_CONTENTS.
    CALL FUNCTION 'RS_VARIANT_CONTENTS'
            EXPORTING
              report                      = gc_dummy_rep
              variant                     = 'variant5'
            MOVE_OR_WRITE               = 'W'
            NO_IMPORT                   = ' '
            EXECUTE_DIRECT              = ' '
          IMPORTING
            SP                          =
            tables
            L_PARAMS                    =
            L_PARAMS_NONV               =
            L_SELOP                     =
            L_SELOP_NONV                =
              valutab                     = lt_params
            OBJECTS                     =
            FREE_SELECTIONS_DESC        =
            FREE_SELECTIONS_VALUE       =
          EXCEPTIONS
            VARIANT_NON_EXISTENT        = 1
            VARIANT_OBSOLETE            = 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.
    I get an error message : variant5 not found.
    is there anything that i miss here?
    or is the way i use to create variant for module pool screen not right?
    Regards,
    Kamini

    Hi,
    To avail save variant option in module pool screen,
    1. You need to create a data base table similar to INDX table with the fields RELID, VARI_NAME
    PROG_NAME
    UNAME
    SRTF2, MEMORYID, CLUSTR,  CLUSID. And the remaining fields can be anything.
    2. Enable the Save button in the Function keys part of GUI Status. And Add a push button for Get variant.
    3. When Save button clicked call a screen with a single field for variant (let us say g_var). After g_var entered, in the PAI of the initial screen export all the screen values to the created database index using the statement .
                         EXPORT: g_characteristics_tab TO DATABASE zav0257(ch) ID g_var,
                                       s_auart TO DATABASE zav0257(au) ID g_var.
                         So that the values will be exported to database.
                         Then update the fields(VARI_NAME,PROG_NAME,UNAME) of  the database table using modify from work area. 
                         So that you will have the history of variance existence.
    4. Next time , when the user clicks on Get Variant option, call another screen to enter the variant name. Then import the values for that variant from the memory id in the database table.
    It worked for me.

  • How to handle The Back button on Module Pool screen

    Hi Gurus,
                  I have created a module pool screen. In that screen I have used some input/output fields(text box) which i have marked mandatory by making the input field as "required" under program tab.
    now when running the screen if no data is entered into these mandatory input field then BACK button does not work. First I have to enter some data into the input filed only then the BACK button works. How should i code so that the back button works even without entering the data into these mandatory fields.

    hi,
    use AT EXIT-COMMAND with the module.
    eg. module user_command at exit command.
    then there will be no problem.

  • Trigger a workflow from module pool screen at save button

    Hi,
    I am new to workflow.Please help me.My requirement is trigger a custom workflow from module pool screen at save button.
    Scenario is: Create a Z screen for material creation and after pressing save button workflow should trigger to approver and approver emailid should be fetch from Z table and have to provide a link in work flow for Z t-code which displays a report of material pending for approval..
    Please suggest me process how i can acheive this..
    Thanks

    Hi,
    If you're using standard bapi's to save the material, you can then use either the standard events which are already triggered or you coul add a change document for material changes or creation.
    Then this event can be the trigger of your custom workflow.
    Kind regards, Rob Dielemans

  • Problem in creating a Select-option im a module pool screen

    I've been searching how to do a select option in a module pool screen, I've found this neat tutorial http://sample-code-abap.blogspot.com/2008/06/select-option-in-module-pool-screen.html
    but I'm having trouble to replicate it...
    I've created this conde in my TOP include
    SELECTION-SCREEN BEGIN OF SCREEN 201 AS SUBSCREEN.
       SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
        SELECT-OPTIONS: s_matnr FOR mara-matnr.
      SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN END OF SCREEN 201.
    and this is my screen flow code
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      MODULE pbo_200.
    PROCESS AFTER INPUT.
      MODULE pai.
      MODULE user_command_0200.
    in the screen 200 I have a subscreen area named subs
    but when I do this:
    MODULE pbo_200 OUTPUT.
      CALL subscreen subs including sy-repid '0201'.
    ENDMODULE.                 " pbo_200  OUTPUT
    it doesn't "compile"
    it gives me this error:
    ""." or "ID ... FIELD ..." expected after "SUBSCREEN"."
    what am I missing? it seems its not recognising the "CALL SUBSCREEN" command...

    you can't use CALL SUBSCREEN... in any ABAP section. It is reserved to dynpro flow logic. Just add it after PROCESS BEFORE OUTPUT (and also after PROCESS AFTER INPUT).

  • How to print the Module pool screen using a push button in the screen

    Hi Every one,
                         i have developed a module program , which have a selection screen and it display the output in a structured way.
    output includes boxes, texts etc...
    my problem is :---
    How to print the Module pool screen using a push button in the screen.

    When the "Print" button is pressed:
    leave to list-processing and return to screen 100.  "(current screen)
    Call a transaction that runs your print program.
    Rob

  • Icon display in Module pool screen not visible to some users

    Hi,
    I have added an icon in one of the module pool screen with dynamic quick info.  The page is rendered fine and the info is also displayed well for most users except some.  I can't figure out why the icon is not being displayed for some users.
    Do someone has any solution for this?
    Thanks,
    Sumith

    As I recall, the icons are actually stored in a file on each PC so some users may have a corrupted or out-of-date file with the icons.  You can look for posting on "how to add an icon" to see a discussion on this topic.
    I found some useful info at:
    Create and Add Icons to table ICON?
    Message was edited by: Charles Folwell

  • How to display image and data in module pool screen?

    Hi,
    I want to display image and relevant data besides the image in module pool screen, I am using docking container to display the image.
    Actually I am able to display image or data any one but not both.
    one more thing I want to display multiple images and their data.
    Please suggest some one if you have any idea.
    Regards,
    Dileep.

    You can try below way, I have used in report.
    DATA: gc_docking              TYPE REF TO cl_gui_docking_container, "#EC NEEDED  "Docking Container
           gc_split                 TYPE REF TO cl_gui_easy_splitter_container, "#EC NEEDED  "Splitter
           gc_top_container         TYPE REF TO cl_gui_container, "#EC NEEDED  "Top Container
           gc_bottom_container      TYPE REF TO cl_gui_container, "#EC NEEDED  "Bottom Container
          gc_document              TYPE REF TO cl_dd_document, "#EC NEEDED  "Document
           gc_events                TYPE REF TO lcl_event_class, "#EC NEEDED  " Local Event Class
           gc_grid                  TYPE REF TO cl_gui_alv_grid, "#EC NEEDED  " ALV Class
    " Creating Docking
    CREATE OBJECT gc_docking
           EXPORTING
             ratio = c_95.
         IF sy-subrc EQ 0.
    * Splitting the Docking container
           CREATE OBJECT gc_split
             EXPORTING
               parent        = gc_docking
               sash_position = c_10 "Position of Splitter Bar (in Percent)
               with_border   = c_1. "With Border = 1 Without Border = 0
         ENDIF.
    *   Placing the containers in the splitter
         gc_top_container = gc_split->top_left_container .
         gc_bottom_container = gc_split->bottom_right_container .
    *   Creating Grid
         CREATE OBJECT gc_grid
           EXPORTING
             i_parent = gc_bottom_container.
       ELSE.
    * Background job handling
         CREATE OBJECT gc_grid
           EXPORTING
             i_parent = gc_docking.
       ENDIF.
    *   Creating the document
       CREATE OBJECT gc_document
         EXPORTING
           style = 'ALV_GRID'.
    Regards,
    Sameer

  • How to insert tabstrip control in module pool screen painter

    Hi all!
    plz tell e how to use tabstrip control in module pool screen painter.Also plz give me an example program using tabstrip control.

    To insert tabstrip just open layout of screen and press on the tabstrip button there .
    Use this souce code further to activate it .
    CONTROLS tabstrip TYPE TABSTRIP.
    DATA: okcode TYPE sy-ucomm,
    dynnr TYPE sy-dynnr,
    flag type flag,
    active like tabstrip-activetab .
    call SCREEN 100.
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE USER_COMMAND_0100 INPUT.
    data: lv_okcode type syucomm.
    lv_okcode = okcode.
    clear okcode.
    case lv_okcode.
    WHEN 'TAB1'.
    dynnr = '0110'.
    WHEN 'TAB2'.
    dynnr = '0120'.
    WHEN 'TAB3'.
    dynnr = '0130'.
    WHEN 'TAB4'.
    dynnr = '0140'.
    WHEN 'TAB5'.
    "check authorization, if authorization fails
    flag = 'X'. "set the global flag
    active = 'TAB1'. "store active tab in global variable
    dynnr = '0110'. "set the screen number
    WHEN 'BACK' or 'EXIT'.
    leave program.
    ENDCASE.
    IF lv_okcode(3) = 'TAB'.
    tabstrip-activetab = lv_okcode.
    ENDIF.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'MAIN'.
    SET TITLEBAR 'xxx'.
    IF tabstrip-activetab IS INITIAL OR
    dynnr IS INITIAL.
    tabstrip-activetab = 'TAB1'.
    dynnr = '0110'.
    ENDIF.
    "set the activetab explicilty here
    if flag eq 'X'. "from authorization failure
    tabstrip-activetab = active. "'TAB1'
    clear flag.
    endif.
    ENDMODULE. " STATUS_0100 OUTPUT

  • How to add logo in module pool screen

    Hi Expert,
    I need to display company logo in the module pool screen
    how this can be added ?
    Regards
    Bikas

    Hi,
    create a custom control called 'CUSTOM_CONTROL'
    CONSTANTS: CNTL_TRUE  TYPE I VALUE 1,
          CNTL_FALSE type i value 0.
    data:h_picture       type ref to cl_gui_picture,
         h_pic_container type ref to cl_gui_custom_container.
    data: graphic_url(255),
          graphic_refresh(1),
          g_result like cntl_true.
    data: begin of graphic_table occurs 0,
            line(255) type x,
          end of graphic_table.
    data: graphic_size type i.
    data: g_stxbmaps type STXBITMAPS,
          l_bytecnt  type i,
          l_content   TYPE  standard table of bapiconten initial size 0.
    g_stxbmaps-tdobject = 'GRAPHICS'.
    g_stxbmaps-tdname = 'ENJOY'.
    g_stxbmaps-tdid = 'BMAP'.
    g_stxbmaps-tdbtype = 'BMON'. 
    call function 'SAPSCRIPT_GET_GRAPHIC_BDS'
         exporting
              i_object       = g_stxbmaps-tdobject
              i_name         = g_stxbmaps-tdname
              i_id           = g_stxbmaps-tdid
              i_btype        = g_stxbmaps-tdbtype
         importing
              e_bytecount    = l_bytecnt
         tables
              content        = l_content
         exceptions
              not_found      = 1
              bds_get_failed = 2
              bds_no_content = 3
              others         = 4.
    call function 'SAPSCRIPT_CONVERT_BITMAP'
         exporting
              old_format               = 'BDS'
              new_format               = 'BMP'
              bitmap_file_bytecount_in = l_bytecnt
         importing
              bitmap_file_bytecount  = graphic_size
         tables
              bds_bitmap_file        = l_content
              bitmap_file            = graphic_table
         exceptions
              others                 = 1.
    call function 'DP_CREATE_URL'
         exporting
            type                 = 'image'           
            subtype              = cndp_sap_tab_unknown
            size                 = graphic_size
            lifetime             = cndp_lifetime_transaction
         tables
            data                 = graphic_table
         changing
            url                  = graphic_url
         exceptions
            others               = 4 .
    create object h_pic_container
           exporting container_name =  'CUSTOM_CONTROL'.
    create object h_picture exporting parent = h_pic_container.
    call method h_picture->set_display_mode
         exporting
              display_mode = cl_gui_picture=>display_mode_normal.
    call method h_picture->load_picture_from_url
         exporting url    = graphic_url
         importing result = g_result.
    or you can check the program RSDEMO_CUSTOM_CONTROL
    check link :
    How to insert Image on Screen
    thanks
    Parvathi

Maybe you are looking for