Skip to main content

Analytical Structure


Analytical Structure Registration​

The PostAddAnalyticalStructure endpoint is responsible for registering a new analytical structure in the MIMS system.


How to register an analytical structure​

HTTP POST Request

Request TypeExample URL
POST{{url_base}}/PostAddAnalyticalStructure
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddAnalyticalStructure"

Input Parameters​

ParameterTypeRequiredDescription
BranchNoString(25)YesExternal code of the branch
StructureNoString(25)YesExternal code of the analytical structure
StructureNameString(20)YesAnalytical structure description
ProductNoString(25)YesExternal code of the product
StandardBooleanNoFlag indicating this is the standard structure, i.e. the version the product starts using
SequenceByProductNoBooleanNoFlag indicating if the sequence is by product code
OverwriteIfExistsBooleanNoFlag indicating that data should be overwritten if the record already exists
ItemListAddAnalyticalStructureItemListYesList of analytical structure items

📝 AddAnalyticalStructureItemList Object​

The AddAnalyticalStructureItemList object represents a list with analytical structure items.

Input Parameters​

ParameterTypeRequiredDescription
ItemNoString(25)YesItem code
MaterialNoString(25)YesExternal code of the material
QtyFloatYesMaterial quantity
ProportionalToOneKiloBooleanNoFlag indicating if the quantity is proportional to one kilo
ComposePrimaryTareBooleanNoFlag indicating if it composes the primary tare
ApportionmentPerUnitBooleanNoFlag indicating if there is apportionment per unit
BatchRequiredBooleanNoFlag indicating if batch is required
DisplayOnlyBooleanNoFlag indicating if it is for display only
RejectPercentFloatNoReject percentage (0 to 100)
WarehouseNoString(25)NoExternal code of the warehouse
MeasurementUnitERPString(3)NoAcronym of the unit of measurement in ERP

Return​

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution
AnalyticalStructureCodeIntegerYesInternal analytical structure code generated in the MIMS system

Request Example​

curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddAnalyticalStructure"' \
--header 'Content-Type: application/json' \
--data '{
"StructureNo": "EST001",
"BranchNo": "FIL001",
"StructureName": "Estrutura Padrão",
"Standard": true,
"ProductNo": "PROD001",
"SequenceByProductNo": false,
"OverwriteIfExists": true,
"ItemList": [
{
"ItemNo": "1",
"MaterialNo": "MAT001",
"Qty": 0.5,
"ProportionalToOneKilo": true,
"ComposePrimaryTare": false,
"ApportionmentPerUnit": false,
"BatchRequired": false,
"DisplayOnly": false,
"RejectPercent": 0,
"WarehouseNo": "ALM001",
"MeasurementUnitERP": "KG"
}
]
}'

Exemplo de Response​

{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
},
"AnalyticalStructureCode": 456
}

🐞 Possible Errors​

CodeMessage
AAA‑001The provided product [parameter] value [value sent in request] registration is incomplete, specific information for the branch [value sent in request] is missing. Process aborted!
AAA‑002The Analytical Structure [value sent in request] is already used in a Production Register, changes are not allowed!
AMA‑001The informed "MaterialNo" already exists!
MAT‑001The Material [value sent in request] at index [item position in the list] does not exist in database!


Analytical Structure Deletion​

The PostDeleteAnalyticalStructure endpoint is responsible for executing the deletion of an analytical structure in the MIMS system.


How to delete an analytical structure​

HTTP POST Request

Request TypeExample URL
POST{{url_base}}/PostDeleteAnalyticalStructure
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteAnalyticalStructure"

Input Parameters​

ParameterTypeRequiredDescription
ProductNoString(25)YesExternal code of the product
StructureNoString(25)YesExternal code of the structure
BranchNoString(25)YesExternal code of the branch

Return​

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution

Request Example​

curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteAnalyticalStructure"' \
--header 'Content-Type: application/json' \
--data '{
"ProductNo": "PROD001",
"StructureNo": "EST001",
"BranchNo": "FIL001"
}'

Response Example​

{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
}
}

🐞 Possible Errors​

CodeMessage
DAS‑001The Analytical Structure does not exist!
DAS‑002The Analytical Structure is standard and does not allow deletion!
DAS‑004The Analytical Structure is already used in a Production Register or in a Processing Line and it does not allow deletion!


Analytical Structure Item Deletion​

The PostDeleteAnalyticalStructureItem endpoint is responsible for executing the deletion of an analytical structure item in the MIMS system.


How to delete an analytical structure item​

HTTP POST Request

Request TypeExample URL
POST{{url_base}}/PostDeleteAnalyticalStructureItem
Examplehttp://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteAnalyticalStructureItem"

Input Parameters​

ParameterTypeRequiredDescription
ProductNoString(25)YesExternal code of the product
StructureNoString(25)YesExternal code of the structure
BranchNoString(25)YesExternal code of the branch
MaterialNoString(25)YesExternal code of the material to be deleted from the structure
Note
  • The method deletes one item per request, identified by MaterialNo. To remove several materials, send one request for each
  • Once the last item of a structure is deleted, the structure no longer exists, since it is the set of its items
  • The last item of the product standard structure cannot be deleted, otherwise the product would be left with a standard structure without any material. To delete the standard structure entirely, first set another structure as the standard one through PostAddAnalyticalStructure, sending Standard as true

Return​

ParameterTypeRequiredDescription
WebServiceReturnWebServiceReturnYesStandard WebService response information in method execution

Request Example​

curl --location 'http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteAnalyticalStructureItem"' \
--header 'Content-Type: application/json' \
--data '{
"ProductNo": "PROD001",
"StructureNo": "EST001",
"BranchNo": "FIL001",
"MaterialNo": "MAT001"
}'

Response Example​

{
"WebServiceReturn": {
"Status": "wrsSuccess",
"ErrorCode": "",
"Message": "",
"Actor": "",
"ReturnQuestion": null
}
}

🐞 Possible Errors​

CodeMessage
DAS‑001The Analytical Structure does not exist!
DAS‑003The Analytical Structure is fixed and does not allow deletion!
DAS‑004The Analytical Structure is already used in a Production Register or in a Processing Line and it does not allow deletion!
DAS‑005The Analytical Structure is standard and its last item cannot be deleted!
MAT‑001The Material [value sent in request] at index [1] does not exist in database!
AMA‑002The Material [value sent in request] does not exist in the Analytical Structure [value sent in request]!