on 08-20-2015 6:36 PM
Hi I am trying to create a Purchase Order. I am able to successfully create. Program is running fine without any errors , but its not adding data in the SAP. I am wondering how this is happening. Please can you help me in understanding why this happens.
I tried using commit function as well as JCOContext.begin() and end() . In both the cases my program is running but its not creating the data in sap.
try
{
JCoContext.begin(destination);
createPurchaseOrderFunction.execute(destination);
functionTransactionCommit.execute(destination);
functionTransactionCommit.getImportParameterList().setValue("WAIT", 10);
JCoContext.end(destination);
}
catch(Exception e)
{
throw e;
}
I tried by removing 6 th line. Program is working for me in both the conditions , but its not creating record in sap , but when i am printing the Table structure it is showing record , but unfortunately record is not updated in SAP.
JCoTable table = createPurchaseOrderFunction.getTableParameterList().getTable("POITEM"); |
Hi Utsav,
your approach is correct, the sequence needs to be executed within a JCoContext. I assume that functionTransactionCommit is pointing to BAPI_TRANSACTION_COMMIT. One remark though: Setting an import parameter after execution does not have any effect. You should switch it with line 5 if you want it to have effect. Furthermore, it's a flag. You can set e.g. 'X' for signalling to wait or you use the default ' ', which means the function module will simply execute a commit work and return afterwards.
Best regards,
Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.