cancel
Showing results for 
Search instead for 
Did you mean: 

SAP ABAP , FREE_SELECTION_DAILOG , find option is needed .

Prati1604
Discoverer
0 Kudos
155

hi All, 

I am facing issue in selection dynamic creation.

Here requirement is to add find option, since the dynamic selection is created using FREE_SELECTION_DAILOG. here I am not able to add any find option.

 

any help is highly appreciated.

thanks in advance!

Accepted Solutions (0)

Answers (2)

Answers (2)

Sandra_Rossi
Active Contributor

No issue for me. I have created the GUI status by copying RSSYSTDB %_FS_DOC_ (the status used by FREE_SELECTIONS_DIALOG by default) and adding the function code ZZFIND, assigned it to Ctrl+F, and I could use Ctrl+F successfully.

As you didn't post your code, maybe your question is "how to add a custom button to the free selections dialog". Here's one way:

TYPES tt_table TYPE STANDARD TABLE OF rsdstabs WITH EMPTY KEY.
TYPES tt_event TYPE STANDARD TABLE OF rsdsevents WITH EMPTY KEY.
TYPES tt_field TYPE STANDARD TABLE OF rsdsfields WITH EMPTY KEY.

DATA(tables) = VALUE tt_table( ( prim_tab = 'SFLIGHT' ) ).
DATA(events) = VALUE tt_event( ( event = 'A'
                                 prog  = sy-repid
                                 form  = 'AT_SELECTION_SCREEN_INPUT' ) ).
DATA(l_selection_id) = VALUE rsdynsel-selid( ).
CALL FUNCTION 'FREE_SELECTIONS_INIT'
  IMPORTING  selection_id = l_selection_id
  TABLES     tables_tab   = tables
             events       = events
  EXCEPTIONS OTHERS       = 1.
IF sy-subrc = 0.
  DATA(pfkey) = VALUE rsdspfkey( pfkey   = 'FREE_SEL_STATUS'
                                 program = sy-repid ).
  DATA(where_clauses) = VALUE rsds_twhere( ).
  DATA(fields_dummy) = VALUE tt_field( ).
  CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
    EXPORTING  selection_id  = l_selection_id
               pfkey         = pfkey
    IMPORTING  where_clauses = where_clauses
    TABLES     fields_tab    = fields_dummy
    EXCEPTIONS OTHERS        = 1.
  IF sy-subrc = 0.
    DATA(where_clause_first_table) = where_clauses[ 1 ].
    SELECT * FROM sflight INTO TABLE (lt_sflight) WHERE (where_clause_first_table-where_tab).
  ENDIF.
ENDIF.

FORM at_selection_screen_input TABLES g_seldyn STRUCTURE rsseldyn
                                      g_fldnum STRUCTURE rsdsfldnum.
  CASE sy-ucomm.
    WHEN 'ZZFIND'.
      " Do whatever you want
  ENDCASE.
ENDFORM.

 

Prati1604
Discoverer
0 Kudos

I did try PFKEY  parameter . it is not helping in find option within my tree. 

 

raymond_giuseppi
Active Contributor
Do not use Answer to respond to a comment or answer. Answer is intended to be used to propose a solution to the initial question. Use Comment on the initial question or on any answer instead.
Sandra_Rossi
Active Contributor
If you tried PFKEY before asking the question, please edit it and explain everything you tried, to avoid asking you what you have already tried.