Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Export search help results to more dynpro fields

Hi!

I've set up a dynpro in a screen exit (ITOB0001). I put 3 new fields into this dynpro: equi-zzfield1, equi-zzfield2, equi-zzfield3.

I also set up a Z-table, and this table contains the possible combinations, which is allowed into the dynpro fields. So this table table has 3 columns, col1, col2, col3.

I would like to create a search help for all 3 fields on the dynpro, which can fill automatically all 3 fields, when I choose a line from the search help. The search help is using the Z-table, to show the possible combinations, which can be chosen.

For example there are the following lines in the Z-table, and these entries will appear in the search help for all 3 fields.

col1 col2 col3

1 1 1

1 1 2

1 2 3

So it doesn't matter which fields's search help I use, when I choose the third line, the equi-field1 = 1, equi-field2 = 2 and equi-field3 = 3.

What are the requirements for this?

Thank you

Tamá

Tags:
replied

Hello Tamás

Sample report ZUS_SDN_CALL_SEARCHHELP demonstrates how to programatically modify a search help.

You need to define the logic at POV in your dynpro to transport the search help values to your dynpro fields.

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_CALL_SEARCHHELP
*&
*&---------------------------------------------------------------------*
*& Thread: Export search help results to more dynpro fields
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1093766"></a>
*&
*& Thread: Disable multiple selection in search help
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="786400"></a>
*&---------------------------------------------------------------------*

REPORT  zus_sdn_call_searchhelp.


TYPE-POOLS: abap, shlp.

DATA: gs_shlp     TYPE shlp_descr,
      gt_retval   TYPE STANDARD TABLE OF ddshretval.


PARAMETERS:
  p_multi   AS CHECKBOX DEFAULT ' '.

START-OF-SELECTION.

  CALL FUNCTION 'F4IF_GET_SHLP_DESCR'
    EXPORTING
      shlpname       = 'DEBIE'
*     SHLPTYPE       = 'SH'
    IMPORTING
      shlp           = gs_shlp.

  PERFORM set_multiple_fields_returned.

  CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
    EXPORTING
      shlp                = gs_shlp
*     DISPONLY            = ' '
*     MAXRECORDS          = 500
      multisel            = p_multi
*     CUCOL               = SY-CUCOL
*     CUROW               = SY-CUROW
*   IMPORTING
*     RC                  =
    TABLES
      return_values       = gt_retval.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
      i_structure_name                  = 'DDSHRETVAL'
*     I_BACKGROUND_ID                   = ' '
      i_grid_title                      = 'Returned F4-Values'
*     IS_LAYOUT_LVC                     =
*     I_DEFAULT                         = 'X'
*     I_SAVE                            = ' '
*     IS_VARIANT                        =
    TABLES
      t_outtab                          = gt_retval
    EXCEPTIONS
      program_error                     = 1
      OTHERS                            = 2.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


END-OF-SELECTION.


*&---------------------------------------------------------------------*
*&      Form  SET_MULTIPLE_FIELDS_RETURNED
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM set_multiple_fields_returned .
* define local data
  DATA: ls_fieldprop  LIKE LINE OF gs_shlp-fieldprop,
        ls_interface  LIKE LINE OF gs_shlp-interface.


  LOOP AT gs_shlp-interface INTO ls_interface.
    CASE ls_interface-shlpfield.
      WHEN 'KUNNR'  OR
           'LAND1'.
        ls_interface-valfield = 'X'.

      WHEN OTHERS.
        CONTINUE.
    ENDCASE.

    MODIFY gs_shlp-interface FROM ls_interface INDEX syst-tabix.
  ENDLOOP.


  LOOP AT gs_shlp-fieldprop INTO ls_fieldprop.
    CASE ls_fieldprop-fieldname.
      WHEN 'KUNNR'  OR
           'LAND1'.
        ls_fieldprop-shlpoutput = 'X'.

      WHEN OTHERS.
        CONTINUE.
    ENDCASE.

    MODIFY gs_shlp-fieldprop FROM ls_fieldprop INDEX syst-tabix.
  ENDLOOP.

ENDFORM.                    " SET_MULTIPLE_FIELDS_RETURNED

Regards

Uwe

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question