SAP ABAP Parking Invoice With Purchase Order Using BAPI

 REPORT ZPARK_INVOICE.


DATA :
  HEADERDATA       TYPE BAPI_INCINV_CREATE_HEADER,
  ITEMDATA         TYPE TABLE OF BAPI_INCINV_CREATE_ITEM,
  LSEMDATA         TYPE BAPI_INCINV_CREATE_ITEM,
  ACCOUNTINGDATA   TYPE TABLE OF BAPI_INCINV_CREATE_ACCOUNT,
  GLACCOUNTDATA     TYPE TABLE OF BAPI_INCINV_CREATE_GL_ACCOUNT,
  LSACCOUNTDATA     TYPE BAPI_INCINV_CREATE_GL_ACCOUNT,
  ITRETURN         TYPE TABLE OF BAPIRET2,
  INVOICEDOCNUMBER TYPE BAPI_INCINV_FLD-INV_DOC_NO,
  FISCALYEAR       TYPE BAPI_INCINV_FLD-FISC_YEAR.

CLEAR HEADERDATA.
HEADERDATA-INVOICE_IND 'X'.
HEADERDATA-DOC_TYPE 'KR'.
HEADERDATA-DOC_DATE   SY-DATUM.
HEADERDATA-PSTNG_DATE SY-DATUM.
HEADERDATA-BLINE_DATE SY-DATUM.
HEADERDATA-REF_DOC_NO 'IV/PO000000001'.
HEADERDATA-COMP_CODE  '1000'.
HEADERDATA-CURRENCY   'IDR'.
HEADERDATA-GROSS_AMOUNT '2000000'.
HEADERDATA-HEADER_TXT   'Parking INV'.

CLEAR LSEMDATA.
LSEMDATA-INVOICE_DOC_ITEM '000010'.
LSEMDATA-PO_NUMBER        '4500003809'.
LSEMDATA-PO_ITEM          '000010'.
LSEMDATA-ITEM_AMOUNT      '1050000'.
LSEMDATA-QUANTITY         '300'.
LSEMDATA-PO_UNIT          'ST'.
LSEMDATA-ITEM_TEXT        'Parking INV'.
APPEND LSEMDATA TO ITEMDATA.

CLEAR LSACCOUNTDATA.
LSACCOUNTDATA-INVOICE_DOC_ITEM '000010'.
LSACCOUNTDATA-GL_ACCOUNT       '0063003000'.
LSACCOUNTDATA-ITEM_AMOUNT      '1050000'.
LSACCOUNTDATA-DB_CR_IND        'S'.
LSACCOUNTDATA-COMP_CODE        '1000'.
LSACCOUNTDATA-TAX_CODE         'I1'.
APPEND LSACCOUNTDATA TO GLACCOUNTDATA.

CALL FUNCTION 'BAPI_INCOMINGINVOICE_PARK'
  EXPORTING
    HEADERDATA       HEADERDATA
*   ADDRESSDATA      =
  IMPORTING
    INVOICEDOCNUMBER INVOICEDOCNUMBER
    FISCALYEAR       FISCALYEAR
  TABLES
    ITEMDATA         ITEMDATA
*   ACCOUNTINGDATA   =
    GLACCOUNTDATA    GLACCOUNTDATA
*   MATERIALDATA     =
*   TAXDATA          =
*   WITHTAXDATA      =
*   VENDORITEMSPLITDATA       =
    RETURN           ITRETURN
*   EXTENSIONIN      =
*   TM_ITEMDATA      =
*   NFMETALLITMS     =
  .

Comments

Popular posts from this blog

PHP MySql CRUD Dengan Konsep MVC

Laravel - Sistem Informasi Perpustakaan Sederhana Laravel

IT Asset Management Dengan PHP MySQL