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: 

need help on drop down list

Former Member
0 Kudos

Iam trying to create the drop down list. Well, I got some programs, creating these lists for both parameter and ranges on the selection screen.

What the user wants is when the selection screen is loaded, he wants to select from the list OR ENTER ANY DATA WHICH IS NOT THERE IN THE LIST. To be able enter any data other than what is there in the list is not working for me.

itz urgent plz

1 ACCEPTED SOLUTION

Former Member
0 Kudos

if u use a list for a parameter u can't enter any other data... instead try giving F4 functionality to the parameter and at the same time user can specify other value which is not present in F4 functionality...

7 REPLIES 7

Former Member
0 Kudos

if u use a list for a parameter u can't enter any other data... instead try giving F4 functionality to the parameter and at the same time user can specify other value which is not present in F4 functionality...

Former Member
0 Kudos

Hi

See the sample code and do accordingly

See the following ex:

TYPES: BEGIN OF TY_MBLNR,

MBLNR LIKE MKPF-MBLNR,

END OF TY_MBLNR.

DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.

data: it_ret like ddshretval occurs 0 with header line.

At selection-screen on value-request for s_mat-low.

Select MBLNR from mkpf into table it_mblnr.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'MBLNR'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = IT_MBLNR

  • FIELD_TAB =

RETURN_TAB = IT_RET

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 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.

IF SY-SUBRC = 0.

read table it_ret index 1.

move it_ret-fieldval to S_mat-low.

ENDIF.

Go through the test program.

REPORT Ztest_HELP .

TABLES : MARA.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS : P_MATNR(10) TYPE C.

SELECTION-SCREEN END OF BLOCK B1.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR TYPE MATNR,

END OF ITAB.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

SELECT MATNR

FROM MARA

INTO TABLE ITAB

UP TO 10 ROWS.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'MATERIAL NUMBER'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'P_MATNR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

<b>Reward points for useful Answers</b>

Regards

Anji

0 Kudos

hi anji reddy,

no they want it to be drill down only they r say it can be plz try

could u try for better answer plz

0 Kudos

Hi

Do you want values in a list box

try with the fun module VRM_SET_VALUES

see the sample code

Input : p_char = 'J'.

Press: enter

List Box of Month = January, June , July.

REPORT ZLIST_VALUES.

TYPE-POOLS vrm.

tables:

spfli.

parameters: p_char type c.

parameters:

p_month(12) as listbox visible length 20,

p_year as listbox visible length 20 .

DATA:

t_table TYPE STANDARD TABLE OF vrm_value,

t_table1 TYPE STANDARD TABLE OF vrm_value,

vrm_values1 LIKE LINE OF t_table.

DATA:

t_year TYPE STANDARD TABLE OF vrm_value.

data: w_year(4) type n value '2000'.

*****************

at selection-screen output.

vrm_values1-key = 'a'.

vrm_values1-text = 'January'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = 'p'.

vrm_values1-text = 'February'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = 'q'.

vrm_values1-text = 'March'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = 'r'.

vrm_values1-text = 'April'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = 's'.

vrm_values1-text = 'May'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = 't'.

vrm_values1-text = 'June'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = 'u'.

vrm_values1-text = 'July'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = 'v'.

vrm_values1-text = 'August'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = 'w'.

vrm_values1-text = 'September'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = 'x'.

vrm_values1-text = 'October'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = 'y'.

vrm_values1-text = 'November'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = 'z'.

vrm_values1-text = 'December'.

APPEND vrm_values1 TO t_table.

t_table1[] = t_table.

delete t_table1 where text+0(1) <> p_char.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'p_month'

values = t_table1

EXCEPTIONS

ID_ILLEGAL_NAME = 1

OTHERS = 2.

do 10 times.

add 1 to w_year.

vrm_values1-key = sy-index.

vrm_values1-text = w_year.

APPEND vrm_values1 TO t_year.

enddo.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'p_year'

values = t_year

EXCEPTIONS

ID_ILLEGAL_NAME = 1

OTHERS = 2.

start-of-selection.

write: p_month.

<b>Reward points for useful Answers</b>

Regards

Anji

0 Kudos

its not like that i should be able to enter my values beside the values in the list

Former Member
0 Kudos

Hello

Is not possible in abap to create a dropdown list. You have to create a matchcode instead.

To do it there are many ways.

On the selection screen on your parameter (that will be the dropdown) create a Z data element and add a domain for it.

When executing the report you have use the match code and you will get the values written on the data element.

Hope this helps,

dont forget to reward!!

Gabriel