Páginas filhas
  • DI_PCP_Protheus_PPI_Multitask_Integration

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

PCP Protheus x PPI-Multitask Integration


Business Context

  1. Manufacturing Execution Systems, or simply MES is the term used to refer to the systems focused on the management of production activities establishing a direct link between planning and shop floor. The MES systems generate precise information and in real time promoting the optimization of all production stages since the issue of an order to the shipment of finished products shipment.
    The importance of these systems comes from the gap that regularly exist between the ERP (Enterprise Resource Planning) and the specific softwares of the production line.  The MES can import data from ERP and integrate with the production daily routine, managing and synchronizing the productive tasks with the flow of materials.
    Considering that in the supply chain the highest added value is in the production, it makes sense investing in systems optimizing the flow, control and quality of material (Source: PPI-Multitask).
  2. Planning and Production Control  Gathering of means of production (raw material, labor, and equipment) enables manufacture of products that arise from the action of productive systems. The plans are the guide of execution and in production control are commanded by the auxiliary body named Planning and Controlling of Production (PCP) that establishes the production line rules, aiming at an ordered and continuous flow of the productive process.
  3. Shop Floor Allows you to plan, punch and monitor activities executed in each work center of the plant and machine, enabling an integrated view of executed operations, under execution and to be processed.  Allows the Management and Monitoring of results (productivity, efficiency, delays, quality, use, levels of downtime, scrap reason, deviation of real/standard time etc). In MES integrated use, punches are executed by MES system.

 

Systems Involved

...

  • PCP PROTHEUS 11.80.14, 12.1.10 (Phase I)
  • PCP - SIGASFC PROTHEUS 11.80.17 (Phase II)
  • PC-FACTORY (PPI MULTITASK)

 

Integration

The aim of the PC Factory Integration (MES software of company PPI Multitask) X PCP PROTHEUS is to make available to TOTVS customers a new option to control the production through the automation of processes, enabling the updating and extraction of online information to simplify the customers flow.

 

Scope

 

Enables the integration between the PCP module of SIGASFC Protheus with MES PC-Factory of PPI Multitask, aiming at controlling the annotation of production orders. Protheus is responsible by the creation of production orders and the PC-Factory with annotation.

The integration contemplates the following routines and processes in PHASE 1:

  1. Parameterization: Enables to parameterize the use of integration, indicating if it is ACTIVE. Indicates whether there is generation of XML files of information that is transferred between the systems, and also enables to define filters that are applied to information.
  2. Integrators: Adapters are functions responsible for sending or receiving information that is transferred between Protheus and PC Factory systems. Integration contemplates the following information: Product, stock location, resource, production orders, production annotation and stoppage annotation.
  3. Pendencies: Enables to manage the pendencies of PCP Protheus delivery to PC-Factory as well as to check the history and errors of integration process.
  4. WebService: Enables to process the annotation of production and stoppage sent from PC-Factory to Protheus;
  5. Synchronization: Enables to execute the synchronization of data from PCP Protheus and PC-Factory. Able to send data from Products, Stock Location, Resource and Production Order.
  6. Import Log: Enables to query the integration process of annotation of production and stoppage sent from PC-Factory to Protheus.

The integration contemplates the following routines and processes in PHASE 2:

Phase 2 contemplates the consumption of components, movements executed by PC-Factory and balances in stock. It also considers the SIGASFC - Shop Floor system.

  1. Parameterization: Enables to parameterize the use of integration, indicating if it is ACTIVE. Indicates whether there is generation of XML files of information that is transferred between the systems, and also enables to define filters that are applied to information.
  2. Integrators: Adapters are functions responsible for sending or receiving information that is transferred between Protheus and PC Factory systems. Integration contemplates the following information: Product, stock location, resource, machine, tools, script, structure, address, production order, balance in stock, movements and transfer of stock, annotation or production and stoppage annotation.
  3. Pendencies: Enables to manage the pendencies of PCP Protheus delivery to PC-Factory as well as to check the history and errors of integration process.
  4. WebService: Enables to process the annotation of production and stoppage sent from PC-Factory to Protheus;
  5. Synchronization: Enables to execute the synchronization of data from Protheus and PC-Factory. Able to send data from Products, Stock Location, Resource, Machine, Script, Structure, Address, Balance in Stock and Production Order.
  6. Import Log: Enables to query the integration process of annotation of production, refusal and stoppage sent from PC-Factory to Protheus.

...

Nota
titleNote:

Integration does not contemplate the generation of orders by APS.

Install/Implement/Use Requirements

For Protheus version 12, apply package of updates from version 12.1.10 in Phase I. It can also be used in version 11.80.14 for Phase I and 11.80.17 for Phase II. Run the update of dictionary with program U_UPDPCP34.
Build must be equal to or later than 7.00.131227A and date 9/8/2014.
IP Address and released port for WebService execution. These data are used in APPSERVER.INI file in session WEBSERVICE.
Update APPSERVER.INI  file in session WEBSERVICE.
To configure a WebService, check this configuration: http://tdn.totvs.com/pages/viewpage.action?pageId=6064937
Exemplo :
; WEBSERVICE CONFIGURATION

...

Enable=1
Server=proxy-jv.jv01.local
Port=8080
User=XXXXX
Password=*******

 

Installation/Updating

The PCP Protheus x PC-Factory PPI-Multitask is activated through the following steps:

...

  • Register, change and deletion of product MATA010, AGRA045 stock location and MATA610, SFCA006 and SFCA002 resource;
  • Register and change of orders MATA650;
  • Process to FIRM orders MATA651;
  • Maintenance of operations MATA632;
  • Maintenance of allocation, MATA380 and MATA381;
  • Register, change and deletion of Operations x Components MATA637;
  • Machine Load MATA690;
  • Calculation of MRP MATA712 (version 11.8) or PCPA107 (version 12);
  • Register, change and deletion of structure, MATA200;
  • Production splits generated by routines that handle order, and SFC310 annotation model 1 of shop floor.
  • Register, change and deletion of address MATA015;
  • Register, change and deletion of tools MATA015;
  • Balance Update
  • Inbound Invoice - Routines executing function B2ATUCOMD1;
  • Sales Invoice - Routines executing function B2ATUCOMD2;
  • Internal Movement - Routines executing function B2ATUCOMD3;
  • Addition of balance MATA220 and MATA805.

...

  • Register of stoppage reasons SFCA004;
  • Register of scrap reasons SFCA003;
  • Stock Separate movements. Inbound MATA250. Outbound MATA240;
  • Transfer of stock MATA261;
  • Annotation of production MATA681 and SFCA310;
  • Annotation of stoppage MATA682 and SFCA311;
  • Refusal, annotation of loss, MATA685.

 

Version Control

TOTVS group, represented by its brands, manages the layout progress demands and other adjustments, agreeing together with requesters the release approval term.
All progress scheduled must be discussed and approved by brands before the start of development and is only developed in case of agreement of brands and alignment with directive defined by TOTVS Integration Committee.

 

Support

All lines are responsible for support to integration resources; hence, the support teams of RM Connector and Protheus® Back Office products are ready to make the first analysis and, whenever needed, to transfer it to the fittest team in each case.

...

Nota
titleNote:

This support model is being reviewed by TOTVS.


Transactions/Entities/Singles Messages

The following transactions are exchanged between TOTVS and PPI-Multitask:

 

 

 

 

001 Reason Reason Annotation1001 AnnotationEstoque 001

Method

ID

Description

SourceOriginTarget

Destination

XSD (versions may vary)

ProgramsTable

FilesRegisters

01

Product

Protheus

PC-Factory

Item_3_001.xsd

MATA010SB1

02

Stock Location

Protheus

PC-Factory

Warehouse_1_001.xsd

AGRA045NNR

03

Machines

Protheus

PC-Factory

Machine_1_000.xsd

MATA610

SFCA002

SH1

CYB

04ResourcesProtheusPC-FactoryResource_1_000

MATA620

SFCA006

SH4

CYH

05StructureProtheusPC-FactoryItemStructure_1_000MATA200SG1
06ScriptProtheusPC-Factory ItemScript_1_000

MATA632

MATA637

SG2

07

Production Order

Protheus

PC-Factory

ProductionOrder_2_

004.xsd

MATA650

MATA651

MATA380

MATA381

MATA690

MATA712

PCPA107

SFCA310

SC2
08AddressProtheusPC-Factory AddressStock_1_000MATA015SBE
09StockProtheusPC-FactoryItemStockLevel_1_000

B2ATUCOMD1

B2ATUCOMD2

B2ATUCOMD3

MATA220

MATA805

SB2

SB8

SBF

Processes

09

Reason of Stoppage

PC-Factory

Protheus

StopReason_1_000

CFGX016

SFCA004

SX5

CYN

10Reason of ScrapPC-FactoryProtheusWasteReason_1_000

CFGX016

SFCA003

SX5

CYO

11Annotation of ProductionPC-FactoryProtheusProductionAppointment_2_000

MATA681

SFCA316

SH6

SD3

CYV

12

Annotation of Stoppage

PC-Factory

Protheus

StopReport_1_001

MATA682

SFCA311

SH6

CYX

13Stock - RequestPC-FactoryProtheusStockLevel_2_00 

SB2

SB8

SBF

14MovementsPC-FactoryProtheus MovementsInternal_1_001

MATA240

MATA250

SD3
15TransferPC-FactoryProtheusTransferWarehouse_1_003MATA261SD3
16RefusalPC-FactoryProtheusRefusal_1_000MATA685SBC

 

 


Information Flow

Transactions information flow:

  • Product, stock location and resource: during creation, change and deletionof a product in program MATA010, from a stock location in program AGRA045 or of a resource in programs MATA610 or SFCA006 or SFCA002 (machine) and tools in MATA620. The programs check whether the integration is active, and if positive, they deliver the register to PC-Factory. If there is no error, the register does not display any message, if there is an error, a message is displayed questioning whether to create a delivery pendency in program PCPA110. If you choose to operate a pendency, the process is committed in Protheus, and the updating for PC-Factory must be executed through PCPA110.
    In the engineering, the register of structure MATA200 and script MATA632 or MATA637 and addresses MATA015 are integrated whenever a record is created, changed or deleted.
  • Production order: during creation and change of a production order, or during the change of the status of an order (allocation/machine load, request, operations change or pledge, MRP creation of splits), the program checks whether the integration is active and, if it is active, it executes the delivery of registration for PC-Factory. If there is no error, the register does not display any message. In case of error, a message is displayed and a delivery pendency can be created in program PCPA110. At the end of the process, the routines processing multiple orders, for example machine load, the amount of records that were sent to PPI-Multitask is displayed and the ones which had delivery pendency. Note: Some routines generate pendencies without executing the questioning due to the number of processed orders.
    Routines affected by integration: Maintenance of Orders (MATA650), Routine to Establish Orders (MATA651), Maintenance of Operations (MATA632 or MATA637), Maintenance of Allocation (MATA380 and MATA381), Machine Load (MATA690) amd MRP (MATA712), Production splits (SFCA310).
  • Program of PCPA110 pendencies management - this program aims at managing pendencies/exceptions related to integration that are created when the message was not sent to PC-Factory, whether they are pendencies or errors. Enables the reprocessing of a message, deletion of a pendency and the XML view, besides having the filter per date of delivery, transaction, type of pendency and generating routine. The routine also enables to query the messages successfully sent.
  • Synchronization program PCPA111 - enables the deliver of information from product, stock location, resource, tools, script, structure, address, balance in stock and production order, it aims at updating the PC Factory database. Besides filters defined in PCPA109, you can also add new filters for each table.
  • Production Annotation: This routine consists in WebService to receive annotation of production executed by PC-Factory. You can also process production annotation and resource stoppage. Executes the same process the routines MATA681 and MATA682. When the Shop Floor is installed, it runs the same process the routine SFCA316 and SFCA311.
    The integration flow is the following: a. the Operator normally reports according to its operation in PCFactory b. In a batch or triggered process, parallel to the system, the message is assembled (XML) according to Schema of Single Message TOTVS and the delivery of message (XML) for Protheus, validating the message and follow the respective business adapter up  (MATA681/MATA682 or SFCA316/SFCA311) for processing. c. In case of mistakes, this report has pending status for delivery in the MES software and the user take actions in PC-FActory (Protheus does not keep traceability of receipt messages, but it registeres in LOG the processing). d. In case of success in report, the number of the report record executed in Protheus returns to PC-Factory. This number can be used in case of reversal.
  • UPdate of balance in PC-Factory will happen as follows:
    a. Request: the PC-Factory requests balance generating request XML message. In this message, you can request balance per item, per stock location, among others.
    b. Protheus Updating: When balance is updated, Protheus must send a XML message to PC-Factory. The main routines of ERP as inbound and sales inbound, some internal movements and addition of balance through MATA220 and MATA805 are considered.
  • Stock movements: When PC-Factory performs stock movements and transfers, these movements are updated in Protheus.
    In case of movements, if I (input), it must run MATA250. If O (output), it must run MATA240. In case of transfers, it runs MATA261.
  • Refusal/annotation of loss. This routine consists in WebService to receive the refusal records in PC-Factory. The same process is executed in MATA685 routines.
  • Query of Import Log PCPA112: This routine consists in the query of annotation records that were processed by the integration Protheus x PC-Factory. Routine must display the annotation executed and the status of each process.

...

Annotation: The entry point  MT680VAL  enables to validate if any information must be mandatory as time, quantity, among others. These validations are under the customers' responsibility, as each has its own rule. Details in: MT680VAL - Addition of Productions.

Production Order: The Entry Point  MTI650ADOP enables to add a new operation in the production orders message. For each operation being sent   this entry point is executed once. Details in:: MTI650ADOP_Add new operation of production order adapter.

Production Order: Production Order: The Entry Point MTI650FCOP enables to change the second unit of measure of the operation being sent in the production orders message. Details in:: MTI650FCOP_Change_conversion_factor_second_unit_of_operation_measure_adapter_production_order.

Production Order: The Entry Point MTI650QTOP enables to change the amount of operation being sent in the production orders message. Details in: MTI650QTOP_Change_quantity_of_operation_adapter_production_order.

Annotation: The entry point MATI680OPR enables to change the code of operation received in the annotation of production. Details in: MATI681OPR_Edit_operation_code_message_annotation_production.

Annotation: The entry point MTI681QTAP enables to edit the quantity received in the annotation of production. This entry point is indicated to apply the conversion factor in the amount of annotation when ERP and PC-Factory work with different unit of measurement. Details in: MTI681QTAP_Edit_amount_of_annotation_ProductionAppointment.

Annotation: The entry point MATI681EXC enables to check whether the annotation is executed. This entry point is indicated for validations that hinder the annotation of production and stoppage. It is also used for cases in which you have to update some information before annotation (example: reversal an address). Details in: MATI681EXC_Processes_Message_Annotation.

Production Order: The Entry Point  MTI650ADOP enables to add a new operation in the production orders message. For each operation being sent   this entry point is executed once. Details in:: MTI650ADOP_Add new operation of production order adapter.

Production Order: Production Order: The Entry Point MTI650FCOP enables to change the second unit of measure of the Production Order: The Entry Point MTI650UMOP enables to change the second unit of measure of the operation being sent in the production orders message. Details in:: MTI650UMOPMTI650FCOP_Change_conversion_factor_second_unit_of_operation_measure_of_operation_adapter_productionnproduction_order.

RegistersProduction Order: The Entry Point PCPXFUNPPI  enables to inhibit the integration in certain routine. Example: If you do not want integration to occur in the creation of MATA650 orders, you can use this function to inhibit the use. Details in: PCPXFUNPPI_Routines_not_executing_integration_with_the_PC_Factory.

Internal Movements. The entry points MATI250CRG and MATI240CRG enable specific validation. These validations are under the customers' responsibility, as each has its own rule. You cannot generate the values of fields that were generated by message. Details in:MATI240CRG_Add_information_Adapter_of_internal_movements and MATI250CRG_Add_information_Adapter_of_production_movements

Transfers: The entry point MI261RCV does not enable the execution of the integration. Details in: MI261RCV_Execute_integration_TransferWarehouse

 

Execute in various branches

In an environment with various branches, just one WEBSERVICE is necessary for execution. The TAGs indicate the branch in which the annotation is processes:

<CompanyId>10</CompanyId>

<BranchId>CLSC0001</BranchId>

Note: When these tags are in blank the system considers what is defined in APPSERVER.ini in session WEBSERVICE field PrepareIn.

[WebServices]

PrepareIn=99,01

 

Routines

Parameterization - PCPA109

Setting parameters directly influences records not moved between the two systems.

The parameter settings routine has the following fields:

  • Active: It indicates whether the integration is active. When you select this field, the others are disabled. If this field is not marked, you cannot perform any other action in the routine.
  • Path: It indicates the path of the PC-Factory WebService. After the path, there is a test button to check if the webservice is active.
  • It has a XML panel.
    This panel indicates:
    - Generate XML - By selecting this field, it generates the XML of exchanged messages, If you do not select it, the system saves it only in tables. You are not required to create files. Use it as a tool to find problems. The content sent is always based on what is registered in the table.
    - Sent - Directory where XMLs sent to PC-Factory are saved
    - Pending - Directory where XMLs not sent PC-Factory are saved
    The name of the files follows the standard below:
    OK_<MSG>_<DATAHORA>_<REGISTRO>
    PEND_<MSG>_<DATAHORA>_<REGISTRO>
    ERR_<MSG>_<DATAHORA>_<REGISTRO>
    Where: OK - Message sent with no problems
               PEND- Message not sent
               ERR - Message sent, but returned with error.
               MSG - Name of message. Ex.: Item, Wharehouse, Workcenter, etc.
               DATETIME: Date and Time of sending
               RECORD: Record code being sent. Ex.: Item code, order number, etc.
    Note: If you select Generate XML, you must enter the directories.

Each file transacted has a folder. For each folder, you can assemble filters. These filters are used in routines that send PC-Factory information enabling you to select what must be sent. The fields of selected table (folders) and operators are displayed so filters are assembled. Like the filters, some files are parameterized.

The routine has the following folders:

  • Product
  • Stock Location
  • Resource
  • Machine 
    The machine folder is only displayed when shop floor is in use.
  • Tool
  • Production Order
    For production order folder, a field to determine how the consumption of components in the panel "Consumption of Components". This field may have the following values:

"1" - BackFlush: Whenever issue of components is executed according to what is defined in Engineering.   

"2" - Actual Consumption: Consumption according to component list.

  • Scripts
  • Structure
  • Address
  • Movimentos e transferência
    Os movimentos de estoque, entrada ou saída e também as transferências são arquivos recebidos pelo Protheus. Não necessita de filtros, porém deverão ser criados alguns parâmetros para o processamento. São eles:
    Type of Input Movement: Use field SOE.OE_VAR1
    Type of Output Movement: Use field SOE.OE_VAR2
    These types of movements are registered in MATA230
  • Stock balance
    For Stock balance folder, the option has three filters. Table SB2, SB8 and SBF.  
    It can also indicate in which process of movement, balance is sent to PC-Factory
    Where: 
    Inbound Invoice: SOE.OE_VAR1 (Marked = 1; Unmarked = 0 )
    Sale Invoice     : SOE.OE_VAR2 (Marked = 1; Unmarked = 0 )
    Internal movements: SOE.PARINTG (Marked = 1; Unmarked = 0 )
    Balance Implementation: SOE_OE_VAR3(Marked = 1; Unmarked = 0 )
    These options are valid only for sending from Protheus to PC-Factory. For request (request of PC-Factory) will not have filters.

 

Image Removed

Synchronization - PCPA111

The synchronization is the process that is used to populate or update the base of PC-Factory with data from Protheus. It will work the same manner the other routines of integration do, by integrating a XML message to WebService of PC-Factory, following the parameterizations defined in PCPA109. The only difference is that all data of the table being integrated are viewed (following the filters) instead of only one record.

 

Image Removed

 

Pendencies - PCPA110

Routine to resend messages not sent to PC-Factory system, whether they are pendencies or mistakes. The routine also enables to query the messages sent (delivery LOG).

To check pendencies and log of messages moved between the systems:

  • Structure Register
  • Product/Item
  • Location of Stock (deposits)
  • Resource PCP
  • Production orders (Operations, Scripts, Components, Splits) 
  • Shop floor resources - Tools, Team and Operator
  • Tools
  • Shop Floor Machinery
  • Scripts - Operations
  • Addresses
  • Balance 

With the following options: 

  • Reprocess: 
    For each line selected, the messages must be sent.
  • Delete
    Delete selected records
  • Save XML
    This option enables to save the XML in a directory location of the machine that is processing the pendencies routine.
  • Update
    Redo the search of records, updating data on screen

 

Image Removed

Import Log - PCPA112

When receiving data from PC-Factory, Webservice Protheus saves information so they are queried (SOG table). Find the list of movements generation LOG below:

  • Production annotation
  • Stoppage annotation
  • Scrap Reason
  • Stoppage Reason
  • Stock movements
  • Transfer

 

Image Removed

 

Messages

Registers

Transaction Item: Item_3_001.xsd
Message Identifier: Item
Version: 3_001
Protheus Module: SiGAPCP
Sending Type: Synchronous

 

Message

Tag

Description

Table/Field: Protheus

Type

Table/Field: PC-Factory

Type

BusinessContentType

CompanyId 

Logged Company Code

 

 

CHAR(02)

 

 

 

BranchId 

Branch Code

 SB1.B1_FILIAL

CHAR(02)

 

 

 

CompanyInternalId

Company+Branch

 COMPANY + SB1.B1_FILIAL

 

 

 

 

Code 

Product code

SB1.B1_COD

CHAR(15)

 

 

 

Name 

Product Description

SB1.B1_DESC

CHAR(30)

 

 

 

InternalId

Company+branch+product code

