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: 

Prefill "Restrict value range" ?

Former Member
0 Kudos

Hello. My first posting, but after searching, I can't find any threads discussing this subject.

So:

My code is like this:

select-options: %%hyperi for ska1-saknr,

%%saknr for ska1-saknr.

When the users press F4 on these fields, they get the same search-help. I want to prefill this search-help so that correct "sub-sheet" is selected, and values are correct.

Is this possible?

I've tried to use

at selection-screen on value-request for %%hyperi-low

and so on..

after filling an internal table, but the funcionality isn't good enough I feel.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Helge,

It is not very clear whether you just want the user to get a different "tab" of the search help for each of these fields, or whether you (also) want to fill your own values into the search-help. I shall try to explain to you both these cases.

Case 1 : You just want to display a different tab for the user for each of these fields, when he presses F4.

The search help SAKO, which is being used in this case, has around 8 different tabs from which the user can select a value. This search-help is therefore called a "Collective search-help", becauses you are providing the suer with several ways of obtaining the input help through a single search-help.

Now, let us assume that you want the user to be able to select from "G/L account number in company code" for the first field. That is to say, when he presses F4 for the first field, he should be able to see only that tab of the actual search-help.

In your program, you will ahve to code something like this:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_HYPERI-LOW.

call function 'F4IF_FIELD_VALUE_REQUEST'

exporting

tabname = 'SKA1'

fieldname = 'SAKNR'

SEARCHHELP = 'GL_ACCT_CA_NO'

tables

return_tab = ITAB_RETVAL.

IF ITAB_RETVAL[] IS NOT INITIAL.

READ TABLE ITAB_RETVAL INDEX 1.

S_HYPERI-LOW = ITAB-RETVAL-FIELDVAL.

ENDIF.

Here ITAB_RETVAL is the return table which contains the entry the user has selected. It is of the type DDSHRETVAL.

2. If you want to use your own values in the F4 help of the user, it is generally recommended to use the search-help exit. However, you can always programmatically control that,too. The function Module F4IF_INT_TABLE_VALUE_REQUEST can be used for the same. Please go through the documentation for this Function Module - SAP has explained it better than I ever can :-).

In general, you should always try to search for the Function Modules beginning with F4IF* for any information on programming the input-help.

Hope this information has been useful.

Regards,

Anand Mandalika.

P.S: In case you did not get how I obtained the search-help GL_ACCT_CA_NO for use in the above example, just go to SE11, and display the search-help SAKO. you will find a tab called "Included search helps". Just dig a little deeper into it and at the end of it, you will understand how several elementary search-helps make up the different tabs of the collective search help.

5 REPLIES 5

Former Member
0 Kudos

Hi Helge,

Search help SAKO is used for diplaying the values. I think the best way to go forward is using the search help exit. In the standard system exit GL_ACCT_F4_EXIT_SET_GET is used which you can just copy to have your own logic.

Regards,

John.

Former Member
0 Kudos

Hi Helge,

It is not very clear whether you just want the user to get a different "tab" of the search help for each of these fields, or whether you (also) want to fill your own values into the search-help. I shall try to explain to you both these cases.

Case 1 : You just want to display a different tab for the user for each of these fields, when he presses F4.

The search help SAKO, which is being used in this case, has around 8 different tabs from which the user can select a value. This search-help is therefore called a "Collective search-help", becauses you are providing the suer with several ways of obtaining the input help through a single search-help.

Now, let us assume that you want the user to be able to select from "G/L account number in company code" for the first field. That is to say, when he presses F4 for the first field, he should be able to see only that tab of the actual search-help.

In your program, you will ahve to code something like this:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_HYPERI-LOW.

call function 'F4IF_FIELD_VALUE_REQUEST'

exporting

tabname = 'SKA1'

fieldname = 'SAKNR'

SEARCHHELP = 'GL_ACCT_CA_NO'

tables

return_tab = ITAB_RETVAL.

IF ITAB_RETVAL[] IS NOT INITIAL.

READ TABLE ITAB_RETVAL INDEX 1.

S_HYPERI-LOW = ITAB-RETVAL-FIELDVAL.

ENDIF.

Here ITAB_RETVAL is the return table which contains the entry the user has selected. It is of the type DDSHRETVAL.

2. If you want to use your own values in the F4 help of the user, it is generally recommended to use the search-help exit. However, you can always programmatically control that,too. The function Module F4IF_INT_TABLE_VALUE_REQUEST can be used for the same. Please go through the documentation for this Function Module - SAP has explained it better than I ever can :-).

In general, you should always try to search for the Function Modules beginning with F4IF* for any information on programming the input-help.

Hope this information has been useful.

Regards,

Anand Mandalika.

P.S: In case you did not get how I obtained the search-help GL_ACCT_CA_NO for use in the above example, just go to SE11, and display the search-help SAKO. you will find a tab called "Included search helps". Just dig a little deeper into it and at the end of it, you will understand how several elementary search-helps make up the different tabs of the collective search help.

Former Member
0 Kudos

Your answers were quick and correct. I got what I needed.

Thank you!

0 Kudos

If that's the case, could you reward come points ?

Regards,

Anand Mandalika

0 Kudos

Well, of course! Sorry for that. A bit newbie here you see.