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

Drop Down list

Former Member
0 Likes
793

Hi.. In a screen i have used a drop down list.

I need to fill it in PBO with one of the fields of a internal table..

I dont know to do that.. Any Guide plz..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
766

Hi,

You may use the function module VRM_SET_VALUES where id is the field name and values are from your itab.

Regards,

Renjith Michael.

7 REPLIES 7
Read only

Former Member
0 Likes
766

HI,

see this link below:

http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm

example:

REPORT demo_dynpro_f4_help_module.

TYPES: BEGIN OF values,

carrid TYPE spfli-carrid,

connid TYPE spfli-connid,

END OF values.

DATA: carrier(3) TYPE c,

connection(4) TYPE c.

DATA: progname TYPE sy-repid,

dynnum TYPE sy-dynnr,

dynpro_values TYPE TABLE OF dynpread,

field_value LIKE LINE OF dynpro_values,

values_tab TYPE TABLE OF values.

CALL SCREEN 100.

MODULE init OUTPUT.

progname = sy-repid.

dynnum = sy-dynnr.

CLEAR: field_value, dynpro_values.

field_value-fieldname = 'CARRIER'.

APPEND field_value TO dynpro_values.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE value_carrier INPUT.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

tabname = 'DEMOF4HELP'

fieldname = 'CARRIER1'

dynpprog = progname

dynpnr = dynnum

dynprofield = 'CARRIER'.

ENDMODULE.

MODULE value_connection INPUT.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = progname

dynumb = dynnum

translate_to_upper = 'X'

TABLES

dynpfields = dynpro_values.

READ TABLE dynpro_values INDEX 1 INTO field_value.

SELECT carrid connid

FROM spfli

INTO CORRESPONDING FIELDS OF TABLE values_tab

WHERE carrid = field_value-fieldvalue.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'CONNID'

dynpprog = progname

dynpnr = dynnum

dynprofield = 'CONNECTION'

value_org = 'S'

TABLES

value_tab = values_tab.

ENDMODULE.

rgds,

bharat.

Read only

0 Likes
766

I have a table control in my screen the I have a dropdown list box.

Now it has to be filled with the indexes of the ITAB. That is if have 4 entries in my ITAB then my listbox should have the value

1

2

3

4

Plz help..

Read only

Former Member
0 Likes
767

Hi,

You may use the function module VRM_SET_VALUES where id is the field name and values are from your itab.

Regards,

Renjith Michael.

Read only

0 Likes
766

Hi,

Check the sample program DEMO_DYNPRO_DROPDOWN_LISTBOX. This uses VRM_SET_VALUES FM for the purpose.

Regards,

Sesh

Read only

0 Likes
766

I have a table control in my screen the I have a dropdown list box.

Now it has to be filled with the indexes of the ITAB. That is if have 4 entries in my ITAB then my listbox should have the value

1

2

3

4

Plz help..

Read only

0 Likes
766
TYPE-POOLS : vrm.

PARAMETERS : p_c(5) TYPE c AS LISTBOX VISIBLE LENGTH 5.

DATA : name1 TYPE vrm_id,
       list1 TYPE vrm_values,
       value1 LIKE LINE OF list1.
DATA : n TYPE i.

AT SELECTION-SCREEN OUTPUT.
  name1 = 'P_C'.

  DO 5 TIMES.
    value1-key = n.
    value1-text = n.
    APPEND value1 TO list1.
    n = n + 1.
  ENDDO.
" in the above case instead of N which is 5. you can take the no of records of the itab.
" describe table itab lines N.
  CALL FUNCTION 'VRM_SET_VALUES'
       EXPORTING
            id     = name1
            values = list1.

Regards

Gopi

Read only

MusAbaper
Active Participant
0 Likes
766

Just to add u a simple idea, try this simple report :

type-pools vrm.

parameters : p_list as listbox visible length 10.

DATA: param TYPE vrm_id,

values TYPE vrm_values,

value LIKE LINE OF values.

AT SELECTION-SCREEN OUTPUT.

param = 'P_list'.

value-key = '1'.

value-text = 'Value 01'.

APPEND value TO values.

value-key = '2'.

value-text = 'Value 02'.

APPEND value TO values.

value-key = '3'.

value-text = 'Value 03'.

APPEND value TO values.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING id = param

values = values.