Dropdown list in module pool program

Hi,
I need to display a dropdown list for LFA1-LIFNR in my module pool program.
In the screen painter I have added an Input/Output field with name LFA1-LIFNR and corresponding to the Dropdown option I have selected Listbox. When I execute the program empty dropdown list is coming. It is not taking the values of LIFNR from the table LFA1. Please let me know the solution for this.
Thanks,
Neethu.

Hello Abaper,
You have very well designed the drop-down box that is to be reflected in your program. The next thing for you to do is use any 1 method for populating the values i.e. using the function module F4IF_INT_TABLE_VALUE_REQUEST or VRM values. I prefer to use the the F4IF_INT_TABLE_VALUE_REQUEST as it is easy to use and understand. If you use the following function module then you need to call in a module under the flow logic of the screen i.e. PROCESS ON VALUE REQUEST.
Let me just illustrate you with the syntax -
Module Pool Code
*internal table declaration
TYPES : BEGIN OF ty_lifnr,
                 lifnr TYPE lfa1-lifnr,
END OF ty_lifnr.
DATA : itab_lifnr TYPE STANDARD TABLE OF ty_lifnr.
*Dialog Modules for PBO
*Dialog Module for PAI
MODULE cancel INPUT.
   LEAVE PROGRAM.
*Dialog Module Process on value reuest
MODULE create_dropdownbox INPUT.
   SELECT lifnr
   FROM LFA1
   INTO CORRESPONDING FIELDS OF TABLE itab_lifnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
   EXPORTING
         retfield      = 'LIFNR'
         value_org = 'S'
   TABLES
         value_tab = itab_lifnr
   EXCEPTIONS
ENDMODULE.
Now for the Flow Logic -
PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
   MODULE cancel AT EXIT-COMMAND.
   MODULE user_command_0100.
PROCESS ON VALUE REQUEST.
   FIELD lfa1-lifnr MODULE create_dropdownbox.
Hope this helps ! Let me know if any other doubts arises.

