61 Extract and Review Data for SPED Accounting

This chapter contains these topics:

61.1 Generating SPED Jobs

Navigation

From Localizations - Brazil (G76B), choose G/L Reports

From Financial Reports - Brazil (G76B09), choose SPED Jobs

The SPED Jobs program (P76B153) organizes the generation of the jobs that process data for the SPED Accounting text files. It handles several programs that retrieve information from different tables and controls the status of the execution. It also allows you to update certain information.

Using options available in this program, you can:

  • Run or re-run a block

  • Maintain hash codes for auxiliary books

  • Maintain job signatories

  • Access related books for book types other than "G"

The screen enables you to inquire, add, change, or delete jobs.

61.1.1 New Job

For a new job, define the Job description, Legal Company, Book Order Number, Year and Period. The Job Number is assigned a Next Unique ID Number.

61.1.2 Book Type

You set up a separate job for each book type. The Book Order Number was associated with a book type in the Book Type Definition program (P76B148). Each job will include all of the blocks required for SPED Accounting for a specified Book Order Number.

61.1.3 Add a Job

When you add a job, the system:

  • Writes data to the SPED Jobs (F76B153), SPED Job Header Blocks (F76B154) and SPED Job Detail Blocks (F76B155) tables using the Process ID and values that you set up in the Block Setup program (P76B147).

  • Writes records to the SPED Job Signatories table (F76B157) for the signatories that you set up for the legal company in the Legal Company Constants program (P76B143).

The program displays the status of the job on this screen. You can view the Process ID, Book Purpose, and Processed Date in the fold area of the screen.

61.2 Modifying Records Before Running a Job

You can modify certain data for jobs before you run the job:

Signatories

When you add a job, the system writes data for the signatories that you set up in the address book record to the F76B157 table. You can modify the signatories information before you run the job by entering a 2 in the option field for the job.

Hash Code

A hash code is a code provided by the Brazilian legal application for auxiliary book types (A or Z). This code is required in the Resumed book type R or B. To add the hash code for related books, enter a 5 in the option field for the job. Because there is one text file generated for each month, the hash code needs to be updated for each month and auxiliary book. Hash codes are written to table F76B151.

Related Books

When you add a job for a book type other than "G," the system allows you to enter data for the related books that you set up in the Book Type Definition program (P76B148) to the SPED Job Related Books table (F76B158). To access the SPED Job Related Books enter a 4 in the option field for the job.

Note:

The system enables you to make changes to the signatories, hash codes, and related books after you run a job. However, the system does not update the output files unless you reprocess the blocks in a job.

61.3 Deleting Job Records

If you attempt to delete a job for which no records exist in the output table, F76B156, the system displays a confirmation message. You can confirm the action to delete the job. When the system deletes a job, it deletes records for the job from all of the related tables.

The system does not enable you to delete a job if a record for it exists in F76B156.

61.3.1 Understanding the Execution Process

You run each block separately for the job you set up from the SPED Jobs program. To access Block Revisions (P76B155), enter a 1 in the option field on the SPED Jobs video. Then, to run all programs for a block, enter a 1 in option field beside that block.

The system completes these tasks for each block in the job:

  • Reads the job information for the block that is stored in the SPED Jobs table (F76B153).

  • Checks the values in the SPED Register Rules table (F76B139) to determine which registers to generate.

  • Populates the SPED Job Output Detail table (F76B156) with the information for the block, period, and registers. If the SPED Job Output Detail table (F76B156) has records for the block you are generating, the system deletes all records from the table for that block, then re-populates the table with the new records.

  • Uses a status code to indicate whether the records are queued for processing. Status codes are: blank (pending), P (in process), D (done), or E (error). These status codes appear for each program in the job that you run, and are displayed in the Block Revisions video. A status code of D (done) appears for the block when all of the programs have run without error. You can view the status of a block from the Block Revisions program.

61.3.2 Order of Execution

Instead of running all programs for a block, you may also run the programs individually. Program J76B162 builds the chart of accounts information, and must be run before any other programs for Blocks I or J. Block 0 may be run either before or after Blocks I and J, however, Block 9 must be run after all others.

61.4 Re-running a Block

To re-run a program, enter a 2 in the option field on the Block Revisions video.

If you reprocess a block or a portion of a block (re-run a program), you must also re-run subsequent blocks that use the data that you regenerated. For example, the Block 9 Generation program (J76B169) reads data from blocks 0, I, and J. If you re-run block 0, I, or J, you must also re-run block 9.

61.4.1 Generating the TXT file

Generating the text files that you send to the government's fiscal authority is done automatically by running Block 9, P76B169. There is one text file generated for each period. For example, if you run your SPED Accounting for periods 1-12, you will have 12 text files. This allows the files to be manageable in size.

The naming convention of the XML file is:

  • SP + Job Number + Period Number

For example, SP7610000201.TXT

61.4.2 Export of the XML File to the IFS Area

You must set up an IFS area on the iSeries for the TXT files.

You must also set up Export parameters on P76B169. On the versions list, choose to change your version. On the Additional Parameters screen, select F6, "Batch Export Parameters." Enter F76B169.TXT in the Import/Export name. Enter your IFS path in the field provided for it.

If more than one user will run Block 9, each must set up Export on the version(s) of P76B169 that they use. Several users may run the same version, but they must all set up individual batch export parameters for that version.

SPED Contabil IFS: 1 file created per period.

Figure 61-1 Figure File Created

Description of Figure 61-1 follows
Description of ''Figure 61-1 Figure File Created''