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 Type | Example URL |
|---|---|
| POST | {{url_base}}/PostAddAnalyticalStructure |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostAddAnalyticalStructure" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| BranchNo | String(25) | Yes | External code of the branch |
| StructureNo | String(25) | Yes | External code of the analytical structure |
| StructureName | String(25) | Yes | Analytical structure description |
| ProductNo | String(25) | Yes | External code of the product |
| Standard | Boolean | No | Flag indicating if the analytical structure is standard |
| SequenceByProductNo | Boolean | No | Flag indicating if the sequence is by product code |
| OverwriteIfExists | Boolean | No | Flag indicating that data should be overwritten if the record already exists |
| ItemList | AddAnalyticalStructureItemList | Yes | List of analytical structure items |
📝 AddAnalyticalStructureItemList Object
The AddAnalyticalStructureItemList object represents a list with analytical structure items.
Input Parameters
Parameter Type Required Description ItemNo String(25) Yes Item code MaterialNo String(25) Yes External code of the material Qty Float Yes Material quantity ProportionalToOneKilo Boolean No Flag indicating if the quantity is proportional to one kilo ComposePrimaryTare Boolean No Flag indicating if it composes the primary tare ApportionmentPerUnit Boolean No Flag indicating if there is apportionment per unit BatchRequired Boolean No Flag indicating if batch is required DisplayOnly Boolean No Flag indicating if it is for display only RejectPercent Float No Reject percentage (0 to 100) WarehouseNo String(25) No External code of the warehouse MeasurementUnitERP String No Unit of measurement in ERP
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard WebService response information in method execution |
| AnalyticalStructureCode | Integer | Yes | Internal 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
| Code | Message |
|---|---|
| AMA‑002 | The 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 Type | Example URL |
|---|---|
| POST | {{url_base}}/PostDeleteAnalyticalStructure |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteAnalyticalStructure" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ProductNo | String(25) | Yes | External code of the product |
| StructureNo | String(25) | Yes | External code of the structure |
| BranchNo | String(25) | Yes | External code of the branch |
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard 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
| Code | Message |
|---|---|
| DAS‑001 | The Analytical Structure does not exist! |
| DAS‑002 | The 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 Type | Example URL |
|---|---|
| POST | {{url_base}}/PostDeleteAnalyticalStructureItem |
| Example | http://seuIPePorta/datasnap/rest/RESTWebServiceMethods/"PostDeleteAnalyticalStructureItem" |
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ProductNo | String(25) | Yes | External code of the product |
| StructureNo | String(25) | Yes | External code of the structure |
| BranchNo | String(25) | Yes | External code of the branch |
| MaterialNo | String(25) | No | External code of the material |
Note
- When
MaterialNois not provided, all items of the analytical structure will be deleted
Return
| Parameter | Type | Required | Description |
|---|---|---|---|
| WebServiceReturn | WebServiceReturn | Yes | Standard 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
| Code | Message |
|---|---|
| DAS‑003 | The Analytical Structure is fixed and does not allow deletion! |