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

Dropdown list in module pool program

Former Member
0 Kudos

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.

12 REPLIES 12

Sandra_Rossi
Active Contributor
0 Kudos

see demo programs in ABAPDOCU transaction. For example, use DEMO_DROPDOWN_LIST_BOX program.

Former Member
0 Kudos

HI,

CLICK AN THE FIELD ATTRIBUTES AND CLICK THE FROM DICTIONARY CHECK BOX IN DICTIONAR TAB OF THE FIELD AND TRY.

Former Member
0 Kudos

Hi,

use this FM in PBO F4IF_INT_TABLE_VALUE_REQUEST and give internal table name in which you select the values you want to display in dropdown list from the database table. Give the fieldname and value org as 'S'.

Thanks.

Aswath.

Former Member
0 Kudos

Hi,

If you need to display standard f4 help, you have to add the field from the dictionary table.

Harsh_Bansal
Contributor

Hi,

Use FM - vrm_set_values for populating listbox values.

Regards,

Harsh Bansal

former_member230486
Contributor
0 Kudos

Hi,

You have to use function module F4IF_INT_TABLE_VALUE_REQUEST and pass the return field,value return(value_org as 'S') and table interface parameters.

former_member1245113
Active Contributor
0 Kudos

Hmmm--> I didnt check the Date -->

davis_raja
Active Participant
0 Kudos

Use TYPE-POOLS : vrm to set the values for the DropDown list in PBOModule..

0 Kudos

Hi everyone,

please see the posting date of the question before posting.

thanks.

0 Kudos

Hi All,

is it possible to add the default value into drop down box?

i mean when user executed the program, value will display in the first line of the drop down box.

We don't need to press the button to list out the value in the drop down box.

Regards,

Luke

Harsh_Bansal
Contributor
0 Kudos

Hi,

In PBO, simply assign default value to the dropdown variable.

Let's say variable name is lb_value.

Then do this -

lb_value = 'Australia'.

Remember, values in Listbox are case-sensitive. So assign exactly same value as in table displaying drop down values.

Only then it will be reflected in the output.

Regards,

Harsh Bansal

Former Member
0 Kudos

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.