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

F4 help

madan_ullasa
Contributor
0 Likes
854

Hi frnds,

i have 2 parameters. plant and mat. no.. the plant has the std. search help. But for the matnr i want to create a search help such that only those values pertaining to the input plant is displayed. im using the fun. module F4IF_FIELD_VALUE_REQUEST in the event AT SELECTION SCREEN ON VALUE REQUESTR. but plz tell me wot values am i to pass to this?

points assured to all replies..

regrds,

Madan.

1 ACCEPTED SOLUTION
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
823

Hi,

Here is the sample code.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.

6 REPLIES 6
Read only

Former Member
0 Likes
823
populate the internal table .

and pass it.

  CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
      tabname           = space
      fieldname         = space
      searchhelp        = shelp
      dynprofield       = 'X'
    TABLES
      return_tab        = ittable
    EXCEPTIONS
      field_not_found   = 1
      no_help_for_field = 2
      inconsistent_help = 3
      no_values_found   = 4
      OTHERS            = 5.
Read only

Former Member
0 Likes
823

DATA: return_values LIKE ddshretval OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'MATNR'

value_org = 'S'

display = 'F'

TABLES

value_tab = t_1001

return_tab = return_values

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.

ELSE .

READ TABLE return_values INDEX 1.

t_1001-matnr = return_values-fieldval.

MOVE t_1001 TO it_1001.

ENDIF.

Reward points if it is helpful.

Cheers

Read only

Former Member
0 Likes
823

Hi,

Look at the sample code...........

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

data: begin of t_itab occurs 0,

pernr like zfdmr_records-pernr,

end of t_itab.

DATA: t_return like ddshretval occurs 0 with header line.

**----


*at selection-screen on value-request for s_pernr-low.

**----


  • perform get_values changing s_pernr-low.

*

**----


*at selection-screen on value-request for s_pernr-high.

**----


  • perform get_values changing s_pernr-high.

&----


*& Form get_values

&----


  • text

----


  • -->P_S_PERNR_LOW text

----


FORM get_values CHANGING P_S_PERNR.

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.

ENDFORM. " get_values

********************This is one way.

2. You can give some values in LIST OF POSSIBLE VALUES..

This we will give at domain level.

Double click on DATA ELEMENT again double click on DOMAIN.

There you will find VALUE RANGE TAB. Here you need to give possible values.

This values will store in DD07T Table.

Then for the above code you need to select from DD07T table and must pass that to FM.

Thanks.

If this helps you reward with points.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
824

Hi,

Here is the sample code.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.

Read only

0 Likes
823

Hi,

I hope your problem is solved.If so,kindly click the blue star on the left of reply,which solves your problem.

If not,get back.

Read only

0 Likes
823

Hi jayanthi !!

Happy :)-:)-