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: 

F4 help in module pool screen

Former Member
0 Kudos

Hello .. I am developing an applicastion in module pool.

<b>How can I force user to select some key fields from F4 only ..</b> No acceptance of other values .

Please reply soon . its urgent

9 REPLIES 9

Former Member
0 Kudos

Madhu,

Have F-Code of F4 and then restrict it according to the function code.

hope this idea helps u.

0 Kudos

writing the code in PROCESS ON VALUE-REQUEST

ex-

*--POV

PROCESS ON VALUE REQUEST .

*--Below statement says that when input help for the

*-field gv_pernr is called, trigger the module f4_pernr.

FIELD gv_pernr MODULE f4_pernr .

*--Here there may be other input help module statements

-


MODULE f4_pernr .

PERFORM f4_objid USING p_otype CHANGING gv_pernr .

ENDMODULE .

kishan negi

0 Kudos

How can I assign F code to F4

Former Member
0 Kudos

hi,

You can't enforce the user to select values from F4 values. You need to write validation module and cross check with entries of F4, If the value not belongings to F4 values raise error message.

If the field has check table. System will enforces to the user to enter lookup values only.

Regards

Bhupal Reddy

Former Member
0 Kudos

for search help on a screen fiel duse the following code -

PROCESS ON VALUE-REQUEST.

FIELD ITAB-PERNR MODULE F4_HELP.

&----


*& Module F4_HELP INPUT

&----


  • text

----


module F4_HELP input.

data: begin of lt_all occurs 0.

include structure DYNPREAD.

data end of lt_all.

data: begin of lt_selected occurs 0.

include structure DDSHRETVAL.

data: end of lt_selected.

DATA: BEGIN OF lt_code OCCURS 0,

code LIKE zgill_main-PERNR,

END OF lt_code.

data no_dyn like sy-dynnr.

no_dyn = sy-dynnr. "give the scren no directly or sy-dynnr in case of report.

*At selection-screen on value-request for ECODE.

select PERNR into table lt_code from zgill_main.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ITAB-PERNR'

dynpprog = sy-repid

dynpnr = no_dyn

dynprofield = 'ITAB-PERNR'

window_title = 'Employee Details'

value_org = 'S'

DISPLAY = 'F'

TABLES

value_tab = lt_code

RETURN_TAB = lt_selected.

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

*if sy-subrc eq '0' .

  • write: 'success'.

*endif.

read table lt_selected index sy-tabix.

move lt_selected-fieldval to ITAB-PERNR.

endmodule. " F4_HELP INPUT

Former Member
0 Kudos

Hi Madhumati,

There are 2 possibilities:

1. If the field has std F4 i.e thru Domain or search help

then code: PROCESS ON INPUT_REQUEST.

FIELD xyz MODULE check_xyz.

Now in the module check the value of the filed if selected from F4 or

not & if noe throw an error.

2. If you have coded the F4 using PROCESS ON VALUE-REUEST

FIELD xyz MODULE F4_xyz.

then imediately after the user selects the value check in this module

if right or not.

I hope this solves youe problem.

Regards,

Vaibhav.

Former Member
0 Kudos

Hi Madhumita,

In a module pool application, F4 is handled in Process On Value Request.

Get the values inside an internal table & use the FM F4IF_INT_TABLE_VALUE_REQUEST for the display.

Use the following sample code as a reference.

PROCESS ON VALUE-REQUEST.

FIELD W_DATA MODULE XYZ .

MODULE XYZ.

"here get the data into an internal table.

"call FM F4IF_INT_TABLE_VALUE_REQUEST.

ENDMODULE.

Regards,

Chetan.

PS:Reward points if this helps.

Former Member
0 Kudos

U can use "field check"

in PAI modue, write similar code...

FIELD <FIELDNAME> MODULE <MODULENAME>

Then create <MODULENAME>....and write code for restriction like

module <MODULENAME>.

select single * from <table> where <fieldname> eq <field name in screen>.

if sy-subrc ne 0.

message 'Invalid Entry' type 'E'.

endif.

endmodule.

This will throw an error when user enter values other than from the F4 help...

Reward me if helpful........

Former Member
0 Kudos

Hi Madhumati,

Best solution for this problem is to prepare a drop down for that field

try using VRM_SET_VALUES and VRM_GET_VALUES to set and get the dropdown values.

this will restrict the user to only selected values. You have to populate the dropdown at runtime.

hope this helps