Programme SAP RWLC_REPORT_IN_PARALLEL - Framework for Parallel Reports

Title
Parallel Processing the Report &SYST-TITLE&.

Purpose
This report (&SYST-CPROG&) allows you to parallel process the report&SYST-TITLE& (&IF_REPRT&).
Parallel processing is divided into three steps:
Preselecting worklists
Estimating the workload and distributing it as evenly as possible amongparallel jobs
Creating variants for the jobs and starting the original report withthese variants on a (dialog) server group.
Instead of using the original report, this report SAPMTRAN is plannedwith a separate variant. You do not have to control the parallel jobs;the system automatically starts another (sub) job as soon as therequested level of parallel processing has been exceeded at the end ofa job.
You can let the next job in the job planning start as soon as thisreport finishes. You can trigger a job event to start the follow-onjob.

Integration
This report (&SYST-CPROG&) was generated with the transactionWLCPAR - External parallel processing.
Formore information on parallel processing, see thedocumentation for the transactionWLCPAR - External parallel processing.

Prerequisites

  • Generate the report with the transaction WLCPAR
  • (which has already been done here).
    • Create a variant for the report &IF_REPRT& as and when you need it if
    • you are planning the report as a normal job.
      • Maintain a (dialog) server group using the transaction
      • RZ12 - CCMS: RFC-Server Group Maintenance where you can startparallel jobs.
        • The maximum runtime for online processes must be set high enough so
        • that the parallel jobs are not terminated too early. Unfortunately youcannot start background processes on server groups.
          • There must be enough online processes available on the servers in this
          • server group.

            Features

            Selection
            Parallel starting of the report
            The report was generated for the report shown here to enable you toperform parallel processing.
            Variants used
            The report (&IF_REPRT&) is started in parallel using this variant. Thevariant is copied for every parallel job and one selection option onlyis changed to create separate worklists for the individual jobs.
            Mandatory entry.
            Number of parallel jobs
            Enter the level of parallel processing.
            Mandatory entry.
            Data preselection from the table
            The table displayed is copied from Customizing.
            IF '&gs_cust_options-presel_sec_tab&' <> ''A second table is displayed in two-level selections.
            ENDIF
            IF '&GF_WTFLD&' <> ''
            Weighting factor field
            The workload of a selected document is weighted with the value of thisfield. The field is copied from Customizing.
            ENDIF
            Workload per job
            You control the size of a job using the workload per job function.Large values mean fewer large jobs, smaller values allow you to createmore jobs. The more jobs that are created, the more flexibly you canreact to delays in a job that is overloading the server. The other jobscan be processed on the remaining servers with the result that,hopefully, all the jobs will end at the same time.
            Every document, depending on its size, creates a certain amount ofworkload. It could be due to the number of document items, thefrequency with which a certain value appears, or the value of a fieldin the document.
            Start on the server group
            The parallel jobs are started on this (dialog) server group.
            Final result
            With this event you can start a follow-on job using the job control.
            IF '&gs_cust_crit-selpar_name&' <> ''
            Additional selection criteria
            All the values that relate to the tables that are to be selected aredetermined from the variant for the worklist preselection. If these areinsufficient or are defined in such a way that there is no reference tothe tables in the data type, you can define your own selection optionsand parameters in Customizing to restrict the selection.
            The various input options from the Customizing entries are given on theselection screen.
            ENDIF
            All the selection options from the original report were determined whenthis report was generated and are displayed on the selection screen asa radio button.
            Selection of selection option for creating split worklists
            In this area you choose the selection option that is filled in thegiven variant to obtain separate worklists for the parallel jobs. Youcan use the F1 help to determine the name of the selection option andthe table field to which it refers (in case you need the values forCustomizing or you want to know why another table has been selected aswell as the primary and secondary table). External parallel processingis only possible if the table field comes from the table that was usedfor the data preselection. Table fields are permitted from a table thathas the same table key as the table that was selected first.
            You will gain some runtime advantage, if you select the option thatbelongs to the primary table key of the documents that are to beprocessed.
            Selection of values for grouping worklists
            In this area you indirectly select the value that is defined by a tablefield which is used for distributing documents among parallel jobs. Youcan also enter another field in the input field in TABLE FIELDform if no selection option is available for it (it is only used if youchoose the radio button beforehand).
            However, the same restrictions are valid here as in the previous area:the selected field must appear in the selected tables or in one tablewith the same primary key as a selected table.
            IF '&GF_INVIS_SELOPT_COUNT&' <> '0'
            In general, only those selection options that were entered forgenerating this report can be seen. However, you can display them bychoosing the pushbutton <948> (display suppressed selection options(Ctrl F2 )) and then suppress them again with <949> (suppress selectionoptions (Ctrl F2)).
            The selection of "suppressed" options is lost then and cannot berecreated if the "suppressed" selection options are displayed again.
            ENDIF
            Error messages
            You can enter search strings in this selection option that are comparedwith the final message of &IF_REPRT& to recognize errors in a sub-jobof &IF_REPRT&.
            Unfortunately the message type (error, success, information) of thefinal message of &IF_REPRT& is not available in the system to respondwith an error message in &SYST-CPROG& too.
            See also: Workload Control/Ext. Parallel.: RFCMessage.
            Log details
            You can monitor the progress of the processing in the background joblog if you output the start and finish messages from the start and endof the (sub) job.
            The list output of the report &IF_RPRT& (if available) can be combinedwith the log output.
            In both outputs, you can choose never to display them in the job log,or only in the case of an error, or always to see them.
            Print report lists immediately?
            The lists that were printed from the report &IF_RPRT& (if available andif a list output has been requested (see above)) can be printedimmediately in a separate spool job. Make the appropriate selection forthis.
            The parameters for the printer are taken from the job definition andthe user settings. Unfortunately, the system does not allow you tocreate a link between the job and the individual spools for immediateprinting. You can, however, set brackets around the spool request usinga name of your choice when planning &SYST-CPROG& to find the spoolrequests that belong together.
            Output gen. selections?
            Additional ABAP routines are generated at the report runtime for datapreselection that are no longer available once the report has ended. Ifthere are syntax errors (for example, if you enter a table that doesnot exist or the tables to be selected have different key field names)or you would like to check the preselection, you can output theroutines by choosing this field.
            Test run
            You can now simulate the external parallel processing response. All thesteps are executed that occur in the real run. Only the start of theactual report &IF_REPRT& is suppressed.
            The variants for the parallel sub-jobs are available in the system ifyou want to run a check (max. 999).

            Selected details about the external parallel processing procedure

            Generic data preselection
            The values for the selection options from the section "ParallelProcessing Using Selection Options" have to be defined from theselected tables. The fields do not necessarily have to be from thetables that come from the worklist assessment (primary and secondarytables). The system tries to find the fields whose values are copied tothe selection options (selected in the areas "Selection...") out of allof the fields in this table. The system searches for a match of thefollowing sequences:

            • Same name (field name from primary or secondary table matches the field
            • name from "Selection of selection option for creating split worklists"or "Selection of values for grouping worklists". A matching data typeis taken implicitly).
              • Same data element

              • Same domain

              • Same internal data type (for example, CHAR with same length)

              • The search is finished successfully when the first match is found.
                If there is not at least one data element match found in the search,another selection for the table is generated on which the selectionoption from one of the two options is based. The above search tries toavoid this additional runtime.
                However, a prerequisite for this additional selection is that thetables that have been read have the same table key (the key can alsodisplay fewer fields). A match in the names is expected. This is alsothe case for accessing the secondary table.
                It is also generally the case that the tables are closely related tothe context of the report.
                The solution, which also covers the last special case, would be tootime-consuming and prone to errors for use in your system forimplementation and the necessary Customizing settings. However, you canprogram your own selection using a function module (templateWLC_PRESELECT_EXAMPLE).
                If the names of the key fields in the tables that are to be selected donot match, then a syntax error occurs in the ABAP routine that isgenerated.

                Worklist distribution among jobs
                To spread the workload of a document, generally the documents aredistributed among the (sub) jobs using different procedures and thedesired workload for each job represents an upper limit.
                If the document workload distribution is very high (variance > 10), thedistribution of the documents among the jobs is not linear (inincreasing value of the filled selection option (option "Selection ofselection option for creating split worklists")). They are distributedin increasing workload. The "biggest" documents are distributed amongthe jobs. The "smaller" documents can then be distributed more flexiblyat the end to keep the job workloads more equal.
                Unfortunately, individual values for intervals without gaps in theselection option cannot be summarized in this procedure, nor in thelinear assignment (background: the number of individual values for eachselection option is limited by the database system. See thedocumentation for WLCPAR).

                Job control
                The jobs are started by a function module using an asynchronous RFC onthe requested server. Only those jobs you have entered will be started.Each time one job ends, a new one is started. The jobs should allfinish at the same time, as the workload was evenly distributed to makethe jobs the same size. However, this was based on an estimation andthere may be delays due to a lack of resources. As the jobs are notallocated statically to a server, once one job finishes, the next canbe started.
                Each of the variants is created before its corresponding job starts. Aslong as no more than 999 jobs have to be started, all the variants willstill be in the system after the jobs have ended (the original namewill have '_' placed in front of it and a 3-figure number placed at theend. Characters may be removed from the middle of the name of thevariant if it is too long.

                Debugging options
                The report contains breakpoints at important points and these can beactivated dynamically. You have to set the user parameterWLC_DEBUG_MODE for this with one or more figures between '0' and '9'.
                The figures have the following meanings:

                • 0

                • The report stops every time a (error) message is generated
                  • 1

                  • The report stops before the worklist preselection
                    • 2

                    • The report stops at several important points during the generation ofthe selection routines
                      • 3

                      • The report stops before the documents are distributed among the (sub)jobs
                        • 4

                        • The report stops before each variant is created for a (sub) job
                          • 5

                          • The report stops before a (sub) job starts on the server group - stillin the same LUW
                            • 6

                            • The report stops once a (sub) job finishes in the LUW of &SYST-CPROG&
                              • 9

                              • The report stops before and after the &IF_REPRT& start (SUBMIT) in theLUW on a server in the server group. A new session is started for thisand should, therefore, be used with care.
                                Figures '7' and '8' have no meaning.
                                If the user parameter had the value 034, for example, then the reportwould stop at all (error) messages, at the beginning of thedistribution, and when jobs are started.

                                Output
                                The output contains

                                • An overview of all the entry parameters

                                • The used and unused restrictions for the preselection

                                • A statistical overview of the preselected worklist's workload (number
                                • of documents, total workload, minimum and maximum workload ... )
                                  • The job processing runtime

                                  • Statistics for each job that has been started

                                  • The workload contained
                                    The variant used
                                    The application server used
                                    The processing status
                                    The job runtime