Similar Messages

  • How to use dropdown list in module pool

    Hi guys,
    I have provided  a dropdown list in my  screen in my module pool program.
    How should I insert values in the dropdown list.
    Regards
    Mac

    HI,
    Check this code.
    PROCESS AFTER INPUT
    PROCESS ON VALUE-REQUEST.
      FIELD ZDEPT-DEPTNO MODULE create_dropdown.
    *** DOUBLE CLICK ON CREATE_DROPDOWN
    MODULE create_dropdown INPUT.
      SELECT EMPNAME
                    DEPTNAME
                    FROM YDEPT
                    INTO CORRESPONDING FIELDS OF TABLE itab_details.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'DEPTNO'
                value_org       = 'S'
           TABLES
                value_tab       = itab_details
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc  0.
      ENDIF.
    ENDMODULE.
    HERE IN PAI DOUBLE CLICK THE MODULE THEN WRITE THE ABOVE CODE IT SHOULD WORK.
    YDEPT IS THE TABLE I CREATED TO STORE DEPARTMENT NUMBERS.
    ZDEPT IS THE STRUCTURE OF THE TABLE.
    IF YOU ARE STILL UNCLEAR
    PLEASE CHECK
    'DEMO_DROPDOWN_LIST_BOX' PROGRAM IN SE51 AND SCREEN NUMBER IS 100
    Regards and Best wishes.

  • Drop down list in module pool program.

    Hi Experts,
                    Can any one tell me how to maintain values in dropdown list on screen of  module pool.
    I have ' z' module pool program in which i have screen for z tcode and i want to add new values in drop down list . please tell me where to do modification.
    Regards,
    Rahul S

    Hi,
    Check the below code.
    TYPE-POOLS: VRM.
    DATA:V_NUM TYPE I.
    DATA:NAME TYPE VRM_ID,
    LIST TYPE VRM_VALUES,
    VALUE LIKE LINE OF LIST.
    DATA:I_WORKPATTERN LIKE ZWORKPAT OCCURS 0 WITH HEADER LINE.
    DATA:ZPATTXT(60).
    MODULE WORKPATTERN_LISTBOX OUTPUT.
    NAME = 'P9434-ZWORKPATTERN'.  --> Screen Field
    IF V_NUM IS INITIAL.
    CLEAR I_WORKPATTERN.
    REFRESH I_WORKPATTERN.
    SELECT *
    FROM ZWORKPAT   --> List box contents from the z table
    INTO TABLE I_WORKPATTERN.
    IF NOT I_WORKPATTERN[] IS INITIAL.
    LOOP AT I_WORKPATTERN.
    VALUE-KEY = I_WORKPATTERN-ZWORKPATTERN.
    VALUE-TEXT = I_WORKPATTERN-ZWORKPATTERN.
    APPEND VALUE TO LIST.
    ENDLOOP.
    ENDIF.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
    ID = NAME
    VALUES = LIST
    EXCEPTIONS
    ID_ILLEGAL_NAME = 1
    OTHERS = 2.
    IF SY-SUBRC 0.
    CLEAR SY-SUBRC.
    ENDIF.
    V_NUM = V_NUM + 1.
    ENDIF.
    Regards,
    Kumar Bandanadham
    Edited by: Velangini Showry Maria Kumar Bandanadham on May 26, 2009 3:53 PM

  • Alv list in module pool programming

    hai abapers ,
    i developed an alv grid display in module pool programming,my prbm is when i click on list button in my prm its displaying list n coming back to main screen if again i click on list button list is diplaying twice like this so on,how many i click on list button its displaying each that many times
    thank u

    It seems you have coded to create the field catalog also at the click of list display.Field catalog should be created only once.When you click on list display, it should only call the REUSE... fm but not the creation of fieldcatalog also.This will result in creation of a new fieldcatalog in addition to the exixting one.

  • Display the list in module pool program

    Hi All,
    I want to display the list of material like report after some user command in module pool.
    How can I achive the same.
    Regards
    Sagar

    Hi,
       If you want to display in ALV, you can use REUSE_ALV_GRID_DISPLAY FM also, which will call standard program from module pool and will display the list.
      If you use module pool, it is not mandatory that you have to use only OO ALV.
      You can create list output also from module pool. For that in user command you can write like
      IF sy-ucomm = '.....'.
         leave to list processing and return.
         write :/ '..............'.
    Endif.
    Thanks and regards,
    Venkat

  • How to populate list box in module pool program

    How to populate list box in module pool program.
    Please give me reply as soon as posible
    regards,
    Venu.

    hi,
    go thrugh the folling code .
    TABLES sdyn_conn.
    DATA   ok_code TYPE sy-ucomm.
    Global data
    TYPES: BEGIN OF type_carrid,
             carrid type spfli-carrid,
             carrname type scarr-carrname,
           END OF type_carrid.
    DATA itab_carrid TYPE STANDARD TABLE OF type_carrid.
    *& Processing Blocks called by the Runtime Environment                 *
    Event Block START-OF-SELECTION
    START-OF-SELECTION.
      CALL SCREEN 100.
    Dialog Module PBO
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    Dialog Modules PAI
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'SELECTED'.
          MESSAGE i888(sabapdocu) WITH sdyn_conn-carrid.
      ENDCASE.
    ENDMODULE.
    Dialog Module POV
    MODULE create_dropdown_box INPUT.
      SELECT carrid carrname
                    FROM scarr
                    INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'CARRID'
                value_org       = 'S'
           TABLES
                value_tab       = itab_carrid
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc <> 0.
      ENDIF.
    ENDMODULE.
    the following code should be included in flow logic of screen
    process on value-request.
      field scarr-carrname  module create_dropdown_box.
    in module pool select list box.
    hope it is useful.
    regards,
    sreelakshmi.

  • List Box Problem In MODULE POOL PROGRAM(EDIT MODE)

    I Have Developed A MODULE POOL PROGRAM ,
    It Basically Consists Of   CREATE  EDIT and DISPLAY Modes.
    CREATE MODE:
    When I am Creating For Example FORM NO 1,it is having Fields With drop down list box with values
    A,B and C. if I Choose A then That form will Get Created With A value and Form 1 will be created.
    EDIT MODE:
    The same form If u want to edit In EDIT Mode ,it is displaying value A and it Showing the list box in the fillowing Manner.A,B,C,and A.(This is what the problem I am Facing Know).It Is Displaying the value two times.How to Avoid this ,PLs Help me in this regard.
    Thaks & Regards,
    Anuradha.

    Where ever you are populating the List Box, write a REFRESH statement just before that.
    Means Refresh the old content and add new content

  • Function module / table which lists screen numbers in module pool program

    Hi everyone,
    I wish to make a list of all screen numbers used in my module pool program Is there any FM / table which maps module pool program name with all the screens used in it?
    For example, if my module pool is SAPMZPROG and it has screens 9001, 9002 and 9003, then I want to have a report as follows:
    Input to the report (selection screen): SAPMZPROG
    Output:
    9001
    9002
    9003
    Thanks,
    Shailesh

    Hello
    Try tables D020S, D020T

  • How to create a ListBox in module pool program in 3.1i system ?

    Hi All,
    How to create a ListBox of type module pool program in 3.1i system ?
    when i tried creating, the listbox option is disabled.
    Thanks in advance.
    Edited by: gulab zehra on Aug 20, 2009 1:26 PM

    Hi,
    please go through this...
    LIST BOX                    
          Drop down list box can be created in a dialog screen(SE51) as well as selection screen.
          In screen painter to create a input/output field into list box we use  'L" as a value for dropdown attribute for the i/o field.  In screen painter to determine the type of method that will be used to fill the value list we use the attribute value list. If it is blank, the value list will be filled by the first column of the input help assigned to the screen field. This input help can be defined in the ABAP Dictionary, on screen using SELECT,VALUES screen statements or in event POV (PROCESS ON VALUE-REQUEST ) and the input help that will be passed to the field should consists of 2 columns ,the key column is filled automatically by the system. SAP recommends value list field should be blank.
    or
    The value  can be 'A' meaning that the value list will be filled in the event PBO(PROCESS BEFORE OUTPUT) or before the screen is displayed.In this method we use function module VRM_SET_VALUES to fill the values and pass it to the i/o field. If a function code is attached to the list box the selection of a value triggers a PAI otherwise PAI will not trigger.  LIST BOX in SELECTION SCREEN
        List Box is created in selection screen using PARAMETERS statement with
    AS LISTBOX addition other attributes like VISIBLE LENGTH (width of listbox) can be specified with the declaration. PARAMETERS name AS LISTBOX VISIBLE LENGTH n.
       The function module VRM_SET_VALUES is used to fill the value list associated with a List Box .This FM uses types which are declared in type group VRM. So we should declare TYPE-POOLS VRM before using this FM.
    Some important types declared in the VRM type group are
    VRM_ID
       It refers to the name of the input/output field associated with list box
    VRM_VALUES
      It refers to the internal table consisting of two fields TEXT(80C) and KEY(40)C
    that will be used to create the list values.
    CALL FUNCTION  'VRM_SET_VALUES'
      EXPORTING
          ID                  = name of screen element, it is of TYPE VRM_ID
          VALUES      = internal table containing values, of TYPE VRM_VALUES
    Thanks
    Ashu Singh

  • How to validate the field values in module pool program?

    Hi Guys
         I am working with module pool programming.
         Here I want to validate the fields like below.
         with out filling all the fields if I click SAVE option it has to show a message that all fields has to be filled.  This can be done by checking all the fields individually.
         I think it can be done through <b>LOOP AT SCREEN ......ENDLOOP</b>. sequence.
         If it is possible, can anyone help me?

    You need to write the Module in between the CHAIN and ENDCHAIN statment in SE51
    If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
    CHAIN.
    FIELD: <f1>, <f 2>,...
    MODULE <mod1>.
    FIELD: <g1>, <g 2>,...
    MODULE <mod2>.
    ENDCHAIN.
    all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.
    Look at the DEMO program DEMO_DYNPRO_FIELD_CHAIN.
    ashish

  • Runtime errors in module pool programming

    HI all,
    I have done a module pool program for invoice tracking level wise.
    I am encountering a runtime error, LIST_TOO_MANY_LPROS, while execution ie., for two and more than two updations of the database.
    The error analysis says that "At present, the maximum permitted number of nested screen levels is restricted to 50".
    Short Text :- "No further list processing possible".
    Can anyone please come out with a solution for this problem.
    regards
    samarendra.
    Edited by: samarendra penugonda on Nov 5, 2008 5:03 AM

    Hi
    U should replace the comand CALL SCREEN with LEAVE TO SCREEN.
    The command CALL SCREEN create an internal mode to link the calling screen to called screen automatically: in this way when it needs to back to calling screen it doesn't need to specify the screen number but only to use:
    - LEAVE TO SCREEN 0.
    or
    - SET SCREEN 0. LEAVE SCREEN.
    Now if you use  LEAVE TO SCREEN, u need to indicate the screen when it needs to back to calling screen:
    - Go from 100 to 200
    LEAVE TO SCREEN 200. (Instead of CALL SCREEN 200)
    - Back to 100.
    LEAVE TO SCREEN 100. (Instead of LEAVE TO SCREEN 0)
    Max

  • Select option in module pool program

    Hi,
    I have develop a module pool program. In one of the screen i need select option. so do any one have idea or approach for it.
    Thanks in advance.

    Hi,
    try the following code
    tables : mard.
    data : ok_code_100 type sy-ucomm.
    selection-screen begin of screen 1010 as subscreen.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_werks for mard-werks,
    s_lgort for mard-lgort.
    parameters : p_var like disvariant-variant.
    parameter: p_rb1 radiobutton group rd1 default 'X', " list
    p_rb2 radiobutton group rd1. " grid
    selection-screen end of block b1.
    selection-screen end of screen 1010.
    start-of-selection.
    CALL SCREEN 100.
    *& Module STATUS_0100 OUTPUT
    text
    module status_0100 output.
    set pf-status 'Z11_SUBMIT'.
    set titlebar 'CALL'.
    endmodule. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    module user_command_0100 input.
    case ok_code_100.
    when 'EXIT'.
    leave program.
    when 'SUBM'.
    submit z11_ap_alv_mat using
    selection-screen '1000'
    with s_plant in s_werks
    with s_stor in s_lgort
    with p_var = p_var
    with p_rb_01 = p_rb1
    with p_rb_02 = p_rb2
    and return.
    endcase.
    endmodule. " USER_COMMAND_0100 INPUT
    here u have to design a subscreen area SUB_1010 in the screen painter, there is a option given there for that.
    and also in the flow logic of screen 0100 you have to call the subscreen SUB_1010 both in PBO and PAI like :
    process before output.
    module status_0100.
    call subscreen sub_1010 including sy-repid '1010'.
    process after input.
    call subscreen sub_1010.
    module user_command_0100.
    reward if helpful

  • Select-options in module pool programming

    hi,
       I need to have four fields as part of my layout that are select-options fields with multiple values entry options. Since layout doesnt have 'select-options" functionality, i defined it from the module pool program, ie: I wrote a  selection screen in the PBO module. The problem is if i make any changes to the code, the layout changes back to the previuos format.
    Is there any way in which i can combine selection-screen logic with my layout.
    Thanks,
    Sruthy

    HI
    GOOD
    Selection Screen Version
    Only for Executable Programs
    If you do not specify a selection screen version, the system automatically creates a selection screen based on the selection criteria of the logical database and the parameters and select-options statements in the program.
    If you want to use a different selection screen of the logical database, enter a number in this field. The number must be smaller than 1000 and correspond to an additional selection screen of the logical database. The possible values help displays a list of available selection screens. You can also look in the selection include of the logical database (program DBxxxSEL, where xxx is the name of the logical database).
    Tomislav
    1. In the top include define the selection screen with
    selection-screen begin of screen 9250 as subscreen.
    SELECT-OPTIONS analyt FOR ztv_cc02-zd_mumla .
    selection-screen end of screen 9250.
    2. Using the screen painter create a subscreen area in
    the main screen where you want to have this.
    3. Then, in the screen flow logic code as follows:
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_1000. etc
    call subscreen SUB1 including 'PROGRAM NAME' '9250'.
    PROCESS AFTER INPUT.
    module exit at exit-command. etc.
    call subscreen SUB1.
    THANKS
    MRUTYUN

  • HOw to find Report program associated module pool program?

    HOw to find Report program associated module pool program?
    I.e
    Me21n is the tcode.I want to find screens related to this tcode.
    Associated report program is RM_MEPO_GUI.(It has no screens hence it is a report program).
    (if module program is attached to tcode,i can easily find entries in d020s)
    Here  report program is calling a module pool program SAPLMEGUI(Has screens).
    If i give the Tcode Me21n,i want to list out all the screens of it..
    Can u give any suggestion....

    Hi Sampath.
    Manually i can see it (by seeing in system-status)..
    programmatically i want to know..
    for ex:if u take  Tcode:Va01
    we can get program (dialog)  and tcode in Tstc table .
    If we know the program name(dialog), we can find program and screens in d020s table.
    Va01 is atatched to a module pool program..No problem to find screens..
    In case of me21n,
    It is atatched to report program(calling module pool program)..
    Here i could not be able to get the screens ..
    I think u undrstood my problem..

  • Module pool programming in ECC 6.0 version

    Hi All,
                   Any  one can help me how to work on module pool progrmming in 6.0 version,it was completely different to 4.7 version, plz send me some documentation regarding the module pool programming  to my mail-id  [email protected]

    hi,
    May be you can search the documentation from this link.
    just select ecc 6 from the dropdown menu at the bottom of the page.
    http://help.sap.com/search/sap_trex.jsp
    Hope this is helpful, Do reward.

