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

f4 needed for me on my selection screen

Hi

could any one help me in making f4 for my selections screen my requirement is as follows

parameters : p_lname type p0002-nachn.

my selection screen:

last name:

for the last name when i press F4 i need to get only last names for all pernrs and repitions should not be displayed

please help with code

points rewarded every useful answer

Regards

sachin

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 02, 2008 at 12:11 PM

    hi

    Here is the code.

    TYPES: BEGIN OF ty_nachn,

    nachn TYPE pa0002-nachn,

    END OF ty_nachn.

    DATA: t_nachn TYPE STANDARD TABLE OF ty_nachn.

    PARAMETERS: p_nachn TYPE pa0002-nachn.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_nachn.

    SELECT nachn

    FROM pa0002

    INTO TABLE t_nachn.

    SORT t_nachn BY nachn.

    DELETE ADJACENT DUPLICATES FROM t_nachn COMPARING nachn.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    retfield = 'NACHN'

    dynpprog = sy-cprog

    dynpnr = sy-dynnr

    dynprofield = 'P_NACHN'

    value_org = 'S'

    TABLES

    value_tab = t_nachn.

    Please assign points.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 02, 2008 at 10:37 AM

    hi use this.

    Put values in table it_year.

    important: type of fields of table it_year shpuld be in refrence with some table.

    use delete adjecent duplicate to delete duplicate entries.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR: s_year-low.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    • DDIC_STRUCTURE = ' '

    retfield = 'G_YEAR'

    • PVALKEY = ' '

    dynpprog = sy-repid

    dynpnr = sy-dynnr

    dynprofield = 'S_YEAR'

    • STEPL = 0

    • WINDOW_TITLE =

    • VALUE = ' '

    value_org = 'S'

    • MULTIPLE_CHOICE = ' '

    • DISPLAY = ' '

    • CALLBACK_PROGRAM = ' '

    • CALLBACK_FORM = ' '

    TABLES

    value_tab = it_year

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

    ENDIF.

    reward if useful

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 02, 2008 at 11:48 AM

    Hi,

    Use the below code.

    tables: P0002, PA0002.

    parameters : p_lname type p0002-nachn.

    data: begin of itab occurs 0,

    lname like p0002-nachn,

    end of itab.

    initialization.

    select distinct nachn from pa0002 into table itab.

    at selection-screen on value-request for p_lname.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    RETFIELD = 'LNAME'

    DYNPPROG = SY-CPROG

    DYNPNR = SY-DYNNR

    DYNPROFIELD = 'P_LNAME'

    VALUE_ORG = 'S'

    TABLES

    VALUE_TAB = ITAB

    • RETURN_TAB = RETURN

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 02, 2008 at 11:53 AM

    HI,

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR

    p_file[UR FIELD OR FILENAME] .

    incase u need it for filE USE fm F4_FILENAME.

    REWARD IF USEFUL

    MANO

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 02, 2008 at 11:55 AM

    if it is field use FM,

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    reward if useful

    mano

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 02, 2008 at 11:59 AM

    Hi,

    U can use the following code.

    data: begin of i_pernr,

    nachn like pa0002-nachn,

    end of i_pernr.

    DATA: t_return1 LIKE ddshretval OCCURS 0 WITH HEADER LINE.

    at selection-screen on value-request for p_lname.

    select distinct nachn from pa0002 into table itab.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    retfield = 'NACHN'

    value_org = 'S'

    TABLES

    value_tab = i_pernr

    return_tab = t_return1.

    p_lname = t_return1-fieldval.

    if it is helpfull pls reward pts.

    Regards

    Srimanta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 02, 2008 at 12:06 PM

    U CAN DO AS SAID BY EVERYBODY IN FORUM ALSO

    U CAN USE MATCH CODE OBJECTS LIKE

    parameters : p_lname type p0002-nachn matchcode object (search_help).

    go to se11 and define a search help

    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.