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: 

logic to get the value selected

Former Member
0 Kudos
109

Hi All!

I am using F4IF_INT_TABLE_VALUE_REQUEST to provide f4 help to a field.Now after user selects the required field from the list that value should be passed to another function module VIEW_MAINTAINANCE_CALL as a input.

Now I am not getting the logic to get the value selected from the first FM and to pass it to the second FM.

Please advise.

regards

praneeth

1 ACCEPTED SOLUTION

Former Member
0 Kudos
80

hi praneeth,

1. Simple

2. use like this (just copy paste in new program)

3. The user is provided with selection field.

on execute, it shows the maintenace

in display mode.

4.

REPORT abc.

*----


DATA : BEGIN OF itab OCCURS 0,

tabname LIKE dd02l-tabname,

END OF itab.

*----


PARAMETERS : a LIKE dd02l-tabname.

*----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR a.

SELECT tabname FROM dd02l

INTO TABLE itab

WHERE tabname = 'V_T001'

.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ITAB-TABNAME'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'A'

value_org = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

value_tab = itab

  • FIELD_TAB = FTAB

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

*----


START-OF-SELECTION.

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'

EXPORTING

action = 'S'

view_name = a.

regards,

amit m.

7 REPLIES 7

Former Member
0 Kudos
80

Hi,

Look at the example 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.<<<<<<<-------

********

Here s_pernr will get the value selected by the user.

Actually with this code the user will get the selected value in input field of selection screen.

You can use this for further process.

Thanks.

If this helps you reward with points.

hymavathi_oruganti
Active Contributor
0 Kudos
80

pass the ret_tab-fieldval to the other fn module

example

data : ret_tab like ddshretval occurs 0 with header line.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'P_PAGE'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = IT_PVAL

RETURN_TAB = RET_TAB.

read table ret_tab index 1.

IF SY-SUBRC = 0.

move ret_tab-fieldval to p_PAGE.

ENDIF.

in the above, <b>ret_tab-fieldval</b> contains the value selected

Former Member
0 Kudos
81

hi praneeth,

1. Simple

2. use like this (just copy paste in new program)

3. The user is provided with selection field.

on execute, it shows the maintenace

in display mode.

4.

REPORT abc.

*----


DATA : BEGIN OF itab OCCURS 0,

tabname LIKE dd02l-tabname,

END OF itab.

*----


PARAMETERS : a LIKE dd02l-tabname.

*----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR a.

SELECT tabname FROM dd02l

INTO TABLE itab

WHERE tabname = 'V_T001'

.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ITAB-TABNAME'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'A'

value_org = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

value_tab = itab

  • FIELD_TAB = FTAB

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

*----


START-OF-SELECTION.

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'

EXPORTING

action = 'S'

view_name = a.

regards,

amit m.

0 Kudos
80

Hi Amit

Can u just brief me the changes to be done when applied to module pool program.

At PAI i am giving Process on value request and starting the module in the report program.I am confused on the parameter to be passed to The FM VIEW_MAINT

regards

Praneeth

REWARDED MAXIMUM POINTS

Message was edited by: Praneeth kumar

0 Kudos
80

THANKS EVERYBODY MY ISSUE GOT SOLVED

0 Kudos
80

Hi again,

1. In pai, just give like this .

PROCESS AFTER INPUT.

PROCESS ON VALUE-REQUEST.

field mylistab module abc.

(where mylisttab is the screen field name,

abc is the module name)

2. The above will take care to populate the list.

3. Now in module pool, u must have given

a button on application toolbar or something else

to show the maintenance screen.

4. In that, (depending upon okcode)

write the code from maintenace FM.

CALL FUNCTION 'VIEW_MAINTENANCE_CALL'

EXPORTING

action = 'S'

view_name = a.

where a is the screen field name(or variable conting table name)

5. For this FM.

action means :

S = Display

U = Change

6. Just have F1 help on this FM.

regards,

amit m.

Former Member
0 Kudos
80

hi,

if u r looking for a value from the list of f4 help to be passed on to a another field or function module

just look at the function module

1.DYNP_VALUES_READ and

2.DYNP_VALUES_UPDATE

go through the documentation in the se37 itself.

these are used to pick the selected list from the f4 help .

hope this will help u out.

vijay.