This API updates an existing Material Issue Report header & description in Smart Materials.
You can update only those MIRs that are of type MIR by BOM Commodity (B)
Required Privilege: API_MIR
Headers
Header Name |
Description |
Required |
Values |
---|---|---|---|
Authorization |
Access token |
Required |
Bearer <access_token> |
Content-Type |
Request type format |
Required |
application/JSON |
Body
You can update an existing MIR using two actions:
-
Through PUT action
-
Through PATCH Action (Preferable when you want to update few elements).
URL Format: PUT/PATCH https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/IssueReports({key})
Specify the values for the project, discipline, and language parameter in the URL. The project, discipline, and language together, defines the project environment where the MIR header get updated.
Element |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
IssueDate |
Date and time of the material issue |
Date Time Offset |
Required |
In the absence of IsuueDate, application takes |
IssueBy |
Name of the user who has issued the MIR |
String |
Optional |
Maximum allowed length is 80. |
OverissueWhId |
Unique ID of the warehouse used for overissue.
|
Integer64 |
Optional |
To view existing the warehouses, use: GET https://{host}/Smat/V1/Projects(‘:project’) To view existing warehouses for user, use: GET https://{host}/Smat/V1/Projects(‘:project’)/ To view existing bin loc warehouses, use: GET https://{host}/Smat/V1/Projects(‘:project’)/ |
CompanyId |
Unique ID of the company. It is a required field, if given MIR type is MIR by BOM Commodity. |
Integer64 |
Required |
To view existing companies, use: GET https://{host}/Smat/V1/Projects |
LocId |
Unique ID of the location. If OverIssue quantity is given, then LocId is a mandatory field. |
Integer64 |
Optional |
To view existing locations, use: GET https://{host}/Smat/V1/Projects( |
BnlId |
Unique ID of the bin location. When project default ZC_BINLOC is set to BLOC, and over issue quantity is given, then BnlId is a mandatory field. |
Integer64 |
Optional |
To view existing bin locations, use: GET https://{host}/Smat/V1/Projects |
IssueType |
Issue type of a MIR. Allowed issue type options depends on the type of MIR given.
|
String |
Required |
|
ScrapWhId |
Unique ID of the warehouse used for scrap |
Integer64 |
Optional |
|
WorkOrder |
Work Order / Agreement |
String |
Optional |
Maximum allowed length is 50. |
ShortDesc |
Short description of the MIR header given by the user |
String |
Optional |
Maximum allowed length is 20. |
Description |
Long description of the MIR header given by the user |
String |
Optional |
Maximum allowed length is 60. |
Sample Code
-
For PUT Action
PUT http://localhost:63552/smat/v1/Projects('RS')/Disciplines('PIPING')/Nls('English')/IssueReports(5286)
{
"MirNumber": "RW000015",
"MirType":"B",
"IssueDate": "2020-11-11T00:00:00+05:30",
"IssueBy": "sandeepmkondachu",
"CompanyId": 94704,
"OverIssueWhId": null,
"LocId": null,
"IssueType": "MISS",
"BnlId": null,
"ScrapWhId": null,
"WorkOrder": "Test",
"ShortDesc": "dst",
"Description": "dst"
}
-
For PATCH Action
PATCH http://localhost:63552/smat/v1/Projects('RS')/Disciplines('PIPING')/Nls('English')/IssueReports(10000056339)
{
"IssueBy": "NewUser",
"CompanyId": 5892,
"MirType": "B",
"IssueType": "REGULAR",
"WorkOrder": "TestfloW",
"ShortDesc": "english shor",
"Description": "english long"
}
Success Response
All the elements of the MIR get displayed in the success response, irrespective of the action. Following success response is for PUT action.
Status: 200 OK
{
"@odata.context": "http://localhost:53427/SMAT/V1/$metadata#Projects('RS')/Disciplines('PIPING')/Nls('English')/IssueReports/$entity",
"MirId": 5286,
"ProjId": "RS",
"DpId": 5020,
"MirNumber": "RW000015",
"RevisionId": 0,
"MirCreateDate": "2006-06-23T00:00:00+05:30",
"PostedDate": null,
"IssueDate": "2020-11-11T00:00:00+05:30",
"IssueBy": "sandeepmkondachu",
"CompanyId": 94704,
"OverIssueWhId": null,
"LocId": null,
"MirType": "B",
"IssueType": "MISS",
"DirectIssueType": null,
"CommodityId": null,
"Ident": null,
"BnlId": null,
"TagNumber": null,
"ScrapWhId": null,
"WorkOrder": "Test",
"ShortDesc": "dst",
"Description": "dst"
}
Element |
Description |
Type |
---|---|---|
MirId |
Unique ID of the Material Issue Report |
Integer64 |
MirNumber |
Name (code) of the MIR. If MirNumber is not given by the user, it populates automatically based on the MIR number rule. |
String |
ProjId |
Unique ID of the Project. Updated MIR belongs to this project. |
String |
DpId |
Unique ID of the Discipline. Updated MIR belongs to this discipline. |
Integer64 |
RevisionId |
Unique revision ID of the MIR. Default value is 0. |
Integer16 |
MirCreateDate |
Date when the MIR was created |
Date Time Offset |
PostedDate |
Date when the MIR was posted in the inventory |
Date Time Offset |
DirectIssueType |
Refers to the issue type when the MIR type is D |
String |
CommodityId |
Unique ID of the commodity |
Integer64 |
Ident |
Ident number |
Integer64 |
TagNumber |
Tag number |
String |
WhId |
Unique ID of the warehouse |
Integer64 |