2006 Nov 02 5:46 PM
Hello,
I'm experiencing the following problem using F4IF_START_VALUE_REQUEST function: it returns empty return table. However, all the parameters are filled correctly. Here's the code:
DATA: lt_returntab TYPE ddshretval OCCURS 0 WITH HEADER LINE ,
l_shlp TYPE shlp_descr.
CALL FUNCTION 'F4IF_GET_SHLP_DESCR'
EXPORTING
shlpname = 'ZOST_ADVANCED_VBELN'
shlptype = 'SH'
IMPORTING
shlp = l_shlp.
CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp = l_shlp
* DISPONLY = ' '
* MAXRECORDS = 500
* MULTISEL = ' '
* CUCOL = SY-CUCOL
* CUROW = SY-CUROW
* IMPORTING
* RC =
TABLES
return_values = lt_returntab
.
If I call standalone search-help, it works correctly. What's wrong with the function call or something?
2006 Nov 02 6:12 PM
Hi Cyrill,
Please check below sample codes from program REXPDSEL.
...
call function 'F4IF_GET_SHLP_DESCR'
exporting
shlpname = 'PRPM'
shlptype = 'SH'
importing
shlp = g_shlp_descr_t.
loop at g_shlp_descr_t-interface into
gwa_shlp_descr_t_interface.
if gwa_shlp_descr_t_interface = 'POSID'.
gwa_shlp_descr_t_interface-valfield = 'X'.
modify g_shlp_descr_t-interface from
gwa_shlp_descr_t_interface.
endif.
endloop.
call function 'F4IF_START_VALUE_REQUEST'
exporting
shlp = g_shlp_descr_t
maxrecords = 500
multisel = 'X'
tables
return_values = gt_return_tab.
...Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
Hello,
I'm experiencing the following problem using F4IF_START_VALUE_REQUEST function: it returns empty return table. However, all the parameters are filled correctly. Here's the code:
DATA: lt_returntab TYPE ddshretval OCCURS 0 WITH HEADER LINE ,
l_shlp TYPE shlp_descr.
CALL FUNCTION 'F4IF_GET_SHLP_DESCR'
EXPORTING
shlpname = 'ZOST_ADVANCED_VBELN'
shlptype = 'SH'
IMPORTING
shlp = l_shlp.
CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp = l_shlp
* DISPONLY = ' '
* MAXRECORDS = 500
* MULTISEL = ' '
* CUCOL = SY-CUCOL
* CUROW = SY-CUROW
* IMPORTING
* RC =
TABLES
return_values = lt_returntab
.
If I call standalone search-help, it works correctly. What's wrong with the function call or something?
2006 Nov 02 6:01 PM
Hi Cyrill,
Code looks extremely fine ...
I understand that RC is optional parameter but just
try uncommenting
<b>Data : RC LIKE Sy-subrc.</b>
<b>* IMPORTING
RC =</b>
and let me know if it works...
2006 Nov 02 6:12 PM
Hi Cyrill,
Please check below sample codes from program REXPDSEL.
...
call function 'F4IF_GET_SHLP_DESCR'
exporting
shlpname = 'PRPM'
shlptype = 'SH'
importing
shlp = g_shlp_descr_t.
loop at g_shlp_descr_t-interface into
gwa_shlp_descr_t_interface.
if gwa_shlp_descr_t_interface = 'POSID'.
gwa_shlp_descr_t_interface-valfield = 'X'.
modify g_shlp_descr_t-interface from
gwa_shlp_descr_t_interface.
endif.
endloop.
call function 'F4IF_START_VALUE_REQUEST'
exporting
shlp = g_shlp_descr_t
maxrecords = 500
multisel = 'X'
tables
return_values = gt_return_tab.
...Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
2006 Nov 03 5:54 AM
Thank you all for your advices - the most helpful one was Ferry's. It solved problem, but when I tried to reward points, server returned error
2007 Apr 30 2:25 PM
2011 Apr 11 8:51 PM
Yes. This does solve getting multiple fields' values back from a search help designed to send back multiple fields. Thank you.
2011 Apr 11 9:18 PM
In case anybody wants another complete example, here it is:
*Variables for the function that sets screen field values
DATA: dyname LIKE d020s-prog,
dynumb LIKE d020s-dnum.
DATA: BEGIN OF dynpfields OCCURS 3.
INCLUDE STRUCTURE dynpread.
DATA: END OF dynpfields.
DATA: lv_numeric_with_two_bytes TYPE n LENGTH 2.
DATA: lt_returntab TYPE ddshretval OCCURS 0 WITH HEADER LINE ,
l_shlp TYPE shlp_descr,
lv_name_sh TYPE shlpname VALUE 'ZZZZ_SHELP_WITH_TWO_EXPORTS'.
lt_interfaces TYPE ddshifaces,
ls_interfaces TYPE LINE OF ddshifaces.
*( 1 ) - Return all information about the search help
CALL FUNCTION 'F4IF_GET_SHLP_DESCR'
EXPORTING
shlpname = lv_name_sh
shlptype = 'SH'
IMPORTING
shlp = l_shlp.
*( 2 ) - Update to indicate that we want values passed back from more than one field!
lt_interfaces = l_shlp-interface.
ls_interfaces-valfield = yc_charx.
MODIFY lt_interfaces FROM ls_interfaces TRANSPORTING valfield
WHERE shlpfield = 'SBELP' OR shlpfield = 'SBELN'.
l_shlp-interface = lt_interfaces.
*( 3 ) - Call the search help that interacts with the user
CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp = l_shlp
DISPONLY = ' '
MAXRECORDS = 500
MULTISEL = ' '
CUCOL = SY-CUCOL
CUROW = SY-CUROW
IMPORTING
RC =
TABLES
return_values = lt_returntab
EXCEPTIONS
OTHERS = 1.
*( 4 ) - Get both values returned
IF sy-subrc IS INITIAL.
LOOP AT lt_returntab.
CASE lt_returntab-fieldname.
WHEN 'SBELN'.
lr_sbeln = lt_returntab-fieldval.
WHEN 'SBELP'.
lr_sbelp = lt_returntab-fieldval.
ENDCASE.
ENDLOOP.
ENDIF.
*Only proceed to set line number if we got the information!
CHECK NOT lr_sbelp IS INITIAL.
*( 5 ) - Call the function that sets values on a screen since the
\ Process on-value request of PAI can only send in (and update)
\ one field at a time
CLEAR gs_cursor_line-search_settlement_line.
GET CURSOR LINE gs_cursor_line-search_settlement_line.
lv_numeric_with_two_bytes = gs_cursor_line-search_settlement_line.
dynpfields-fieldname = 'ymmssb_checkline_struc-sbELP(&&)'.
REPLACE '&&' WITH lv_numeric_with_two_bytes INTO dynpfields-fieldname.
TRANSLATE dynpfields-fieldname TO UPPER CASE.
dynpfields-fieldvalue = lr_sbelp.
APPEND dynpfields.
dyname = sy-repid.
dynumb = sy-dynnr.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = dyname
dynumb = dynumb
TABLES
dynpfields = dynpfields.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |