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

Choosing Multiple values from F4-Help screen

Former Member
0 Likes
2,663

Hi All,

I have a requirement in a Report Program, where i need to select multiple values from the Value Help screen for a particular Select option.

I am aware of the method to enable Value Help for a select option where we can select single value from the F4-Help screen, but i am not aware of the method to enable the same for multiple values.

Any help in this direction will be extremely helpful.

Thanks in advance.

regards,

Booma

Hi All,

I have a requirement in a Report Program, where i need to select multiple values from the Value Help screen for a particular Select option.

I am aware of the method to enable Value Help for a select option where we can select single value from the F4-Help screen, but i am not aware of the method to enable the same for multiple values.

Any help in this direction will be extremely helpful.

Thanks in advance.

regards,

Booma

4 REPLIES 4
Read only

Former Member
0 Likes
1,321

Hi,

turn on the MULTIPLE_CHOICE = 'X' in the function module F4IF_INT_TABLE_VALUE_REQUEST

Read only

Former Member
0 Likes
1,321

Use the Function Module REUSE_ALV_POPUP_TO_SELECT .

Chech the3 sample code below.

REPORT ztest_alv_check MESSAGE-ID zz .
 
TYPE-POOLS: slis.
DATA: x_fieldcat TYPE slis_fieldcat_alv,
it_fieldcat TYPE slis_t_fieldcat_alv,
l_layout TYPE slis_layout_alv,
x_events TYPE slis_alv_event,
it_events TYPE slis_t_event.
DATA: BEGIN OF itab OCCURS 0,
vbeln LIKE vbak-vbeln,
posnr LIKE vbap-posnr,
chk(1),
color(4),
END OF itab.
SELECT vbeln
posnr
FROM vbap
UP TO 20 ROWS
INTO TABLE itab.
 
x_fieldcat-fieldname = 'CHK'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 1.
x_fieldcat-input = 'X'.
x_fieldcat-edit = 'X'.
x_fieldcat-checkbox = 'X'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
 
x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-seltext_l = 'VBELN'.
x_fieldcat-hotspot = 'X'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 2.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
 
x_fieldcat-fieldname = 'POSNR'.
x_fieldcat-seltext_l = 'POSNR'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 3.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
 
 
DATA selfield TYPE  slis_selfield.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
  EXPORTING
    i_title                 = 'Select Data'
    i_selection             = 'X'
    i_zebra                 = 'X'
    i_screen_start_column   = 5
    i_screen_start_line     = 5
    i_screen_end_column     = 50
    i_screen_end_line       = 10
    i_checkbox_fieldname    = 'CHK'
    i_tabname               = 'ITAB'
    i_scroll_to_sel_line    = 'X'
    it_fieldcat             = it_fieldcat
    i_callback_program      = sy-repid
    i_callback_user_command = 'USER_COMMAND'
  IMPORTING
    es_selfield             = selfield
  TABLES
    t_outtab                = itab
  EXCEPTIONS
    program_error           = 1.
 
*&---------------------------------------------------------------------*
*&      Form  STATUS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_EXTAB    text
*----------------------------------------------------------------------*
FORM status USING p_extab TYPE slis_t_extab.
 
  SET PF-STATUS 'STATUS'.
ENDFORM. " STATUS
 
*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
*----------------------------------------------------------------------*
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
 
  DATA: gd_repid LIKE sy-repid, "Exists
  ref_grid TYPE REF TO cl_gui_alv_grid.
  IF ref_grid IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
      IMPORTING
        e_grid = ref_grid.
  ENDIF.
  IF NOT ref_grid IS INITIAL.
    CALL METHOD ref_grid->check_changed_data .
  ENDIF.
 
  LOOP AT itab WHERE chk = 'X'.
    itab-color = 'C300'.
    MODIFY itab INDEX sy-tabix TRANSPORTING color.
  ENDLOOP.
  rs_selfield-refresh = 'X'.
  BREAK-POINT.
 ENDFORM. "USER_COMMAND

Hope this helps,

Murthy.

Read only

Former Member
0 Likes
1,321

Hi,

if you want to select multiple values from the Value Help screen for a particular Select option.

use the function module like F4IF_INT_TABLE_VALUE_REQUEST

and use the parameter MULTIPLE_CHOICE = 'X'.

Multiple selection is activated if this parameter has the value 'X'.

You can also select multiple lines in the hit list.

At the moment you cannot automatically reset the selected values in

screen fields if multiple selection is set. As a result, amodal dialogs

are not provided.

Regards,

Madhu

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,321

Hi,

Use this code, its working:-

User enters a value for SPEY on screen field with name YAPN-SPEY and according to it values for AREA field are fetched from database table corresponding to SPEY and displayed to user.


REPORT  z_f1f4.

CALL SCREEN 1010.
*&---------------------------------------------------------------------*
*&      Module  GET_F4_HELP  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE get_f4_help INPUT.

  TYPES : BEGIN OF it,
            area TYPE yapn-area,
          END OF it.

  DATA : itab TYPE STANDARD TABLE OF it WITH HEADER LINE,
         tb_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE,
         spey TYPE yapn-spey.

  CLEAR:   tb_dynpfields.
  REFRESH: tb_dynpfields.

  MOVE 'YAPN-SPEY' TO tb_dynpfields-fieldname.
  APPEND tb_dynpfields.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname                               = 'Z_F1F4'
      dynumb                               = '1010'
*   TRANSLATE_TO_UPPER                   = ' '
*   REQUEST                              = ' '
*   PERFORM_CONVERSION_EXITS             = ' '
*   PERFORM_INPUT_CONVERSION             = ' '
*   DETERMINE_LOOP_INDEX                 = ' '
*   START_SEARCH_IN_CURRENT_SCREEN       = ' '
*   START_SEARCH_IN_MAIN_SCREEN          = ' '
*   START_SEARCH_IN_STACKED_SCREEN       = ' '
*   START_SEARCH_ON_SCR_STACKPOS         = ' '
*   SEARCH_OWN_SUBSCREENS_FIRST          = ' '
*   SEARCHPATH_OF_SUBSCREEN_AREAS        = ' '
    TABLES
      dynpfields                           = tb_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 tb_dynpfields INDEX 1.
  IF sy-subrc EQ 0.
    spey = tb_dynpfields-fieldvalue.
  ENDIF.

 SELECT area FROM yapn
    INTO TABLE itab
  WHERE
    spey = spey.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
*   DDIC_STRUCTURE         = ' '
      retfield               = 'AREA'
*   PVALKEY                = ' '
     dynpprog               = 'Z_F1F4'
     dynpnr                 = '1010'
     dynprofield            = 'AREA'
*   STEPL                  = 0
*   WINDOW_TITLE           =
*   VALUE                  = ' '
   value_org              = 'S'
*   MULTIPLE_CHOICE        = ' '
*   DISPLAY                = ' '
*   CALLBACK_PROGRAM       = ' '
*   CALLBACK_FORM          = ' '
*   MARK_TAB               =
* IMPORTING
*   USER_RESET             =
    TABLES
      value_tab              = itab
*   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.
ENDMODULE.                 " GET_F4_HELP  INPUT

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir