Transaction Documents are every document types, which change the stock, Quotations or Orders
Syntax is always the same with only small differences
POST Commands
In this Object you can define BatchNumbers, SerialNumbers and BinLocations in one line
Example: Create Receipt for RM_B on bin managed warehouse "BW" on BinCode "001001", BatchNumber BT-014"
let r=bsl.post("receipt",{"DocumentLines": [
{"ItemCode": "RM_B",
"WhsCode":"BW",
"BinCode":"001001",
"DistNumber":"BT-014",
"Quantity":2.53 }
]}
);
Return Value
ret_code
ret_value
ret_text
Working with BatchNumbers and SerialNumbers
The System make automatically a grouping by ItemCode/WareHouse and allocate all BatchNumbers, SerialNumbers and Locations
But you can use Property BatchNumbers or SerialNumbers or BinLocations to define this separtly
Example
{"ItemCode":"A001"
"BatchNumbers": [
{"DistNumber": "O0033", "Quantity":10},
{"DistNumber": "O0023", "Quantity":5}
]
}
Beas create a line for ItemCode A001 and insert DistNumber O0033
After this it will copy the line and insert the Information from Second BatchNumbers
You can define all Batch- or Serial- or BinLocation information in the SubObject. It simulate only this subobject, which is in reality not existing.
Attention: Please insert always Quantity 1, if you working with Serial numbers
UDF Fields
UDF fields supported on line level. No support on Batch Level or Bin location Level
In SAP the system must declare the Values from UDF fields always as String. Beas convert always automatically the Value to String
If you have a UDF-Number field and you must save a value with decimal places, the converting can produce problems (regional setting problem). In this case send the Number as string
Wrong: "U_myQuantityField":3.34
Correct: "U_myQuantityField":"3.34"
#jbs
let r=bsl.post{"Issue",{"DocumentLines":
[ {"ItemCode":"1111","Quantity":2, "WhsCode":"01","U_Waste":5}]
});
alert(r.ret_code+" / "+r.ret_value);