Copyright 2020 - BV TallVision IT

The data on SAP's tables sometimes needs to pulled out of the system. Compare to other systems, freeze the moment (repeat the download 2 days later and compare changes) or just to ensure nothing is lost when you are about to embark on something. This report is a download tool for data. It's quite flexible in letting you define which tables (multiple), which fields and which records. Table name and description, field names and table content of all tables specified will end up in a single dataset (file).  

 A screenprint of the selection screen - which should explain a thing or two about the program:

The main screen or opening screen controls the detail of interface file location and contents. The file can be handed to the presentation server or to the back-end. Existing files can also be appended to, so if all your material can not be specified in a single program run, simply run it again for the second part. A selection of table fields (columns) to be included (sequence of columns can not be influenced) or fields that should be excluded (as per example: MANDT is excluded). Then there is control over the level of detail of information that should be included in the file. Headers, column headers, messages and even the first column (which holds the table name).

With these settings, field values can be fixed to a selection. All these lines are applied to their respective tables, as a series of selection settings added together with AND.

These are also field settings which are AND-ed together. Values that are filled in here will be applied to all selected tables that have the field.

The last is the most elaborate of selection options. This is where any set of options can be filled in. The selection screen explained:

  • Table T100 (messages) is specified as only table (up to 20 tables can be specified)
  • For this table the MSGNR field should be set to 100 OR between 123 and 345 OR it should be larger than 500. 
  • AND For table T100 (the only table specified here) field ARBGB should start with a Z

The table contents of multiple tables will be listed into a single output and handed to an CSV file (ready for Excel) or dumped on screen (from where save-as can be used to store the data).

Example output to Excel

Example output as report

For every table the table name, description, list of fields and the actual content will be downloaded. The selection screen also allows field selections (where predefined values can be defined) or a flexible selection (for which a bit more knowledge of Abap selections is required). If a mistake is made in the selection parameters, a message will appear (dumps are captured/avoided).

Getting a dump ?

The download tool very much relies on function module /BODS/RFC_READ_TABLE which has undergone SAP improvements. This can lead to the CALL_FUNCTION_CONFLICT_LENGTH dump, that can easily be resolved by adjusting the definition of the OPTIONS tables parameter, which should be a table of /BODS/RFC_DB_OPT (c255) or RFC_DB_OPT (c72), old style.


Summary of functionality - The fields on the selection screen:

  • Tables - specify a table or a list of tables. Wild cards and ranges are supported, however the total number of tables that can be selected is 20. If more tables are specified, the user is informed with a message "Number of tables reduces to 20", after which the selection continues.
  • Table fields - this is where the field names to be displayed can be selected, irrelevant of the table they are in. It can e.g. be used to omit the MANDT field, but normally it is left blank. Note: if a table is too big - the total number of characters to be processed can not exceed 512, which includes field separators - further fields are automatically omitted. A message will indicate this. The table fields select option can be used to remove unwanted fields leaving room for more fields OR it can be used to specify exactly which fields are needed. Hence this parameter controls the columns to be downloaded.
  • Save as- indicator to save the result as file. The format is defaulted to .csv (semi-colon-delimited) which is accepted by Excel. The file name supports system variables, which will be populated at runtime:
    • {S}=system+client
    • {D}=date yyyymmdd
    • {T}=time hhmmss
    • {H}=hour hh
    • {M}=minutes mm
    • {C}=client
    All of the above parameters can be placed in the file name (or path).
  • Append - The append option will append results to an already existing file. This can be a very handy feature if you want to process multiple tables and you can not specify all tables with selection options in a single run. Simply add another run and append the results tot the data from the first run.
  • Start Excel - opens Excel with the results.
  • Save on server - Store the results in a server file. The same parameter set ({S}, {D}, ... etc) is available for the path and filename specified here. The file can also be Appended to
  • If the output is not directly sent to XLS and also not stored on the server, it is dumped to the screen as a report (without header). From there it can be saved as a text file or .csv file (unconverted).
  • Header with table description - add a header line stating the table for each table that is processed. It shows the table name, the number of selected entries and the table description (in logon language).
  • Columnheaders as fieldname and Columnheaders as description - lets you add a header line to each table with column names as DDIC field names or column names with a short description (in logon language). Can also be used simultaneously.
  • Incorporate messages in the result - if there are error messages during the processing of a table, they will be shown in the result as a line.
  • First column: table name - the first column of every line shows the table name
  • Quote text fields and Quote all fields - Add double quotes to text fields or all fields
  • Format dates - transforms internally formatted dates (20140913) to european dates (13-09-2014).
  • Overlay fields with - Spaces are overlayed with the given character - which will fill out the fields (every field will be the same length)
  • Field Separator - this is the separator character used to delimit the fields, it is defaulted to ; (.csv). A checkbox parameter is available to set the seperator to the TAB character
  • Max. number of records per table - limits the maximum number of records that will be processed (performance reasons). If you have no maximum, the field can also be left blank.
  • Skip records - this field can be used to start selecting at record N+1 (skipping the first N records)

Tabs: Field selection, field selection-2 and flexible field selection:

  • Field selection - specify the table name, field name (both from combo boxes) and the value the specified field should be set to.
  • Field selection (2) - as above, but without relation to a table. The field specified here will be checked in every table that is processed. Note that the specified field will be ignored for tables that don't have the field.
  • Free selection- Table and selection logic. For each table free - format selection logic can be applied. Knowledge of SQL selections is required. A few examples:
    MSGNR <= '100'  
    MSGNR BETWEEN '123' AND '304' 
    MSGNR <> '123'
    MSGNR <= 100 AND ARBGB LIKE 'Z%'
    MSGNR IN ('012', '013', '014', '015')