Application Development 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: 

Export search help results to more dynpro fields

Former Member
0 Kudos

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á

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

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

7 REPLIES 7

former_member188685
Active Contributor
0 Kudos

in that case you need to mark the checkboxes IMPORT and EXPORT for all the fields then it will fill automatically, if you select the single line.

0 Kudos

They are checked for all fields, but it is still not working. I think there will be the problem, but I don't know exactly what. The field name are not the same (field1 <> col1) maybe this is the problem? Of course tables are not the same also, because the search help is using a Z-table, while in the screen exit I have to use the equi. But the data elements are the same for both types (equi-field1 and ztable-col1). But it seems it is not enough...

Edited by: Tamás Nyisztor on Oct 20, 2008 9:50 AM.

0 Kudos

>But the data elements are the same for both types (equi-field1 >and ztable-col1).

change the Data elements. and inside the dataelement properties mention the search help and parameter (in your case you have specify differently for each)

0 Kudos

Unfortunately it is still not working. Any other opinions?

Former Member
0 Kudos

Hi,

Probably you might have to write additional coding in the POV event...

Check this thread for details.

Thanks

Naren

uwe_schieferstein
Active Contributor
0 Kudos

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 Kudos

Thank you! I can't belive this is not working without any additional coding, but I don't have time for trying out all possible combinations and variations of the search help and the dynpro fields.

This solution is surely working, I found it sooner already, but thanx for the help anyways.