Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

F4IF_START_VALUE_REQUEST trouble [+]

Former Member
0 Likes
3,621

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,245

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?

6 REPLIES 6
Read only

messier31
Active Contributor
0 Likes
2,245

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

Read only

Former Member
0 Likes
2,246

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.

Read only

0 Likes
2,245

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

Read only

Former Member
0 Likes
2,245

Ferry - this is very useful - thanks

Graham

Read only

0 Likes
2,245

Yes. This does solve getting multiple fields' values back from a search help designed to send back multiple fields. Thank you.

Read only

0 Likes
2,245

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.