If you want to post a time receipt in Beas via an externally developed application.
A Beas Time Receipt consists of several objects. Accordingly, you have to build the necessary JSON string.
The objects are:
- The Time Receipt
- Scrap information (if any exists, not mandatory)
- Issue of material
- Receipt of material
You have to create a JSON string for the specific Time Receipt which you need for your process.
Example:
The time receipt will report the Time along with the Scrap information and the issue and receipt of the necessary materials and items.
Creation of the JSON string
The following example is a JSON string:
- In black: the Time Receipt part
- In red: the Scrap Information part
- In green: the material issue part
- In blue: the product receipt part
[
{"DocEntry":235,"LineNumber":10,"LineNumber2":10,"PersonnelId":"14","QuantityGoodRUoM":2,"FromTime":"8:00",
"TimeReceiptScrap":
[
{"ScrapId":"Scrap-001","Quantity":3,"UDF1":"test"}
],
"Issue":
{"Lines":[{"ItemCode":"RM","WhsCode":"01","Quantity":1,"BaseLineNumber2":10}]},
"Receipt":
{"Lines":[{"ItemCode":"FP","WhsCode":"01","Quantity":2}]}
}
]
You can use this JSON string directly with any web application or you can test it via Postman.
It’s also possible to use it in Beas Script for a customization.
Testing with Postman
Insert the JSON string into the Body/raw section of Postman.
Possible results are:
"value": 1 | (transaction: OK) |
"SystemNumber": 3421 | (System Number of TimeReceipt) |
"values": | |
"TimeReceiptEntry": 3621 | (beas system number for the time receipt) |
"BoMIssueDocEntry": 2609 | (Document entry for the Issue document) |
"BoMReceiptDocEntry": 127 | (Document entry for the receipt document of a BOM material line) |
"ReceiptDocEntry": 3461 | (Document entry for the receipt document of the assembly) |
"TimeReceiptJournalEntry": 781 | (Document entry for the time receipt based journal entry) |
Usage with Beas Script
Create a script variable for the JSON String.
Verify which WO variables are available for your script.
Could be:
- Directly from a beas window:
<dw_1.item.belnr_id.value> (WO number)
<dw_1.item.belpos_id.value> (WO position)
<dw_1.item.pos_id.value> (Routing position)
- Available as system variables:
<e_belnrid>
<e_belposid>
<e_posid>
setvar=ls_json=&
{"DocEntry":<e_belnrid>,LineNumber":<e_belposid>,"LineNumber2":<e_posid> &
,"PersonnelId":"14","QuantityGoodRUoM":2,"FromTime":"8:00"&
, "TimeReceiptScrap":[{"ScrapId":"Scrap-001","Quantity":3,"UDF1":"test"}]&
,”Issue":{"Lines":[{"ItemCode":"RM","WhsCode":"01","Quantity":1,"BaseLineNumber2":10}]} &
,"Receipt":{"Lines":[{"ItemCode":"FP","WhsCode":"01","Quantity":2}]} &
}
instance bsl b
b.post=TimeReceipt=<ls_json>
Result variables:
<b.ret_code>
<b.ret_text>
<b.ret_value>
For fast checking:
messagebox=<b.ret_code> <b.ret_text> <b.ret_value>
For error handling:
If <b.ret_code> n< 0 then
Message=Error in Time Receipt
return failure
end if
Comments
0 comments
Please sign in to leave a comment.