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: 

F4IF_FIELD_VALUE_REQUEST

Former Member
0 Kudos

Hi,

I'm looking to retrieve a list of all possible values for a given screen/table and field. I have come across F4IF_FIELD_VALUE_REQUEST which seems to solve most of my problem. The only issue I have is that calling this function module sometimes brings up a dialog that I wish to supress. I can supress the results by setting the SUPPRESS_RECORDLIST parameter but I cannot find a way to supress all dialogs and only return the results in a table.

I'm hoping this is possible.

Thanks in advance,

Charles

11 REPLIES 11

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Here is the sample code for the FM 'F4IF_INT_TABLE_VALUE_REQUEST'.THis will serve your purpose.Kindly reward points by clikcing the star on the left of reply,if it helps.

tables kna1.

data:

begin of t_values occurs 2,

value like kna1-begru,

end of t_values,

t_return like ddshretval occurs 0 with header line.

select-options s_begru for kna1-begru.

at selection-screen on value-request for s_begru-low.

refresh t_values.

t_values = 'PAR*'.

append t_values.

t_values = 'UGG'.

append t_values.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'BEGRU'

value_org = 'S'

tables

value_tab = t_values

return_tab = t_return

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc = 0.

read table t_return index 1.

s_begru-low = t_return-fieldval.

endif.

0 Kudos

Hi,

Instead of appending manually,use select statement to fetch the data from the required table.

Former Member
0 Kudos

HI Charles Evans

Try using function module: F4IF_INT_TABLE_VALUE_REQUEST

This function module also retrieve a list of all possible values for a given screen/table and field.

And you don't need to supress any dialog box.

For Sample code of the same:

GO TO se51.

PROGRAM: DEMO_DROPDOWN_LIST_BOX

SCREEN : 0100

Cheers,

Vijay Raheja

0 Kudos

I may have the wrong end of the stick here but I couldn't get F4IF_INT_TABLE_VALUE_REQUEST to automatically bring back the possible values for the given table and field. Instead, I had to manually populate the VALUE_TAB table with the values that were to be displayed on the subsequent form.

I couldn't find a way to do this automatically nor could i find a way to do this without any dialogs being displayed.

Former Member
0 Kudos

Hi,

I think we have 2 options for list of all possible values.

*************************

1. refresh t_itab.

clear t_return.

select pernr from zfdmr_records into table t_itab.

delete adjacent duplicates from t_itab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'PERNR'

  • PVALKEY = ' '

DYNPPROG = sy-cprog

DYNPNR = sy-dynnr

DYNPROFIELD = 'ZFDMR_RECORDS-PERNR'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

MULTIPLE_CHOICE = ' '

DISPLAY = 'F'

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

TABLES

VALUE_TAB = t_itab

  • FIELD_TAB =

RETURN_TAB = t_return

  • 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 TABLE t_return INDEX 1.

p_s_pernr = t_return-fieldval.

*******

2. If it is Z-Table you can fill the List of possible values in the DOMAIN level.

That is in the DOMAIN-->Value Range.

In this you can give values what are all the list of possible values.

Then you need to get this values from table DD07T.

From this table you need to go to FM 'F4IF_FIELD_VALUE_REQUEST'.

*****************

I hope this will help you.

If your issue is solved with this award points.

Thanks.

Message was edited by: Deepak333 k

0 Kudos

The problem with the solutions you have privded is that it requires me to know where the possible values come from. I am looking at a more generic approach to this solution where I do not have to manually populate any tables with the possible values. (ie. No SELECT statements to fill an internal table with the possible values)

F4IF_FIELD_VALUE_REQUEST seems to do this without having to know any underlying tables but my problem is that with some fields a dialog box is shown.

Take the following example:

DATA: ITAB TYPE TABLE OF DDSHRETVAL WITH HEADER LINE.

PARAMETERS: P_TABLE LIKE DFIES-TABNAME DEFAULT 'RMMG1'.

PARAMETERS: P_FIELD LIKE DFIES-FIELDNAME DEFAULT 'MATNR'.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

TABNAME = P_TABLE

FIELDNAME = P_FIELD

  • SEARCHHELP = ' '

  • SHLPPARAM = ' '

  • DYNPPROG = 'SAPLMGMM'

  • DYNPNR = '0060'

  • DYNPROFIELD = 'MATNR'

  • STEPL = 0

VALUE = '*'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = 'X'

SUPPRESS_RECORDLIST = 'X'

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

TABLES

RETURN_TAB = ITAB

  • EXCEPTIONS

  • FIELD_NOT_FOUND = 1

  • NO_HELP_FOR_FIELD = 2

  • INCONSISTENT_HELP = 3

  • NO_VALUES_FOUND = 4

  • OTHERS = 5

Using the default values of RMMG1 and MATNR, the code will pop up a dialog. Once the dialog is closed, the results I want are returned to ITAB. If I use SFLIGHT and CARRID as another test, the dialog is not shown and the results are available to me in ITAB. I want to know if there is anyway I can specify that no dialog box should be shown at all.

I hope the above explains the problem a little more clearly.

Thanks,

Charles

0 Kudos

Hi Charles Evans

Definitely SUPPRESS_RECORDLIST = 'X' suppresses the dialogues.

But Setting the parameter does not automatically suppress all dialogs. Depending on the search help,the dialoges for restricting and for selecting an elementary search help can still appear.

This is the same case.

Setting this parameter reflects the most common application.If you need other settings, you can overwrite CALLCONTROL in a CALLBACK form.

Like for Personal help values are not used. <b>set (CALLCONTROL-PVALUES = 'D'.)</b>

Go inside code of function module 'F4IF_FIELD_VALUE_REQUEST'

and read <b>Function Module Documentation.</b>

Cheers,

Vijay Raheja

0 Kudos

Try uncommenting he parameter below and do as follows

Change from

<i>* DISPLAY = 'X'</i>

to

<i>DISPLAY = SPACE</i>

0 Kudos

I have setup a callback and changed CALLCONTROL-PVALUES to 'D'. This doesn't seem to make any difference. Nor does changing the DISPLAY parameter of the main call.

The two CHANGING parameters I have are:

shlp_top TYPE SHLP_DESCR_T

callcontrol TYPE ddshf4ctrl.

Is there anything in those parameters that I can change to stop the display of the entire form? I have managed to remove the maximum records section from the form but I don't want the form shown at all.

Former Member
0 Kudos

May be this is what you need F4IF_SELECT_VALUES

0 Kudos

Hi Srinivas,

Please explain how I could use this.