‎2007 Jan 09 5:44 AM
Hi,
i provided search help option for a field.in the selection screen search help option is working.but after selecting one line from dropdown list it is not getting displayed in the selection screen.
without displaying the value in the selection screen it is executing selected record.
can any one tell me is there any thing else to do this.
‎2007 Jan 09 5:48 AM
You need to provide the return value. Check the following sample.
data: it_ret like ddshretval occurs 0 with header line.
At selection-screen on value-request for s_mat-high.
Select MBLNR from mkpf into table it_mblnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MBLNR'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_MBLNR
FIELD_TAB =
RETURN_TAB = IT_RET
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.
IF SY-SUBRC = 0.
read table it_ret index 1.
move it_ret-fieldval to S_mat-high.
ENDIF.
‎2007 Jan 09 5:58 AM
Hi,
I provided return code now it is displaying value.
but if i select perticular line from dropdown list it should display that line value.
instead of this it is taking the value from first line record.
‎2007 Jan 09 6:01 AM
refer below demo code -
probably u r not assigning the selected values to the variable..hence selected value is not getting displyaed on ur selection screen
REPORT ZGILL_VALUE_REQUEST .
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.
Parameters : ECODE like zgill_main-PERNR.
*parameters: pernr like pa0001-pernr .
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 = 'ECODE'
dynpprog = sy-repid
dynpnr = no_dyn
dynprofield = 'ECODE'
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 ECODE.
‎2007 Jan 09 6:56 AM
in the last statement after return code line sy-tabix is always taking 1 only.
that means sy-tabix = 1.so it is selecting always first line from dropdown list.
still it is not taking selected record.
‎2007 Jan 09 7:06 AM
‎2007 Jan 09 7:18 AM
DATA:lf_repid LIKE sy-repid,
lf_dynnr LIKE sy-dynnr.
lf_repid = sy-repid.
lf_dynnr = sy-dynnr.
DATA: BEGIN OF it_selected OCCURS 0,
field1 type ztable-field1,
field2 type ztable-field2,
END OF it_selected.
AT SELECTION-SCREEN.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR field-low.
SELECT <name1> <name2>
FROM >ztable>
INTO TABLE it_selected
WHERE <name2> NE space.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'name2'
dynpprog = lf_repid
dynpnr = lf_dynnr
dynprofield = 'field'
value_org = 'S'
TABLES
value_tab = it_selected
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF SY-SUBRC = 0.
read table it_selected index sy-tabix.
move it_selected-field2 to field-low.
ENDIF.
‎2007 Jan 09 7:24 AM
Hi ,
Here is a code which worked well
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_mvgr4.
SELECT mvgr4 bezei INTO TABLE g_t_mvgr_he
FROM tvm4t
WHERE spras = sy-langu.
IF sy-subrc = 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MVGR4'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_MVGR4' " My Parameter
value_org = 'S'
TABLES
value_tab = g_t_mvgr_he
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
REFRESH g_t_mvgr_he.
ENDIF.
ENDIF.Regards
Arun
‎2007 Jan 09 7:24 AM
You need to provide the return value. Check the following sample.
data: it_ret like ddshretval occurs 0 with header line.
IF SY-SUBRC = 0.
read table it_ret index 1.
move it_ret-fieldval to S_mat-high.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR field-low.
SELECT <name1> <name2>
FROM >ztable>
INTO TABLE it_selected
WHERE <name2> NE space.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'name2'
dynpprog = lf_repid
dynpnr = lf_dynnr
dynprofield = 'field'
value_org = 'S'
TABLES
value_tab = it_selected
RETURN_TAB = IT_RET "Need to add this
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF SY-SUBRC = 0.
*****Change as below
read table it_ret index sy-tabix.
move it_ret-field2 to field-low.
ENDIF.
‎2007 Jan 09 6:00 AM