Maybe you are looking for

  • ITunes Makes Me Log in Every Time I Open It

    iTunes v. 12.0.1.26 and Yosemite updates recently installed. 2012 27" iMac iTunes makes me log in every time I open it. I thought the problem was fixed in THIS THREAD and it was a very helpful set of instructions by Linc but the problem keeps recurri

  • Help w/Photoshop Elements 6

    I was working with Elements 6 and took the image to 200% [to get a closer look at something], by typing in 200% in the lower left-hand corner of the APS window.  This has given the photo file a huge border around the image and no matter how many time

  • FCP X transcoding Sony HDR-FX7 (1080i) to NTSC 720 x 480. Results are not pretty.

    Help, please? I shot some interview footage for my student documentary film with a Sony HDR-FX7 (1080i). FCP X transcodes it to NTSC 720 x 480 on import and it looks awful. Have now learned the difference between interlaced and progressive!. The film

  • Types of Mapping XI Support

    Hi All, Could you pleasae tell me the defination of the followings terms  :- <b> 1. Structure Mapping 2. Node mapping 3. Value Mapping 4. Functional Mapping</b> Which one is/are not supported by XI ? I think 'Node Mapping' only ?? If you anyone have

  • How to Deploy Forms on web and Run report in Web browser

    Hi all, I am wondering how to run forms from the web and run report on web .. can u pl. brief me out and tell any source if i can reach and study...