Skip to Content
author's profile photo Former Member
Former Member

F4 help for one field in modulepool program..(Possible values)

Hello Experts,

I have 3 fields in my module pool screen.

PLANT, MATERIALNO AND STORAGELOCATION.

BASED ON PLANT AND MATERIAL I NEED TO PROVIDE F4 HELP FOR STORAGE LOCATION(LGORT).

How can i write the code in PROCESS ON VALUE REQUEST ..

AND WHICH FUNCTION MODULE SHOULD BE USED.

Please can anybody send me the code asap.

I will give u full points if ur code matches my requirement.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2008 at 10:07 AM

    Raja ,

    for this you can use FM

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    select values into itab and pass that itab to

    value_tab

    revert for any query,

    Regards,

    Talwinder

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2008 at 10:12 AM

    Hi Raja,

    i will send a sample code for ur problem check in once..In that code i explicitly hardcoded the values for serchhelp.Instead of that we have to use select statement based on ur condition and place them in internal table ok.

    FUNCTION MODULE:

    F4IF_INT_TABLE_VALUE_REQUEST.

    CODE:

    &----


    *& Report YSEARCHHELP *

    *& *

    &----


    *& DEVELOPER : KIRAN KUMAR.G.A *

    *& PURPOSE : DEMO ON SEARCH HELP *

    *& CREATION DT : 27/12/2007 *

    *& REQUEST : ERPK900035 *

    &----


    REPORT YSEARCHHELP.

    • INTERNAL TABLE FOR STORING NAMES IN SELECTION LIST

    data: begin of t_itab occurs 0,

    name(10) type c,

    end of t_itab.

    *FIELDNAME AND TAB NAME FOR THE SELECTION

    DATA :field_tab LIKE dfies OCCURS 0 WITH HEADER LINE.

    *THE TABLE FOR RETURNING THE NAME OF THE SELECTED ITEM

    DATA : return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.

    *START THE SELECTION SCREEN BLOCK

    selection-screen begin of block ss1 with frame.

    parameters: p_name1(10) type c.

    selection-screen end of block ss1.

    &----


    *& *

    *& F4 Help for p_name1 *

    &----


    at selection-screen on value-request for p_name1.

    *CLEAR ALL EXISTING DATA

    *TO BE DONE EVERYTIME F4 HELP IS REQUESTED

    REFRESH t_itab.

    REFRESH field_tab.

    field_tab-fieldname = 'ERNAM'.

    field_tab-tabname = 'VBAK'.

    APPEND field_tab.

    t_itab-name = 'Andrews'.

    append t_itab.

    t_itab-name = 'Jennie'.

    append t_itab.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    • DDIC_STRUCTURE = ' '

    retfield = field_tab-fieldname

    • PVALKEY = ' '

    • DYNPPROG = ' '

    • DYNPNR = ' '

    • DYNPROFIELD = ' '

    • STEPL = 0

    WINDOW_TITLE = 'Select name'

    • VALUE = ' '

    • VALUE_ORG = 'C'

    • MULTIPLE_CHOICE = ' '

    • DISPLAY = ' '

    • CALLBACK_PROGRAM = ' '

    • CALLBACK_FORM = ' '

    • MARK_TAB =

    • IMPORTING

    • USER_RESET =

    tables

    value_tab = t_itab

    FIELD_TAB = field_tab

    RETURN_TAB = return_tab

    • 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.

    else.

    p_name1 = return_tab-fieldval.

    ENDIF.

    Award points if helpful.

    Kiran Kumar.G

    Have a Nice Day..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2008 at 10:45 AM

    Hi,

    u need to use the function module 'dynpvalues_read'

    Call function ‘CIFIDYNP_VALUES_READ’

    Exporting

    DYNAME = <ur program name ie SY-CPROG>

    DYNUMB = < u r screen number ie SY-DYNNR>

    tables

    DYNPFIELDS = <internal table with screen fields which helps to select next data of type DYNPREAD>.

    Here is logic TO WRITE AT PAI :-

    PROCESS ON VALUE-REQUEST.

    FIELD <STORAGELOCATION> MODULE F4HELPMODULE.

    AT SE38:-

    MODULE F4HELPMODULE INPUT.

    Data : waDYNPREAD type DYNPREAD,

    itabDYNPREAD type table of DYNPREAD.

    waDYNPREAD-FIELDNAME = ‘u r screen field name ie PLANT’ .

    append waDYNPREAD to itabDYNPREAD.

    CLEAR waDYNPREAD.

    waDYNPREAD-FIELDNAME = ‘u r screen field name ie MATNR’ .

    append waDYNPREAD to itabDYNPREAD.

    CLEAR waDYNPREAD.

    waDYNPREAD-FIELDNAME = ‘u r screen field name ie STORAGELOCATION’ .

    append waDYNPREAD to itabDYNPREAD.

    CLEAR waDYNPREAD.

    Then call THE FUNCTION MODULE :- ‘CIFIDYNP_VALUES_READ’

    THEN IT HAVE FIELDNAME WITH VALUES FROM SCREEN.

    THEN :-

    READ TABLE itabDYNPREAD INTO WADYNPREAD WHERE FIELDNAME = ‘u r screen field name ie PLANT’.

    IF SY-SUBRC = 0.

    V_PLANT = WADYNPREAD-FIELDVALUE.

    ENDIF.

    READ TABLE itabDYNPREAD INTO WADYNPREAD WHERE FIELDNAME = ‘u r screen field name ie MATNR’.

    IF SY-SUBRC = 0.

    V_MATNR = WADYNPREAD-FIELDVALUE.

    ENDIF.

    THEN :-

    SELECT PLANT MATNR FROM mara into TABLE i_matnr WHERE PLANT = V_PLANT AND MATNR = V_MATNR.

    THEN:-

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    DDIC_STRUCTURE = ' '

    retfield = 'STORAGE LOCATION FIELD ON SCREEN'

    PVALKEY = ' '

    dynpprog = SY-CPROG

    dynpnr = sy-dynnr

    dynprofield = ' ‘u r screen field name ie STORAGELOCATION ie S_STORAGELOCATION'

    VALUE = ' '

    value_org = 'S'.

    ENDMODULE.

    BEST REGARDS,

    mekala vijay

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.