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 box in screen painter!!!!

Former Member
0 Likes
15,093

Can u please tell me How shall i put drop down list box in screen painter. in that list box i have to add some entries in it user has to select among them.

I ave already searched in net some FM to use and i tried but i not yet got the answer.

Please help me in this regard i need step by step.

Thanks in advance.

Can u please tell me How shall i put drop down list box in screen painter. in that list box i have to add some entries in it user has to select among them.

I ave already searched in net some FM to use and i tried but i not yet got the answer.

Please help me in this regard i need step by step.

Thanks in advance.

12 REPLIES 12
Read only

Former Member
0 Likes
4,686

This message was moderated.

Read only

0 Likes
4,686

Thank you mam, I working on it.

Read only

0 Likes
4,686

Hi,

for creating the list box:

-


in the screen painter you have the option for creating the drop down box.

for populating the values into list box:

-


populate the internal table with the required data.

Under process on value request module,you call the fm 'F4IF_INT_TABLE_VALUE_REQUEST'.

To this function module export the field name and internal table.

Read only

sridhar_meesala
Active Contributor
0 Likes
4,686

Hi,

In the screen painter you select a input/output field and drag it on the screen painter.

Now double click on the field, you will get screen painter attribute window.

There you select list box near drop down.

Thanks,

Sri.

Read only

0 Likes
4,686

Hi

In screen there is list box name

DEPARTMENT when i click it shows the drop down list box.

there it shows all the departments.

FINANCE

COSTING

HR

HR

HR

HR

MATERIALS

MATERIALS

If i select finance and click SAVE button. It inserted into my table corresponding department field.

dept is my field. The field entry i fetched from ZTABLE-DEPT.

After entering new entry it shows

FINANCE

FINANCE

COSTING

HR

HR

HR

HR

MATERIALS

MATERIALS

I want only the list of deparment not the repeated entry. How can i overcome this. May be it basic.

Thanks and regards

arvind

Read only

0 Likes
4,686

what you can do is create an internal table with only field as department.

Now for all entries in your previous internal table copy all corresponding department in this new table.

Now sort this department internal table and delete adjacent duplicates comparing the field.

This table now gives you unique department.

Now you can refer your drop down to this internal table field.

Regards,

Lalit Mohan Gupta.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
4,686

Hi,

Refer the programs:-

DEMO_DYNPRO_DROPDOWN_LISTBOX

DEMO_DROPDOWN_LIST_BOX

Also you can refer:-

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
4,686

HI...

Goto to se51 in ur form painter..

select ur field and double click on it..

In the attributes window...select the listbox in dropdown field.

And Use the below shown FM as per ur requirement---

DATA : BEGIN OF VALUE ,

FRMNM TYPE PINPF-FRMNM,

END OF VALUE .

DATA : VTAB LIKE TABLE OF VALUE ,

VAL LIKE LINE OF VTAB .

CLEAR VTAB .

MOVE 'YES' TO VAL-FRMNM .

APPEND VAL TO VTAB .

CLEAR VAL .

MOVE 'NO' TO VAL-FRMNM .

APPEND VAL TO VTAB .

CLEAR VAL .

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'FRMNM'

  • PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'ZSTORES-MODVATE'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = VTAB

  • FIELD_TAB =

  • RETURN_TAB =

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

Read only

Former Member
0 Likes
4,686

Hi,

In the layout select the listbox option for the field u want to apply the dropdown list box.

In Pbo use the function module VRM_SET_VALUES

for example:

DATA : lt_vrm_values TYPE TABLE OF vrm_value,

ls_vrm_values TYPE vrm_value.

CONSTANTS : lc_field TYPE vrm_id VALUE 'The name given to the dropdown on the layout'.

(select the fields that should be displayed in the dropdown)

select id

desc from table

into itab.

LOOP AT itab INTO wa.

ls_vrm_values-key = wa_id.

ls_vrm_values-text = wa_desc.

APPEND ls_vrm_values TO lt_vrm_values.

CLEAR ls_vrm_values.

AT LAST.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = lc_field

values = lt_vrm_values

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

Thanks & Regards

Read only

0 Likes
4,686

Hi hema thaks for ur response i tried but still.

Kindly spare few minutes,

I have a table called zcrept there fields are SNO (is the unique), department etc, In department field is a drop down list box in screen painter, which i shown above question,

What i need is 1. when execution List box values must comes from master table zdept and after selecting the dept field under run time it has to save in my transaction table ie, zcrept.

I am working this call report for a long time still not yet arrived the solution.

thanks and regards

Read only

Former Member
0 Likes
4,686

TYPES : BEGIN OF TY_ZCS_TAG_CAT,

CATG TYPE ZCS_TAG_CAT-Z_CODE,

Z_DESC TYPE ZCS_TAG_CAT-Z_DESC,

END OF TY_ZCS_TAG_CAT.

DATA : IT_ZCS_TAG_CAT TYPE STANDARD TABLE OF TY_ZCS_TAG_CAT.

in screen I used CATG with length 30 for displaying text.

&----


*& Module CATG_F4_HELP INPUT

&----


  • text

----


MODULE CATG_F4_HELP INPUT.

IF IT_ZCS_TAG_CAT[] IS INITIAL.

SELECT Z_CODE Z_DESC FROM ZCS_TAG_CAT INTO TABLE IT_ZCS_TAG_CAT.

SORT IT_ZCS_TAG_CAT. " BY Z_CODE.

delete adjacent duplicates from IT_ZCS_TAG_CAT comparing z_code.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'CATG'

  • PVALKEY = ' '

  • DYNPPROG = SY-CPROG

  • DYNPNR = SY-DYNNR

  • DYNPROFIELD = 'CATG'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

TABLES

VALUE_TAB = IT_ZCS_TAG_CAT

  • FIELD_TAB =

  • RETURN_TAB =

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

ENDIF.

Read only

Former Member
0 Likes
4,686

TYPES : BEGIN OF TY_ZCS_TAG_CAT,

CATG TYPE ZCS_TAG_CAT-Z_CODE,

Z_DESC TYPE ZCS_TAG_CAT-Z_DESC,

END OF TY_ZCS_TAG_CAT.

DATA : IT_ZCS_TAG_CAT TYPE STANDARD TABLE OF TY_ZCS_TAG_CAT.

in screen I used CATG with length 30 for displaying text,

and my main aim is use the corresponding code of it for further process

then

&----


*& Module CATG_F4_HELP INPUT

&----


  • text

----


MODULE CATG_F4_HELP INPUT.

IF IT_ZCS_TAG_CAT[] IS INITIAL.

SELECT Z_CODE Z_DESC FROM ZCS_TAG_CAT INTO TABLE IT_ZCS_TAG_CAT.

SORT IT_ZCS_TAG_CAT. " BY Z_CODE.

delete adjacent duplicates from IT_ZCS_TAG_CAT comparing z_code.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'CATG'

  • PVALKEY = ' '

  • DYNPPROG = SY-CPROG

  • DYNPNR = SY-DYNNR

  • DYNPROFIELD = 'CATG'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

TABLES

VALUE_TAB = IT_ZCS_TAG_CAT

  • FIELD_TAB =

  • RETURN_TAB =

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

ENDIF.