«

»

Oct 25 2011

How can I select or sort based on a report variable within Report Design Aid (RDA) if the variable is not included in the Business View?

VN:F [1.9.22_1171]
Rating: 2.0/5 (2 votes cast)

Described below is the concept for allowing a workfile to be used by Multiple Users in a UBE.  Advanced Knowledge of RDA and ER Design is a Pre-Requisite to code the report.

Add additional columns to the workfile that are not included in the original business view.
Add columns to the workfile in order to keep track of the records created by the UBE:
>Add the following DD Aliases to the workfile: CTID, JOBS, USER, PID, UPMJ, JOBN, UPMT
>Add CTID, JOBS to the Primary Key of the workfile.

Since the workfile will be shared by users submitting the same version of the UBE, (CTID, JOBS) will keep track of the workfile records created by the version being run.
>CTID is retrieved using bsfn B9800181/Get Local ComputerID
>JOBS is a Next Number that is retrieved using bsfn X0010 with a system code reserved for customers such as 55 and index 1. The Next Number for system code 55 must be set up initially through the Next Numbers application P0002.

In order to keep track of when the records are created, (USER, PID, UPMJ, JOBN, UPMT) are audit information fields that are returned by bsfn B9800100 – GetAuditInfo. The audit information fields will help in the event that the UBE ends abnormally in the middle of the process, therefore causing the workfile records to be not cleared for that run. These records will then be removed manually via a SQL Delete Statement using (CTID, JOBS).

The logic for the workfile is as follows:

Driver Section – event Initialize Section
>bsfn B9800181 to retrieve CTID into an ER variable report scope
>bsfn X0010 to retrieve JOBS into an ER variable report scope
>bsfn B9800100 to retrieve (USER, UPMJ, JOBN, UPMT) into ER variables report scope
>assign system value SL ReportName to ER variable report scope PID

Section to be Determined based on UBE (If based on the summary level, End Section of Level Break Footer.  If based on detail level, Do Section of main section). This section should also be invisible.
>ER TIO.Insert to write records to the workfile

Driver Section – event End Section – Call Second Report or Second Section which will use business view of workfile.  Because records are now in a business view, can print, sort etc.

>ER TIO.Delete on the Workfile using (CTID, JOBS) as the key – this will delete records that are created during the running session of the version.

An Example of this process is in R42565 Print Invoices, where records are written to workfile F42565, which is then used to print the invoices.

Published under the license.

VN:F [1.9.22_1171]
Rating: 2.0/5 (2 votes cast)
How can I select or sort based on a report variable within Report Design Aid (RDA) if the variable is not included in the Business View? , 2.0 out of 5 based on 2 ratings
(Visited 412 times, 1 visits today)

About the author

Muthu Kumar Lakshmanan

JDE Technical Developer

Leave a Reply