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: 

How to display only the table names in Search help?

former_member699182
Participant
0 Kudos

Hello All,

I am wrting a report program with table name as parameter. I have defined the parameter as given below and it provides me search help by default.

PARAMETERS: p_tabnam TYPE DD02L-TABNAME OBLIGATORY.

The problem is, the search help displays the list of tables and structures as well. I want to restrict it to display only tables and not structures.

Is there a table similar to DD02L which has onyl the tablenames? Or the only way is to call the FM to add search help? Any ideas?

Thanks!

1 ACCEPTED SOLUTION

former_member191761
Active Participant
0 Kudos

Hi Gita,


Please use Event at selection-screen on value-request to read required values from table DD02L and use FM F4IF_INT_TABLE_VALUE_REQUEST to add search help.


PARAMETERS: p_tabnam TYPE DD02L-TABNAME OBLIGATORY.


data :it_return type STANDARD TABLE OF DDSHRETVAL,

        wa_return like line of it_return.


at selection-screen on value-request for p_tabname.

select tabname

  from DD02L

  into TABLE IT_DD02l

where tabclass = 'TRANSP'

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

  EXPORTING

*   DDIC_STRUCTURE         = 'DD02L'

    RETFIELD               = 'TABNAME'

*   PVALKEY                = ' '

*    DYNPPROG               = sy-repid

*    DYNPNR                 = sy-dynnr

*   DYNPROFIELD            = 'TABNAME'

*   STEPL                  = 0

*   WINDOW_TITLE           = 'Ekko Records'

*   VALUE                  = ' '

    VALUE_ORG              = 'S'

*    MULTIPLE_CHOICE        = 'X' "allows you select multiple entries from the popup

*   DISPLAY                = ' '

*   CALLBACK_PROGRAM       = ' '

*   CALLBACK_FORM          = ' '

*   MARK_TAB               =

* IMPORTING

*   USER_RESET             = ld_ret

  TABLES

    VALUE_TAB              = it_dd021

*    FIELD_TAB              = lt_field

    RETURN_TAB             = it_return

*   DYNPFLD_MAPPING        =

EXCEPTIONS

   PARAMETER_ERROR        = 1

   NO_VALUES_FOUND        = 2

   OTHERS                 = 3.

READ TABLE it_return into wa_return index 1.

p_tabnam = wa_return-fieldval.


Hope this helps.


Regards,

Sri

12 REPLIES 12

Former Member
0 Kudos

Hi Gita,

PARAMETERS: p_tabnam TYPE DD02L-TABNAME MATCHCODE OBJECT DD_DBTB_16.


regards,

Archer

0 Kudos

Thank you Archer. It does remove the structures from the list but I see that it removes Views as well?

I want the Search help to display the list same as that of SE16.

Any ideas?

Thanks.

former_member191761
Active Participant
0 Kudos

Hi Gita,


Please use Event at selection-screen on value-request to read required values from table DD02L and use FM F4IF_INT_TABLE_VALUE_REQUEST to add search help.


PARAMETERS: p_tabnam TYPE DD02L-TABNAME OBLIGATORY.


data :it_return type STANDARD TABLE OF DDSHRETVAL,

        wa_return like line of it_return.


at selection-screen on value-request for p_tabname.

select tabname

  from DD02L

  into TABLE IT_DD02l

where tabclass = 'TRANSP'

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

  EXPORTING

*   DDIC_STRUCTURE         = 'DD02L'

    RETFIELD               = 'TABNAME'

*   PVALKEY                = ' '

*    DYNPPROG               = sy-repid

*    DYNPNR                 = sy-dynnr

*   DYNPROFIELD            = 'TABNAME'

*   STEPL                  = 0

*   WINDOW_TITLE           = 'Ekko Records'

*   VALUE                  = ' '

    VALUE_ORG              = 'S'

*    MULTIPLE_CHOICE        = 'X' "allows you select multiple entries from the popup

*   DISPLAY                = ' '

*   CALLBACK_PROGRAM       = ' '

*   CALLBACK_FORM          = ' '

*   MARK_TAB               =

* IMPORTING

*   USER_RESET             = ld_ret

  TABLES

    VALUE_TAB              = it_dd021

*    FIELD_TAB              = lt_field

    RETURN_TAB             = it_return

*   DYNPFLD_MAPPING        =

EXCEPTIONS

   PARAMETER_ERROR        = 1

   NO_VALUES_FOUND        = 2

   OTHERS                 = 3.

READ TABLE it_return into wa_return index 1.

p_tabnam = wa_return-fieldval.


Hope this helps.


Regards,

Sri

0 Kudos

Thank you Sri for the source. I am trying to keep it a little simple and see if I can make it work without using the FM. I assume there should be a way.

Thanks.

0 Kudos

Do it like this:

at selection-screen on value-request for p_tabname.

   DATA: DNUM LIKE D020S-DNUM.

   data: variant like rsvar-variant.

   DNUM = SY-DYNNR.

    CALL FUNCTION 'RS_HELP_HANDLING'

         EXPORTING

              DYNPFIELD = 'DATABROWSE-TABLENAME'

              DYNPNAME  = DNUM

              OBJECT    = 'TB  '

              PROGNAME  = 'SAPLSETB'

              SUPPRESS_SELECTION_SCREEN = 'X'

              variant = variant.


regards,

Archer

0 Kudos

Archer it still doesnt bring out the same list of tables as that of SE16.

Any idea why?

Thanks.

0 Kudos

how it could be. I just copied the same source code from SE16.

You can check it in SE16, before you click F4, to type a '/h' on toolbar input filed, then it will take you to that place where F4 is come from.

former_member186077
Active Participant
0 Kudos

Hi Can you use the match code  DDSETBVIEW?

Thanks and Regards,

Sriranjani Chimakurthy.

0 Kudos

Sriranjani, it doesnt bring out the table list same as that of SE16. It lists the views.


Thanks.

0 Kudos

Hi Gita, Hope you have observed in the F4 that there are 2 tabs.

One for Views and another for tables. The Tables is the same as that of SE16.

Can you check again and confirm?

Thanks and Regards,

Sriranjani Chimakurthy.

0 Kudos

Yes I noticed it Sriranjani. But the list is heavily loaded and doesnt match the list in SE16 (I have only 5-6 tables in my list when i see from SE16). Does it work for you?

Thanks.

0 Kudos

Hi Gita,

In that case, you need to create a collective search help with the following search helps DD_VIEW_16 and DD_DBTB_16 and use it in your program.

Kindly check DDSETBVIEW  in SE11 for further information.

Thanks and Regards,

Sriranjani Chimakurthy.