COMPANY + SB1.B1_FILIAL + SB1.B1_COD

 

 

 

 

ShortName 

Short name

SB1.B1_DESC

CHAR(30)

 

 

 

Active 

Active item?

SB1.B1_ATIVO

CHAR(01)

 

 

 

UnitOfMeasureCode 

Unit of Measurement:

SB1.B1_UM

CHAR(02)

 

 

 

UnitOfMeasureInternalId

Company+branch+unit or measure

COMPANY + SB1.B1_FILIAL + SB1.B1_UM

 

 

 

 

StockGroupCode

Inventory Group

SB1.B1_GRUPO

CHAR(04)

 

 

 

StockGroupInternalId

Company+branch+stock group

COMPANY + SB1.B1_FILIAL + SB1.B1_GRUPO

 

 

 

 

StockGroupDescription

Stock Group Description

SBM.BM_DESC

CHAR(30)

 

 

 

StandardWarehouseCode

Stock Location

SB1.B1_LOCPAD

CHAR(02)

 

 

 

StandardWarehouseInternalId

Company+branch+stock location

COMPANY + SB1.B1_FILIAL + SB1.B1_LOCPAD

 

 

 

 

StandardWarehouseDescription

Stock Location Description

NNR.NNR_DESCRI

CHAR(40)

 

 

 

EconomicLot 

Economic Lot

SB1.B1_LE

DEC(12,2)

 

 

 

MinimumLot 

Minimum Lot

SB1.B1_LM

DEC(12,2)

 

 

 

FamilyCode 

Family

SB1.B1_FPCOD

CHAR(10)

 

 

 

FamilyInternalId

Company+branch+family

COMPANY + SB1.B1_FILIAL + SB1.B1_FPCOD

 

 

 

 

FamilyDescription 

Family Description

SYC.YC_NOME

CHAR(40)

 

 

 

NetWeight

Item Weight

SB1.B1_PESO

DEC(11,4)

 

 

 

GrossWeigh

Gross Weight

SB1.B1_PESBRU

DEC(11,4)

 

 

 

Trail

Trace

SB1.B1_RASTRO

CHAR(01)

 

 

 

BinControl

Controls Address

SB1.B1_LOCALIZ

CHAR(01)

 

 

 

SecondUnitOfMeasureCode

Second Measurement Unit

SB1.B1_SEGUM

CHAR(02)

 

 

 

SecondUnitOfMeasureInternalId

Company+branch+ sec. measure unit

COMPANY + SB1.B1_FILIAL + SB1.B1_SEGUM

 

 

 

 

MultiplicationFactorValue 

Conversion Factor

SB1.B1_CONV

DEC(5,2)

 

 

 

ProductType

Type of Item

SB1.B1_TIPO

CHAR(02)

 

 

 

PackingQuantity 

Package Quantity

SB1.B1_QE

NUM(09)

 

 

 

CostCenterCode

Cost Center

SB1.B1_CC

CHAR(09)

 

 

Nota
titleNota:

If it is an undefined type, it must be saved as GENERIC. Example: Type = SAMPLER.

 

Deposit Transaction: Warehouse_1_001.xsd
Message Identifier: Warehouse
Version: 1_001
Protheus Module: SiGAPCP
Sending Type: Synchronous

 

Message

Tag

Description

Table/Field: Protheus

Type

Table/Field: PC-Factory

Type

BusinessContentType

CompanyId

Company Code

 

CHAR(02)

 

 

 

BranchId

Branch Code

NNR.NNR_FILIAL

CHAR(02)

 

 

 

CompanyInternalId

Company+Branch

COMPANY + NNR.NNR_FILIAL

 

 

 

 

Code

Code of Stock Location(warehouse/deposit)

NNR.NNR_CODIGO

CHAR(02)

 

 

 

InternalId

Company+Branch+location code

COMPANY + NNR.NNR_FILIAL +

NNR.NNR_CODIGO

 

 

 

 

Description

Description of Stock Location (warehouse/deposit)

NNR.NNR_DESCRI

CHAR(20)

 

 

 

Active

Location of Active Stock?

TRUE

CHAR(01)

 

 

 

Type

Type of Stock Location

NNR.NNR_TIPO

CHAR(01)

 

 

 

WarehouseClassification

Classification

NNR.NNR_INTP

CHAR(01)

 

 

 

Transaction Resource PCP / Machine SFC: Machine_1_000.xsd
Message Identifier: Machine
Version: 1_000
Protheus Module: SIGAPCP, SIGASFC
Sending Type: Synchronous

Point MTI650QTOP enables to change the amount of operation being sent in the production orders message. Details in: MTI650QTOP_Change_quantity_of_operation_adapter_production_order.

Production Order: The Entry Point MTI650UMOP enables to change the second unit of measure of the operation being sent in the production orders message. Details in: MTI650UMOP_Change_second_unit_of_measure_of_operation_adapter_productionn_order.

Production Order: The Entry Point MTI650TMAC enables to change the machine time (TimeMachine) in the message of ProductionOrder. Details in: MTI650TMAC_Edit_amount_of_machine_time_production_order.

Production Order: The Entry Point MTI650LOTE enables to generate the Batch of the order in the tag LotCode in the message ProductionOrder. Details in: MTI650LOTE_Add_batch_in_message_of_production_orders

Registers: The Entry Point PCPXFUNPPI  enables to inhibit the integration in certain routine. Example: If you do not want integration to occur in the creation of MATA650 orders, you can use this function to inhibit the use. Details in: PCPXFUNPPI_Routines_not_executing_integration_with_the_PC_Factory.

Register of Item: The Entry Point PCPADDTAGS enables to add specific tags in TOTVS standard messages. It is enabled for the registration of the item MATA010. Details in: PCPADDTAGS_Add_information_XML_integration_TOTVS_MES.

Register of Processes: The Entry Point PCPADDTAGS enables to add specific tags in TOTVS standar messages. It is enabled for the registration of script MATA632. Details in: PCPADDTAGS_Add_information_XML_integration_TOTVS_MES

Internal Movements. The entry points MATI250CRG and MATI240CRG enable specific validation. These validations are under the customers' responsibility, as each has its own rule. You cannot generate the values of fields that were generated by message. Details in:MATI240CRG_Add_information_Adapter_of_internal_movements and MATI250CRG_Add_information_Adapter_of_production_movements

Transfers: The entry point MI261RCV does not enable the execution of the integration. Details in: MI261RCV_Execute_integration_TransferWarehouse

Refusal: The Entry Point MATI685EXC enables to check whether the refusal is executed. This entry point is indicated for the validations hindering the annotation of refusal or updating of information necessary to execute the refusal. Details in: MATI685EXC_Processes_Message_Refusal

 

Execute in various branches

In an environment with various branches, just one WEBSERVICE is necessary for execution. The TAGs indicate the branch in which the annotation is processes:

<CompanyId>10</CompanyId>

<BranchId>CLSC0001</BranchId>

Note: When these tags are in blank the system considers what is defined in APPSERVER.ini in session WEBSERVICE field PrepareIn.

[WebServices]

PrepareIn=99,01


Control of latency

There are situations in which the webservice waiting time is lower than the time of processing of information to ERP. There may be situations in which the ERP continues to process the import and the WebService of PC-Factory stops waiting for the answer. When PC-Factory does not receive the answer in time, the same file is resent, generating then duplicity in the message processing.

Solution:

Control ID of PC-Factory for received messages. Every received message must be handled like this:

  • ProductionAppointment
  • StopReport
  • MovementsInternal
  • TransferWarehouse
  • StopReason
  • WasteReason

In the XML´s, the TAG  Key name = "IDPCfactory" is used.

<BusinessEvent>

      <Entity>Entity</Entity>

      <Event>upsert</Event>

      <Identification>

        <key name="IDPCFactory">29892829</key>

      </Identification>

</BusinessEvent>

 

The return with error displays a message with the following pattern:

 

<ProcessedOn>2017-03-28T09:11:17</ProcessedOn>

   <Status>ERROR</Status>

   <ListOfMessages>

      <Message type="ERROR" code="N">MENSAGEM</Message>

   </ListOfMessages>

</ProcessingInformation>

 

The return XML must follow this rule:

  • When ID is processed and has ERROR

              Retorns the ID PC-Factory in tag  <UUID>

              In the tag Message type="ERROR" code="2", uses the 2 to indicate error.

              The message is: ID xxxx already processed. Status: error message”.

             Example: <Message type="ERROR" code="2">ID productionappointment-0038 already processed. Status: ProductionOrderNumber not registered in Protheus.</Message>

 

  • When ID is already successfully processed

              Retorns the ID PC-Factory in the tag  <UUID>

              In the tag Message type="ERROR" code="3", uses the 3 to indicate the successfull processing.

             The message is: "ID xxxx already processed. Status: ID of Protheus" or  "ID xxxx already processed. Status: Reprocessed. ID of Protheus" when PC-Factory sends more than once.

             Example 1:      <Message type="ERROR" code="3">ID productionappointment-0038 already processed. Status: 5091</Message>

             Example 2:      <Message type="ERROR" code="3">ID productionappointment-0038 already processed. Status: Reprocessed. 5091</Message>.

  • When ID already is in base but in processing

              Retorns the ID PC-Factory in the tag  <UUID>

              In the tag Message type="ERROR" code="4", uses the 4 to indicate that is in processing.

              The message is: ID xxxx is being processed by Protheus.

              Example: <Message type="ERROR" code="4">ID apapapapeaaa is being processed by Protheus.</Message>

 

Note:

The return, when message is processed "right away" , within the waiting time of the webservice, is "1" - Processed for the first time with ERROR or OK.

Example:

With Error:

<ProcessingInformation>

   <ProcessedOn>2017-03-28T09:00:03</ProcessedOn>

   <Status>ERROR</Status>

   <ListOfMessages>

      <Message type="ERROR" code="1">ProductionOrderNumber not registered in protheus.</Message>

   </ListOfMessages>

</ProcessingInformation>

 

Successfully:

<ProcessingInformation>

         <ProcessedOn>2017-03-28T08:57:28</ProcessedOn>

         <Status>OK</Status>

</ProcessingInformation>

<ReturnContent>

         <ListOfInternalId>

            <InternalId>

               <Name>PRODUCTIONAPPOINTMENTINTERNALID</Name>

               <Destination>5090</Destination>

            </InternalId>

         </ListOfInternalId>

</ReturnContent>

 

 

 

Unexpected situations may occur: the stoppage of Protheus service, downsizing of database, power outage, among others. If during the integration processing, the record of PC-Factory (ID of PC-Factory) may be locked up and there is no output of message from the processing queue. To handle this situation:

The PC-Factory tries to send by determination of time - time which is parameterized in PC-Factory. If you continue to receive the same message after the parameterized time, PC-Factory generates pendency of delivery and moves to the next record. Upon doing this, a counter of messages that were not sent is generated. When this counter reaches a (parameterized) limit, the integration process is stopped so the users can solve the problem. The processing control is registered in LOG SOH table.

Check below, table of sent codes:

Code

Message

Table of control - SOH.OH_STATUS

1

Processed in the first attempt with ERROR or OK

1 or 2

2

Record already processed with error return

2

3

Record already processed with success

1

4

Record being processed

0

Important:

  • If a record gets locked with status "record being processed", it can be unlocked by routine PCPA112, including the corresponding IDMES.
  • The reprocessing of a message with ERROR(2) can be done passing the tag Reprocess = true.
    Example:

<BusinessEvent>

            <Entity>productionappointment</Entity>

            <Event>upsert</Event>

            <Identification>

              <key name="IDPCFactory">9o93049u88557</key>

              <key name="Reprocess">true</key>

            </Identification>

        </BusinessEvent>


Routines

Parameterization - PCPA109

Setting parameters directly influences records not moved between the two systems.

The parameter settings routine has the following fields:

  • Active: It indicates whether the integration is active. When you select this field, the others are disabled. If this field is not marked, you cannot perform any other action in the routine.
  • Path: It indicates the path of the PC-Factory WebService. After the path, there is a test button to check if the webservice is active.
  • It has a XML panel.
    This panel indicates:
    - Generate XML - By selecting this field, it generates the XML of exchanged messages, If you do not select it, the system saves it only in tables. You are not required to create files. Use it as a tool to find problems. The content sent is always based on what is registered in the table.
    - Sent - Directory where XMLs sent to PC-Factory are saved
    - Pending - Directory where XMLs not sent PC-Factory are saved
    The name of the files follows the standard below:
    OK_<MSG>_<DATAHORA>_<REGISTRO>
    PEND_<MSG>_<DATAHORA>_<REGISTRO>
    ERR_<MSG>_<DATAHORA>_<REGISTRO>
    Where: OK - Message sent with no problems
               PEND- Message not sent
               ERR - Message sent, but returned with error.
               MSG - Name of message. Ex.: Item, Wharehouse, Workcenter, etc.
               DATETIME: Date and Time of sending
               RECORD: Record code being sent. Ex.: Item code, order number, etc.
    Note: If you select Generate XML, you must enter the directories.

Each file transacted has a folder. For each folder, you can assemble filters. These filters are used in routines that send PC-Factory information enabling you to select what must be sent. The fields of selected table (folders) and operators are displayed so filters are assembled. Like the filters, some files are parameterized.

The routine has the following folders:

  • Product
  • Stock Location
  • Resource
  • Machine 
    The machine folder is only displayed when shop floor is in use.
  • Tool
  • Production Order

    MRP Panel: Indicates how the system must behave in relation to the orders generated by MRP. It will have the following options:
    "Does not integrate": The orders generated by MRP are not sent to PC-Factory by the MRP calculation.
    "Generate Pendency": The orders generated by MRP are registered in the pendencies of delivery
    "Integrates": The orders generated by MRP are sent to PC-Factory by the MRP calculation.


    For production order folder, a field to determine how the consumption of components in the panel "Consumption of Components". This field may have the following values:

"1" - BackFlush: Whenever issue of components is executed according to what is defined in Engineering.   

"2" - Actual Consumption: Consumption according to component list.Painel "Operações": Define se o filtro criado no folder "Roteiros" deve ser utilizado para filtrar as operações da ordem de produção.     

           

"Scrap" Panel: Defines the location of stock/deposit for the scrapped item when scrap is the same product of the production order. When the deposit - "WharehouseCodeTo" is in blank, in the message ProductionAppointment, use what was defined in the parameter.

  • Scripts
  • Structure
  • Address
  • Movimentos e transferência
    Os movimentos de estoque, entrada ou saída e também as transferências são arquivos recebidos pelo Protheus. Não necessita de filtros, porém deverão ser criados alguns parâmetros para o processamento. São eles:
    Type of Input Movement: Use field SOE.OE_VAR1
    Type of Output Movement: Use field SOE.OE_VAR2
    These types of movements are registered in MATA230
  • Stock balance
    For Stock balance folder, the option has three filters. Table SB2, SB8 and SBF.  
    It can also indicate in which process of movement, balance is sent to PC-Factory
    Where: 
    Inbound Invoice: SOE.OE_VAR1 (Marked = 1; Unmarked = 0 )
    Sale Invoice     : SOE.OE_VAR2 (Marked = 1; Unmarked = 0 )
    Internal movements: SOE.PARINTG (Marked = 1; Unmarked = 0 )
    Balance Implementation: SOE_OE_VAR3(Marked = 1; Unmarked = 0 )
    These options are valid only for sending from Protheus to PC-Factory. For request (request of PC-Factory) will not have filters.

 

Image Added

Synchronization - PCPA111

The synchronization is the process that is used to populate or update the base of PC-Factory with data from Protheus. It will work the same manner the other routines of integration do, by integrating a XML message to WebService of PC-Factory, following the parameterizations defined in PCPA109. The only difference is that all data of the table being integrated are viewed (following the filters) instead of only one record.

 

Image Added

 

Pendencies - PCPA110

Routine to resend messages not sent to PC-Factory system, whether they are pendencies or mistakes. The routine also enables to query the messages sent (delivery LOG).

To check pendencies and log of messages moved between the systems:

  • Structure Register
  • Product/Item
  • Location of Stock (deposits)
  • Resource PCP
  • Production orders (Operations, Scripts, Components, Splits) 
  • Shop floor resources - Tools, Team and Operator
  • Tools
  • Shop Floor Machinery
  • Scripts - Operations
  • Addresses
  • Balance 

With the following options: 

  • Reprocess: 
    For each line selected, the messages must be sent.
  • Delete
    Delete selected records
  • Save XML
    This option enables to save the XML in a directory location of the machine that is processing the pendencies routine.
  • Update
    Redo the search of records, updating data on screen

 

Image Added

Import Log - PCPA112

When receiving data from PC-Factory, Webservice Protheus saves information so they are queried (SOG table). Find the list of movements generation LOG below:

  • Production annotation
  • Stoppage annotation
  • Scrap Reason
  • Stoppage Reason
  • Stock movements
  • Transfer

 

Image Added

 

Messages


Registers

Transaction Item: Item_3_001.xsd
Message Identifier: Item
Version: 3_001
Protheus Module: SiGAPCP
Sending Type: Synchronous

 

 

 

Table Field:

