2005 Aug 04 8:26 AM
Hi,
I'm using various BAPI's to perform functions such as to park an invoice when no purchase order is available.
If I do not change the document number when creating a new entry, the system "dumps", because the document number is already in the database.
What is the best way to ensure I have a unique document number before calling the BAPI, should I just create an internal table based on findinf the document number I am trying to insert, or is there a function available which does this already?
Thanks...
2005 Aug 04 9:03 AM
Hi Sims,
you should use number ranges. I would advise an internal number range, then SAP handles number assignment automatically.
If internal number ranges can't be assigned, define your own number range (SNRO) and use function module NUMBER_GET_NEXT to get unique numbers.
Regards,
Christian
2005 Aug 04 9:08 AM
Hi,
can't use number ranges, the customer is passing in the document number they would like to use, and then it is up to me to check if it is unique or pass back an error message
2005 Aug 04 9:19 AM
Hi,
have you checked out BAPI_DOCUMENT_EXISTENCECHECK?
-Mikko
Sorry this was applicable to DMS only after checking it out.. I'd go with external number ranges where you can have your own document numbers if they are just included in the range you define. You should get an error message if the number has already been reserved.
Message was edited by: Mikko Mäki-Rahkola
Message was edited by: Mikko Mäki-Rahkola
2005 Aug 04 9:24 AM
Hi,
if you should change the number, then number ranges are an option.
If you should raise an error, then a simple select will give you your answer. But then no document will be created, that's the result of ERROR message.
Regards,
Christian
2005 Aug 04 10:07 AM
Hi tried the BAPI, not really sure which document type I should be using for Parked invoices, tried a few , which did not work.
2005 Aug 04 10:43 AM
Hi Sims,
my mistake, sorry. The BAPI was only for DMS documents as I stated before.
If not finding any bapi's and the table lookup is not an option, I'd go with the external number ranges.
-Mikko
2005 Aug 04 11:48 AM
Hi,
table select is not an option? Isn't RBKP holding the data?
By the way: if you should raise a message and still book the document, then use the external number range in this exception cases.
Regards,
Christian