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

selection screen help !

HI Gurus !

on selection-screen , i have

Reservation : _____________

Item No : ______________

when user types resvervation no . eg : 125 then when user press f4 - help on Item no it shud display item corresponding to 125.

i have write this code .

AT SELECTION-SCREEN ON VALUE-REQUEST FOR itemno-low.

perform itemvalue.

  • RE_RENUM is selection field for reservation

form itemvalue.

select RSNUM rspos into corresponding fields of table it_help from resb

where RSNUM in RE_RENUM.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'RSPOS'

  • PVALKEY = ' '

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'RESB-RSPOS'

  • STEPL = 0

WINDOW_TITLE = 'Item No'

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = it_help

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

endform. "itemvalue

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 27, 2008 at 11:20 AM

    look at this code...

    &----


    *& Report ZTESTRKS004

    *&

    &----


    *&

    *&

    &----


    REPORT ztestrks004.

    types:: begin of y_resb,

    rsnum type rsnum,

    rspos type rspos,

    end of y_resb.

    DATA: dynpfields TYPE STANDARD TABLE OF dynpread WITH HEADER LINE,

    t_resb TYPE STANDARD TABLE OF y_resb.

    PARAMETERS: reserv TYPE resb-rsnum,

    itemno TYPE resb-rspos.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR itemno.

    dynpfields-fieldname = 'RESERV'.

    APPEND dynpfields.

    CALL FUNCTION 'DYNP_VALUES_READ'

    EXPORTING

    dyname = sy-repid

    dynumb = sy-dynnr

    TABLES

    dynpfields = dynpfields[]

    EXCEPTIONS

    INVALID_ABAPWORKAREA = 1

    INVALID_DYNPROFIELD = 2

    INVALID_DYNPRONAME = 3

    INVALID_DYNPRONUMMER = 4

    INVALID_REQUEST = 5

    NO_FIELDDESCRIPTION = 6

    INVALID_PARAMETER = 7

    UNDEFIND_ERROR = 8

    DOUBLE_CONVERSION = 9

    STEPL_NOT_FOUND = 10

    OTHERS = 11

    .

    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 dynpfields index 1.

    select rsnum rspos from resb into table t_resb where rsnum = dynpfields-FIELDVALUE.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    • DDIC_STRUCTURE = ' '

    retfield = 'RSPOS'

    • PVALKEY = ' '

    DYNPPROG = sy-repid

    DYNPNR = '1000'

    DYNPROFIELD = 'ITEMNO'

    • STEPL = 0

    • WINDOW_TITLE =

    • VALUE = ' '

    VALUE_ORG = 'S'

    • MULTIPLE_CHOICE = ' '

    • DISPLAY = ' '

    • CALLBACK_PROGRAM = ' '

    • CALLBACK_FORM = ' '

    • MARK_TAB =

    • IMPORTING

    • USER_RESET =

    tables

    value_tab = t_resb

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 27, 2008 at 07:32 AM

    Hi rahul,

    DYNPPROG and DYNNR cannot be passed as SY-REPID and SY-DYNNR bcaz they are only analyzed after the function module has been called. Instead, first copy SY-REPID and Sy-DYNNR into local variables and then pass this local variables to the function module.

    Reward pts if it helps....

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      *type definition for F4 help

      TYPES:BEGIN OF ty_lifnr_f4,

      lifnr TYPE lifnr,

      name1 TYPE name1_gp,

      END OF ty_lifnr_f4.

      *internal table declaration for F4 help

      DATA: it_lifnr_f4 TYPE STANDARD TABLE OF ty_lifnr_f4.

      SELECT query on lifnr

      SORT it_lifnr_f4 BY lifnr.

      DELETE ADJACENT DUPLICATES FROM it_lifnr_f4.

      *display help dialog

      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

      EXPORTING

      retfield = 'LIFNR' "we can't use contant here, system gives dump

      dynpprog = sy-cprog

      dynpnr = c_dyn100

      dynprofield = 'WA_HDR-LIFNR'

      value_org = 'S' "this value is always fixed

      TABLES

      value_tab = it_lifnr_f4

      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

      S@meer

  • author's profile photo Former Member
    Former Member
    Posted on Mar 27, 2008 at 09:36 AM

    Hi rahul, ur DYNPROFIELD should b ur selection screen field.

    RE_ITEMNO is ur selection screen field of item number.

    DYNPROFIELD = 'RE_ITEMNO'

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Venkat !

      function F4IF_INT_TABLE_VALUE_REQUEST is fine. The problem is in Select statement.

      select RSNUM rspos into corresponding fields of table it_help from resb

      where RSNUM = R_no.

      where R_no is getting NULL as we want value on selection screen.ie Reservation No entried on screen , how to fetch that value.

  • author's profile photo Former Member
    Former Member
    Posted on Mar 27, 2008 at 09:58 AM

    hi rahul,

    some change in ur program..

    see below it.

    call function 'f41f.............'

    Dynpro = 'sy-cprog'

    .........

    reward if useful,

    thx,

    s.suresh

    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.