Application Development and Automation 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: 
Read only

drill down box

Former Member
0 Likes
697

hi all,

I need to give a list box for the user to select the month. I have entered the below code in the parameters section.

p_month(10) OBLIGATORY as listbox VISIBLE LENGTH 12 default 'January'

where do i enter the remaining values?

thanks

nayan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
672

Hi,

Below program will satisfy your requirement.

REPORT ZKK_LIST.

TYPE-POOLS : vrm. "Value Request Manager

PARAMETERS: p_test AS LISTBOX VISIBLE LENGTH 12 OBLIGATORY.

INITIALIZATION.

PERFORM f4_value_request.

START-OF-SELECTION.

WRITE P_TEST.

&----


*& Form f4_value_request

&----


  • text

----


FORM f4_value_request.

DATA: l_name TYPE vrm_id,

li_list TYPE vrm_values,

l_value LIKE LINE OF li_list.

l_value-key = '1'.

l_value-text = 'January'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '2'.

l_value-text = 'February'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '3'.

l_value-text = 'March'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '4'.

l_value-text = 'April'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '5'.

l_value-text = 'May'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '6'.

l_value-text = 'June'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '7'.

l_value-text = 'July'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '8'.

l_value-text = 'August'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '9'.

l_value-text = 'September'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '10'.

l_value-text = 'October'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '11'.

l_value-text = 'November'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '12'.

l_value-text = 'December'.

APPEND l_value TO li_list.

CLEAR l_value.

l_name = 'P_TEST'.

p_test = '1'. "this is to set the default value of the list box.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = l_name

values = li_list

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " f4_value_request

5 REPLIES 5
Read only

Former Member
0 Likes
672

check the d/b table<b> T247</b>, fetch all the months into an internal table and use the FM F4IF_INT_TABLE_VALUE_REQUEST to display the months in a list box

Message was edited by:

Rajesh

Read only

Former Member
0 Likes
672

refer prg rsdemo_dropdown_listbox

Read only

0 Likes
672

I saw the program. Could not find anything substancial...

Read only

Former Member
0 Likes
673

Hi,

Below program will satisfy your requirement.

REPORT ZKK_LIST.

TYPE-POOLS : vrm. "Value Request Manager

PARAMETERS: p_test AS LISTBOX VISIBLE LENGTH 12 OBLIGATORY.

INITIALIZATION.

PERFORM f4_value_request.

START-OF-SELECTION.

WRITE P_TEST.

&----


*& Form f4_value_request

&----


  • text

----


FORM f4_value_request.

DATA: l_name TYPE vrm_id,

li_list TYPE vrm_values,

l_value LIKE LINE OF li_list.

l_value-key = '1'.

l_value-text = 'January'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '2'.

l_value-text = 'February'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '3'.

l_value-text = 'March'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '4'.

l_value-text = 'April'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '5'.

l_value-text = 'May'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '6'.

l_value-text = 'June'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '7'.

l_value-text = 'July'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '8'.

l_value-text = 'August'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '9'.

l_value-text = 'September'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '10'.

l_value-text = 'October'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '11'.

l_value-text = 'November'.

APPEND l_value TO li_list.

CLEAR l_value.

l_value-key = '12'.

l_value-text = 'December'.

APPEND l_value TO li_list.

CLEAR l_value.

l_name = 'P_TEST'.

p_test = '1'. "this is to set the default value of the list box.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = l_name

values = li_list

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " f4_value_request

Read only

0 Likes
672

hey thanks buddy for the program.that solved my problem.

im giving u full points.thanks