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(25)YesAnalytical structure description
ProductNoString(25)YesExternal code of the product
StandardBooleanNoFlag indicating if the analytical structure is standard
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
MeasurementUnitERPStringNoUnit 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
AMA‑002The Material [value sent in request] does not exist in the Analytical Structure [value sent in request]!


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!


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)NoExternal code of the material
Note
  • When MaterialNo is not provided, all items of the analytical structure will be deleted

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‑003The Analytical Structure is fixed and does not allow deletion!