cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ENTRYSHEET_CREATE

0 Kudos

Hi,

We are developing a proxy where data will come from external service and will create SES via BAPI_ENTRYSHEET_CREATE. There will be multiple SES data in one call and proxy has to validate all the data for create and acceptance.

The requirement is that if all the whole data looks good, SES should be created and accepted (for all the SES's came in Proxy) and then only the commit work should happen. If any one of the multiple SES data has issues, the transaction should not be committed and no SES should be created and accepted.. It is like All or none..

For this we call in loop, BAPI_ENTRYSHEET_CREATE and set the flag for acceptance in create itself. We also set NO_COMMIT flag to true so no auto commit happens inside the BAPI. And we commit after checking any error message coming out of the loop. The issues we are facing is follows..

When there are multiple SES Data (each one have diff PO nos), BAPI is able to create SES and accept SES ( 2 Messages in return) for first line item is created ( no commit) but inside the loop when second line items comes, it is throwing error " error in update". For the subsequent calls to BAPI, it is showing created and some I000 with text message with no errors.....

When the No commit flag is take off from BAPI (for same data) SES’s are getting created and accepted without error. However since the commit has already been done, if any error occurs in subsequent data, we lose the ability to un commit it.

Please advice how to handle this situation..!!

PS: We are not using ay release strategy for SES.

Accepted Solutions (1)

Accepted Solutions (1)

myra_zhao
Active Participant
0 Kudos

As mentioned in the KBA 2468660 , it cannot be avoided.

2468660 - BAPI_ENTRYSHEET_CREATE Number Range Issue

Best regards,

Myra

Answers (4)

Answers (4)

0 Kudos

Thanks closing this thread!

0 Kudos

Sorry to bother all of you again and this question is partially related to BAPI so posting it again..!! We kind of made a compromise in design and what we do now is, if the Test run is ON, we run the BAPI with No Commit = 'X' and without acceptance flag. This will ensure that all validation of Creating Entry sheet is done ( not the acceptance which we plan to do before calling BAPI)

If there are error in any of the data ( we run this bapi multiple times based on how much data comes in proxy), we issue error message. If there are no error in run, we call the BAPI again, this time with No Commit = blank and adding acceptance flag = X in BAPI .

All worked fine, except one issue. When the BAPI run in test mode ( even with No commit = 'X'), it is consuming the number range. So when it goes to actual run, the document number of entry sheet is increment by 1. For e.g. the proxy data has 3 entry sheet data, for the first test run the no is 100XX01, the actual run is creating 100XX02 ( Plus 1). At the end of proxy run we would have 100XX02,100XX04, 100XX06 as doucment number.

Now offcousre business does not want this gap as this create problem in reconciliation. We cannot make number range external as we have user creating manually though ML81N. One more thing we tried is when the test mode pass the EXT_NUMBER to BAPI so it can use this no for test mode but that also did not work.

Please advice, if you have any insight of the issue

PS: I tested and remove the buffer from NRIV etc so that did not help as well..

Regards,

0 Kudos

Thanks for reply.. I downloaded the note and although it said it can be implemented, after implementation, message said changes already there. Also manual steps where already there..!! We are 605. Also i compered the code and no changes were made.

The issue is No commit works for creation of SES. But for Create & accept when you run the BAPI in loop, first SES, i get the message created and accepted. For Second, error in update and for next there is I000 with no message.

On checking in ML81N, nothing get created due to error. if I force the commit outside the loop using BAPI Commit, Still it doe not work.Does Create and accept requires commit before it moves to next level.?

Another option is to do create & accept commit for each record and then if there is error in next record, unaccept all the SES and delete it.

However for that also i could not find any FM/BAPI to un-accept it. We don't have release strategy setup.

Thanks & please advice.

yang_bai
Active Participant
0 Kudos

Hi,

Please refer to the following note for commit work issue:

1338514 - Commit work problem in BAPI


Please ensure this note has been implemented in your system.


Best regards,
Yang

0 Kudos

Thanks for reply.. I downloaded the note and although it said it can be implemented, after implementation, message said changes already there. Also manual steps where already there..!! We are 605. Also i compered the code and no changes were made.

The issue is No commit works for creation of SES. But for Create & accept when you run the BAPI in loop, first SES, i get the message created and accepted. For Second, error in update and for next there is I000 with no message.

On checking in ML81N, nothing get created due to error. if I force the commit outside the loop using BAPI Commit, Still it doe not work.Does Create and accept requires commit before it moves to next level.?

Another option is to do create & accept commit for each record and then if there is error in next record, unaccept all the SES and delete it.

However for that also i could not find any FM/BAPI to un-accept it. We don't have release strategy setup.

Thanks & please advice.