on 08-29-2018 8:06 AM
Hi.
I have created a Production Order in SAP B1 with Java JCO.
This is the code that i have used
IProductionOrders vOP;
if (SapOb.getConnect() == 0) {
// Create a Production Order
try {
vOP = SBOCOMUtil.newProductionOrders(SapOb.getCompany());
vOP.setProductionOrderType(1); // P
vOP.setProductionOrderStatus(0); // planificado
vOP.setItemNo("PC00294");
vOP.setPlannedQuantity(50.00);
vOP.setWarehouse("01");
vOP.setDueDate(dateFormat.parse(pF1));
vOP.setPostingDate(dateFormat.parse(pF1));
vOP.getUserFields().getFields().item("U_user").setValue(pUser);
vOP.getUserFields().getFields().item("U_terminal").setValue(pHost);
// Add lines
vOP.getLines().add();
vOP.getLines().setCurrentLine(0);
vOP.getLines().setItemNo("PC00313");
vOP.getLines().setItemType(0);
vOP.getLines().setBaseQuantity(1.00);
vOP.getLines().setPlannedQuantity(50.00);
vOP.getLines().setWarehouse("01");
vOP.getLines().setProductionOrderIssueType(0);
vOP.setRemarks("ESTO ES DE PRUEBA");
// add Sales Order
if (vOP.add() == 0) {
JOptionPane.showMessageDialog(null, "Transaction Completed");
} else {
SBOErrorMessage errMsg = SapOb.getCompany().getLastError();
Dao.commitGeneral("INSERT INTO dbo.est_sap_error_log (descripction, error_type) VALUES ('"+errMsg.getErrorMessage()+" "+errMsg.getErrorCode()+ "','SAP TRANSACTION' )");
// get error message fom SAP Business One Server
JOptionPane.showMessageDialog(null, "SAP Transaction Error.. " + errMsg.getErrorMessage() + " " + errMsg.getErrorCode());
}
} catch (SBOCOMException e) {
e.printStackTrace();
}
Now i want to create a Production receipt from a production order, but i don't know what objet i have to use.
What is the correct Object, Document or Class to use In JCO?
Thanks in advanced.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.