05-11-2010 11:42 AM
Hi ppl,
I am using the BAPI 'BAPI_ENTRYSHEET_CREATE' in my program to create service entry sheets.
The problem is that when I run this BAPI in test run mode, still the service entry number gets created (though the actual document is not created).
Is there any way to restrict the number generation for the entry sheets when the BAPI is executed in test mode ?
CALL FUNCTION 'BAPI_ENTRYSHEET_CREATE'
EXPORTING
entrysheetheader = wa_header
testrun = w_test_run
IMPORTING
entrysheet = ws_entrysheet_no
TABLES
ENTRYSHEETACCOUNTASSIGNMENT = i_account
entrysheetservices = bapi_esll
entrysheetsrvaccassvalues = i_service_acc
return = i_return.
The value of w_test_run is decided at runtime.
Regards.
05-11-2010 12:27 PM
David,
The Number is generated as the next number in the number range.
This happens with all the BAPIs.
This will however not update in the database.
If still required, you may have a new number range for testing and then reset / delete the range later.
Thnx
05-11-2010 12:33 PM
Hi Pranu,
We have a checkbox 'Test Run' on the selection screen of our program.
The users will first execute the program in test run and then if there are no errors, they will create the service entry sheet in actual through the program.
But, when the program is executed in test run, a service entry number is created which is of no use. That's a concern for the user.
Regards.
05-13-2010 7:06 AM
06-07-2010 9:24 AM
Just a way around....
Create a ZBAPI which will be the exact replica of the Standard.
Put a condition over the code where the Next Available Number is fetched from the Number Range.
Thus this Number will NOT be used if you are in Test Run.
Pranu
06-02-2010 11:58 AM