Protheus SFCCodeMachine SH1H1_CODIGOCYB.CYB_CDMQ2040 CHAR(10CHAR(40)CHAR(20   VolumeMachineQuantityDEC(12,4DEC(05,2)NUM(02NUM(03BOOLEANBOOLEANProductionAreaCodeCHAR(10DATEFinalValidateDate CHAR(20ResourceNameCYC.CYC_NMRC40

CYC.CYC_TPUNTE

1 = Hours;2=Minutes;3=SecondsDATE114 
MessageTag

Description

Table/Field: Protheus

Message

Tag

Description

Table/Field:

Protheus PCP

TypeTable/Field: PC-FactoryType
BusinessContentType CompanyId Code of the Logged Company 

 

  CHAR(02)  
 BranchId Branch Code SB1.B1_BRANCHCHAR(02)

TBLInProduct.PlantCode

CHAR(15)
 CompanyInternalIdCompany+BranchCOMPANY + SB1.B1_BRANCH   
 Code Product CodeSB1.B1_COD

Description

Machine Description

SH1.H1DESCRI

CYB.CYB_DSMQCHAR(15)

 

 TBLInProduct.CodeCHAR(20)
 

WorkCenterCode

Work Center Code

SH1.H1_CTRAB

CYB.CYB_CDCETR

Name Product DescriptionSB1.B1_DESCCHAR(30)TBLInProduct.NameCHAR(70)
 

 

 

WorkCenterDescription

Work Center Description

SHB.HB_NOME

CYB.CYB_DSCETR

InternalIdCompany+branch+product codeCOMPANY + SB1.B1_BRANCH + SB1.B1_COD   
 

CostCenterCode

Cost Center Code

SH1.H1_CCUST

CYB.CYB_CDCECS

ShortName Short nameSB1.B1_DESCCHAR(30)TBLInProduct.SecondNameCHAR(30)
 Active 

 

ProcessorType

Type of Processing

 

CYB.CYB_TPPC

1=Single processing; 2=Batch processing;

3=Multiple Processings;4=Manual

Item active?SB1.B1_ACTIVECHAR(01)TBLInProduct.FlgEnableSMALLINT
 

LaborType

Type MOD

 

CYB.CYB_TPMOD

1=Does not report;2=Operator;3=Team

CHAR(01)

UnitOfMeasureCode Unit of MeasureSB1.B1_UMCHAR(02)TBLInProduct.Unit1codeCHAR(05)
 UnitOfMeasureInternalIdCompany+branch+unit of measureCOMPANY + SB1.B1_BRANCH + SB1.B1_UM   
 

Machine Volume Quantity

 

CYB.CYB_QTVMMQ

StockGroupCodeGroup of StockSB1.B1_GROUPCHAR(04)  
 

EfficiencyMachineValue

Machine Efficiency

 

CYB.CYB_VLEFMQ

StockGroupInternalIdCompany+branch+stock groupCOMPANY + SB1.B1_BRANCH + SB1.B1_GROUP   
 

OperatorMachineQuantity

Machine Operator Quantity

 

CYB.CYB_QTOEMQ

StockGroupDescriptionDescription of stock groupSBM.BM_DESCCHAR(30)  
 

SimultaneousActivityQuantity

Simultaneous Operations Quantity

 

CYB.CYB_QTATSM

StandardWarehouseCodeLocation of StockSB1.B1_LOCPADCHAR(02)  
 

IsSetup

Has Setup

 

CYB.CYB_LGSU

StandardWarehouseInternalIdCompany+branch+location of stockCOMPANY + SB1.B1_BRANCH + SB1.B1_LOCPAD   
 

IsOverlapReport

Overlap annotation

 

CYB.CYB_LGOVRP

StandardWarehouseDescriptionLocation of Stock DescriptionNNR.NNR_DESCRICHAR(40)  
 EconomicLot 

Production Area

 

CYB.CYB_CDARPO

Economic lotSB1.B1_LEDEC(12,2)  
 

InitialValidateDate

Validity Start Date

 

CYB.CYB_DTBGVD

MinimumLot Minimum lotSB1.B1_LMDEC(12,2)  
 FamilyCode 

Validity End Date

 

CYB.CYB_DTEDVD

DATE

 

 

FamilySB1.B1_FPCODCHAR(10)TBLInProduct.FamilyProductCodeCHAR(15)
 FamilyInternalIdCompany+branch+familyCOMPANY + SB1.B1_BRANCH + SB1.B1_FPCOD

ListOfResources

 

 

 

   
 

 ResourceType

Resource Type

 

CYC.CYC_TPRC

1=Operator;2=Tool;

3=Team;4=Equipment

CHAR(01)

 

 

 

ResourceCode

Resource Code

 

CYC.CYC_CDRC

FamilyDescription Description of familySYC.YC_NAMECHAR(40)TBLInProduct.FamilyProductNameCHAR(30)
 NetWeightItem WeightSB1.B1_WEIGHTDEC(11,4)  
 GrossWeighGross WeightSB1.B1_PESBRUDEC(11,4)  
 Trail

Resource Name

 

TraceSB1.B1_TRACECHAR(01)  
 

UnitTimeType

Time Measure Type

 

BinControlControls AddressSB1.B1_LOCALIZCHAR(01)  
 

StartExpirationDate

Expiration Start Date

 

CYC.CYC_DTBGVD

DATE

 

 

 

EndExpirationDate

Expiration End Date

 

CYC.CYC_DTEDVD

SecondUnitOfMeasureCodeSecond Unit of MeasureSB1.B1_SEGUMCHAR(02)TBLInProduct.Unit2CodeCHAR(20)
 SecondUnitOfMeasureInternalIdCompany+branch+ sec. measure unitCOMPANY + SB1.B1_BRANCH + SB1.B1_SEGUM   
 

CycleQuantity

Number Cycles

 

MultiplicationFactorValue Factor of conversionSB1.B1_CONVCYC.CYC_QTCIDEC(5,2)

 

TBLInProduct.Unit2FactorDEC(8,4)
 

IsTimeActivity

Determines time

 

CYC.CYC_LGTEAT

BOOLEAN

 

 

ListOfProductionShifts

 

 

 

 

 

 

 

 

ProductionShiftCode

Shift Model Code

 

CYL.CYL_CDTN

CHAR(08)

 

 

 

ProductionShiftDescription

Shift Model Description

 

CYL.CYL_DSTN

CHAR(40)

 

 

 

BeginDate

Expiration Start Date

 

CYL.CYL_DTVDBG

DATE

 

 

 

EndDate

Expiration End Date

 

CYL.CYL_DTVDED

DATE

 

 

...

ProductTypeType of ItemSB1.B1_TYPECHAR(02)TBLInProduct.ProductTypeCodeCHAR(15)
 PackingQuantity Quantity PackageSB1.B1_QENUM(09)TBLInProduct.QtyPackageDEC(19,4)
 CostCenterCodeCost CenterSB1.B1_CCCHAR(09)TBLInProduct.CostCenterCodeCHAR(20)
 StockControlTypeControl of item stock CHAR(01) 
Nota
titleNote:

 

  • If it is an undefined type, it must be saved as GENERIC. Example: Type = SAMPLER.
  • The tag StockControlType can be, 1=Serial;2=No. of Series;3=Lote;4=Reference. If field B1_RASTRO is S=SubLote or L=Lote, save as '3'. If field B1_LOCALIZ is S=Yes, save as 2. The product can control lot and series at the same time, being registered in the tags TRIAL and BINCONTROL.

 

Deposit Transaction: Warehouse_1_001.xsd
Message Identifier: Warehouse
Version: 1_001
Protheus Module: SiGAPCP

 

SFC Resource Transaction: Resource_1_000
Message Identifier: Resource
Version: 1_000
Protheus Module: SIGAPCP
Sending Type: Synchronous

PCP   CYH.CYH_CDRC06 CHAR(10)CYA.CYA_DSARPO40 ItemComponentType CHAR(05LaborCode08
MessageTagDescriptionTable/Field:
Protheus

Table Field:

Protheus SFC

TypeTable/Field: PC-FactoryType
BusinessContentTypeCompanyId Company Code 

 

 

CHAR(02)TBLInWarehouse.ExtcodeCHAR(20)
 BranchIdBranch Code

Resource Code

SH4.H4_CODIGO

NNR.NNR_BRANCHCHAR(02)

 

TBLInWarehouse.PlantCodeCHAR(15)
 

Name

Resource Name

SH4.H4_DESCRI

CYH.CYH_NMRC

CHAR(40)

CompanyInternalIdCompany+BranchCOMPANY + NNR.NNR_BRANCH   
 

Type

Resource Type

1=Operator;2=Tool;

3=Team;4=Equipment.

 

CYH.CYH_TPRC

 1=Operator;2=Tool;

3=Team;4=Equipment

CHAR(25)

 

 

 

ProductionAreaCode

Production Area

 

CYH.CYH_CDARPO

CodeLocation of Stock Code(warehouse/deposit)NNR.NNR_CODECHAR(02)TBLInWarehouse.CodeCHAR(15)
 InternalIdCompany+Branch+location code

COMPANY + NNR.NNR_BRANCH +

NNR.NNR_CODE

   
 

ProductionAreaDescription

Production area description

 

DescriptionLocation of Stock Description (warehouse/deposit)NNR.NNR_DESCRICHAR(20)

 

TBLInWarehouse.NameCHAR(15)
 

 

 

 

 

 

ActiveLocation of Stock Active?TRUECHAR(01)TBLInWarehouse.FlgEnableSMALLINT
 

 

ProductionShiftNumber

Shift

SH4.H4_TURNO

CYH.CYH_NRTN

TypeLocation of Stock TypeNNR.NNR_TYPECHAR(01)  
 WarehouseClassification

MOB

Fixed '1'

ClassificationNNR.NNR_INTPCYH.CYH_CDMODCHAR(01) 

 

 

StartExpirationDate

Start validity date

Current Date

CYH.CYH_DTVDBG

DATE

 

 

 

EndExpirationDate

End Validity Date

 

CYH.CYH_DTVDED

DATE

 

 


Transaction Resource PCP / Machine SFC: Machine_1_000.xsd
Message Identifier: Machine
Version: 1_000
Protheus Module: SIGAPCP, SIGASFC
Sending Type: Synchronous

 

NUM(07)ToolCodeCYH.CYH_CDMPRC15 ToolDescriptionTool  CYHCYHDSMPRC 
MessageTagDescription

Table/Field:

Protheus PCP

Table Field:

Protheus SFC

TypeTable/Field: PC-FactoryType
BusinessContentType
    

 

UnitCycleQuantity

Units Cycles

 

CYH.CYH_QTUNCI

  
 Code

Tool

 

Machine CodeSH1.H1_CODECYB.CYB_CDMQCHAR(20)

 

TBLInResource.codeCHAR(15)
 DescriptionMachine DescriptionSH1.H1DESCRICYB.CYB_DSMQCHAR(40)

TBLInResource.Name

TBLInResource.Nickname

CHAR(20)
 

...

WorkCenterCode

...

titleNota:

...

  • The Resource in the PCP indicates the machine, in the shop floor indicates toosl, operator etc;
  • When origin is PCP the tag Type (Resource Type) is generated in fixed value '2';
  • When origin is PCP the tag UnitCycleQuantity (Cycles Unit) is generated in fixed value '1';
  • When origin is PCP the tag UnitCycleQuantity (Cycles Unit) is generated in fixed value '1';
  • When origin is PCP the tag StartExpirationDate (Start Validity) is generated with date of message generation;
  • When origin is PCP the tag EndExpirationDate (End Validity) is generated in fixed value '1';
    Current date (dDataBase) + lifespan of tool (H4_VIDAUTI). Consider type of lifec ycle (H4_TIPOVID) - D=Days;H=Hours;M=Month;A=Year
Work Center CodeSH1.H1_CTRABCYB.CYB_CDCETRCHAR(10)

TBLInResource.ManagerGrpCode

CHAR(15)
 WorkCenterDescriptionWork Center DescriptionSHB.HB_NAMECYB.CYB_DSCETRCHAR(40)

TBLInResource.WorkCenterDescription

CHAR(15)
 CostCenterCodeCost Center CodeSH1.H1_CCUSTCYB.CYB_CDCECSCHAR(20)  
 ProcessorTypeType of Processing 

CYB.CYB_TPPC

1=Monoprocess;2=By Batch;

3=Multiple Processes;4=Manual

CHAR(01)  
 LaborTypeType MOD 

CYB.CYB_TPMOD

1=Does not Report;2=Operator;3=Team

CHAR(01

Transaction Structure: ItemStructure_1_000.xsd 
Message Identifier: ItemStructure
Version: 1_000
Protheus Module: SiGAPCP
Sending Type: Synchronous

 

CHAR(02COMPANY + SG1.G1_FILIAL

COMPANY + SG1.G1_FILIAL +

SG1.G1_COD CHAR(15SB1.B1_QB07ItemComponentType  ItemSequenceComponent sequenceSG1G1TRTNUM(05)SG1.G1_COMP15 SG1.G1_INIFinalDateDATESB1.B1_FANTASMDEC(05,2  ListOfScriptCHAR(02 ---- CHAR(02)NUM(03

Message

Tag

Description

Table/Field: Protheus

Type

Table/Field: PC-Factory

Type

BusinessContentType

CompanyId

Company Code

 

)  
 VolumeMachineQuantity

CompanyInternalId

Company+Branch

Machine Volume Quantity CYB.CYB_QTVMMQDEC(12,4)  
 EfficiencyMachineValueMachine Efficiency 

ItemInternalId

Company+Branch+parent item code

CYB.CYB_VLEFMQDEC(05,2)  
 OperatorMachineQuantity

ItemCode

Parent Item Code

SG1.G1_COD

Machine Operator Quantity CYB.CYB_QTOEMQNUM(02)  
 

ItemAmount

Base quantity of parent item

SimultaneousActivityQuantityQuantity Simultaneous Operations CYB.CYB_QTATSMNUM(03)  
 IsSetupIt is set up 

 

CYB.CYB_LGSUBOOLEAN  
 IsOverlapReportOverlaps Annotation CYB.CYB_LGOVRPBOOLEAN  
 

ItemComponentCode

Component item code

ProductionAreaCodeProduction Area CYB.CYB_CDARPOCHAR(10)  
 

ItemComponentInternalId

Internal Id of Component Item

COMPANY +SG1.G1_FILIAL +SG1.G1_COMP

InitialValidateDateValidity Initial Date CYB.CYB_DTBGVDDATE  
 

InitialDate

Start validity date

FinalValidateDateValidity End Date CYB.CYB_DTEDVDDATE  
ListOfResources
  

End Validity Date

SG1.G1_FIM

    
  ResourceType

IsGhostMaterial

Indicates if is ghost

Resource Type 

CYC.CYC_TPRC

1=Operator;2=Tool;

3=Team;4=Equipment

CHAR(01)  
 

ItemComponentAmount

Component Item Quantity

SG1.G1_QUANT

DEC(12,6)

 

 

 

LossFactor

Loss factor

SG1.G1_PERDA

ResourceCodeResource Code CYC.CYC_CDRCCHAR(20)TBLInUser.CodeCHAR(30)
 ResourceNameResource Name 

 

 

 

 

 

CYC.CYC_NMRCCHAR(40)

 TBLInUser.Name

 TBLInUser.Nickname
CHAR(60

 

Scriptcode

Script Code

SGF.GF_ROTEIRO

)
 UnitTimeTypeMeasure Time Type 

ScriptAlternative

Script Alternative

CYC.CYC_TPUNTE

1=Hours;2=Minutes;3=Seconds

CHAR(01)  
 StartExpirationDateValidity Start Date 

ActivityIntenalID

Operation ID

CYC.CYC_DTBGVDDATE  
 EndExpirationDate

ActivityCode

Operation Code

SGF.GF_OPERAC

Validity End Date CYC.CYC_DTEDVDDATE  
 CycleQuantity

ActivityComponentSequence

Sequence of component in operation

SGF.GF_TRT

Number Cycles CYC.CYC_QTCIDEC(11,4)  
 

Script Transaction - Item Operations: ItemScript_1_000.xsd 
Message Identifier: ItemScript
Version: 1_000
Protheus Module: SiGAPCP
Sending Type: Synchronous

 

CHAR(15ItemDescriptionItem SB1B1DESCCHAR(02)CHAR(40)
IsTimeActivityDetermines time CYC.CYC_LGTEATBOOLEAN  
ListOfProductionShifts       
 ProductionShiftCodeCode Shift Model CYL.CYL_CDTNCHAR(08

Message

Tag

Description

Table/Field: Protheus

Type

Table/Field: PC-Factory

Type

BusinessContentType

ItemCode

Item code

SG2.G2_PRODUTO

)  
 ProductionShiftDescriptionDescription Shift Model CYL.CYL_DSTNCHAR(40)  
 

ItemInternalId

Company|Branch|Item

COMPANY + SG2.G2_FILIAL +

SG2.G2_PRODUTO

 

 

 

 

ScriptCode

Script Code

SG2.G2_CODIGO

BeginDateValidity Start Date CYL.CYL_DTVDBGDATE  
 

ScriptDescription

Script Description

--

EndDateValidity End Date 

 

CYL.CYL_DTVDEDDATE 


In PCP, the machines are registered in the routine of resources MATA610 and in the Shop Floor, the routine is SFCA002. Nomenclature is also changed. When using Shop Floor, it is named MACHINE. When using only PCP. it is RESOURCE. The routine of parameters PCPA109 is ready to present the name according to the use of the system.

 

SFC Resource Transaction: Resource_1_000
Message Identifier: Resource
Version: 1_000
Protheus Module: SIGAPCP
Sending Type: Synchronous

 

CHAR(60)SG2.G2_RECURSO SG2.G2_FERRAM06 Operation Executes operation = Does not execute.CHAR(01SG2.G2_CTRAB06NUM(06)DEC(05,2UnitTimeTypeTime Unit Type

Message

Tag

Description

Table/Field:

Protheus PCP

Table Field:

Protheus SFC

Type

Table/Field: PC-Factory

Type

BusinessContentType

 

 

ScriptAlternative

Alternative Script

--

CHAR(02)

 

 

ListOfActivity

 

 

 

 

 

 

 

ActivityInternalID

Operation ID

SG2.R_E_C_N_O_

NUM(05)

 

 

 

ActivityCode

Operation Code

SG2.G2_OPERAC

CHAR(02)

 

 

 

ActivityDescription

Operation Description

SG2.G2_DESCRI

 

 

 

MachineCode

Machine Code

 

 

 

 

Code

Resource Code

SH4.H4_CODE

CYH.CYH_CDRC

CHAR(06)

TBLTooling.Code

CHAR(15)

  

Name

ToolCode

Tool Code

Resource Name

SH4.H4_DESCRI

CYH.CYH_NMRC

CHAR(

40)

 

TBLTooling.Name

CHAR(50)

 ActivityType

Type

Resource Type

1=

Operator;2

=Tool;

3=Team;4=Equipment.

 

CYH.CYH_TPRC

 1=Operator;2=Tool;

3=Team;4=Equipment

CHAR(25)

 

 

 

WorkCenterCode

Work Center Code

ProductionAreaCode

Production Area

 

CYH.CYH_CDARPO

CHAR(

10)

 

 

 

WorkCenterInternalId

Work Center Id

COMPANY + SG2.G2_FILIAL +SG2.G2_CTRAB

ProductionAreaDescription

Production area description

 

CYA.CYA_DSARPO

CHAR(40)

 

 

 ItemComponentType

 

UnitItemNumber

Standard lot 

SG2.G2_LOTEPAD

 

 

 

TimeResource

Resource Time

0

 

 

 

 

TimeMachineProductionShiftNumber

Machine TimeShift

SG2SH4.G2H4_TEMPAD

DEC(05,2)

 

 

 

TimeSetup

Preparation Time

SG2.G2_SETUP

TURNO

CYH.CYH_NRTN

CHAR(05)

 

 

 

LaborCode

MOB

1 = Hours;2=Minutes;3=Seconds;4=Days

 

 

 

Fixed '1'

CYH.CYH_CDMOD

CHAR(08

 

ScriptAlternative

Alternative

SG2.G2_ROTALT

CHAR(02)

 

 

 

InitialDateStartExpirationDate

Start validity date

Current Date

SG2CYH.G2CYH_DTINIDTVDBG

DATE 

TBLTooling.Period

 INT

 

FinalDateEndExpirationDate

End Validity Date

 

CYHSG2.G2CYH_DTFIMDTVDED

DATE 

TBLTooling.Period

 INT

 

PercentageScrapValue

% Scrap

UnitCycleQuantity

Units Cycles

 

CYH.CYH_QTUNCI

NUM(07)--

 

 

 

ToolCode

Tool

 

PercentageValue

Proportion

--

CYH.CYH_CDMPRC

CHAR(15)

 

 

  

ToolDescriptionResourceQuantity

Tool Description

Resource Quantity

--

 

CYH.CYH_DSMPRC

CHAR(40) 

 

 

Nota
titleNotaNote:
  • The Resource in the PCP indicates the machine, in the shop floor indicates toosl, operator etc;
  • When origin is PCP the tag Type (Resource tag ActivityType (Operation Type) is generated with in fixed value '12';The tag ActivityType (Time
  • Unit TypeWhen origin is PCP the tag UnitCycleQuantity (Cycles Unit) is generated with in fixed value '1';
  • The tag ListOfPertOrders is not generated for Protheus;
  • In the deletion of a script, do not delete if there is integrity with the routine of OPERATIONS x COMPONENTS, MATA637. In this case, you do not need to send any message to PC-Factory;
  • When adding, editing or deleting data from MATA637, structure message is sent, ItemStructure.
  • When origin is PCP the tag UnitCycleQuantity (Cycles Unit) is generated in fixed value '1';
  • When origin is PCP the tag StartExpirationDate (Start Validity) is generated with date of message generation;
  • When origin is PCP the tag EndExpirationDate (End Validity) is generated in fixed value '1';
    Current date (dDataBase) + lifespan of tool (H4_VIDAUTI). Consider type of lifec ycle (H4_TIPOVID) - D=Days;H=Hours;M=Month;A=Year


Transaction Structure: ItemStructureAddresses Transaction: AdressStock_1_000.xsd 
Message IdenfierIdentifier: AdressStockItemStructure
Version: 1_000
Protheus Module: SiGAPCP
Sending Type: Synchronous

 

CHAR(15)SBE.BE_DESCRIC30
MessageTagDescriptionTable/Field: ProtheusTypeTable/Field: PC-FactoryType
BusinessContentType

WarehouseCode

Warehouse/Deposit

CompanyIdCompany Code SBE.BE_LOCALCHAR(02)  
 

LocationCode

Address/Location

SBE.BE_LOCALIZ

CompanyInternalIdCompany+BranchCOMPANY + SG1.G1_BRANCH   
 

AdressInternalId

Address full key

ItemInternalIdCompany+Branch+code parent item

COMPANY + SG1.G1_BRANCH +

SG1.G1_COD COMPANY + SBE.BE_FILIAL + SBE.BE_LOCAL + SBE.BE_LOCALIZ

   
 

AdressStockDescription

Address description

ItemCodeCode parent itemSG1.G1_CODCHAR(15)

 

 

 

Balance Transaction: ItemStockLevel_1_000.xsd
Message Identifier: ItemStockLevel
Version: 1_000
Protheus Module: Various
Sending Type: Synchronous

 

CHAR(15DESCCHAR30ListOfStockReferenceCode 02 CHAR(10)CHAR(15DATEDEC(12BookedStockAmountDEC(12,2) QuantityUpdatedUpdated QuantityDEC(12,2)1=Input or 2=Output.01

TBLInWOHD.ProductCode

TBLInWOHD.WOCode

CHAR(30

Message

Tag

Description

Table/Field: Protheus

Type

Table/Field: PC-Factory

Type

BusinessContentType

ItemCode

Product code

SB2.B2_COD

)
 

 

ItemAmountBase quantity of parent item

 

ItemDescription

Item Description

SB1.B1_QBNUM(07)

 

 

TBLInWOHD.TotalQTYDEC(19,4)
ItemComponentType      
 ItemSequence

Reference

--

 

 

Sequence of componentSG1.G1_TRTNUM(05)TBLInBillMat.BillMatExtCodeCHAR(20)
 

WarehouseCode

Deposit/Stock location/Warehouse

ItemComponentCodeCode item componentSG1.G1_COMPSB2.B2_LOCALCHAR(15)

 

TBLInBillMat.ProductCodeCHAR(20)
 

LotCode

Lot Number

SB8.B8_LOTECTL

ItemComponentInternalIdInternal Id of Item ComponentCOMPANY + SG1.G1_BRANCH + SG1.G1_COMP   
 

SubLotCode

Sub-lot

SB8.B8_NUMLOTE

CHAR(06)

 

 

 

NumberSeries

Serial Number

SBF.BF_NUMSERI

CHAR(20)

 

 

InitialDateValidity Initial DateSG1.G1_INIDATETBLInWOHD.DtPlanStartDATETIME
 FinalDateValidity End DateSG1.G1_FIMDATETBLInWOHD.DtPlanEndDATETIME
 IsGhostMaterialIndicates whether it is ghostSB1.B1_FANTASMBOOLEAN ( FALSE ou TRUE

 

AddressCode

Address/Location

SBF.BF_LOCALIZ

)  
 

LotDueDate

Expiration Date

SB8.B8_DTVALID

ItemComponentAmountQuantity of component itemSG1.G1_QUANTDEC(12,6)  
 

CurrentStockAmount

Stock balance

SB2.B2_QATU

SB8.B8_SALDO

SBF.BF_QUANT

LossFactorFactor of lossSG1.G1_LOSSDEC(05,2)  
(mais) ListOfScript  

Reserved Quantity

SB2.B2_RESERVA

SB8.B8_EMPENHO

SBF.BF_EMPENHO

    
 ScriptcodeCode of ScriptSGF.GF_SCRIPTCHAR(02)TBLInWOHD.ExtCodeCHAR(20)
 ScriptAlternativeAlternative of Script--

AvailableStockAmount

Available balance

SB2.B2_QATU - SB2.B2_RESERVA

SB8.B8_SALDO - SB8.B8_EMPENHO

SBF.BF_QUANT - SBF.BF_EMPENHO

DEC(12,2)

   
 

 

ActivityIntenalIDID Operation--   
 

InputOutput

Input or Output

ActivityCodeCode of OperationSGF.GF_OPERACCHAR(02)TBLInWodet.CodeCHAR(10)
 ActivityComponentSequence

 

Nota
titleNota:
  • When updating new balance in ERP, message is sent to PC-Factory.
    Transactions generating movement of stock and executing balance updating routines activating integration:
    Inbound Inv.  - Function B2ATUCOMD1
    Sale Inv. - Function B2ATUCOMD2 Internal Transac. - Function B2ATUCOMD3
  • When the balance is updated by an update of PC-Factory do not generated the balance updating message. When the origin of the balance change is TOTVSMES, message is not generated.
    In production annotation message, tag Product Name indicates what is sent to record. For TOTVS MES, this information is saved in SH6.H6_OBSERVA = 'TOTVSMES'.
    If the movement is internal, it is registered in SD3.D3_OBSERVA = 'TOTVSMES'.
  • The field QuantityUpdated corresponds to the updated quantity, that is, quantity being moved. 
  • The field InputOutput indicates if the movement is input or output. 
  • When the item controls address (B1_LOCALIZ), the balance message must be generated only in the confirmation of MATA265, routine executing the address.
  • The routines of initial balance of PCP and Stock, MATA220 and MATA805 also generated the balance message.

Waste Reason Transaction: WasteReason_1_000.xsd 

Message Identifier: WasteReason
Version: 1_000
Protheus Module: SIGAPCP/SIGASFC
Sending Type: Synchronous

 

Sequence of component in the operationSGF.GF_TRTNUM(03) 


Script Transaction - Item Operations: ItemScript_1_000.xsd 
Message Identifier: ItemScript
Version: 1_000
Protheus Module: SiGAPCP
Sending Type: Synchronous

 

CHAR(08CHAR(40ReworkBOOLEAN
MessageTagDescriptionTable/Field: ProtheusTypeTable/Field: PC-FactoryType
BusinessContentTypeItemCodeItem CodeSG2.G2_PRODUCTCHAR(15)

TBLInWOHD.ProductCode

TBLInWOHD.WOCode

CHAR(20)
 ItemDescriptionDescription of itemSB1.B1_DESCCHAR(40)  
 ItemInternalIdCompany[Branch|Item

COMPANY + SG2.G2_BRANCH +

SG2.G2_PRODUCT

   
 ScriptCodeCode of ScriptoSG2.G2_CODECHAR(02

Message

Tag

Description

Table/Field:

Protheus PCP

Table Field:

Protheus SFC

Type

Table/Field: PC-Factory

Type

BusinessContentType

Code

Waste Code

SX5.X5_CHAVE

CYO.CYO_CDRF

)  
 ScriptDescriptionDescription

Scrap Description

X5_DESCRI

X5_DESCSPA

X5_DESCENG

CYO.CYO_DSRF

Script--CHAR(40)  
 ScriptAlternativeScript Alternative--CHAR(02)  
ListOfActivity 

IsRework

     
 

CYO.CYO_LGRT

ActivityInternalIDID OperationSG2.R_E_C_N_O_NUM(05)  
 

IsScrapMaterial

Scrap Material

SBE.BE_DESCRIC

CYO.CYO_LGRFMP

BOOLEAN

 

 

Nota
titleNota:
    • When no is integrated with Shop Floor, MV_INTSFC equal to '0' the scrap is registered in generic table SX5. 
    • It must search in SX5 table according to command below:
      select X5_CHAVE from sx5990 where X5_TABELA = '43'
      Where:
      - Code of reason is X5_CHAVE
      Table of reason is '43'.
    • When it is integrated with  Shop Floor, MV_INTSFC equal to '1' is generated only the table of  Shop Floor - CYO. Routine SFCA003. If in the message there is no indicator of scrap or rework, consider scrap (CYO_LGRFMP = 'T').
    • Waste reasons have different sizes in tables. Validate it if receipt code does not exceed the size of columns in Protheus.
    • When uses the SIGAPCP it must validate a SX5.X5_CHAVE and SBC.BC_MOTIVO.
    • When uses the SIGASFC validate against the CYO.CYO_CDRF, CY0.CY0_CDRF  and SBC.BC_MOTIVO.

 

Stop Reason Transaction: StopReason_1_000.xsd

Message Identifier: StopReason
Version: 1_000
Protheus Module: SIGAPCP/SIGASFC
Sending Type: Synchronous

 

--IsSetupSetup Stoppage 
ActivityCodeCode of OperationSG2.G2_OPERACCHAR(02)TBLInWodet.CodeCHAR(10)
 ActivityDescriptionDescription OperationSG2.G2_DESCRICHAR(60)TBLInWodet.NameCHAR(40)
 MachineCodeMachine CodeSG2.G2_RESOURCECHAR(06)TBLInWodet.ResourceCHAR(15)
 ToolCodeCode ToolSG2.G2_TOOLCHAR(06)  
 ActivityTypeType Operation

1 = Executes operation; 2 = Does not execute.

CHAR(01)  
 WorkCenterCodeCode Work CenterSG2.G2_CTRABCHAR(06)TBLInWodet.ManagerGrpCodeCHAR(15)
 WorkCenterInternalIdId Work CenterCOMPANY + SG2.G2_BRANCH + SG2.G2_CTRAB   
 UnitItemNumberStandard Lot SG2.G2_LOTEPADNUM(06)TBLInWodet. StdSpeedDEC(28,23)
 TimeResourceTime Resource0 TBLInWodet. StdSpeedDEC(28,23)
 TimeMachineTime MachineSG2.G2_TEMPADDEC(05,2)TBLInWodet. StdSpeedDEC(28,23)
 TimeSetupTime PreparationSG2.G2_SETUPDEC(05,2)TBLInWodet. SetUpTimeINT
 UnitTimeTypeType Unit Time1 = Hours;2=Minutes;3=Seconds;4=Days TBLInWodet. StdSpeedFormatTINYINT
 ScriptAlternativeAlternativeSG2.G2_ROTALTCHAR(02)  
 InitialDateInitial DateSG2.G2_DTINIDATETBLInWodet.DtPlanStartDATETIME
 FinalDateFinal DateSG2.G2_DTFIMDATETBLInWodet.DtPlanEndDATETIME
 PercentageScrapValue% Scrap

Message

Tag

Description

Table/Field:

Protheus PCP

Table Field:

Protheus SFC

Type

Table/Field: PC-Factory

Type

BusinessContentType

Code

Stoppage Reason Code

SX5.X5_CHAVE

CYN.CYN_CDSP

CHAR(10)

 

 

 

Description

Stoppage Description

X5_DESCRI

X5_DESCSPA

X5_DESCENG

CYN.CYN_DSSP

CHAR(40)

 

 

 

IsEfficiency

Change Efficiency

--

--

 

 

 

 

IsEmailEquipment

E-mail Planner

--

--

 

 

 

 

IsServiceRequest

Issue Service Request

--   
 PercentageValueProportion--   
 ResourceQuantityQuantity Resource--  
  • When no is integrated with Shop Floor, MV_INTSFC equal to '0' the stoppage reason is registered in generic table SX5. 
  • It must search in SX5 table according to command below:
    select X5_CHAVE from sx5990 where X5_TABELA = '44'
    Where:
    - Code of reason is X5_CHAVE
    Table of reason is '44'.
  • When it is integrated with  Shop Floor, MV_INTSFC equal to '1' is generated only the table of  Shop Floor - CYN. Routine SFCA004. 
  • Stoppage reasons have different sizes in tables. Validate it if receipt code does not exceed the size of columns in Protheus.
    When it uses the SIGAPCP it must validate against the SX5.X5_CHAVE and SH6.H6_MOTIVO
    When it uses the SIGASFC validate against the CYN.CYN_CDSP, CYX.CYX_CDSP and SH6.H6_MOTIVO
    Nota
    titleNotaNote:

    Production Order Transaction: ProductionOrder_2_003.xsd

    Message Identifier: ProductionOrder
    Version: 2_003
    Module Protheus: SIGAPCP
    Sending Type: Synchronous

    • The tag ActivityType (Operation Type) is generated with fixed value '1';
    • The tag ActivityType (Time Unit Type) is generated with fixed value '1';
    • The tag ListOfPertOrders is not generated for Protheus;
    • In the deletion of a script, do not delete if there is integrity with the routine of OPERATIONS x COMPONENTS, MATA637. In this case, you do not need to send any message to PC-Factory;
    • When adding, editing or deleting data from MATA637, structure message is sent, ItemStructure.


    Addresses Transaction: AdressStock_1_000.xsd
    Message Idenfier: AdressStock
    Version: 1_000
    Protheus Module: SiGAPCP
    Sending Type: Synchronous

     

    20 CHAR(30)SC2.C2_PRODUTO15
    MessageTagDescriptionTable/Field: ProtheusTypeTable/Field: PC-FactoryType
    BusinessContentType

    Number

    Production Order Number

    WarehouseCodeWarehouse/DepositSBE.BE_LOCALSC2.C2_NUM + SC2.C2_ITEM + SC2.C2_SEQUENCHAR(02)

     

    TBLInAddress.WarehouseCodeCHAR(15)
     

    ProductionOrderUniqueID

    Company+Branch+Production Order

    COMPANY + SC2.C2_FILIAL + SC2.C2_NUM +

    SC2.C2_ITEM + SC2.C2_SEQUEN

    LocationCodeAddress/LocationSBE.BE_LOCALIZCHAR(15)TBLInAddress.CodeCHAR(15)
     AdressInternalIdFull Key address

     COMPANY + SBE.BE_BRANCH + SBE.BE_LOCAL + SBE.BE_LOCALIZ

       
     

    ItemCode

    Item Code

    AdressStockDescriptionDescription of addressSBE.BE_DESCRIPCHAR(30)

     

     

     

    ItemDescription

    Item Description

    SB1.B1_DESC

    CHAR(40)

     

     

     

    Type

    Order type

    1= Internal; 2=External; 3=Internal/External; 4=Rework;

    5=Repair; 6=Maintenance; 7=Fixed Asset;

    8=Tool Shop; 9=Reuse

     

    CHAR(01)

     

     

    TBLInAddress.ExtCodeCHAR(20)


    Balance Transaction: ItemStockLevel_1_000.xsd
    Message Identifier: ItemStockLevel
    Version: 1_000
    Protheus Module: Various
    Sending Type: Synchronous

     

    DEC(12,2)DEC(12,2)SC2.C2_UM SC2.C2_PEDIDO06 CHAR(01SC2.C2_LOCAL02CHAR(30ScriptCodeScript CodeSC2C2ROTEIRO CHAR(20CHAR(10 
    MessageTagDescriptionTable/Field: ProtheusTypeTable/Field: PC-FactoryType
    BusinessContentTypeItemCodeCode of productSB2.B2_CODCHAR(15)TBLInMovMat.ProductCodeCHAR(20)
     ItemDescriptionDescription of itemSB1.B1_DESCCHAR(30)  
    ListOfStock  

     

     

    Quantity

    Quantity

    SC2.C2_QUANT

       

    ReportQuantity

    Reported Quantity

    SC2.C2QUJE

     ReferenceCodeReference--   
     

    UnitOfMeasureCode

    Measurement Unit

    WarehouseCodeDeposit/Location of stock/WarehouseSB2.B2_LOCALCHAR(02)

     

    TBLInMovMat.WarehouseCodeCHAR(15)
     

    RequestOrderCode

    Production Order Code

    LotCodeNumber of LotSB8.B8_LOTECTLCHAR(10)

     

    TBLInMovMat.LotCodeCHAR(41)
     

    StatusOrderType

    Order status

    Estimated/Opened = 1

    Started = 6

    Partial/Total Closed = 7

    Idle = 9

    SubLotCodeSub-LotSB8.B8_NUMBATCHCHAR(06)  
     

    WarehouseCode

    Deposit Code

    NumberSeriesNumber of SeriesSBF.BF_NUMSERICHAR(20)  
     

    EndOrderDateTime

    CP Production Order End Date

    SC2.C2_DATPRF

    DATE

     

     

     

    StartOrderDateTime

    CP Production Order Start Date

    SC2.C2_DATPRI

    DATE

     

     

    AddressCodeAddress/LocationSBF.BF_LOCALCHAR(15)TBLInMovMat.AddressCodeCHAR(15)
     LotDueDateValidity DateSB8.B8_DTVALIDDATETBLInMovMat.LotDtValidityDATETIME
     CurrentStockAmountBalance of stock

    SB2.B2_QATU

    SB8.B8_BALANCE

    SBF.BF_QUANT

    DEC(12,2

     

    AbbreviationProviderName

    Customer Name

    SC5.C5_CLIENTE ( SA1.A1_NOME)

    )  
     BookedStockAmountReserved Quantiy

    SB2.

    B2_

    CHAR(02)

     

     

    ListOfActivityOrders

    RESERVATION

    SB8.B8_ALLOCATION

    SBF.BF_ALLOCATION

    DEC(12,2)  
     AvailableStockAmount

     

     

     

    ProductionOrderNumber

    Production Order

    SC2.C2_NUM + SC2.C2_ITEM +

    SC2.C2_SEQUEN

    Balance available

    SB2.B2_QATU - SB2.B2_RESERVA

    SB8.B8_SALDO - SB8.B8_ALLOCATION

    SBF.BF_QUANT - SBF.BF_ALLOCATION

    DEC(12,2)  
     

    ActivityID

    Record ID

    RECNO (SG2,SHY or SH8)

    QuantityUpdated
    Updated Quantity DEC(12,2)TBLInMovMat.QtyDEC(18,2)
     
    InputOutput

     

    ActivityCode

    Operation Code

    SG2.G2_OPERAC

    SHY.HY_OPERAC

    SH8.H8_OPER

    CHAR(02)

     

     

     

    ActivityDescription

    Operation Description

    SG2.G2_DESCRI

    CHAR(40)

     

     

     

    Split

    Operation split

    SH8.H8_DESDOBR

    CHAR(04)

     

     

     

    ItemCode

    Item Code

    SC2.C2_PRODUTO

    CHAR(15)

     

     

     

    ItemDescription

    Item Description

    SB1.B1_DESC

    CHAR(40)

     

     

     

    ActivityType

    Operation Type

    1 - Register ; 2-Does not Register

    CHAR(01)

     

     

     

    WorkCenterCode

    Work Center Code

    SG2.G2_CTRAB

    SHY.HY_CTRAB

    SH8.H8_CTRAB

    CHAR(06)

     

     

     

    WorkCenterDescription

    Work Center Description

    SHB.HB_NOME

    CHAR(30)

     

     

     

    UnitTimeType

    Time Unit Type

    1 - Hours; 2 - Minutes; 3- Seconds 4 - Days

    CHAR(01)

     

     

     

    TimeResource

    Resource Time (Standard time for a lot)

    SG2.G2_TEMPAD

    DEC(05,2)

     

     

     

    TimeMachine

    Machine Time (Time to do all order)

    SG2.G2_TEMPAD *SC2.C2_QUANT

    SHY.HY_TEMPO 

    SH8.H8_HRINI - SH8.H8_HRFIM

    DEC(14,4)

     

     

     

    TimeSetup

    Preparation Time

    SG2.G2_SETUP

    SHY.HY_TEMPOS

    SH8.H8_SETUP

    DEC(15,4)

     

     

     

    ScriptCode

    Script Code

    SG2.G2_CODIGO

    SHY.HY_ROTEIRO

    SH8.H8_ROTEIRO

    CHAR(02)

     

     

     

    LaborCode

    Direct Labor Code

    MOD+CC

    CHAR(08)

     

     

     

    UnitItemNumber

    Default Batch

    SG2.G2_LOTEPAD

    NUM(05)

     

     

     

    IsActivityEnd

    Last Operation

    Last operation, pass TRUE.

    In others FALSE.

    BOOLEAN

     

     

     

    MachineCode

    Machine Code

    SG2_RECURSO

    SHY_RECURSO

    H8_RECURSO

    CHAR(06)

     

     

     

    StartPlanDateTime

    Schedule Start Date/Time

    SHY.HY_HORAINI

    SC2.C2_DATPRI

    SH8.H8_DTINI

    DATE

     

     

     

    EndPlanDateTime

    Schedule End Date/Time

    SHY.HY_HORAFIM

    SC2.C2_DATPRF

    SH8.H8_DTFIM

    DATE

     

     

     

    ProductionQuantity

    Quantity to produce in the operation

    SHY.HY_QUANT 

    SH8.H8_QUANT 

    SC2.C2_QUANT

    DEC(12,2)

     

     

     

    UnitActivityCode

    Measurement Unit

    SB1.B1_UM

    CHAR(02)

     

     

     

    SecondUnitActivityCode

    Second measure unit in operation

    --

     

     

     

     

    SecondUnitActivityFactor

    Conversion factor for second unit in operation

    --

     

     

     

    ListOfMaterialOrders

     

     

     

     

     

     

     

    ProductionOrderNumber

    Production order

    SC2.C2_NUM + SC2.C2_ITEM +

    SC2.C2_SEQUEN

    CHAR(20)

     

     

     

    MaterialID

    Reservation record ID

    SD4.R_E_C_N_O_

    CHAR(10)

     

     

     

    MaterialCode

    Reservation Item Code

    SD4.D4_COD

    CHAR(15)

     

     

     

    MaterialDescription

    Item Description

    SB1.B1_DESC

    CHAR(40)

     

     

     

    ScriptCode

    Script Code

    SD4.D4_ROTEIRO

    CHAR(02)

     

     

     

    ActivityCode

    Operation Code

    SD4.D4_OPERAC

    CHAR(02)

     

     

     

    WarehouseCode

    Deposit Code

    SD4.D4_LOCAL

    CHAR(02)

     

     

     

    MaterialDate

    Reservation Date

    SD4.D4_DATA

    DATE

     

     

     

    MaterialQuantity

    Reservation Quantity

    SD4.D4_QUANT

    DEC(12,2)

     

     

     

    LotCode

    Lot

    SD4.D4_LOTECTL

    CHAR(10)

     

     

     

    PertMaterialNumber

    Item sequence

    SD4.D4_TRT

    CHAR(03)

     

     

     

    RequestType

    Request type

    SB1.B1_APROPRI

    CHAR(01)

     

     

    ListOfAllocatedMaterial

     

     

     

     

     

     

     

     

    WarehouseCode

    Deposit Code

    SD4.D4_LOCAL

    CHAR(02)

     

     

     

    LotCode

    Lot Code

    SD4.D4_LOTECTL

    SDC.DC_LOTECTL

    CHAR(10)

     

     

     

    LocationCode

    Location/Address

    SDC.DC_LOCALIZ

    CHAR(15)

     

     

     

    ActivityCode

    Operation Code

    SD4.D4_OPERAC

    CHAR(02)

     

     

     

    ScriptCode

    Script Code

    SD4.D4_ROTEIRO

    CHAR(02)

     

     

     

     AllocationQuantity

    Allocated Quantity

    SD4.D4_QUANT 

    SDC.DC_QUANT

    DEC(12,2)

     

     

     

    AllocationType

    Allocation Type

    1 = Add;2=Reduce;3=Absolut Value

    CHAR(01)

     

     

     

    SubLotCode

    Sub-lot

    SD4.D4_NUMLOTE

    SDC.DC_NUMLOTE

    CHAR(06)

     

     

     

    NumberSeries

    Serial Number

    SDC.DC_NUMSERI

    CHAR(20)

     

     

     

    LotDueDate

    Expiration Date

    SD4.D4_DTVALID

    DATE

     

     

    ListOfQuotaActivity

     

     

     

     

     

     

     

    ProductionOrderNumber

    Production Order Number

    CY9.CY9_NRORPO

    CHAR(20)

     

     

     

    ControlType

    Split Selection

    --

     

     

     

     

    ActivityID

    Operation ID

    CY9.CY9_CDAT

    CHAR(10)

     

     

     

    ItemCode

    Item code

    CYY.CYY_CDAC

    CHAR(15)

     

     

     

    ItemDescription

    Item Description

    CYY.CYY_DSAC

    CHAR(40)

     

     

     

    StartActivityDateTime

    Activity Start Date/Time

    CYY.CYY_DTBGAT / CYY.CYY_HRBGAT

    DATETIME

     

     

     

    EndActivityDateTime

    Activity End Date/Time

    CYY.CYY_DTEDAT / CYY.CYY_HREDAT

    DATETIME

     

     

     

    ApprovedQuantity

    Approved Quantity

    CYY.CYY_QTATAP

    DEC(13,4)

     

     

     

    ScrapQuantity

    Scrap Quantity

    CYY.CYY_QTATRF

    DEC(13,4)

     

     

     

    MachineCode

    Machine Code

    CYY.CYY_CDMQ

    CHAR(20)

     

     

     

    MachineDescription

    Machine Description

    CYY.CYY_DSMQ

    CHAR(40)

     

     

     

    ActivityQuantity

    Expected Quantity

    CYY.CYY_QTAT

    DEC(12,4)

     

     

     

    StandardSetup

    Standard Setup Time

    CYY.CYY_QTPASU

    NUM(10)

     

     

     

    StandardActivity

    Standard Operation Time

    CYY.CYY_QTPAAT

    NUM(10)

     

     

     

    StandardPostprocessing

    Standard Post-process Time

    CYY.CYY_QTPAPP

    NUM(10)

     

     

     

    StandardMachine

    Standard Machine Time

    CYY.CYY_QTPAMQ

    NUM(10)

     

     

     

    StandardOperator

    Standard Time MOD

    CYY.CYY_QTPAOE

    NUM(10)

     

     

     

    UsedCapacity

    Used Capacity

    CYY.CYY_QTVMAT

    DEC(12,4)

     

     

     

    ActivityTimeQuantity

    Available Activity Time

    CYY.CYY_HRDI

    CHAR(08)

     

     

     

    ReportQuantity

    Reported Quantity

    CYY.CYY_QTATRP

    DEC(13,4)

     

     

     

    ReworkQuantity

    Reworked Quantity

    CYY.CYY_QTATRT

    DEC(12,4)

     

     

     

    StartSetupDateTime

    Setup Start Date/Time

    CYY.CYY_DTBGSU / CYY.CYY_HRBGSU

    DATETIME

     

     

     

    EndSetupDateTime

    Setup End Date/Time

    CYY.CYY_DTEDSU / CYY.CYY_HREDSU

    DATETIME

     

     

     

    TimeSetup

    Preparation Time

    CY9.CY9_QTTESU

    NUM(10)

     

     

     

    TimeMachine

    Machine Time

    CY9.CY9_QTTEMQ

    NUM(10)

     

     

     

    TimeOperator

    Time MOD

    CY9.CY9_QTTERC

    NUM(10)

     

     

     

    TimePostprocessing

    Post-processing Time

    CY9.CY9_QTTEPP

    NUM(10)

     

     

     

    QuotaActivityID

    ID Split

    CYY.CYY_IDATQO

    CHAR(05)

     

     

     

    WorkCenterCode

    Work Center

    CY9.CY9_CDCETR

    CHAR(10)

     

     

     

    ReportedSplit

    Reported Split

    CYY.CYY_LGQORP

    BOOELAN

     

     

     

    StatusActivityType

    Operation Status

    CYY.CYY_TPSTAT

    CHAR(01)

     

     

    ListOfQuotaActivityTools

     

     

     

     

     

     

     

    ToolCode

    Tool

    CYY.CYY_CDFE

    CHAR(20)

     

     

     

    ToolQuantity

    Tool Quantity

    CYY.CYY_QTFE

    NUM(03)

     

     

    Nota
    titleNota:
      • The tags not used by PCP Protheus x PC-Factory integration, even in messages, described in Schema of TOTVS Single Message are not mentioned in this document.
      • The tag Type (Order Type) is generated with value "1" - Internal Order.
      • The tag RequestType (Request Type) identifies if the request can be done separately from the production report, according to rule below:
        If parameter MV_REQAUT has 'D' the DIRECT materials are entered and the INDIRECT are automatically loaded;
        If parameter MV_REQAUT has 'A' the consumption of materials is executed in all components;
        This tag has the following values: 1-Direct, 2-Indirect.
      • The tag Allocation Type (Allocation Type) is generated with value "3" - Absolute Order.
      • The session ListOfAllocatedMaterial follows some rules for allocation: 
        If item controls address and did not generate SBC it does not generate data from list  ListOfAllocatedMaterial (verificar only when parameter MV_LOCALIZ = S);
        If item controls trace and did not generate the batch in SD4,  it does not generate data from list ListOfAllocatedMaterial;
        If item does not control address or batch, it must generate data from list  ListOfAllocatedMaterial based on SD4.
      • The tags of operations os session order ListOfActivityOrders can have different origin according to parameterization or executed routines. If you execute the machine MATA690, table SH8 is used. When parameter MV_PCPATOR has 'S', table SHY is used. If parameter MV_PCPATOR has 'N', table SG2 is used. 
      • The tag Split of session ListOfActivityOrders is generated when there is unfolding of operation in several resources. Generated when using Shop Floor.
      • The tag ActivityType (Operation Type) is generated with value '1' - Register;
      • The tag UnitTimeType (Unit Measure Type) is generated with value '1' - Time;
      • The tag UnitItemNumber is used to register the standard batch of operation production.
      • For PC-Factory, indicate in which operation the component is consumed. When component x operation concept is not used, link components in last operation.
      • The tag TimeMachine (Machine Time) indicates time for production order.
        By using parameter MV_PCPATOR the time is SHY.HY_TEMPOM.
        When machine load is used, use the difference between SH8.H8_HRINI and SH8.H8_HRFIM.
        The time can have variation according to Operation Type (when it is not in SHY):
        Operation Type 1 Regular: Apply the batch time the quantity of order. Which are: (SG2.G2_TEMPAD / SG2.G2_LOTEPAD) * SC2.C2_QUANT) / SH1.H1_MAOOBRA. Note: If time and lot are zero, consider 1.
        Operation Type 2 Fixed and 3 Unlimited: Regardless of amount, the time is the same. Which are: SG2.G2_TEMPAD. Note: If zero delivers 1.
        Operation Type 4 Minimum Time: Considers the multiple quantity of batch. Example: Lot = 10. Time = 5. Order Amt. = 7. It must consider time to make 10 spare parts. The same calculation is type 1 Regular.
        Another point to consider is the PC-Factory waits time in Centesimal. When parameter MV_TPHR is other than 'C', time is converted to centesimal.
      • The tag TimeResource (Resource Time) indicates tiem to make standard batch.
      • The tag LaborCode (Labor Code) is indicated by 'MOD' + Cost Center.
      • The session ListOfQuotaActivity is generated only when Shop Floor is active.
      • The tag StatusActivityType has the following values: 1=Not Started;2=Programmed;3=Released;4=Started;5=Finished;6=Suspended

    Processes

    Production Annotation Transaction: ProductionAppointment_1_001.xsd
    Message Identifier: ProductionAppointment
    Version: 1_001
    Protheus Module: SIGAPCP/SIGASFC
    Sending Type: Synchronous 

    Nota
    titleNota:

    This message is generated by PC-Factory and sent to Protheus.

     

    Input or Output1 = Input or 2 = OutputCHAR(01)TBLInMovMat.ClassificationCHAR(15)
    Nota
    titleNote:
    • When updating new balance in ERP, message is sent to PC-Factory.
      Transactions generating movement of stock and executing balance updating routines activating integration:
      Inbound Inv.  - Function B2ATUCOMD1
      Sale Inv. - Function B2ATUCOMD2 Internal Transac. - Function B2ATUCOMD3
    • When the balance is updated by an update of PC-Factory do not generated the balance updating message. When the origin of the balance change is TOTVSMES, message is not generated.
      In production annotation message, tag Product Name indicates what is sent to record. For TOTVS MES, this information is saved in SH6.H6_OBSERVA = 'TOTVSMES'.
      If the movement is internal, it is registered in SD3.D3_OBSERVA = 'TOTVSMES'.
    • The field QuantityUpdated corresponds to the updated quantity, that is, quantity being moved. 
    • The field InputOutput indicates if the movement is input or output. 
    • When the item controls address (B1_LOCALIZ), the balance message must be generated only in the confirmation of MATA265, routine executing the address.
    • The routines of initial balance of PCP and Stock, MATA220 and MATA805 also generated the balance message.


    Waste Reason Transaction: WasteReason_1_000.xsd 

    Message Identifier: WasteReason
    Version: 1_000
    Protheus Module: SIGAPCP/SIGASFC
    Sending Type: Synchronous

     

    MessageTagDescription

    Table/Field:

    Protheus PCP

    Table Field:

    Protheus SFC

    TypeTable/Field: PC-FactoryType
    BusinessContentTypeCodeScrap CodeSX5.X5_KEYCYO.CYO_CDRFCHAR(08)TBLOutScrap.CodeCHAR(15)
     DescriptionDescription of Scrap

    X5_DESCRI

    X5_DESCSPA

    X5_DESCENG

    CYO.CYO_DSRFCHAR(40)TBLOutScrap.NameCHAR(30)
     IsReworkRework

     

    CYO.CYO_LGRTBOOLEAN  
     IsScrapMaterialMaterial ScrapSBE.BE_DESCRICCYO.CYO_LGRFMPBOOLEAN 
    Nota
    titleNote:
      • When no is integrated with Shop Floor, MV_INTSFC equal to '0' the scrap is registered in generic table SX5. 
      • It must search in SX5 table according to command below:
        select X5_CHAVE from sx5990 where X5_TABLE = '43'
        Where:
        - Code of reason is X5_CHAVE
        Table of reason is '43'.
      • When it is integrated with  Shop Floor, MV_INTSFC equal to '1' is generated only the table of  Shop Floor - CYO. Routine SFCA003. If in the message there is no indicator of scrap or rework, consider scrap (CYO_LGRFMP = 'T').
      • Waste reasons have different sizes in tables. Validate it if receipt code does not exceed the size of columns in Protheus.
      • When uses the SIGAPCP it must validate a SX5.X5_CHAVE and SBC.BC_MOTIVO.
      • When uses the SIGASFC validate against the CYO.CYO_CDRF, CY0.CY0_CDRF  and SBC.BC_REASON.

     

    Stop Reason Transaction: StopReason_1_000.xsd

    Message Identifier: StopReason
    Version: 1_000
    Protheus Module: SIGAPCP/SIGASFC
    Sending Type: Synchronous

     

    Message

    Tag

    Description

    Table/Field:

    Protheus PCP

    Table Field:

    Protheus SFC

    Type

    Table/Field: PC-Factory

    Type

    BusinessContentType

    Code

    Stoppage Reason Code

    SX5.X5_KEY

    CYN.CYN_CDSP

    CHAR(10)

    TBLOutResourceStatus.Code

    CHAR(05)

     

    Description

    Stoppage Description

    X5_DESCRI

    X5_DESCSPA

    X5_DESCENG

    CYN.CYN_DSSP

    CHAR(40)

    TBLOutResourceStatus.Name

    CHAR(30)

     

    IsEfficiency

    Change Efficiency

    --

    --

     

     

     

     

    IsEmailEquipment

    E-mail Planner

    --

    --

     

     

     

     

    IsServiceRequest

    Issue Service Request

    --

    --

     

     

     

     

    IsSetup

    Setup Stoppage

    --

    --

     

    TBLOutResourceStatus.FlgSetup

    SMALLINT

    Nota
    titleNote:
      • When no is integrated with Shop Floor, MV_INTSFC equal to '0' the stoppage reason is registered in generic table SX5. 
      • It must search in SX5 table according to command below:
        select X5_CHAVE from sx5990 where X5_TABELA = '44'
        Where:
        - Code of reason is X5_CHAVE
        Table of reason is '44'.
      • When it is integrated with  Shop Floor, MV_INTSFC equal to '1' is generated only the table of  Shop Floor - CYN. Routine SFCA004. 
      • Stoppage reasons have different sizes in tables. Validate it if receipt code does not exceed the size of columns in Protheus.
        When it uses the SIGAPCP it must validate against the SX5.X5_CHAVE and SH6.H6_REASON
        When it uses the SIGASFC validate against the CYN.CYN_CDSP, CYX.CYX_CDSP and SH6.H6_REASON


    Production Order Transaction: ProductionOrder_2_004.xsd

    Message Identifier: ProductionOrder
    Version: 2_003
    Module Protheus: SIGAPCP
    Sending Type: Synchronous

     

    CYV_CDSUNUM(10CYV.CYV_CDTN08CHAR(20CHAR(05DATETIMEBOOLEANDATEReportDateTimeDATETIMECHAR(02CHAR 10CloseOperationCloses OperationSH6H6PTLocationCodeCHAR(20WasteAppointment WasteCodeWaste CodeSBCBC_MOTIVO
    MessageTagDescription

    Table/Field

    TypeTable/Field: PC-FactoryType
    BusinessContentTypeNumberNumber Production OrderSC2.C2_NUM + SC2.C2_ITEM + SC2.C2_SEQUENCHAR(20)TBLInWOHD.CodeCHAR(41)
     ProductionOrderUniqueIDCompany+Branch+Production Order

    COMPANY + SC2.C2_BRANCH + SC2.C2_NUM +

    SC2.C2_ITEM + SC2.C2_SEQUEN

    CHAR(30)  
     ItemCodeCode ItemSC2.C2_PRODUCTCHAR(15)TBLInWOHD.ProductCodeCHAR(20)
     ItemDescriptionDescription ItemSB1.B1_DESCCHAR(40)  
     TypeType of Order

    1= Internal; 2=External; 3=Internal/External; 4=Rework;

    5=Fixing; 6=Maintenance; 7=Fixed Asset;

    8=Tooling; 9=Reuse

     

    CHAR(01)TBLInWOHD.WoTypeCodeCHAR(20)
     QuantityQuantitySC2.C2_QUANTDEC(12,2)TBLInWOHD.TotalQty

     DEC(19,4)

     ReportQuantityQuantity ReportedSC2.C2QUJEDEC(12,2)  
     UnitOfMeasureCodeUnit of MeasureSC2.C2_UMCHAR(02)TBLInWoDet.Unit1CodeCHAR(05)
     RequestOrderCodeRequest Code Production OrderSC2.C2_ORDERCHAR(06)  
     StatusOrderTypeOrder Status

    Estimated/Opened = 1

    Started = 6

    Partial/Total Closed = 7

    Idle = 9

    CHAR(01)TBLInWOHD.StatusSMALLINT
     WarehouseCodeCode DepositSC2.C2_LOCALCHAR(02)TBLInWOHD.AuxCode1CHAR(20)
     EndOrderDateTimeEnd Date Production Order CPSC2.C2_DATPRFDATETBLInWOHD.DtPlanEndDATETIME
     StartOrderDateTimeStart Date Production Order CPSC2.C2_DATPRIDATETBLInWOHD.DtPlanStartDATETIME
     AbbreviationProviderNameName CustomerSC5.C5_CLIENTE ( SA1.A1_NOME)CHAR(30)  
     ScriptCodeCode ScriptSC2.C2_SCRIPTCHAR(02)  
     ReportOrderTypeType of Report

    1 = Order; 2 = Operations; 3 = Control Point; 4 = Item

     

    CHAR(01)  
    ListOfActivityOrders      
     ProductionOrderNumberProduction Order

    SC2.C2_NUM + SC2.C2_ITEM +

    SC2.C2_SEQUEN

    CHAR(20)TBLInWoDet.Wocode

    CHAR(10)

     ActivityIDID of RecordRECNO (SG2,SHY ou SH8)CHAR(10)  
     ActivityCodeCode Operation

    SG2.G2_OPERAC

    SHY.HY_OPERAC

    SH8.H8_OPER

    CHAR(02)TBLInWoDet.WODetCode+Split

     CHAR(10)

     ActivityDescriptionDescription OperationSG2.G2_DESCRICHAR(40)TBLInWoDet.WODetName

    CHAR(30)

     SplitSplit of operationSH8.H8_DESDOBRCHAR(04)  
     ItemCodeCode of item

    SC2.C2_PRODUCT

    CHAR(15)  
     ItemDescriptionDescription of itemSB1.B1_DESCCHAR(40)  
     ActivityTypeType Operation1 - Register ; 2-Does not registerCHAR(01)  
     WorkCenterCodeCode Work Center

    SG2.G2_CTRAB

    SHY.HY_CTRAB

    SH8.H8_CTRAB

    CHAR(06)TLBInWODet.ManagerGrpCode CHAR(15)
     WorkCenterDescriptionDescription Work CenterSHB.HB_NOMECHAR(30)  
     UnitTimeTypeType Unit Time1 - Hours; 2 - Minutes; 3- Seconds; 4 - DaysCHAR(01)TLBInWODet.StdSpeedFormat TINYINT
     TimeResourceTime Resource (Standard time for lot)SG2.G2_TEMPADDEC(05,2)TLBInWODet.StdSpeed DEC(28,23)
     TimeMachineTime Machine (Time to order)

    SG2.G2_TEMPAD * SC2.C2_QUANT

    SHY.HY_TIME 

    SH8.H8_HRINI - SH8.H8_HRFIM

    DEC(14,4)

    TLBInWODet.StdSpeed

    DEC(28,23)
     TimeSetupTiem Setup

    SG2.G2_SETUP

    SHY.HY_TIMES

    SH8.H8_SETUP

    DEC(15,4)TLBInWODet.SetUpTimeINT
     TimeMODTime Man--   
     TimeIndMESIindicator of time in MES1 = Machine Time; 2 = Labor Time; 3 = Choice by MES.CHAR(01)  
     ScriptCodeCode Script

    SG2.G2_CODE

    SHY.HY_SCRIPT

    SH8.H8_SCRIPT

    CHAR(02)  
     LaborCodeCode Direct LaborMOD+CCCHAR(08)  
     UnitItemNumberStandard LotSG2.G2_LOTEPADNUM(05)TLBInWODet.StdSpeedDEC(28,23)
     IsActivityEndLast Operation

    In the last operation, TRUE.

    Otherwise, FALSE.

    BOOLEANTLBInWODet.ReportTrigger

    TINYINT

     MachineCodeMachine Code

    SG2_RESOURCE

    SHY_RESOURCE

    H8_RESOURCE

    CHAR(06)  
     StartPlanDateTimeDate/Time Start Schedule

    SHY.HY_HORAINI

    SC2.C2_DATPRI

    SH8.H8_DTINI

    DATETLBInWODet.StartPlanDateTimeDATETIME
     EndPlanDateTimeDate/Time End Schedule

    SHY.HY_HORAFIM

    SC2.C2_DATPRF

    SH8.H8_DTFIM

    DATETLBInWODet.EndPlanDateTimeDATETIME
     ProductionQuantityQuantity to produce in operation

    SHY.HY_QUANT 

    SH8.H8_QUANT 

    SC2.C2_QUANT

    DEC(12,2)TLBInWODet.Qty DEC(19,4)
     ActivityQuantityQuantity of operation

    SHY.HY_QUANT 

    SH8.H8_QUANT 

    SC2.C2_QUANT

    DEC(12,2)  
     UnitActivityCodeUnit of measureSB1.B1_UMCHAR(02)TLBInWODet.Unit1CodeCHAR(5)
     SecondUnitActivityCodeSecond unit of measure in operation-- TLBInWODet.Unit2CodeCHAR(5)
     SecondUnitActivityFactorConversor Factor for second unit in operation-- TLBInWODet.Unit2Factor DEC(8,4)
     ResourceQuantityQuantity of resources

    SG2.G2_MAOOBRA

    SHY.HY_MAOOBRA

    NUM(03)  
    ListOfMaterialOrders      
     ProductionOrderNumberProduction Order

    SC2.C2_NUM + SC2.C2_ITEM +

    SC2.C2_SEQUEN

    CHAR(20)TBLInBillMat.WocodeCHAR(41)
     MaterialIDID of reservation recordSD4.R_E_C_N_O_CHAR(10)  
     MaterialCodeCode Reservation ItemSD4.D4_CODCHAR(15)TBLInBillMat.ProductCodeCHAR(20)
     MaterialDescriptionDescription of ItemSB1.B1_DESCCHAR(40)  
     ScriptCodeCode ScriptSD4.D4_SCRIPTCHAR(02)  
     ActivityCodeCode OperationSD4.D4_OPERACCHAR(02)TBLInBillMat.WODetCodeCHAR(10)
     WarehouseCodeCode DepositSD4.D4_LOCALCHAR(02)TBLInBillMat.ExtCodeCHAR(20)
     MaterialDateDate ReservationSD4.D4_DATEDATE  
     MaterialQuantityQuantity of ReservationSD4.D4_QUANTDEC(12,2)TBLInBillMat.TotalQtyDEC(19,4)
     LotCodeLotSD4.D4_LOTECTLCHAR(10)  
     PertMaterialNumberSequence of itemSD4.D4_TRTCHAR(03)  
     RequestTypeType of RequestSB1.B1_APROPRICHAR(01)TBLInBillMat.CommentsCHAR(500)
    (mais)ListOfAllocatedMaterial

     

          
     WarehouseCodeCode DepositSD4.D4_LOCALCHAR(02)TBLInMovMat.WarehouseCodeCHAR(15)
     LotCodeCode Lot

    SD4.D4_LOTECTL

    SDC.DC_LOTECTL

    CHAR(10)TBLInMovMat.LotCodeCHAR(41)
     LocationCodeLocation/AddressSDC.DC_LOCALIZCHAR(15)TBLInMovMat.AddressCodeCHAR(15)
     ActivityCodeCode OperationSD4.D4_OPERACCHAR(02)TBLInMovMat.WoDetCodeCHAR(10)
     ScriptCodeCode ScriptSD4.D4_SCRIPTCHAR(02)  
     AllocationQuantityAllocated Quantity

    SD4.D4_QUANT 

    SDC.DC_QUANT

    DEC(12,2)TBLInMovMat.Qty DEC(19,4)
     AllocationTypeType Allocation

    1 = Adds;2=Decreases;3=Absolute Value

    CHAR(01)TBLInMovMat.AllocationTypeINT
     SubLoteCodeSub Lot

    SD4.D4_NUMLOTE

    SDC.DC_NUMLOTE

    CHAR(06)  
     NumberSeriesNumber of SeriesSDC.DC_NUMSERICHAR(20)  
     LotDueDateValidity DateSD4.D4_DTVALIDDATETBLInMovMat.LotDtValidityDATETIME
    ListOfQuotaActivity      
     ProductionOrderNumberNumber Production OrderCY9.CY9_NRORPOCHAR(20)  
     ControlTypeSelection Split--   
     ActivityIDID OperationCY9.CY9_CDAT

    Message

    Tag

    Description

    Table/Field

    Protheus PCP

    Table Field

    Protheus SFC

    Type

    Table/Field: PC-Factory

    Type

    BusinessContentType

    MachineCode

    Machine

    SH6.H6_RECURSO

    CYV.CYV_CDMQ

    CHAR(06)

     

     

     

    ProductionOrderNumber

    Production Order

    SH6.H6_OP

    CYV.CYV_NRORPO

    CHAR(20)

     

     

     

    ActivityCode

    Operation

    SH6.H6_OPERAC

    CYV.CYV_CDAT

    CHAR(02)

     

     

     

    Split

    Split

    SH6.H6_DESDOBR

    CYV.CYV_IDATQO

    CHAR(04)

     

     

     

    ActivityID

    Operation ID

    --

    --

     

     

     

     

    ItemCode

    Product

    SH6.H6_PRODUTO

    CYV.CYV_CDACRP

    CHAR(15)

     

     

     

    ApprovedQuantity

    Approved Quantity

    SH6.H6_QTDPROD

    CYV.CYV_QTATAP

    DEC(11,2)

     

     

     

    ScrapQuantity

    Scrap Quantity

    SH6.H6_QTDPERD

    CYV.CYV_QTATRF

    DEC(11,2)

     

     

     

    ReworkQuantity

    Reworked Quantity

    --

    --

     

     

     

     

    StartSetupDateTime

    Setup Start Date/Time

    --

    CYV_DTBGSU

    CYV_HRBGSU

    DATETIME

     

     

     

    EndSetupDateTime

    Setup End Date/Time

    --

    CYV_DTEDSU

    CYV_HREDSU

    DATETIME

     

     

     

    SetupCode

    Setup Code

    --

    CHAR(10)  
     

    OpTimeInt

    Operation Time

    --

    CYV.CYV_QTTERP

    ItemCodeCode of itemCYY.CYY_CDACCHAR(15)  
     

    ProductionShiftCode

    Shift Model Code

    --

    ItemDescriptionDescription of itemCYY.CYY_DSACCHAR(40)  
     

    ProductionShiftNumber

    Shift Number

    --

    CYV.CYV_NRTN

    CHAR(05)

     

     

     

    DocumentCode

    Document

    --

    CYV.CYV_NRDO

    StartActivityDateTimeDate/Time Start ActivityCYY.CYY_DTBGAT / CYY.CYY_HRBGATDATETIMETBLInWODet.StartPlanDateTimeDATETIME
     EndActivityDateTimeDate/Time End ActivityCYY.CYY_DTEDAT / CYY.CYY_HREDATDATETIME TBLInWODet.EndPlanDateTimeDATETIME
     ApprovedQuantityApproved QuantityCYY.CYY_QTATAPDEC(13,4)  
     

    DocumentSeries

    Document Series

    --

    CYV.CYV_NRSR

    ScrapQuantityScrapped QuantityCYY.CYY_QTATRFDEC(13,4)  
     

    StartReportDateTime

    Report Start Date/Time

    SH6.H6_DATAINI

    SH6.H6_HORAINI

    CYV.CYV_DTRPBG

    CYV.CYV_HRRPBG

    MachineCodeCode MachineCYY.CYY_CDMQCHAR(20)TBLInWODet.ResourceCodeCHAR(15)
     MachineDescriptionDescription of MachineCYY.CYY_DSMQCHAR(40)  
     

    EndReportDateTime

    Report End Date/Time

    SH6.H6_DATAFIN

    SH6.H6_HORAFIN

    CYV.CYV_DTRPED

    CYV.CYV_HRRPED

    DATETIME

     

     

     

    ReversedReport

    Annotation Reversal

    TRUE or FALSE

    TRUE or FALSE

    ActivityQuantityEstimated QuantityCYY.CYY_QTATDEC(12,4)TBLInWODet.QTYDEC(19,4)
     StandardSetupStandard Time PreparationCYY.CYY_QTPASUNUM(10)  
     

    ReversalDate

    Reversal Date

    --

    CYV.CYV_DTEO

    StandardActivityStandard Time OperationCYY.CYY_QTPAATNUM(10)  
     StandardPostprocessing

    Report Date/Time

    SH6.H6_DTAPONT

    CYV.CYV_DTRP

    CYV.CYV_HRRP

    Standard Time Post_processCYY.CYY_QTPAPPNUM(10)  
     

    WarehouseCode

    Deposit Code

    SH6.H6_LOCAL

    CYV.CYV_CDDP

    StandardMachineStandard Time MachineCYY.CYY_QTPAMQNUM(10)  
     

    LotCode

    Lot/Series

    SH6.H6_LOTECTL

    CYV.CYV_CDLOSR

    StandardOperatorStandard Time MODCYY.CYY_QTPAOENUM(10)  
     

    LotDueDate

    Lot Validity Date

    SH6.H6_DTVALID

    CYV.CYV_DTVDLO

    DATE

    UsedCapacityCapacity UsedCYY.CYY_QTVMATDEC(12,4)  
     

    IntegrationReport

    Record to be reversed

     

    ActivityTimeQuantityActivity Available TimeCYY.CYY_HRDICHAR(08)  
     ReportQuantityReported QuantityCYY.CYY_QTATRPDEC(13,4)

    CYV.CYV_LGEDRP

    BOOLEAN

      
     ReworkQuantity

    Location

    --

    CYV.CYV_CDLC

    Reworked QuantityCYY.CYY_QTATRTDEC(12,4)  
     StartSetupDateTimeDate/Time Start SetupCYY.CYY_DTBGSU / CYY.CYY_HRBGSUDATETIME  
     EndSetupDateTimeDate/Time End SetupCYY.CYY_DTEDSU / CYY.CYY_HREDSUDATETIME  
     TimeSetupTime SetupCY9.CY9_QTTESUNUM(10)TBLInWODet.SetUpTimeTINYINT
     TimeMachineMachine TimeCY9.

    CY0.CY0_CDRF

    CHAR(02)

     

     

     

    WasteDescription

    Waste Description

    SBC.BC_DESCRI

    CY0.CY0_DSRF

    CHAR(40)

     

     

     

    ScrapQuantity

    Scrap Quantity

    SBC.BC_QUANT

    CY0.CY0_QTRF

    DEC(11,2)

     

     

    ResourceAppointment

     

     

     

     

     

     

     

     

    OperatorCode

    Operator Code

    --

    CYW.CYW_CDOE

    CHAR(20)

     

     

     

    StartDateTime

    Start Date/Time

    --

    CYW.CYW_DTBGRP

    CYW.CYW_HRBGRP

    DATETIME

     

     

     

    EndDateTime

    End Date/Time

    --

    CYW.CYW_DTEDRP

    CYW.CYW_HREDRP

    DATETIME

     

     

     

    MOBTime

    Direct Labor Time

    --

    CYW.CYW_QTTEOE

    NUM(10)

     

     

     

    ExtraTime

    Over time

    --

    CYW.CYW_QTTEEX

    NUM(10)

     

     

     

    UtilTime

    Working Time

    --

    CYW.CYW_QTTEUT

    NUM(10)

     

     

     

    ProductionShiftCode

    Shift Model Code

    --

    CYW.CYW_CDTN

    CHAR(08)

     

     

     

    ProductionShiftNumber

    Shift Number

    --

    CYW.CYW_NRTN

    CHAR(05)

     

     

    SupplyOrder

     

     

     

     

     

     

     

     

    ProductionOrderNumber

    Production Order Number

    SD3.D3_OP

    CZP.CZP_NRORPO

    CHAR(20)

     

     

     

    MaterialCode

    Reservation Item Code

    SD3.D3_COD

    CZP.CZP_CDMT

    CHAR(15)

     

     

     

    UsedQuantity

    Used Quantity

    SD3.D3_QUANT

    CZP.CZP_QTRPPO

    DEC(12,2)

     

     

     

    WarehouseCode

    Deposit Code

    SD3.D3_LOCAL

    CZP.CZP_CDDP

    CHAR(02)

     

     

     

    LocationCode

    Location

    SD3.D3_LOCALIZ

    CZP.CZP_CDLC

    CHAR(15)

     

     

     

    LotCode

    Lot/Series

    SD3.D3_LOTECTL

    or

    SD3.D3_NUMSERI

    CZP.CZP_CDLO

    CHAR(20)

     

     

     

    ActivityCode

    Operation Code

    --

    CZP.CZP_CDAT

    CHAR(02)

     

     

     

    ScriptCode

    Script

    --

    CZP.CZP_CDRT

    CHAR(02)

     

     

    ReportToolActivity

     

     

     

     

     

     

     

     

    ToolCode

    Tool Code

    --

    CZ0.CZ0_IDFE

    CHAR(20)

     

     

    Nota
    titleNota:
      • The default annotation for this integration is MATA681.
      • The fields Machine, Production Order, Operation, Product and Date/Time Report are mandatory.
      • If Report Date/Time is earlier than the current date, the system uses the current Date/Time, that is, date and time the integration is being processed.
      • If the deposit code field is without completion, use the default location of item register(SB1.B1_LOCPAD).
      • The field CloseOperation indicates whether the annotation is TOTAL or PARTIAL. If you send true, it must be T=total. If false, it is considered as P=Partial. 
        The following rule is used to finish the order/production in Protheus is used.
        Close OPERATION: The following TAGS must be entered: ProductionOrderNumber, ActivityCode, CloseOperation (TRUE when TOTAL annotation or closed/finished operation), ReportDateTime. The other quantity fields(ApprovedQuantity and ScrapQuantity) and date/time start/end (StartReportDateTime and EndReportDateTime) must be passed without value (blank)
        Close ORDER: Annotation of quantity in the last operation with tag CloseOperation = TRUE.
      • Every annotation must send a return message, indicating possible problems or processing performed with success. 
        In case of success, the number of annotation is sent to Pc-Factory in the return message of ProductionAnnotation and corresponds to RECNO of SH6. This same number is used when a reverse must be registered(IntegrationReport).
      • The reversal when the field ReversedReport (Annotation Reversal) with content TRUE.
        When is reversal, it must have  the number of annotation, field IntegrationReport. 
      • The reversal can be generated in two ways in the file: only reversal or reversal + annotation. 
        Only reversal: it has approved quantity and zeroed scrap (or without content) and ReversedReport data.
        Reversal + annotation: with ReversedReport indicated and order data and quantity approved or scrap than zero.
      • The field SH6.H6_OBSERVA = 'TOTVSMES' is automatically registered to indicate the record was generated through TOTVSMES integration.
      • The system PC-Factory uses the format of hours with HH:MM:SS. For PCP Protheus, only HH:MM is considered. Annotation with time lower than 1 minute is rejected.
      • Import respects parameters defined in routines MATA681 through function F12 for user "admin".
      • As in PC-Factory, the operation can be issued later to the annotation, the following rule is used:
        The following TAGS must be entered:
        ProductionOrderNumber: Production Order 
        ActivityCode: Operation 
        CloseOperation: True or False. If TRUE when TOTAL annotation or closed/finalized operation. False in case of PARTIAL operation. 
        ReportDateTime: Annotation date.
      • The other quantity fields(ApprovedQuantity and ScrapQuantity) and date/time start/end (StartReportDateTime and EndReportDateTime) must be passed without value (blank)
      • The integration follows the rules and triggers defined by customers. Example: The start and end date/time are not mandatory, but the customer can define the obligatoriness through dictionary making tags to be filled out.
      • If is integrated to Shop Floor SIGASFC, it must save tables in this system. The base will be the process of Annotation Model 2, SFCA316

    Consumption notes of components:

    • The consumption of components must follow the parameterization of PCPA109. In parameters routine is defined how the treatment of components consumption:
      1 - BackFlush: Whenever issue of components is executed according to what is defined in Engineering. Disregard the list of consumption SupplyOrder.
      2 - Actual Consumption: It consumes according to the list of components SupplyOrder sent in message.
    • In the consumption of components, the process must follow this rule, according to parameterization:
      If parameter MV_REQAUT is 'D' the DIRECT materials are entered and the INDIRECT are automatically loaded. To load the Indirects the type of movement must have field Ind Approp as O in routine MATA230.
      If parameter MV_REQAUT is 'A', the consumption of materials is executed for all components.
    • It must consider the movement type of register of parameters PCPA109, folder MOVEMENTS. If input, use field OE_VAR1. If output, use field OE_VAR2. When Shop Floor is used, it must use movements parameterized in SIGASFC (MV_SFRQMB and MV_TMPAD).
    • In PC Factory, batch and number of series are not used at the same time. O retorno desse conteúdo será via tag SupplyOrder - LotCode, que pode ser o Lote ou número de série, conforme o cadastro do item.

     

    Shop Floor Notes

    • Quantity reported  CYV_QTATRP, sum of quantity approved and rejected.
    • Start and End Date/Time and code of Preparation despite being virtual, if machine demands setup (CYB_LGUSU) must send tags SetupCode, StartSetupDateTime and EndSetupDateTime.
    • If document, tag DocumentCode, is blank, the production order number is saved.
    • The fields Reservation Date 'CZP_DTMT' must receive the content of table CYP.CYP_DTMT 
      The reservation quantity 'CZP_QTMT' must receive the content of table  CYP.CYP_QTMT
      State 'CZP_TPST' must receive content of table CYP.CYP_TPST 
    • The operation unit time, CZ0_QTTEUN, must be generated according to rule SFCA314

     

    Scrap Notes

    ...

    CY9_QTTEMQNUM(10)TBLInWODet.StdSpeedDEC(28,23)
     TimeOperatorTime MODCY9.CY9_QTTERCNUM(10)  
     TimePostprocessingPost Process TimeCY9.CY9_QTTEPPNUM(10)  
     QuotaActivityIDID SplitCYY.CYY_IDATQOCHAR(05)

    ActivityCode+

    TBLInWODet.WODetCode
    CHAR(10)
     WorkCenterCodeWork CenterCY9.CY9_CDCETRCHAR(10)TBLInWODet.ManagerGrpCodeCHAR(15)
     ReportedSplitReported SplitCYY.CYY_LGQORPBOOELAN  
     StatusActivityTypeState OperationCYY.CYY_TPSTATCHAR(01)  
    (mais) ListOfQuotaActivityTools      
     ToolCodeToolCYY.CYY_CDFECHAR(20)  
     ToolQuantityQuantity ToolCYY.CYY_QTFENUM(03)  
    Nota
    titleNote:
      • The tags not used by PCP Protheus x PC-Factory integration, even in messages, described in Schema of TOTVS Single Message are not mentioned in this document.
      • The tag Type (Order Type) is generated with value "1" - Internal Order.
      • The tag RequestType (Request Type) identifies if the request can be done separately from the production report, according to rule below:
        If parameter MV_REQAUT has 'D' the DIRECT materials are entered and the INDIRECT are automatically loaded;
        If parameter MV_REQAUT has 'A' the consumption of materials is executed in all components;
        This tag has the following values: 1-Direct, 2-Indirect.
      • The tag Allocation Type (Allocation Type) is generated with value "3" - Absolute Order.
      • The session ListOfAllocatedMaterial follows some rules for allocation: 
        If item controls address and did not generate SBC it does not generate data from list  ListOfAllocatedMaterial (verificar only when parameter MV_LOCALIZ = S);
        If item controls trace and did not generate the batch in SD4,  it does not generate data from list ListOfAllocatedMaterial;
        If item does not control address or batch, it must generate data from list  ListOfAllocatedMaterial based on SD4.
      • The tags of operations os session order ListOfActivityOrders can have different origin according to parameterization or executed routines. If you execute the machine MATA690, table SH8 is used. When parameter MV_PCPATOR has 'S', table SHY is used. If parameter MV_PCPATOR has 'N', table SG2 is used. 
      • The tag Split of session ListOfActivityOrders is generated when there is unfolding of operation in several resources. Generated when using Shop Floor.
      • The tag ActivityType (Operation Type) is generated with value '1' - Register;
      • The tag UnitTimeType (Unit Measure Type) is generated with value '1' - Time;
      • The tag UnitItemNumber is used to register the standard batch of operation production.
      • For PC-Factory, indicate in which operation the component is consumed. When component x operation concept is not used, link components in last operation.
      • The tag TimeMachine (Machine Time) indicates time for production order.
        By using parameter MV_PCPATOR the time is SHY.HY_TEMPOM.
        When machine load is used, use the difference between SH8.H8_HRINI and SH8.H8_HRFIM.
        The time can have variation according to Operation Type (when it is not in SHY):
        Operation Type 1 Regular: Apply the batch time the quantity of order. Which are: (SG2.G2_TEMPAD / SG2.G2_LOTEPAD) * SC2.C2_QUANT) / SH1.H1_MAOOBRA. Note: If time and lot are zero, consider 1.
        Operation Type 2 Fixed and 3 Unlimited: Regardless of amount, the time is the same. Which are: SG2.G2_TEMPAD. Note: If zero delivers 1.
        Operation Type 4 Minimum Time: Considers the multiple quantity of batch. Example: Lot = 10. Time = 5. Order Amt. = 7. It must consider time to make 10 spare parts. The same calculation is type 1 Regular.
        Another point to consider is the PC-Factory waits time in Centesimal. When parameter MV_TPHR is other than 'C', time is converted to centesimal.
      • The tag TimeResource (Resource Time) indicates tiem to make standard batch.
      • The tag LaborCode (Labor Code) is indicated by 'MOD' + Cost Center.
      • The session ListOfQuotaActivity is generated only when Shop Floor is active.
      • The tag StatusActivityType has the following values: 1=Not Started;2=Programmed;3=Released;4=Started;5=Finished;6=Suspended
      • The co-product is sent to PC-Factory na ListOfMaterialOrders, tag MaterialQuantity, e na ListOfAllocatedMaterial, tag AllocationQuantity (quando existir) com quantidade negativa. O PC-Factory deverá enviar ao Protheus na mensagem de apontamento ProductionAppointment na SupplyOrder the tag UsedQuantity with negative quantity, then the ERP understands that it is the input of a co-product in stock. The type of transaction for co-product, it is registered in the PCPA109 and must have content lower than 500, as it is an input and must be type RETURN and the field Update Allocation must be yes (routine MATA230).
      •  A tag TimeIndMES deve ser gerada como '3'. 


    Processes

    Production Annotation Transaction: ProductionAppointment_2_000.xsd
    Message Identifier: ProductionAppointment
    Version: 2_003
    Protheus Module: SIGAPCP/SIGASFC
    Sending Type: Synchronous 


    Nota
    titleNote:

    This message is generated by PC-Factory and sent to Protheus.


    MessageTagDescription

    Table/Field

    Protheus PCP

    Table Field

    Protheus SFC

    TypeTable/Field: PC-FactoryTipo
    BusinessContentTypeMachineCodeMachineSH6.H6_RESOURCECYV.CYV_CDMQCHAR(06)TBLOutInteg.ResourceCodeCHAR(15)
     ProductionOrderNumberProduction OrderSH6.H6_OPCYV.CYV_NRORPOCHAR(20)TBLOutInteg.WOCodeCHAR(41)
     ActivityCodeOperationSH6.H6_OPERACCYV.CYV_CDATCHAR(02)TBLOutInteg.WODetCodeCHAR(10)
     SplitSplitSH6.H6_DESDOBRCYV.CYV_IDATQOCHAR(04)TBLOutInteg.WODetCodeCHAR(10)
     ActivityIDID Operation----   
     ItemCodeProductSH6.H6_PRODUCTCYV.CYV_CDACRPCHAR(15)TBLOutInteg.ProductCodeCHAR(20)
     ApprovedQuantityApproved QuantitySH6.H6_QTDPRODCYV.CYV_QTATAPDEC(11,2)TBLOutInteg.QtyDEC(19,4)
     ScrapQuantityScrapped QuantitySH6.H6_QTDPERDCYV.CYV_QTATRFDEC(11,2)TBLOutInteg.QtyDEC(19,4)
     ReworkQuantityReworked Quantity----   
     StartSetupDateTimeDate/Time Start Setup--

    CYV_DTBGSU

    CYV_HRBGSU

    DATETIME  
     EndSetupDateTimeDate/Time End Setup--

    CYV_DTEDSU

    CYV_HREDSU

    DATETIME  
     SetupCodeSetup Code--CYV_CDSUCHAR(10)  
     OpTimeIntOperation Time--CYV.CYV_QTTERPNUM(10)  
     ProductionShiftCodeCode Shift Model--CYV.CYV_CDTNCHAR(08)  
     ProductionShiftNumberShift Number--CYV.CYV_NRTNCHAR(05)TBLOutInteg.ShiftSMALLINT
     DocumentCodeDocument--CYV.CYV_NRDOCHAR(20)TBLOutInteg.DocNumberCHAR(20)
     DocumentSeriesSeries Document--CYV.CYV_NRSRCHAR(05)  
     StartReportDateTimeDate/Time Start Report

    SH6.H6_DATAINI

    SH6.H6_HORAINI

    CYV.CYV_DTRPBG

    CYV.CYV_HRRPBG

    DATETIMETBLMSGERP.StartDATETIME
     EndReportDateTimeDate/Time End Report

    SH6.H6_DATAFIN

    SH6.H6_HORAFIN

    CYV.CYV_DTRPED

    CYV.CYV_HRRPED

    DATETIMETBLMSGERP.EndDATETIME
     ReversedReportAnnotation ReversalTRUE or FALSETRUE ou FALSEBOOLEAN  
     ReversalDateReversal Date--CYV.CYV_DTEODATETBLOutInteg.DTEvDATETIME
     ReportDateTimeDate/Time ReportSH6.H6_DTAPONT

    CYV.CYV_DTRP

    CYV.CYV_HRRP

    DATETIMETBLOutInteg.DtEvDATETIME
     WarehouseCodeDepositSH6.H6_LOCALCYV.CYV_CDDPCHAR(02)TBLOutInteg.WarehouseCodeCHAR(15)
     LotCodeLot/SeriesSH6.H6_LOTECTLCYV.CYV_CDLOSRCHAR(10)TBLOutInteg.LotCodeCHAR(41)
     LotDueDateDate Validity LotSH6.H6_DTVALIDCYV.CYV_DTVDLODATE

    TBLLot.DtValidity

    DATETIME
     CloseOperationClose OperationSH6.H6_PTCYV.CYV_LGEDRPBOOLEAN  
     LocationCodeLocation--CYV.CYV_CDLCCHAR(20)TBLOutInteg.Address1CodeCHAR(15)
    ListOfReversalAppointments       
     IntegrationReportRecord to be reversed  CHAR(10)TBLOutInteg.TransacTypeTINYINT
     ReversalTypeType of Reversal  CHAR(01)  
     ReversalQuantityQuantity reverted-- DEC(18,4)  
    WasteAppointment       
     WasteCodeCode Scrap

    SBC.BC_REASON

    CY0.CY0_CDRFCHAR(02)TBLOutInteg.ScrapCodeCHAR(15)
     WasteDescriptionDescription Scrap

    SBC.BC_DESCRI

    CY0.CY0_DSRFCHAR(40)  
     ScrapQuantityScrapped Quantity

    SBC.BC_QUANT

    CY0.CY0_QTRFDEC(11,2)TBLOutInteg.QtyDEC(18,4)
     ScrapProductScrapped ProductSBC.BC_PRODUCT--CHAR(15)  
     WareHouseCodeDeposit Scrapped ProductSBC.BC_LOCORIG--CHAR(10)  
     ScrapProductToGenerated ScrapSBC.BC_CODDEST--CHAR(15)  
     WareHouseCodeToDeposit of generated scrapSBC.BC_LOCAL--CHAR(10)  
     AdressCodeOrigin AddressSBC.BC_LOCALIZ CHAR(15)  
     AdressCodeToDestination AddressSBC.BC_LOCDEST CHAR(15)  
     NumberSeriesNumber of SeriesSBC.BC_NUMSERI CHAR(20)  
     NumberSeriesToNumber of Series DestinationSBC.BC_NSEDEST CHAR(20)  
     LotCodeLotSBC.BC_LOTECTL CHAR(10)  
     SubLoteCodeSub LotSBC.BC_NUMLOTE CHAR(06)  
     LotDueDateValidity DateSBC.BC_DTVALID DATE  
     CostCenterCodeCost CenterSBC.BC_CC CHAR(09)  
    ResourceAppointment       
     OperatorCodeOperator Code--CYW.CYW_CDOECHAR(20)TBLOutInteg.UserCodeCHAR(30)
     StartDateTimeStart Date/Time--

    CYW.CYW_DTBGRP

    CYW.CYW_HRBGRP

    DATETIMETBLMSGERP.StartDATETIME
     EndDateTimeEnd Date/Time--

    CYW.CYW_DTEDRP

    CYW.CYW_HREDRP

    DATETIMETBLMSGERP.EndDATETIME
     MOBTimeTime Direct Labor--CYW.CYW_QTTEOENUM(10)  
     ExtraTimeExtra Time--CYW.CYW_QTTEEXNUM(10)  
     UtilTimeUseful Time--CYW.CYW_QTTEUTNUM(10)  
     ProductionShiftCodeCode Shift Model--CYW.CYW_CDTNCHAR(08)  
     ProductionShiftNumberNumber Shift--CYW.CYW_NRTNCHAR(05)TBLOutInteg.ShiftSMALLINT
    SupplyOrder       
     ProductionOrderNumberNumber Production OrderSD3.D3_OPCZP.CZP_NRORPOCHAR(20)

    TBLOutInteg.WOCode

    CHAR(41)
     MaterialCodeCode Reservation ItemSD3.D3_CODCZP.CZP_CDMTCHAR(15)TBLOutInteg.ProductCodeCHAR(20)
     UsedQuantityQuantity UsedSD3.D3_QUANTCZP.CZP_QTRPPODEC(12,2)TBLOutInteg.Qty DEC(19,4)
     WarehouseCodeCode DepositSD3.D3_LOCALCZP.CZP_CDDPCHAR(02)TBLOutInteg.WarehouseCodeCHAR(15)
     LocationCodeLocationSD3.D3_LOCALIZCZP.CZP_CDLCCHAR(15)TBLOutInteg.Address1CodeCHAR(15)
     LotCodeLot/Series

    SD3.D3_LOTECTL

    ou

    SD3.D3_NUMSERI

    CZP.CZP_CDLOCHAR(20)TBLOutInteg.LotCodeCHAR(41)
     ActivityCodeCode Operation--CZP.CZP_CDATCHAR(02)TBLOutInteg.WODetCodeCHAR(10)
     ScriptCodeScript--CZP.CZP_CDRTCHAR(02)  
    ReportToolActivity       
     ToolCodeCode Tool--CZ0.CZ0_IDFECHAR(20)  
    Nota
    titleNote:
      • The default annotation for this integration is MATA681.
      • The fields Machine, Production Order, Operation, Product and Date/Time Report are mandatory.
      • If Report Date/Time is earlier than the current date, the system uses the current Date/Time, that is, date and time the integration is being processed.
      • If the deposit code field is without completion, use the default location of item register(SB1.B1_LOCPAD).
      • The field CloseOperation indicates whether the annotation is TOTAL or PARTIAL. If you send true, it must be T=total. If false, it is considered as P=Partial. 
        The following rule is used to finish the order/production in Protheus is used.
        Close OPERATION: The following TAGS must be entered: ProductionOrderNumber, ActivityCode, CloseOperation (TRUE when TOTAL annotation or closed/finished operation), ReportDateTime. The other quantity fields(ApprovedQuantity and ScrapQuantity) and date/time start/end (StartReportDateTime and EndReportDateTime) must be passed without value (blank)
        Close ORDER: Annotation of quantity in the last operation with tag CloseOperation = TRUE. Encerrar a ORDEM: Realizar o encerramento da ordem sem necessidade de informações de apontamento no XML. Considera somente as tags ProductionOrderNumber e CloseOperation(TRUE). Sendo que, deverá verificar se tem apontamento na última operação. Deverá executar o mesmo procedimento da opção "Encerrar" do MATA681. Devendo fazer as movimentações e atualização do campo SC.C2_DATRF.
      • Every annotation must send a return message, indicating possible problems or processing performed with success. 
        In case of success, the number of annotation is sent to Pc-Factory in the return message of ProductionAnnotation and corresponds to RECNO of SH6. This same number is used when a reverse must be registered(IntegrationReport).
      • The reversal when the field ReversedReport (Annotation Reversal) with content TRUE.
        When is reversal, it must have  the number of annotation, field IntegrationReport. Poderá conter uma lista de Ids(ListOfReversalAppointments) que serão estornados. Pode estornar registros de apontamentos de produção e registros de recusa. Para isso a tag ReversalType indica qual o processo a ser executado, sendo, 1 = Produção; 2 = Recusa
      • The reversal can be generated in two ways in the file: only reversal or reversal + annotation. 
        Only reversal: it has approved quantity and zeroed scrap (or without content) and ReversedReport data.
        Reversal + annotation: with ReversedReport indicated and order data and quantity approved or scrap than zero.
      • The field SH6.H6_OBSERVA = 'TOTVSMES' is automatically registered to indicate the record was generated through TOTVSMES integration.
      • The system PC-Factory uses the format of hours with HH:MM:SS. For PCP Protheus, only HH:MM is considered. Annotation with time lower than 1 minute is rejected.
      • Import respects parameters defined in routines MATA681 through function F12 for user "admin".
      • As in PC-Factory, the operation can be issued later to the annotation, the following rule is used:
        The following TAGS must be entered:
        ProductionOrderNumber: Production Order 
        ActivityCode: Operation 
        CloseOperation: True or False. If TRUE when TOTAL annotation or closed/finalized operation. False in case of PARTIAL operation. 
        ReportDateTime: Annotation date.
      • The other quantity fields(ApprovedQuantity and ScrapQuantity) and date/time start/end (StartReportDateTime and EndReportDateTime) must be passed without value (blank)
      • The integration follows the rules and triggers defined by customers. Example: The start and end date/time are not mandatory, but the customer can define the obligatoriness through dictionary making tags to be filled out.
      • If is integrated to Shop Floor SIGASFC, it must save tables in this system. The base will be the process of Annotation Model 2, SFCA316
      • The subproduct is handled in the ListOfWasteAppointments, tags ScrapProduct and ScrapProductTo. The movements depend on the parameterization(F12) of MATA685, indicating whether the origin product is consumed. Do not enter scrapped products generated scrap. In this case, register only the defects.
        For the subproduct to be generated, the parameter MV_DIGIPER, must be set as 'S'.
      • For Reuse, the generated Scrap must be the same product of the order. In this case, only the deposit will change, in which there will be a own location to store the scrap. This functionality is for companis that resue the finished product with defect (without generating subproduct) in the composition of other product. For this case, the deposit of the scrap can be parameterized in PCPA109. The movements depend on the parameterization (F12) do MATA685. If this parameterization is 'S' the routine will download the balance of the product/origin location and add/generate the balance of the product/destination location. If 'N', it will only update the balance of the product/destination location.


    Consumption notes of components:

    • The consumption of components must follow the parameterization of PCPA109. In parameters routine is defined how the treatment of components consumption:
      1 - BackFlush: Whenever issue of components is executed according to what is defined in Engineering. Disregard the list of consumption SupplyOrder.
      2 - Actual Consumption: It consumes according to the list of components SupplyOrder sent in message.
    • In the consumption of components, the process must follow this rule, according to parameterization:
      If parameter MV_REQAUT is 'D' the DIRECT materials are entered and the INDIRECT are automatically loaded. To load the Indirects the type of movement must have field Ind Approp as O in routine MATA230.
      If parameter MV_REQAUT is 'A', the consumption of materials is executed for all components.
    • It must consider the movement type of register of parameters PCPA109, folder MOVEMENTS. If input, use field OE_VAR1. If output, use field OE_VAR2. When Shop Floor is used, it must use movements parameterized in SIGASFC (MV_SFRQMB and MV_TMPAD).
    • Quando consumo real, deverá considerar o tipo de movimento do cadastro de parâmetros PCPA109, folder "Movimentos e Transferência". Para saídas usar o campo OE_VAR2. Quando usa o Chão de Fábrica, deverá usar as movimentações parametrizadas no SIGASFC (MV_SFRQMB).
    • For the annotation, the type of movement is the one in the parameter MV_TMPAD, for SIGAPCP and SIGASFC.
      When back-flush, it uses the types of standard movements of the routine.
    • In PC Factory, batch and number of series are not used at the same time. The return of this content is through tag SupplyOrder - LotCode, which can be the Lot or number of series, according to register of item.

     

    Shop Floor Notes

    • Quantity reported  CYV_QTATRP, sum of quantity approved and rejected.
    • Start and End Date/Time and code of Preparation despite being virtual, if machine demands setup (CYB_LGUSU) must send tags SetupCode, StartSetupDateTime and EndSetupDateTime.
    • If document, tag DocumentCode, is blank, the production order number is saved.
    • The fields Reservation Date 'CZP_DTMT' must receive the content of table CYP.CYP_DTMT 
      The reservation quantity 'CZP_QTMT' must receive the content of table  CYP.CYP_QTMT
      State 'CZP_TPST' must receive content of table CYP.CYP_TPST 
    • The operation unit time, CZ0_QTTEUN, must be generated according to rule SFCA314

     

    Scrap Notes

    • Register scrap reason (tags of ListOfWasteAppointments), updating data from table SBC
    • If reason of scrap is not registered, it is added to reasons register of table SX5. 
      Where:  
      Code of reason is X5_CHAVE
      Table of reason is '44'. 
      For Shop Floor, table - CY0 must be generated.
    • Scrap reasons have different sizes in tables. Validate it if receipt code does not exceed the size of columns in Protheus.
      When it uses the PCP it must validate a SX5.X5_CHAVE and SBC.BC_MOTIVO.
      When it uses the SIGASFC validate against the CYO.CYO_CDRF, CY0.CY0_CDRF and SBC.BC_MOTIVO.

     

    Machine Stoppage Annotation Transaction: StopReport_1_001.xsd StopReport_1_001.xsd

    Message Identifier: StopReport
    Version: 1_001
    Protheus Module: SIGAPCP
    Sending Type: Synchronous

     

    Nota
    titleNote:

    This message is generated by PC-Factory and sent to Protheus.

    MessageTagDescription

    Table/Field

    Protheus PCP

    Table/Field

    Protheus SFC

    TypeTable/Field: PC-FactoryType
     MachineCodeMachine CodeSH6.H6_RESOURCECYX.CYX_CDMQCHAR(06)TBLOutRSEv.ResourceCodeCHAR(15)
     MachineDescriptionMachine Description     
     StopReasonCodeCode Reason StoppageSH6.H6_REASONCYX.CYX_CDSPCHAR(02)TBLOutRSEv.ResourceStatusCodeCHAR(20)
     StopReasonDescriptionDescription Reason StoppageSX5.X5_DESCRI *CYX.CYX_DSSPCHAR(40)  
     StartDateTimeSt Date/Time

    SH6.H6_DATAINI

    SH6.H6_HORAINI

    CYX.CYX_DTBGSP

    CYX_HRBGSP

    DATETBLOutRSEv.ShiftDtStartDATETIME
     EndDateTimeEnd Date/Time

    SH6.H6_DATAFIN

    SH6.H6_HORAFIN

    CYX.CYX_DTEDSP

    CYX.CYX_HREDSP

    DATETBLOutRSEv.ShiftDtEndDATETIME
     OperatorCodeOperator CodeSH6.H6_OPERADOCYX.CYX_CDOECHAR(20)TBLOutRSEv.UserCodeStartCHAR(30)
     ReportDateTimeReport Date/TimeSH6.H6_DTAPONTCYX.CYX_DTRPDATETBLOutRSEv.DtTimeStampDATETIME
     ToolCodeCode Tool-- CYX.CYX_CDFEPO   
     ProductionTeamCodeCode Team--CYX.CYX_CDGROE   
     StopTypeType Stoppage (1=Not Scheduled;2=Scheduled)--CYX.CYX_TPSP   
     ReportSequenceID PC-Factory---- TBLOutRSEv.IDOutRSEv 
    Nota
    titleNote:
    • The annotation of standard stoppage for this integration is MATA682 in PCP and in Shop Floor the routine is SFCA311.
    • The fields Machine,Stoppage Reason, Start and End Date/Time and Report Date/Time are mandatory.
    • If Report Date/Time is earlier than the current date, the system uses the current Date/Time, that is, date and time the integration is being processed.
    • Stoppage annotation sets SH6.H6_TIPO = 'I'.
    • Product must be labor. Generated by system. Example: SH6.H6_PRODUTO = MOD001
    • The quantity loss is generated by the system. SH6.H6_QTDPERD.
    • The field SH6.H6_IDENT is also generated by the system.
    • The field SH6.H6_TEMPO must be calculated by adapter. It must be the stoppage total time.
    • Stoppage Reason:
      The reason can be registered through integration. It must check the stoppage reason is registered. If not, you must add the reason used in annotation in table SX5.
      Where:
      Code of reason is X5_CHAVE
      Table of reason is '44'.
      For Shop Floor, table - CYN must be generated.
    • Every annotation must send a return message, indicating possible problems or processing performed with success. 
    • In case of success, the number of annotation is sent to PV-Factory in the return message of StopReport and corresponds to RECNO of SH6. This same number is used when a reverse must be registered(IntegrationReport).
    • The reversal when the field ReversedReport (Annotation Reversal) with content TRUE.
      When is reversal, it must have  the number of annotation, field IntegrationReport.
    • The reversal can be generated in two ways in the file: only reversal or reversal + annotation. When the message has the reversal and the annotation only can commit the movements when both are concluded.
      To identify whether the message only has reversal or reversal + annotation, the following status must be checked:
      Only reversal: it only has the information of ReverseReport and IntegrationReport with other tags without data. 
      Reversal + annotation: has ReversedReport and IntegrationReport entered and the other mandatory data (Machine, Stoppage Reason, Start and End Date/Time and Report Date/Time) filled out.
    • The field SH6.H6_OBSERVA = 'PPI' is automatically registered to indicate the record was generated through PCP Protheus x PC-Factory.
    • The system PC-Factory uses the format of hours with HH:MM:SS. For PCP Protheus, only HH:MM is considered. Annotation with time lower than 1 minute is rejected.
    • The field ReportSequence is used to register ID of table registering the stoppage information. It must be used in MATI681CRG entry point.
    • Shift model and number is automatically generated by routine SFCA311. Only when using Shop Floor.
    • If message does not send StopType, it is considered as 2= Not Scheduled. Only when using Shop Floor.
    • Stoppage

    ...

    • reasons have different sizes in tables. Validate it if receipt code does not exceed the size of columns in Protheus.
      When it uses the PCP it must validate

    ...

    • SX5.X5_CHAVE and SBC.BC_MOTIVO.
      When it uses the SIGASFC validate against the CYO.CYO_

    ...

    • CDSF, CY0.CY0_

    ...

    • CDSP and

    ...

    • SH6.

    ...

    • H6_MOTIVO. 

     

    Machine Stoppage Annotation Transaction: StopReport_1_001.xsd StopReport_1_001Transaction Balance in Stock - Request: StockLevel_2_000.xsd
    Message Identifier: StopReportStockLevel
    Version: 12_001000
    Protheus Module: SIGAPCP
    Sending Type: Synchronous

    ...

    titleNota:

     

    For this type of updating the PC Factory requests balance to Protheus. Message has two parts. Request, in which parameters for balance query and the Return, which has the balance return, are displayed.

    This Request

    ...

    is generated by PC-Factory and sent to Protheus. This Return is generated by Protheus to PC-Factory.

     

     

    Request

    Message
    Tag
    Description

    Table/Field

    Protheus PCP

    Table/Field

    Protheus SFC

    Type

    Table/Field: PC-Factory

    Type

     

    MachineCode

    Machine Code

    SH6.H6_RECURSO

    CYX.CYX_CDMQ

     

     

     

     

    MachineDescription

    Machine Description

     

     

     

     

     

     

    StopReasonCode

    Stoppage Reason Code

    SH6.H6_MOTIVO

    CYX.CYX_CDSP

     

     

     

     

    StopReasonDescription

    Stoppage Reason Description

    SX5.X5_DESCRI *

    CYX.CYX_DSSP

     

     

     

     

    StartDateTime

    Start Date/Time

    SH6.H6_DATAINI

    SH6.H6_HORAINI

    CYX.CYX_DTBGSP

    CYX_HRBGSP
    Type
    ListOfRequestItemInternalIdCode of productCHAR(15)
     ReferenceCodeReferenceCHAR(20)
     WarehouseInternalIdCode of deposit/location of stock/WarehouseCHAR(10)
     LotNumberLotCHAR(10)
     SubLotCodeSubLotCHAR(10)
     SerialNumberNumber of SeriesCHAR(20)
     AddressLocationCHAR(15)
     LotExpirationDateValidity DateDATE
    Nota
    titleNote:
      • The search can happen as follows:
        Per Product: It returns information of all location of product stock.
        By Stock Location (Warehouse): It returns information of all products in stock location.
      • By Stock Location (Warehouse) and Product: It returns information on Product of Stock Location defined.
        For other fields, Batch, Sub-Batch, series number, location and validity date consider only if you enter product code. If you send these fields without the product code, it must return error message.
      • The Request may be a request list.


    Return

    Message
    Tag
    Description
    Table/Field
    Type
    ReturnContentTypeClosingStockDateStock closing date-- 
    ListOfReturnItemCompanyIdCompany  
     BranchIdBranch  
     CompanyInternalIdCompany + Branch  
     
     
    ItemInternalId

    EndDateTime

    End Date/Time

    SH6.H6_DATAFIN

    SH6.H6_HORAFIN

    CYX.CYX_DTEDSP

    CYX.CYX_HREDSP

     

     

     

     

    OperatorCode

    Operator Code

    SH6.H6_OPERADO

    CYX.CYX_CDOE
    Code of productSB2.B2_CODCHAR(15)
     ReferenceCodeReference-- 
    (mais) ListOfStockBalance    
     

    ReportDateTime

    Report Date/Time

    SH6.H6_DTAPONT

    CYX.CYX_DTRP

     

     

     

     

    ToolCode

    Tool Code

    -- 

    CYX.CYX_CDFEPO

     

     

     

     

    ProductionTeamCode

    Team Code

    --

    CYX.CYX_CDGROE

     

     

     

     

    StopType

    Stop Type (1=Not Programmed;2=Programmed)

    --

    CYX.CYX_TPSP

     

     

     

     

    ReportSequence

    ID PC-Factory

    --

    --

     

     

     

    Nota
    titleNota:
    • The annotation of standard stoppage for this integration is MATA682 in PCP and in Shop Floor the routine is SFCA311.
    • The fields Machine,Stoppage Reason, Start and End Date/Time and Report Date/Time are mandatory.
    • If Report Date/Time is earlier than the current date, the system uses the current Date/Time, that is, date and time the integration is being processed.
    • Stoppage annotation sets SH6.H6_TIPO = 'I'.
    • Product must be labor. Generated by system. Example: SH6.H6_PRODUTO = MOD001
    • The quantity loss is generated by the system. SH6.H6_QTDPERD.
    • The field SH6.H6_IDENT is also generated by the system.
    • The field SH6.H6_TEMPO must be calculated by adapter. It must be the stoppage total time.
    • Stoppage Reason:
      The reason can be registered through integration. It must check the stoppage reason is registered. If not, you must add the reason used in annotation in table SX5.
      Where:
      Code of reason is X5_CHAVE
      Table of reason is '44'.
      For Shop Floor, table - CYN must be generated.
    • Every annotation must send a return message, indicating possible problems or processing performed with success. 
    • In case of success, the number of annotation is sent to PV-Factory in the return message of StopReport and corresponds to RECNO of SH6. This same number is used when a reverse must be registered(IntegrationReport).
    • The reversal when the field ReversedReport (Annotation Reversal) with content TRUE.
      When is reversal, it must have  the number of annotation, field IntegrationReport.
    • The reversal can be generated in two ways in the file: only reversal or reversal + annotation. When the message has the reversal and the annotation only can commit the movements when both are concluded.
      To identify whether the message only has reversal or reversal + annotation, the following status must be checked:
      Only reversal: it only has the information of ReverseReport and IntegrationReport with other tags without data. 
      Reversal + annotation: has ReversedReport and IntegrationReport entered and the other mandatory data (Machine, Stoppage Reason, Start and End Date/Time and Report Date/Time) filled out.
    • The field SH6.H6_OBSERVA = 'PPI' is automatically registered to indicate the record was generated through PCP Protheus x PC-Factory.
    • The system PC-Factory uses the format of hours with HH:MM:SS. For PCP Protheus, only HH:MM is considered. Annotation with time lower than 1 minute is rejected.
    • The field ReportSequence is used to register ID of table registering the stoppage information. It must be used in MATI681CRG entry point.
    • Shift model and number is automatically generated by routine SFCA311. Only when using Shop Floor.
    • If message does not send StopType, it is considered as 2= Not Scheduled. Only when using Shop Floor.
    • Stoppage reasons have different sizes in tables. Validate it if receipt code does not exceed the size of columns in Protheus.
      When it uses the PCP it must validate SX5.X5_CHAVE and SBC.BC_MOTIVO.
      When it uses the SIGASFC validate against the CYO.CYO_CDSF, CY0.CY0_CDSP and SH6.H6_MOTIVO. 

     

    Transaction Balance in Stock - Request: StockLevel_2_000.xsd
    Message Identifier: StockLevel
    Version: 2_000
    Protheus Module: SIGAPCP
    Sending Type: Synchronous

     

    For this type of updating the PC Factory requests balance to Protheus. Message has two parts. Request, in which parameters for balance query and the Return, which has the balance return, are displayed.

    This Request is generated by PC-Factory and sent to Protheus. This Return is generated by Protheus to PC-Factory.

     

    Request

    Message

    Tag

    Description

    Type

    ListOfRequest

    ItemInternalId

    Product code

    CHAR(15)

     

    ReferenceCode

    Reference

    CHAR(20)

     

    WarehouseInternalId

    Code of deposit/stock location/Warehouse

    CHAR(10)

     

    LotNumber

    Lot

    CHAR(10)

     

    SubLotCode

    Sub-lot

    CHAR(10)

     

    SerialNumber

    Serial Number

    CHAR(20)

     

    Address

    Location

    CHAR(15)

     

    LotExpirationDate

    Expiration Date

    DATE

    Nota
    titleNota:
      • The search can happen as follows:
        Per Product: It returns information of all location of product stock.
        By Stock Location (Warehouse): It returns information of all products in stock location.
      • By Stock Location (Warehouse) and Product: It returns information on Product of Stock Location defined.
        For other fields, Batch, Sub-Batch, series number, location and validity date consider only if you enter product code. If you send these fields without the product code, it must return error message.
      • The Request may be a request list.

    Return

    Message

    Tag

    Description

    Table/Field

    Type

    ReturnContentType

    ClosingStockDate

    Stock closing date

    --

     

    ListOfReturnItem

    CompanyId

    Company

     

     

     

    BranchId

    Branch

     

     

     

    CompanyInternalId

    Company+Branch

     

     

     

    ItemInternalId

    Product code

    SB2.B2_COD

    CHAR(15)

     

    ReferenceCode

    Referencia

    --

     

     ListOfStockBalance

     

     

     

     

     

    WarehouseInternalId

    Location of Stock (Warehouse/Deposit)

    SB2.B2_LOCAL

    CHAR(10)

     

    LotNumber

    Lot Number

    SB8.B8_LOTECTL 

    CHAR(10)

     

    SubLotCode

    Sub-lot

    SB8.B8_NUMLOTE

    CHAR(10)

     

    LotExpirationDate

    Expiration date

    SB8.B8_DTVALID

    DATE

     

    SerialNumber

    Serial number

    SBF.BF_NUMSERI 

    CHAR(20)

     

    Address

    Location

    SBF.BF_LOCALIZ

    CHAR(15)

     

    CurrentStockAmount

    Product balance in quantity

    SB2.B2_QATU

    SB8.B8_SALDO

    SBF.BF_QUANT

    DEC(17,4)

     

    BookedStockAmount

    Amount reserved in Stock

    SB2.B2_RESERVA

    SB8.B8_EMPENHO

    SBF.BF_EMPENHO

    DEC(17,4)

     

    AvailableStockAmount

    Available balance of the Product in quantity

    SB2.B2_QATU - SB2.B2_RESERVA

    SB8.B8_SALDO - SB8.B8_EMPENHO

    SBF.BF_QUANT - SBF.BF_EMPENHO

    DEC(17,4)

     

    UnitItemCost

    Product unit price

    --

     

     

    AverageUnitItemCost

    Product average price

    --

     

     

    ValueOfCurrentStockAmount

    Current balance of product stock in value

    --

     

     

    Stock Movement Transactions:  MovementsInternal_1_001.xsd 
    Message Identifier: MovementsInternal
    Version: 1_001
    Protheus Module: SIGAPCP
    Sending Type: Synchronous

    Note: This message is generated by PC-Factory and sent to Protheus.

     

    WarehouseInternalIdLocation of Stock (Warehouse/Deposit)SB2.B2_LOCALCHAR(10)
     LotNumberNumber of LotSB8.B8_LOTECTL CHAR(10)
     SubLotCodeSub LotSB8.B8_NUMLOTECHAR(10)
     LotExpirationDateValidity DateSB8.B8_DTVALIDDATE
     SerialNumberNumber of seriesSBF.BF_NUMSERI CHAR(20)
     AddressLocationSBF.BF_LOCALIZCHAR(15)
     CurrentStockAmountBalance of Product in quantity

    SB2.B2_QATU

    SB8.B8_BALANCE

    SBF.BF_QUANT

    DEC(17,4)
     BookedStockAmountQuantity reserved in Stock

    SB2.B2_RESERVATION

    SB8.B8_ALLOCATION

    SBF.BF_ALLOCATION

    DEC(17,4)
     AvailableStockAmountBalance available of Product in quantity

    SB2.B2_QATU - SB2.B2_RESERVATION

    SB8.B8_SALDO - SB8.B8_ALLOCATION

    SBF.BF_QUANT - SBF.BF_ALLOCATION

    DEC(17,4)
     UnitItemCostUnitary cost of Product-- 
     AverageUnitItemCostAverage cost of Product-- 
     ValueOfCurrentStockAmountCurrent balance of stock of product in value-- 
         

     

    Stock Movement Transactions:  MovementsInternal_1_001.xsd 
    Message Identifier: MovementsInternal
    Version: 1_001
    Protheus Module: SIGAPCP
    Sending Type: Synchronous

    Note: This message is generated by PC-Factory and sent to Protheus.

     
    Message
    Tag
    Description
    Table/Field
    Type
    Table/Field: PC-Factory
    Type
    BusinessContentTypeCompanyIdCode of company    
     BranchIdBranch    
     CompanyInternalIdInternalId of full key of the company    
     InternalIdInternalId of movement.    
     TypeMovementCodeCode of Type of internal movementSD3.D3_TMCHAR(03)  
     EmissionDateDate of IssueSD3.D3_ISSUEDATETBLOutInteg. DtTimeStampDATETIME
     ItemCodeCode of ProductSD3.D3_CODCHAR(15)

    TBLOutInteg.ProductCode

    CHAR(20)
     UnitOfMeasureCodeUnit of MeasureSD3.D3_UMCHAR(02)  
     QuantityQuantitySD3.D3_QUANTDEC(12,2)

    TBLOutInteg.Qty

    DEC(19,4)
     WarehouseCodeCode of WarehouseSD3.D3_LOCALCHAR(02)

    TBLOutInteg.WarehouseCode

    CHAR(15)
     LotNumberLotSD3.D3_LOTECTLCHAR(10)

    TBLOutInteg.LotCode

    CHAR(41)
     SubLotNumberSubLotSD3.D3_NUMLOTECHAR(06)  
     LotExpirationDateLot Validity DateSD3.D3_DTVALIDDATE

    TBLLot.DTDUE

    DATETIME
     AddressAddressSD3.D3_LOCALIZCHAR(15)

    TBLOutInteg.Address1Code

    CHAR(15)
     NumberSeriesNumberSeriesSD3.D3_NUMSERICHAR(20)

    TBLOutInteg.LotCode

    CHAR(41)
     InputOrOutputInput or Output MovementI=Input / O = OutputCHAR(01)

    TBLOutInteg.MovTypeCode

    CHAR(05)
     ReferenceCodeReference--   
     ScriptCodeScriptSD4.D4_SCRIPTCHAR(02)  
     ActivityCodeOperationSD4.D4_OPERACCHAR(02)

    TBLOutInteg.WODetCode

    CHAR(15)
     ProductionOrderNumberProduction Order/DocumentSD3.D3_OP e SD3.D3_DOCCHAR(13)

    TBLOutInteg.WOCode

    CHAR(41)
     FatherItemCodeParent Item--  
           
    Nota
    titleNote:
    • It registers the movement had origin in integration with PC-Factory. The field SD3.D3_OBSERVA is saved as content "TOTVSMES".
    • If tag InputOrOutput is I (input) it must execute routine MATA250. If O (output), it executes the process of routine MATA240. Different than I or O, reject message.
    • The tag InputOrOutput indicates if it is input or output. Based on this information, consider the type of movement of register PCPA109, folder MOVEMENTS. If input, use field OE_VAR1. If output, use field OE_VAR2.
    • No option of reversal. To execute a reversal process, it must send the opposite movement, that is, to reverse an input, it must send an output movement.
    • For tag ProductionOrderNumber, it is validate if content is production order (SC2), If OP saves in field SD3.D3_OP, otherwise, saves in field SD3.D3_DOC.
    • When Shop Floor is in use, the routine does not allow to execute movement of manual input. Only annotation through Shop Floor.

     

    Transaction Transfers:  TransferWarehouse_1_003.xsd 
    Message Identifier: TransferWarehouse 
    Version: 1_003
    Protheus Module: SIGAPCP
    Sending Type: Synchronous

    Note: This message is generated by PC-Factory and sent to Protheus.

     

     

    Sub-lotLotExpirationDate Expiration DateAddressLOCALIZCHAR(15)NumberSeriesNumberSeriesNUMSERI20CHAR(01ReferenceCodeSD4.D4_ROTEIRO02SD4.D4_OPERAC02Production Order/DocumentOP and SD3.D3_DOC13
    Message
    Tag
    Description
    Table/Field
    Type
    Table/Field: PC-Factory
    Type
    BusinessContentTypeCompanyIdCompany    
     BranchIdBranch    
     CompanyInternalIdInternalId of full key of the company    
     InternalIdInternalId of transfer    
     NumberNumber of MovementSD3.D3_NUMSEQCHAR(06)  
     RegisterDateTimeDate of Issue of RequestSD3.D3_ISSUEDATE  
    TransferWarehouseType      
     InternalIdInternalId of transfer    
     EmissionDateIssue DateSD3.D3_ISSUEDATE

    TBLOutInteg.DtTimeStamp

    DATETIME
     ItemCodeFromItem/Product OriginSD3.D3_CODCHAR(15)

    TBLOutInteg.ProductCode

    CHAR(20)
     ItemCodeToItem/Product DestinationSD3.D3_CODCHAR(15)

    TBLMovEv.ProductCode

    CHAR(20)
     UnitOfMeasureFromUnit of Measure OriginSD3.D3_UMCHAR(02)  
     UnitOfMeasureToUnit of Measure DestinationSD3.D3_UMCHAR(02)  
     QuantityQuantitySD3.D3_QUANTDEC(12,2)

    TBLOutInteg.Qty

    DEC(19,4)
     WarehouseCodeFromCode of Origin WarehouseSD3.D3_LOCALCHAR(02)

    TBLOutInteg.WarehouseCode

    CHAR(15)
     WarehouseCodeToCode of Destination WarehouseSD3.D3_LOCALCHAR(02)

    TBLMovEv.WarehouseCode

    CHAR(15)
     LotNumberFromNumber of Origin LotSD3.D3_LOTECTLCHAR(10)

    TBLOutInteg.LotCode

    CHAR(41)
     LotNumberToNumber of Destination

    Message

    Tag

    Description

    Table/Field

    Type

    BusinessContentType

    CompanyId

    Company code

     

     

     

    BranchId

    Branch

     

     

     

    CompanyInternalId

    InternalId of full key of company

     

     

     

    InternalId

    InternalId of movement.

     

     

     

    TypeMovementCode

    Code of internal movement type

    SD3.D3_TM

    CHAR(03)

     

    EmissionDate

    Date of Issue

    SD3.D3_EMISSAO

    DATE

     

    ItemCode

    Product Code

    SD3.D3_COD

    CHAR(15)

     

    UnitOfMeasureCode

    Unit of Measurement:

    SD3.D3_UM

    CHAR(02)

     

    Quantity

    Quantity

    SD3.D3_QUANT

    DEC(12,2)

     

    WarehouseCode

    Warehouse Code

    SD3.D3_LOCAL

    CHAR(02)

     

    LotNumber

    LotSD3.D3_LOTECTLCHAR(10)

    TBLMovEv.LotCode

    CHAR(41)
     SubLotNumberNumber of SubLotSD3.D3_NUMLOTECHAR(06)  
     LotExpirationDateFromValidity Date of Origin LotSD3.D3_DTVALIDDATE

    TBLLot.DtDue

    DATETIME
     

    Address

    LotExpirationDateToValidity Date of Destination LotSD3.D3_DTVALIDDATE

    TBLLot.DtDue

    DATETIME
     AddressFromOrigin AddressSD3.D3_LOCALIZCHAR(15)

     

    InputOrOutput

    Input or Output Movement

    I=Input / O = Output

    TBLOutInteg.Address1Code

    CHAR(15)
     AddressTo

    Reference

    --

     

     

    ScriptCode

    Script

    Destination AddressSD3.D3_LOCALIZCHAR(15)

     

    ActivityCode

    Operation

    TBLOutInteg.Address2Code

    CHAR(15)
     

    ProductionOrderNumber

    NumberSeriesNumber of SeriesSD3.D3_NUMSERICHAR(20)

     

    FatherItemCode

    Parent Item

    --

     

    TBLOutInteg.LotCode

    CHAR(41)
    Nota
    titleNotaNote:
    • It registers the movement had origin in integration with is registered that its origin transfers was through integration with  PC-Factory. The field SD3.D3_OBSERVA is saved as content "TOTVSMES".
    • If tag InputOrOutput is I (input) it must execute routine MATA250. If O (output), it executes the process of routine MATA240. Different than I or O, reject message.
    • The tag InputOrOutput indicates if it is input or output. Based on this information, consider the type of movement of register PCPA109, folder MOVEMENTS. If input, use field OE_VAR1. If output, use field OE_VAR2For transfers, routine MATA261 is executed.
    • No option of reversal. To execute a reversal process, it must send the opposite movement, that is, to reverse an input, it must send an output movement.
    • For tag ProductionOrderNumber, it is validate if content is production order (SC2), If OP saves in field SD3.D3_OP, otherwise, saves in field SD3.D3_DOC.
    • When Shop Floor is in use, the routine does not allow to execute movement of manual input. Only annotation through Shop Floor., to reverse a transfer from X to Y, it must send a transfer movement from Y to X.

     

    Transaction TransfersRefusal:  TransferWarehouse  Refusal_1_003000.xsd 
    Identifier of Message Identifier: TransferWarehouse Refusal
    Version: 1_003000
    Module Protheus Module: SIGAPCP
    Sending Type of Delivery: Synchronous

    This message is used to register the losses of production when good spare parts are registered, then later a defect is verified. It can be used to register the losses of raw material.

     

    Note:

    This message is generated by PC-Factory and sent to Protheus.

     

    and sent to Protheus.

     

     

    BranchInternalId of transferInternalIdInternalId of transferItemCodeFromItem/Source SD3D3COD15SD3.D3_UM02QuantitySD3D3QUANT12SD3.D3_LOCAL02LotNumberToDestination NumberSD3D3LotExpirationDateFrom of Origin Batch

    Message

    Tag

    Description

    Table/Field

    Type

    Table/Field: PC-Factory

    Type

    BusinessContentType

    ProductionOrderNumber

    Production Order

    SBC.BC_OP

    CHAR(20)

     

     

     

    IdReport

    ID Annotation

     

    CHAR(10)

     

     

     

    ItemCode

    Refused Product

    SBC.BC_PRODUCT

    CHAR(20)

    Message

    Tag

    Description

    Table/Field

    Type

    BusinessContentType

    CompanyId

    Company

     

     

     

    BranchId

    WarehouseCode

    Deposit Code

    SBC.BC_LOCORIG

    CHAR(02)

     

     

     

    CompanyInternalId

    AddressCode

    Address

    SBC.BC_LOCALIZ

    CHAR(15)InternalId of full key of company

     

     

     

    InternalId

    NumberSeries

    Series Number

    SBC.BC_NUMSERI

    CHAR(20)

     

     

     

    NumberTypemovement Number

    Type Loss

    SD3SBC.D3BC_NUMSEQTIPO

    CHAR(0601)

     

    RegisterDateTime

    Request issue date

    SD3.D3_EMISSAO

    DATE

     

     

    WasteCode

    Reason of Loss

    SBC.BC_REASON

    CHAR(02)

     

     

     

    WasteDescription

    Description of Loss

    SBC.BC_DESCRI

    CHAR(40)

    TransferWarehouseType

     

     

     

     

     

    LossQuantity

    Quantity of Loss

    SBC.BC_QUANT

    DEC(11,2)

     

     

     

    EmissionDate

    Date of Issue

    SD3.D3_EMISSAO

    CostCenterCode

    Cost Center

    SBC.BC_CC

    CHAR(09)

     

     DATE

     

    ItemCodeTo

    Product Generated

    SBC.

    BC_

    CODDEST

    CHAR(

    20)

     

    ItemCodeTo

    Item/Target Product

     

     

    WarehouseCodeTo

    Code of Destination deposit

    SBC.BC_LOCALSD3.D3_COD

    CHAR(1502)

     

     

     

    UnitOfMeasureFrom

    Unit of Origin Measurement:

    AdressCodeTo

    Destination Address

    SBC.BC_LOCDEST

    CHAR(

    15)

     

     

    UnitOfMeasureTo

     

    NumberSeriesTo

    No. Unit of Destination Measurement:Series

    SD3SBC.D3BC_UMNSEDEST

    CHAR(0220)

     

     

     

    QuantityTo

    Destination Quantity

    SBC.

    BC_

    QTDDEST

    DEC(

    11,2)

     

     

     

    ActivityCode

    Operation

    SBC.BC_OPERAC

    WarehouseCodeFrom

    Origin Warehouse Code

    SD3.D3_LOCAL

    CHAR(0210)

     

     

     

    WarehouseCodeTo

    Destination Warehouse Code

    ResourceCode

    Machine/Resource

    SBC.BC_RESOURCE

    CHAR(

    20)

     

     

     

    LotNumberFrom

    Origin Lot Number

    SD3.D3_LOTECTL

    LossDate

    Date of Loss

    SBC.BC_DATE

    DATE

     

     CHAR(10)

     

    LotCode

    Lot

    SBC.

    BC_LOTECTL

    CHAR(10)

     

     

     

    SubLotCode

    SubLot

    SBC.BC

    SubLotNumber

    Sub-lot Number

    SD3.D3_NUMLOTE

    CHAR(06)

     

     

     

    LotDueDate

    Validity Date

    SD3.D3_DTVALID

    DATE

     

    LotExpirationDateTo

    Validity Date of Destination Batch

    SD3.D3_DTVALID

    DATE

     

    AddressFrom

    Origin Address

    SD3.D3_LOCALIZ

    CHAR(15)

     

    AddressTo

    Destination Address

    SD3.D3_LOCALIZ

    CHAR(15)

     

    NumberSeries

    Serial number

    SD3.D3_NUMSERI

    CHAR(20)

    Nota
    titleNota:
    • It is registered that its origin transfers was through integration with  PC-Factory. The field SD3.D3_OBSERVA is saved as content "TOTVSMES".
    • For transfers, routine MATA261 is executed.
    • No option of reversal. To execute a reversal process, it must send the opposite movement, that is, to reverse a transfer from X to Y, it must send a transfer movement from Y to X.

    SBC.BC_DTVALID

    DATE

     

     

     

    This message will have the following purposes: 
    Loss of Finished Product entering destination product:
    Enables you to change certain amount that has already been registered and is in stock as good. It is called refusal of finished product, as you do not need to perform reversal and adjustment of annotation.
    Example: OP of 50 units, 5 annotations of 10, Need of adjustment of 45 spare parts with deffects and 5 good.

    Instead of reversing 5 annotation and register again 5 good ones and 45 scraps in ProductionAppointment, a Refusal message can be sent for OP, indicating the reason of refusal/defect and code of destination product.

    Loss of Raw Material:

    The message of refusal is also used to register loss of raw material during the productive process. The raw material can generated a subproduct or not.

    Loss of Finished Product without entering destination product:

    Used to enter the loss of finished product, without being necessary to generate the destination tags.

     

    Note:

    • Routine MATA685 is executed
    • The tag IdReport is not mandatory. It indicates the production report that must be updated (Not used for Protheus)
    • The tag Type, indicates whether it is Scrap. 1 = No ; 2= Yes.

    ...

    General Limitations/Restrictions

    The integration does not contempalte the generation of orders by APs, register through Fluig (WorkFlow) or routines not described in this document.
    Build must be equal to or later than 7.00.131227A and date 9/8/2014.

     

    Common Situations 

    Possible common problematic status that can happen during the work of the integration and how to solve it.

    ...

    Change waiting time of WebService PC-Factory.

     

    Application support checklist

    Verification Checklist:

    • In the parameters routine, PCPA109, check whether the active field is "1 - ACTIVE"
    • In the parameters routine, PCPA109, tstar connection with WebService of PPI entered through the button Test.
    • Configuration of sessions WEBSERVICE and PROXY from APPSERVER.INI;
    • Adjust integration in relation to configuration or business.

    ...