Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ENTRYSHEET_CREATE in test run

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

Has nobody faced this problem ever ?

0 Kudos

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

Former Member
0 Kudos

not possible