Skip to Content
Author's profile photo Eitan Rosenberg

SDB_ADBC – the program

Hi all,

As I wrote here http://scn.sap.com/community/abap/blog/2013/12/23/sdbadbc–power-to-the-people

I have been playing with package SDB_ADBC and its gang members….

Based on what I learned from program ADBC_QUERY I wrote a program (Y_R_EITAN_TEST_28_01) that I hope you will find it useful .

The program allow the user (A programmer) to query data using the raw native power of the local database.

For example In case of Oracle you can refer to Oracle documentation (http://docs.oracle.com/cd/B19306_01/server.102/b14200/toc.htm).

– The program create SQL statment based on the selected fields and functions (FORM get_statment) .
– The program create a dynamic table based on the selected fields and functions (FORM run_statment) .
– Using SDB_ADBC clases the program query the data and fill the dynamic table (FORM run_statment).
– The table is presented using CL_SALV_TABLE .

The native SQL is not client dependent so using MANDT in the where clue is required.

Limitation:
  The program is not design for joins (This require more development and I do not have the time…)
 
Some screens:

/wp-content/uploads/2013/12/capture_20131226_120644_350969.png

/wp-content/uploads/2013/12/capture_20131226_115955_350968.png

Source:

Y_R_EITAN_TEST_28_01.txt – the program.

Y_R_EITAN_TEST_28_01_screen_100.txt – screen source .(it is very simple since I use OO components )

/wp-content/uploads/2013/12/capture_20131226_123501_350978.png

/wp-content/uploads/2013/12/capture_20131226_123526_350979.png

STATUS_COMMON

Define BACK , EXIT and CANCEL as Exit Command.

/wp-content/uploads/2013/12/capture_20131226_124042_350981.png

/wp-content/uploads/2013/12/capture_20131226_123820_350980.png

TITLE_COMMON

/wp-content/uploads/2013/12/capture_20131226_124300_350982.png

That is all for now .

Have fun.

Update 2013/12/29

I added multi function support.(More power to the peoples…)

See screen cap:

Capture.PNG

Update 2014/01/01

Since I hate typing I just added the SUM function as a check box.

Also I forgot to mention that a click on the field name will append the field name to the text box (As I said I hate typing… )

Capture_02.GIF

Update: 19/02/2014

Take into account those pesky “name space” fields.

Assigned tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sander Boers
      Sander Boers

        CALL METHOD cl_alv_table_create=>create_dynamic_table

          EXPORTING

            it_fieldcatalog = it_fieldcatalog

          IMPORTING

            ep_table        = g_data-it_data.

      🙁 , what about RTTI?

      Author's profile photo Eitan Rosenberg
      Eitan Rosenberg
      Blog Post Author

      Hi,

      True .

      I wanted to use RTTI but I wanted to INCREASE the size of field when using SUM function
      and at the same time I wanted to retain the headings .

      Regards.

      I even asked :

      I want to use RTTC but.....

      Author's profile photo Sander Boers
      Sander Boers

      Considered CL_SALV_TABLE?

      * Short sample

      DATA lt_u TYPE STANDARD TABLE OF usr02.

      SELECT *

         FROM usr02

         INTO TABLE lt_u.

      cl_salv_table=>factory(

      IMPORTING r_salv_table = DATA(lo_alv)

      CHANGING t_table = lt_u ).

      lo_alv->get_columns( )->set_optimize( ).

      lo_alv->display( ).

      Author's profile photo Eitan Rosenberg
      Eitan Rosenberg
      Blog Post Author

      Hi,

      I do not understand what you mean ?

      The program is using CL_SALV_TABLE to dispaly the output .

      For field selection I use cl_gui_alv_grid (input fields) .

      Regards.

      Author's profile photo Marius Stoica
      Marius Stoica

      Hi Etian,

      I know you are retired. Is there a chance that you could upload the program? There is no download link. Or maybe any other fellow ABAPer could upload it.

      Kind regards,

      Marius

      PS: Enjoy your retirement :).