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(20) | Yes | Analytical structure description |
| ProductNo | String(25) | Yes | External code of the product |
| Standard | Boolean | No | Flag indicating this is the standard structure, i.e. the version the product starts using |
| 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(3) No Acronym of the 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 |
|---|---|
| AAA‑001 | The 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‑002 | The Analytical Structure [value sent in request] is already used in a Production Register, changes are not allowed! |
| AMA‑001 | The informed "MaterialNo" already exists! |
| MAT‑001 | The 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 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! |
| DAS‑004 | The 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 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) | Yes | External 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
Standardastrue
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‑001 | The Analytical Structure does not exist! |
| DAS‑003 | The Analytical Structure is fixed and does not allow deletion! |
| DAS‑004 | The Analytical Structure is already used in a Production Register or in a Processing Line and it does not allow deletion! |
| DAS‑005 | The Analytical Structure is standard and its last item cannot be deleted! |
| MAT‑001 | The Material [value sent in request] at index [1] does not exist in database! |
| AMA‑002 | The Material [value sent in request] does not exist in the Analytical Structure [value sent in request]! |