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: 

Ho to link a Select-option for a data element

birendra_chatterjee
Active Participant
0 Kudos

Hi Friends,

I have created a domain with data element, now I want to have a select-option for that domain/data element in a program, with F4 and F1 helps, in it. Is it possible programatically.

Thanks and Regards,

Birendra Chatterjee

7 REPLIES 7

Former Member

Hi Birendra...

you can declare variable for that data element tn the program and then you can have a select option . i mean.....

if you have a date element ytest in your data dictionary then,

see the following code...

<b>data test1 type ytest.

select-options s_test for test1.</b>

Hope it helps you...

Let me know if u have any more doubt...

Reward points if useful......

Suresh.......

Former Member
0 Kudos

Hi birendra,

1. simple

2. Eg for MATNR data element.

3.

report abc.

data : mymatnr type matnr.

select-options : matnr for mymatnr.

regards,

amit m.

Former Member
0 Kudos

Hi,

You need to write the code for that one, <b>At selction screen value request</b> and <b>At selection Help request</b>. here you need to write the code

Regards

Sudheer

0 Kudos

Hi Birendra,

Another thing what you can do is create a search help in se11 and attach it to select-options using

select-options MATCHCODE OBJECT search_help addition.

Regards,

Aravind

former_member673464
Active Contributor
0 Kudos

hi..

You can link a select-option for a data element using either seearch help or using fixed values .You can also give help by using function modules at At selction screen value request and At selection Help request.

Function modules are :

F4IF_FIELD_VALUE_REQUEST

Calls the input help of the ABAP Dictionary dynamically. You can pass the component names of a structure or database table of the ABAP Dictionary to the function module in the import parameters TABNAME and FIELDNAME. The function module starts the ABAP Dictionary input help for this component. All of the relevant screen fields are read. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the user’s selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.

F4IF_INT_TABLE_VALUE_REQUEST

This function module displays a value list that you created in an ABAP program. The value list is passed to the function module as the table parameter VALUE_TAB. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the user’s selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.

regards,

veeresh

Former Member
0 Kudos

Hi Birendra,

If you r creating a data elemnt w.r.t. to existing domain which is having Values in value range. It will give u F4 for the selected field.

Otherwise you can create search help for that data element & use it.

Thanks

Sandeep

Reward if helpful

Former Member
0 Kudos

Hi Birendra,

Say, you have created 'zdataelm' and it is related to field 'dataelm'.the filed is used in table ztab.

write.............

SELECT-OPTIONS: s_dataelm TYPE ztab-dataelm.

OR

PARAMETERS: p_dataelm TYPE ztab-dataelm.

You will get the F4 help too.

Reward is useful,

Regards,

Tanmay