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

Search help with non database values in a module pool program

Former Member
0 Likes
2,077

Dear Experts,

I am working on a module pool program with input fields. Now in one of the input screens I want to attach a search help to a field with only few values to be displayed and which are not stored in any database tables. So how is it possible to achieve this ??

Also if it is possible to do using List Box properly in screen painter then how to do that also with non database values??

Apart from the F4 values the user should also be able to type any value in the text/List box for the same field.

So pls suggest a more preferable option for this functionality.

Thanks,

Vishal

4 REPLIES 4
Read only

Former Member
0 Likes
1,380

Hello,

here's what you can do -

in the module Process on value-request, write this module field something module get_value.

module get_value

Use FM 'F4IF_INT_TABLE_VALUE_REQUEST' to show the values for this field. Under tables option you provide a internal table with values for this field. This internal table will be build in you program.

end module.

best regards,

swanand

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,380

Look better at screen painter, you can define list box filled by program, in the PBO you have to use FM VRM_SET_VALUES. (refer to the dropdown boxes section of the ABAP Programming manual.)


Reagrds,

Raymond

Read only

former_member209120
Active Contributor
0 Likes
1,379

Hi Vishal bhatt,

Use this F4 helps

1. F4IF_INT_TABLE_VALUE_REQUEST

*******************************************************************
*        TYPES DECLARATION                                        *
*******************************************************************
TYPES: BEGIN OF ty_mara,
        matnr TYPE mara-matnr,
        mtart TYPE mara-mtart,
        END OF ty_mara.

*******************************************************************
*        INTERNAL TABLE AND WORKAREA  DECLARATION                 *
*******************************************************************
DATA : it_mara TYPE TABLE OF ty_mara,
        wa_mara TYPE ty_mara.

*******************************************************************
*      PARAMETERS DECLARATION                                     *
*******************************************************************

PARAMETERS p_matnr TYPE ty_mara-matnr.

*******************************************************************
*    SELECTION SCREEN FOR VALUE REQUEST                           *
*******************************************************************

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_matnr.

*******************************************************************
*    SELECT QUIRES FOR CUSTOM FIELDS                              *
*******************************************************************

SELECT matnr mtart FROM mara INTO TABLE it_mara UP TO 10 ROWS.

*******************************************************************
*      FUNCTION MODULE TO POPULATE F4 HELP                        *
*******************************************************************

   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
     EXPORTING
       retfield    = 'MATNR'
       dynpprog    = sy-repid
       dynpnr      = sy-dynnr
       dynprofield = 'P_MATNR'
       value_org   = 'S'
     TABLES
       value_tab   = it_mara.


2. VRM_SET_VALUES

TYPE-POOLS: vrm.

PARAMETERS p_carrid LIKE scarr-carrid AS LISTBOX
VISIBLE LENGTH 20 OBLIGATORY.

DATA: t_carrid TYPE vrm_values,
w_line LIKE LINE OF t_carrid.

INITIALIZATION.

SELECT carrid carrname FROM scarr INTO (w_line-key, w_line-text).
APPEND w_line TO t_carrid.
ENDSELECT.

AT SELECTION-SCREEN OUTPUT.

CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_CARRID'
values = t_carrid.

END-OF-SELECTION.


TYPE-POOLS : vrm.

PARAMETERS p_TEST(3) AS LISTBOX VISIBLE LENGTH 5 DEFAULT 'YES'.

DATA: g_name TYPE vrm_id,
       g_list  TYPE vrm_values,
       g_value LIKE LINE OF g_list.

AT SELECTION-SCREEN OUTPUT.

   CLEAR: g_value, g_list.
   g_value-key = 'YES'.
   g_value-text = 'YES'.
   APPEND g_value TO g_list.

   g_value-key = 'NO'.
   g_value-text = 'NO'.
   APPEND g_value TO g_list.


     CALL FUNCTION 'VRM_SET_VALUES'
       EXPORTING
         id     = 'P_TEST'
         values = g_list.



Read only

Former Member
0 Likes
1,379

Hi Vishal,

     Go thru the following code it shows how to add desired values to the search help

     data: ls_itab like line of itab

    

     clear ls_itab

     ls_itab-sign = 'I'.                                                                     

    ls_itab-option = 'EQ'.

    ls_itab-low = 'Value1'.                        " value1 = value you want to add in the searchhelp

    append ls_itab to itab.

    

     clear ls_itab

    ls_itab-sign = 'I'.

    ls_itab-option = 'EQ'.

    ls_itab-low = 'Value2'.

    append ls_itab to itab.

     * repeat this for all the values you want add in your search help.

   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

       retfield    = 'RETFIED'    " enter the return field name

       dynpprog    = sy-repid

       dynpnr      = sy-dynnr

  TABLES

       value_tab   = itab.

Hope this will be useful