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

Set Default Values in Listbox with Dialog Programming

Former Member
0 Likes
720

Hi all,

I am stuck with a problem i.e I am working with Dialog Programming Screen

where i have to set default values in some n numbers of Listbox which i have created on Screen.

This default value is needed to be fetched from database table.

I am using single table. Hence no confusion that i have to first fetch data from 1st listbox then corresponding data is fetched into second & so on ..NO NO This is not required.

Simple one screen which will update a table in database, where some fields on the screen needs to be default set as per tables domain default values set while table creation.

Please help me out in this.

Thanks & Regards,

Sandhya.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
443

Please search SDN, before you post a new forum from next time... any ways just follow the below code..

u need to use the FM 'VRM_SET_VALUES' to implement list box in module pool. Check the below code. u have to write this code in PBO..

if c = 0.

select land1 landx from t005t into table wi_country.

sort wi_country by land1.

delete adjacent duplicates from wi_country comparing all fields.

loop at wi_country.

wa_ctry-key = wi_country-land1.

wa_ctry-text = wi_country-landx .

append wa_ctry to wi_ctry.

endloop.

call function 'VRM_SET_VALUES'

exporting

id = 'ZCUST_MASTER1-COUNTRY'

values = wi_ctry

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.

c = 1.

endif.

Hope this helps u,

Regards,

Rajesh

1 REPLY 1
Read only

Former Member
0 Likes
444

Please search SDN, before you post a new forum from next time... any ways just follow the below code..

u need to use the FM 'VRM_SET_VALUES' to implement list box in module pool. Check the below code. u have to write this code in PBO..

if c = 0.

select land1 landx from t005t into table wi_country.

sort wi_country by land1.

delete adjacent duplicates from wi_country comparing all fields.

loop at wi_country.

wa_ctry-key = wi_country-land1.

wa_ctry-text = wi_country-landx .

append wa_ctry to wi_ctry.

endloop.

call function 'VRM_SET_VALUES'

exporting

id = 'ZCUST_MASTER1-COUNTRY'

values = wi_ctry

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.

c = 1.

endif.

Hope this helps u,

Regards,

Rajesh