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: 

How can i use Enqeue and deqeue option ..for BAPI - BAPI_BILLINGDOC_CREATEMULTIPLE creating invoices

former_member15804
Participant

Hi,

I am creating a program in which i am using BAPI BAPI_BILLINGDOC_CREATEMULTIPLE , but not sure how to use lock object functionality before calling this BAPI

Please help me in this

6 REPLIES 6

mateuszadamus
Active Contributor
0 Kudos

Hi,

What object do you want to lock?

Regards,
Mateusz

Sandra_Rossi
Active Contributor
0 Kudos

And why do you want to lock it?

former_member15804
Participant
0 Kudos

Hi,

Thanks for your quick response.

I am using this bapi for creating invoices....i don't know about the object which bapi has used internally.....can u pls help me in this.

mateuszadamus
Active Contributor

Hi ak6155

There is no need for you to lock the billing document. Actually, it is not possible, because the billing document does not exist, yet. You are about to create it.

What you could lock, possibly, but I'm not sure if it is needed in your case, is a Sales Order or a Delivery document. Example for Sales Order lock below.

CALL FUNCTION 'ENQUEUE_EVVBAKE'
  EXPORTING
    vbeln          = lv_sales_order
  EXCEPTIONS
    foreign_lock   = 1
    system_failure = 2
    OTHERS         = 3.
IF sy-subrc = 0.
  " document locked successfully
ELSE.
  " error locking document
ENDIF.
Regards,
Mateusz

0 Kudos

Hello,

not need to lock explicitly anything before to use BAPI. BAPI will manage lock itself and return error message in RETURN table if an error occurs.

Sandra_Rossi
Active Contributor
0 Kudos

I still don't understand what you want to achieve with a lock... What is the relationship between the BAPI and the lock?