03-27-2008 7:21 AM
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
03-27-2008 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.
03-27-2008 7: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....
03-27-2008 8:52 AM
HI Venkat !
i tried that thing. but its displaying all the records. but i want only the records corresponding to reservation no on selection screen. how to fetch that value into the program.
regards.
Rahul
03-27-2008 9:44 AM
*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
03-27-2008 9: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'
03-27-2008 9:51 AM
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.
03-27-2008 9:58 AM
hi rahul,
some change in ur program..
see below it.
call function 'f41f.............'
Dynpro = 'sy-cprog'
.........
reward if useful,
thx,
s.suresh
03-27-2008 10:17 AM
hi Suresh !
there is no prob wid F4 function.
i just want to the value of RE_RENUM which the user enters the value on selection screen.
03-27-2008 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.
04-02-2008 12:13 PM