Skip to Content
avatar image
Former Member

bapi 'bapi_acc_document_post'.

hi all,

i'm creating credit memo request thru bapi 'bapi_acc_document_post'.

i'm getting success message for creation of cmr(it is also updating the table bkpf) but

i'm not able to get the document number for created document.

can ne 1 suggest me how to get document number thru bapi in this case.

thanx in advance

Manish

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Oct 08, 2008 at 07:47 AM

    Hi,

    Check if you are using Commit BAPI.

    Regards,

    Prashant.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 08, 2008 at 07:55 AM

    are you using the exporting parameters

    *"  EXPORTING
    *"     VALUE(OBJ_TYPE) LIKE  BAPIACHE09-OBJ_TYPE
    *"     VALUE(OBJ_KEY) LIKE  BAPIACHE09-OBJ_KEY      "check the object key
    *"     VALUE(OBJ_SYS) LIKE  BAPIACHE09-OBJ_SYS

    check the OBJ_KEY value.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 08, 2008 at 11:10 AM

    Hi Vijay,

    Thanks for your reply.

    I am not getting what to pass in obj_key. Can you please suggest what should I pass in this parameter?

    I have passed concatenatio of fiscal year and company code in it.

    Add comment
    10|10000 characters needed characters exceeded

    • Don't pass any values to them, if the BAPI success then it will return the Document number in l_key (it is a combination of document number and year).

      data: l_type like gd_documentheader-obj_type,
              l_key  like gd_documentheader-obj_key,
              l_sys  like gd_documentheader-obj_sys.
      
          call function 'BAPI_ACC_DOCUMENT_POST'
            exporting
              documentheader    = wa_docheader
              customercpd       =   wa_pcd
              contractheader    = wa_fica_head
            importing
              obj_type          = l_type
              obj_key           = l_key
              obj_sys           = l_sys
            tables
              accountgl         = it_accountgl
              accountreceivable = it_accountreceivable
              accountpayable    = it_accountpayable
              accounttax        = it_accounttax
      ......
      

  • avatar image
    Former Member
    Oct 08, 2008 at 11:11 AM

    Hi Vijay,

    Thanks for your reply.

    I am not getting what to pass in obj_key. Can you please suggest what should I pass in this parameter?

    I have passed concatenatio of fiscal year and company code in it.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 08, 2008 at 01:00 PM

    Hi,

    Please try with this:

    Declare a variable like this:

    V_OBJ_KEY type AWKEY.

    Pass this to OBJ_KEY.

    AWKEY (OBJ_KEY) Reference key

    Source document number

    The reference key is made up of:

    u2022 AWREF Reference document number (10 digits)

    Source document number

    u2022 AWORG Reference organizational unit (10 digits)

    Number range ID (if required)

    When the document is being processed, the system checks whether a reference document number (first part of the reference key) has been transferred.

    If an accounting document is posted via the interface in Accounting, the sending application transfers a unique reference. It consists of object key and object type. The object key consists of a reference document number and a reference organizational unit.

    Example: 1000007899 00011996

    Reference Reference organizational unit

    document no. client and fiscal year

    The object type contains a note on storing the original document.

    u2022 AWTYP (OBJ_TYPE) Reference transaction

    Sender ID

    Regards,

    Neenu Jose.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 08, 2008 at 01:17 PM
    Add comment
    10|10000 characters needed characters exceeded