Problem solve Get help with specific problems with your technologies, process and projects.

Dynamic name determination of an ODS table

Here's a way to determine the technical name of any table of an ODS Object.

Use class-method cl_rsd_odso=>get_tablnm to determine the technical name of any table of an ODS Object, as well as other useful information, at runtime. I wrote the code in BW 3.0B, SAP version 6.20. It also works in BW 2.1C, SAP version 4.6D. I would expect it to work in BW 3.1 as well. I do not know whether it would work in a BW release prior to 2.1C.
*&---------------------------------------------------------------------*
*& Report  ZEXAMPLE1                                                   *
*&---------------------------------------------------------------------*
*& Display 100 records from any database table of an ODS Object.       *
*&---------------------------------------------------------------------*

program zexample1.

parameters:
  odsobjt type rsdodsobject obligatory," ODS Object

* Table type of ODS table:
*   Values: 0 = Active table
*           1 = Revised table (Obsolete as of 3.0x)
*           3 = Changelog Table
*           4 = Update Table
*           5 = Rollback Table
* Constant containing above values: 'rsdod_c_tabt' in type-group 'rsdod'
  tabtype type rsdodstabt   obligatory value check.

data:
  tabname   type tabname,              " Table name
  data      type ref to data.          " Data object of above table type

field-symbols:
  <data> type table.                   " Reference to 'data'

start-of-selection.
  call method cl_rsd_odso=>get_tablnm
    exporting
      i_odsobject = odsobjt
      i_tabt      = tabtype
    importing
      e_tablnm    = tabname.

  create data data type standard table of (tabname).
  assign data->* to <data>.

  select * into table <data> up to 100 rows from (tabname).

  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_structure_name = tabname
    tables
      t_outtab         = <data>.
This was last published in June 2003

Dig Deeper on SAP ABAP

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchHRSoftware

Close