SAP Program STARTDB4 - Submits reports that have to be run after the installation

Description
The purpose of this report is to complete an mySAP ERP installation orupgrade. The report is specific to mySAP ERP on IBM iSeries.
All reports that must be executed before end users can work smoothly onmySAP ERP are included in this report to make life easier at thecustomer site.
This report has one parameter 'VARIANT' of type N (numeric character)and length '1' and two report variants SAP_STARTDB4_1 and STARTDB4_2delivered by SAP.
SAP_STARTDB4_1 uses parameter value '1' and SAP_STARTDB4_2 usesparameter value '2'; all other values specified for parameter 'VARIANT'will return an error message 'wrong parameter value specified'.

  • Variant = 1:

  • Executes reports RSBTCUPD, RSPO0049, RPUTCTZ00, RSDB4STR and generatesSDB1FDB4 and some RSDB4 reports.
    • Variant = 2:

    • Deletes records in table MACID and MACOB and executes RDDMCGEN.
      As of Release 4.5A, RDDGENMC is used instead of RDDMCGEN.

      Reason
      RSDB4STR: Creates the database performance monitor file QAQQPRFcorrectly (for more details, see the report documentation for RSDB4STR).
      RSBTCUPD: (runtime < 1 min)
      Fixes INVALID_PRINT_PARAMS error in the syslog which prevents mySAP ERPbackground jobs from running; Updates TBTCP table entries.
      RSPO0049: (runtime < 1 min)
      Adds a print method 'Z' to TSP6D and TSP6T tables needed for AS/400printing.
      RPUCTZ00: (runtime ca. 15 min)
      Fixes HR data, updates T52C5 table, must run after upgrade/installation.
      RDDMCGEN: (runtime ca. 37 min)
      Regenerates matchcode data in MACOB and MACID tables because they areASCII.
      Tables affected: MACOB and MACID. Records in these tables have to bedeleted before RDDMCGEN can be executed successfully.
      Generation of SDB1FDB4:
      These are reports containing ABAP Native SQL statements (SELECTs) ontables/views not defined within the ABAP Dictionary. Normally an ABAPNative SQL statement does not need to have the table name qualified (seeexample) but, for performance reasons, the mySAP ERP data library name(R3DATA, is the SAP System ID of mySAP ERP) isgenerated into these statements. As the SAP System ID is defined atcustomer site and is freely selectable, the generation needs to be doneat customer site.
      Generation of RSDB4 reports:
      The database monitor file QAQQPRF is defined within the ABAP Dictionary,but has a sligthly different format at AS/400 level. To access thecontent of some fields of QAQQPRF completely or in part, ABAP Native SQLstatements are necessary. For performance reasons and to ensure that thecorrect file is accessed, the mySAP ERP data library name in generatedinto the ABAP Native SQL statement. As the SAP System ID is defined atcustomer site and is freely selectable, the generation needs to be doneat customer site.

      Precondition
      This report is designed for mySAP ERP on IBM iSeries (database systemDB2/400).
      It is executed once at the end of an installation or upgrade.

      Output
      The report STARTDB4 creates a log file (stream file) in the integratedfile system detailing which steps were performed and which errors wereencountered. If no errors or warnings occurred, an additional streamfile (referred to as 'success file') is created (necessary for startingSTARTDB4 via the command strreport at AS/400 level). Both files will becreated in the directory /usr/sap/trans/tmp. If this is not possible(the directory does not exist or has wrong the authorities assigned),/usr/sap/tmp or /tmp will be tried. If the creation of the log filefails in all three directories, the report will end with an error.
      Naming of log and success file:
      If the report is executed:

      • Using an existing variant (for example: SAP_STARTDB4_1):

      • Log file name: .
        Success file name: _SUC.
        • Online without an existing variant:

        • Log file name: STARTDB4.
          Success file name: STARTDB4_SUC.
          • In the background without an existing variant:

          • A variant with a generated name such as '&<13_digit_number>& and thelast two digits are taken for the name
            Log file name: STARTDB4_.
            Success file name: STARTDB4__SUC.

            Example
            Let us assume that the SAP System ID is 'C11' (so the mySAP ERP datalibrary is R3C11DATA), and that this library R3C11DATA contains a tableXYZ not known within mySAP ERP and that you want to access the table'scontents within an ABAP report. This can be done by formulationg an ABAPNative SQL statement like:
            exec sql.
            select * from XYZ
            into :name_of_abap_variable
            where ...
            endexec.
            When the report containing this statement is executed, the databaselooks into all libraries of the current AS/400 job (work process) fromtop to bottom to see if a table of this name exists and fetches the datafrom the first table found. This search takes some time. More seriousconsequences arise, however, if a table of the same name but withdifferent data exists in another library that gets searched first.
            To prevent this from happening, you can use the 'qualified table name'in ABAP/4 Native SQL. That is, you specify the library in which thetable exists as follows:
            exec sql.
            select * from R3C11DATA/XYZ
            into :name_of_abap_variable
            where ...
            endexec.