Skip to Content
0
Mar 27, 2020 at 10:23 PM

Craete parked document without PO using BAPI : BAPI_INCOMINGINVOICE_PARK

134 Views Last edit Sep 16, 2020 at 02:37 PM 2 rev

Hello ABABers

I am using BAPI :BAPI_INCOMINGINVOICE_PARK

to create parked document in TCODE: FB75

but in don't have Purchase order line item.

how can i use this BAPI to create parked document?

this is my code

  DATA: x_in_header LIKE bapi_incinv_create_header,

        wt_accountingdata TYPE TABLE OF bapi_incinv_create_account,

       accountingdata LIKE LINE OF wt_accountingdata,



       wt_glaccountdata TYPE TABLE OF bapi_incinv_create_gl_account,

       glaccountdata LIKE LINE OF wt_glaccountdata,



        lc_belnr    LIKE bapi_incinv_fld-inv_doc_no,

        lc_gjahr    LIKE bapi_incinv_fld-fisc_year,

        lw_ekko     TYPE ekko,

        d_msg(110),

        lw_ekpo     TYPE ekpo,

        i_return    LIKE bapiret2 OCCURS 0 WITH HEADER LINE.







  x_in_header-invoice_ind   = 'X'.

  x_in_header-doc_type      = 'DG'.

  x_in_header-pstng_date    = '20191231'.

  x_in_header-doc_date      = '20191231'.

  x_in_header-comp_code     = '1200'.

  x_in_header-currency      = 'EGP'.

  x_in_header-gross_amount  = '70'.

  x_in_header-calc_tax_ind  = 'X'.



  accountingdata-invoice_doc_item = '1'.

  accountingdata-tax_code = 'I0'.

  accountingdata-item_amount = '20'.

  accountingdata-gl_account = '3031600014'.

  accountingdata-costcenter = '1299999901'.

  APPEND accountingdata TO wt_accountingdata.

  CLEAR : accountingdata.



  accountingdata-invoice_doc_item = '2'.

  accountingdata-tax_code = '03'.

  accountingdata-item_amount = '-20'.

  accountingdata-gl_account = '2205020000'.



  APPEND accountingdata TO wt_accountingdata.

  CLEAR : accountingdata.





  glaccountdata-invoice_doc_item = '1'.

  glaccountdata-gl_account = '3031600014'.

  glaccountdata-item_amount = '1'.

  glaccountdata-db_cr_ind = 'X'.

  glaccountdata-comp_code = '1200'.

  glaccountdata-tax_code = 'I0'.

  glaccountdata-item_text = 'TEXT1'.

  APPEND glaccountdata TO wt_glaccountdata.

  CLEAR : glaccountdata.





  glaccountdata-invoice_doc_item = '2'.

  glaccountdata-gl_account = '2205020000'.

  glaccountdata-item_amount = '1'.

  glaccountdata-db_cr_ind = 'X'.

  glaccountdata-comp_code = '1200'.

  glaccountdata-tax_code = '03'.

  glaccountdata-item_text = 'TEXT2'.

  APPEND glaccountdata TO wt_glaccountdata.

  CLEAR : glaccountdata.





  CALL FUNCTION 'BAPI_INCOMINGINVOICE_PARK'

    EXPORTING

      headerdata       = x_in_header

    IMPORTING

      invoicedocnumber = lc_belnr

      fiscalyear       = lc_gjahr

    TABLES

      accountingdata   =  wt_accountingdata

      glaccountdata  =  wt_glaccountdata

*    itemdata         = i_in_item

      return           = i_return.



  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

      wait = 'X'.

Thanks in advance.