Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

Copyright © 2013–2014 Ariba, Inc. All rights reserved.

This documentation, as well as the Ariba software and/or services described in it, contain proprietary information. They are provided under a
license or other agreement containing restrictions on use and disclosure and are also protected by copyright, patent and/or other intellectual
property laws. Except as permitted by such agreement, no part of the document may be reproduced or transmitted in any form by any means,
electronic, mechanical or otherwise, without the prior written permission of Ariba, Inc.

Ariba, Inc. assumes no responsibility or liability for any errors or inaccuracies that may appear in the documentation. The information contained
in the documentation is subject to change without notice.

Ariba, the Ariba logo, AribaLIVE, SupplyWatch, Ariba.com, Ariba.com Network and Ariba Spend Management. Find it. Get it. Keep it. and PO-
Flip are registered trademarks of Ariba, Inc. Ariba Procure-to-Pay, Ariba Buyer, Ariba eForms, Ariba PunchOut, Ariba Services Procurement,
Ariba Travel and Expense, Ariba Procure-to-Order, Ariba Procurement Content, Ariba Sourcing, Ariba Savings and Pipeline Tracking, Ariba
Category Management, Ariba Category Playbooks, Ariba StartSourcing, Ariba Spend Visibility, Ariba Analysis, Ariba Data Enrichment, Ariba
Contract Management, Ariba Contract Compliance, Ariba Electronic Signatures, Ariba StartContracts, Ariba Invoice Management, Ariba
Payment Management, Ariba Working Capital Management, Ariba Settlement, Ariba Supplier Information and Performance Management, Ariba
Supplier Information Management, Ariba Discovery, Ariba Invoice Automation, Ariba PO Automation, Ariba Express Content, Ariba Ready,
and Ariba LIVE are trademarks or service marks of Ariba, Inc. All other brand or product names may be trademarks or registered trademarks of
their respective companies or organizations in the United States and/or other countries.

Ariba Sourcing solutions (On Demand and software) are protected by one or more of the following patents, including without limitation: U.S.
Patent Nos. 6,199,050; 6,216,114; 6,223,167; 6,230,146; 6,230,147; 6,285,989; 6,408,283; 6,499,018; 6,564,192; 6,871,191; 6,952,682;
7,010,511; 7,072,061; 7,130,815; 7,146,331; 7,152,043;7,225,152; 7,277,878; 7,249,085; 7,283,979; 7,283,980; 7,296,001; 7,346,574; 7,383,206;
7,395,238; 7,401,035; 7,407,035; 7,444,299; 7,483,852; 7,499,876; 7,536,362; 7,558,746; 7,558,752; 7,571,137; 7,599,878; 7,634,439;
7,657,461; and 7,693,747. Patents pending.

Other Ariba product solutions are protected by one or more of the following patents:

U.S. Patent Nos. 6,199,050, 6,216,114, 6,223,167, 6,230,146, 6,230,147, 6,285,989, 6,408,283, 6,499,018, 6,564,192, 6,584,451, 6,606,603,
6,714,939, 6,871,191, 6,952,682, 7,010,511, 7,047,318, 7,072,061, 7,084,998; 7,117,165; 7,225,145; 7,324,936; and 7,536,362. Patents pending.

Certain Ariba products may include third party software or other intellectual property licensed from a third party. For information regarding
software or other intellectual property licensed from a third party, go to http://www.ariba.com/copyrights.cfm

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 2 Revised 25, April 2014
Table of Contents
Integration of Invoice Status Update with Ariba Network ...................................................... 5
Summary .......................................................................................................................................5
Design............................................................................................................................................5
Prerequisite/Setup: ........................................................................................................................5
Parameters: ...................................................................................................................................5
RFC Pseudo Code:...........................................................................................................................8
Output Structure of Invoice Status Update (ISU)..............................................................................8
Pseudo Code: .................................................................................................................................9
Data Filters ..................................................................................................................................10
Error Handling ..............................................................................................................................10
Globalization................................................................................................................................11

Integration of Payment Proposal Request with Ariba Network ............................................. 12


Summary .....................................................................................................................................12
Design..........................................................................................................................................12
Prerequisite/Setup: ......................................................................................................................12
Parameters: .................................................................................................................................12
RFC Pseudo Code:.........................................................................................................................14
/ARBA/PAYMENT_PROPOSAL.......................................................................................................15
Output Structures of Payment Proposal ........................................................................................15
Pseudo Code: ...............................................................................................................................17
Data Filters ..................................................................................................................................19
Error Handling ..............................................................................................................................19
Globalization................................................................................................................................19

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 3 Revised 25, April 2014
Integration of ERP-Initiated Invoice with Ariba Network ...................................................... 20
Summary .....................................................................................................................................20
Design..........................................................................................................................................20
Prerequisite/Setup: ......................................................................................................................20
Parameters: .................................................................................................................................20
RFC Pseudo Code:.........................................................................................................................21
/ARBA/INVOICE_GET_DETAILS .....................................................................................................22
Output Structures of ERP-Initiated Invoice ....................................................................................22
Pseudo Code: ...............................................................................................................................24
Data Filters ..................................................................................................................................27
Error Handling ..............................................................................................................................28
Globalization................................................................................................................................28

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 4 Revised 25, April 2014
Integration of Invoice Status Update with Ariba
Network

Summary

This document describes design, functionality within SAP and pseudo code for Invoice Status Update.
This RFC will fetch the invoice statuses for the AN enabled vendor in regular intervals based on the date
and time stamp. Invoices with different statuses like Reconciled, Canceled, Processing, Paid and
Rejected are pulled.

Design

This would be schedule task which can be run at regular intervals. This process will be initiated from
proxy program /ARBA/INVSTATUPDT_EXPORT which calls the RFC function module
'/ARBA/INVOICE_STATUS_UPDATE' to pull the Invoice Status Update information from SAP. Data from
SAP is mapped to AN’s cXML and the data is posted to ASN using NetWeaver XI.

Prerequisite/Setup:

1. /ARBA/AN_VENDOR should be populated with enabled vendors for which the invoices
should be pulled.

2. Invoice document type, partial payment document and full payment document type
parameters should be maintained in /ARBA/PARAM_TAB.

3. The Authorization objects ZARIBA_RFC need to be added to the user who is executing the
function module.

Parameters:

NAME FIELDNAME SIGN OPTI LOW HIGH DESCRIPTION

CHECK_XBLNR_EMPTY K~XBLNR I NE If
INVOICE_DOC_OPTION
parameter is set and if
the XBLNR field is not
filled in invoice, then
those invoice
documents are not

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 5 Revised 25, April 2014
NAME FIELDNAME SIGN OPTI LOW HIGH DESCRIPTION

sent to AN.

INVOICE_DOC_OPTION I EQ XBLNR To send output invoice


number as XBLNR.

INVOICE_DOC_TYPE KR I EQ KR To store general


document type.

INVOICE_DOC_TYPE_FULL_ X I EQ X To store doc type


required for full
AUTO automatic payment for
invoice status update.

INVOICE_DOC_TYPE_FULL_ KZ I EQ KZ To store doc type


required for full
MANUAL manual payment for
invoice status update.

INVOICE_DOC_TYPE_PARTI KA I EQ KA To store doc type


required for partial
AL payment.

ERP_INV_PROCESSED_STATUS X I EQ X The invoices that are


created in your SAP
ERP system and sent to
Ariba Network are
stored in the table
/ARBA/AN_ERPINV.
When the ISU and PP
scheduled tasks run at
their scheduled time,
the scheduled tasks
query the
/ARBA/AN_ERPINV
table and send ISU and
PP only for the invoices
that are available in
the table. To ensure
that ISU and PP
scheduled tasks can
query the table, you
must provide the
Copyright © 2013–2014 Ariba, Inc. All rights reserved. 6 Revised 25, April 2014
NAME FIELDNAME SIGN OPTI LOW HIGH DESCRIPTION

required value for this


parameter.

GRACE_TIME_ISU_PP 5,10,15, so I EQ Mins This parameter is set to


on ensure invoice status is
not sent for an invoice
that is not sent to Ariba
Network. Grace time is
maintained in this
parameter so that the
grace time will be
subtracted from the
last run date and time
stamp.

AVOID_DUPLICATE_ISU_PP X I EQ X This ensures that


duplicate entries are
not sent to Ariba
Network. The invoices
will be only sent if the
fields Payment
Method, Payment
Block, Payment terms
and due dates are
changed. This will also
ensure and send only
the invoices which are
already sent to AN.

INVOIC02_REJECT_STATUS 51, 71 and I EQ 51, 71 Status number of the


so on and so Invoice IDOC which are
on rejected. If you do not
maintain anything, the
default value will be
51.

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 7 Revised 25, April 2014
RFC Pseudo Code:

Import Parameters:

DATE_IN Like SY-DATUM

TIME_IN Like SY-UZEIT

Export Parameters:

DATE_OUT Like SY-DATUM

TIME_OUT Like SY-UZEIT

Tables:

INVOICE_STATUS_INFO type /ARBA/INVOICE_STATUS_T

Function Module Name:

/ARBA/INVOICE_STATUS_UPDATE

Output Structure of Invoice Status Update (ISU)


ISU Details /ARBA/INVOICE_STATUS_T

Component Component Data Type Length Decimals Short Description


Type
LIFNR LIFNR CHAR 10 0 Account Number of Vendor or
Creditor
INV_DOC_NO XBLNR CHAR 16 0 Reference Document Number
ERP_INV_NO BELNR_D CHAR 10 0 Accounting Document Number
DOC_DATE BLDAT DATS 8 0 Document Date in Document
DOC_TIME CPUTM TIMS 6 0 Time of Entry
INVOICE_STATUS CHAR 50 0 Invoice Status for AN
AMT_DOCCUR BAPIWRBTR DEC 23 4 Amount in document currency
CURRENCY WAERS CUKY 5 0 Currency Key
COMMENTS CHAR 300 0 Comments showing the
error/holds

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 8 Revised 25, April 2014
Pseudo Code:

1. Only users who are having authorization will be able to execute this RFC. If this
authorization object is not added, then RFC execution will be terminated with an exception
‘No Authorization to execute the transaction’.

2. Get all AN enabled vendors from /ARBA/AN_VENDOR.

3. The invoice document types, partial payment document types and full payment document
types are picked from /ARBA/PARAM_TAB.

4. Get all the invoice accounting documents created or changed after last run date for all the
AN enabled vendors from BKPF and BSIK (user inner join and to filter the credit memo’s use
the BKPF-TCODE <> ‘MR8M’). Reversed documents are not taken.

5. The invoice status is set as ‘reconciled’ for newly created and changed invoices if there is no
payment block (BSIK-ZLSPR = Blank).

6. The invoice status is set as ‘processing’ for newly created and changed invoices if there is a
payment block (BSIK-ZLSPR not equal to blank).

7. If AVOID_DUPLICATE_ISU_PP parameter is maintained, then while fetching the invoice


documents which got changed after the last run date and time, the documents will be only
picked if the following fields are changed. This is to ensure invoice status should not be sent
if the user changes a field that does not affect ISU for e.g. Vendor Text.

a. Payment Block Key

By maintaining this parameter AVOID_DUPLICATE_ISU_PP, it ensures duplicate entries are


not sent to Ariba Network.

8. Partially Paid Invoices: If the partial payment is done for the invoices after the last run date
get the partial payment details using the BSIK and BKPF. Get the invoice details for the same
from BKPF (document type, Invoice information for the partial payment will be stored in
field REBZG, REBZJ, REBZZ).

9. The status is populated as paid and the comments field is populated as ‘Paid using manual
partial payment (f-58) in SAP’.

10. Fully Paid Invoices: Get all the full payments for the AN enabled vendors after the last run
date from BSAK and BKPF for the full payment document types. Fetch the invoice details
from BSAK and BKPF for the payments. The status is set to ‘paid’ and comment is populated
as ‘Paid using manual full payments (f-58) SAP’.

11. Reversed Invoices: Reversed payments are fetched for the AN enabled vendors after the last
run date and time from BSAK and BKPF.( where xreversal = 2[Reversal Documents]). The
Copyright © 2013–2014 Ariba, Inc. All rights reserved. 9 Revised 25, April 2014
invoices for the reversed payments are fetched from BSAK and BKPF by passing company
code and reversed payment document number.

12. The status is populated as ‘canceled’.

13. Rejected Invoices: If the invoice is created in AN and sent to SAP R/3 via IDOC and if the
IDOC creation fails, then the IDOC details are fetched from EDID4 table and the status is
populated as ‘rejected’ and the ISU is again sent back to AN.

14. Based on INVOICE_DOC_OPTION parameter, invoice number or Reference document


number is populated.

15. SAP ERP Invoice Number is populated to ERP_INV_NO field.

16. Invoice Details like Vendor, Document Date, Document time, Amount and currency is also
populated in the Output table.

17. If the ERP_INV_PROCESSED_STATUS parameter is maintained, then the invoice status


update will query the /ARBA/AN_ERPINV table and will send the invoices that are available
in table. To ensure that ISU should not send the invoice that is not available in AN. Also the
invoices will be only sent if the BKPF-BKTXT = ARIBA_ASN.

18. If the ERP_INV_PROCESSED_STATUS is not maintained, then the invoice status will be sent
to the invoice which is not available in AN.

Data Filters

1. Last Pull Date: This is the date with timestamp of the last pull/run date/time of this batch
integration process. The program updates the date-time stamp in /arba/proxyparam table.

2. Customers need to populate all the AN enabled vendors in /ARBA/AN_VENDOR for which the
invoice data’s needs to be pulled.

3. Invoice Document type, partial payment document type and full payment document type should
be maintained in /ARBA/PARAM_TAB.

Error Handling

1. If the invoice document type is not maintained in /ARBA/PARAM_TAB, then transaction is


terminated with message ‘Maintain INVOICE_DOC_TYPE parameter in /ARBA/PARAM_TAB’.

2. If fully paid document types are not maintained in /ARBA/PARAM_TAB, then transaction is
terminated with message ‘Maintain
INVOICE_DOC_TYPE_FULL_AUTO/INVOICE_DOC_TYPE_FULL_MANUAL parameter in
/ARBA/PARAM_TAB’.

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 10 Revised 25, April 2014
3. If the user who is executing the transaction is not having authorization, then the transaction is
terminated with a message ‘No Authorization to execute the transaction’.

Globalization

Time zone: In SAP time zone data of the invoice is not maintained hence we have provided a Time zone
as the global variable in NetWeaver XI.

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 11 Revised 25, April 2014
Integration of Payment Proposal Request with
Ariba Network
Summary

This document describes design, functionality within SAP and pseudo code for the Payment Proposal
Request. This RFC will fetch the payments schedules or payment proposal information for the AN
enabled vendor in regular intervals based on the date and time stamp. The payments schedule data’s
are derived from the invoice.

Design

This would be schedule task which can be run at regular intervals. This process will be initiated from the
proxy program /ARBA/PAYMENTPROPOSAL_EXPORT which invokes the RFC function
/ARBA/PAYMENT_PROPOSAL which takes the input as last run date-time stamp got from the table
/ARBA/PROXYPARAM to pull the Payment Proposal information from SAP. Data from SAP is mapped to
AN’s cXML and the data is posted to ASN using NetWeaver XI.

Prerequisite/Setup:

1. /ARBA/AN_VENDOR should be populated with AN enabled vendors for which the invoices
should be pulled.

2. Invoice document type and partial payment document type parameters should be
maintained in /ARBA/PARAM_TAB.

3. The Authorization objects ZARIBA_RFC need to be added to the user who is executing the
function module.

Parameters:

NAME FIELDNAME SIGN OPTI LOW HIGH DESCRIPTION

CHECK_XBLNR_EMPTY K~XBLNR I NE If
INVOICE_DOC_OPTION
parameter is set and if
the XBLNR field is not
filled in invoice, then
those invoice
documents are not
sent to AN.

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 12 Revised 25, April 2014
INVOICE_DOC_OPTION I EQ XBLNR To send output invoice
number as XBLNR.

INVOICE_DOC_TYPE KR I EQ KR To store general


document type.

INVOICE_DOC_TYPE_PARTI KA I EQ KA To store doc type


required for partial
AL payment.

ERP_INV_PROCESSED_STATUS X I EQ X The invoices that are


created in your SAP
ERP system and sent to
Ariba Network are
stored in the table
/ARBA/AN_ERPINV.
When the ISU and PP
scheduled tasks run at
their scheduled time,
the scheduled tasks
query the
/ARBA/AN_ERPINV
table and send ISU and
PP only for the invoices
that are available in
the table. To ensure
that ISU and PP
scheduled tasks can
query the table, you
must provide the
required value for this
parameter.

GRACE_TIME_ISU_PP 5,10,15, so I EQ Mins This parameter is set to


on ensure payment
proposal is not sent for
an invoice that is not
sent to Ariba Network.
Grace time is
maintained in this
parameter so that the
grace time will be
subtracted from the
Copyright © 2013–2014 Ariba, Inc. All rights reserved. 13 Revised 25, April 2014
last run date and time
stamp.

AVOID_DUPLICATE_ISU_PP X I EQ X This ensures that


duplicate entries are
not sent to Ariba
Network. The invoices
will be only sent if the
fields Payment
Method, Payment
Block, Payment terms
and due dates are
changed. This will also
ensure and send only
the invoices which are
already sent to AN.

NET_DISCOUNT_DAYS X I EQ X You need to maintan


this parameter if you
want to pay only on or
after the due date
without any discount.

RFC Pseudo Code:

Import Parameters:

DATE_IN Like SY-DATUM

TIME_IN Like SY-UZEIT

Export Parameters:

DATE_OUT Like SY-DATUM

TIME_OUT Like SY-UZEIT

Tables:

PAYMENT_PROPOSAL_INFO Like /ARBA/PAYMENT_PROPOSAL

PAYEE_INFO Like /ARBA/PAYEE

PAYER_INFO Like /ARBA/PAYER

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 14 Revised 25, April 2014
RECV_BANK_INFO Like /ARBA/REC_BANK

Function Module Name:

/ARBA/PAYMENT_PROPOSAL

Output Structures of Payment Proposal


The output structure of payment proposal is as follows:

Header Details /ARBA/PAYMENT_PROPOSAL

Component Component Data Type Length Decimals Short Description


Type
PROPOSALID CHAR 50 0 Payment Proposal ID
DUE_DATE BLDAT DATS 8 0 Document Date in
Document
REF_INV_NUM XBLNR CHAR 16 0 Reference Document
Number
REF_DOC_DATE BLDAT DATS 8 0 Document Date in
Document
REF_DOC_TIME CPUTM TIMS 6 0 Time of Entry
PAYMENT_METHOD DZLSCH CHAR 1 0 Payment Method
PAYMENT_METHOD_DESC TEXT1_042 CHAR 30 0 Name of the Payment
Z Method in the Language
of the Country
PYMNT_CURRENCY WAERS CUKY 5 0 Currency Key
GROSS_AMT BAPIWRBTR DEC 23 4 Amount in document
currency
NET_AMT BAPIWRBTR DEC 23 4 Amount in document
currency
DISC_AMT BAPIWRBTR DEC 23 4 Amount in document
currency
DISC_CURRENCY WAERS CUKY 5 0 Currency Key
OPERATION CHAR 10 0

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 15 Revised 25, April 2014
Payee Details /ARBA/PAYEE

Component Component Data Type Length Decimals Short Description


Type
INVOICE_NUM XBLNR CHAR 16 0 Reference Document
Number
FISCAL_YEAR GJAHR NUMC 4 0 Fiscal Year
PAYEE CHAR 10 0 Payee
LANGUAGE SPRAS LANG 1 0 Language Key
VENDOR_NAME NAME1 CHAR 30 0 Name
POSTAL_ADDRESS ADRNR CHAR 10 0 Address
STREET1 AD_STREET CHAR 60 0 Street
STREET2 AD_STRSPP1 CHAR 40 0 Street 2
STREET3 AD_STRSPP2 CHAR 40 0 Street 3
CITY AD_CITY1 CHAR 40 0 City
STATE REGIO CHAR 3 0 Region (State, Province,
County)
POSTAL_CODE AD_PSTCD1 CHAR 10 0 City postal code
COUNTRY LAND1 CHAR 3 0 Country Key
EMAIL AD_SMTPAD CHAR 241 0 E-Mail Address
R
PHONE AD_TLNMBR CHAR 30 0 First telephone no.:
1 dialling code+number
FAX AD_FXNMBR CHAR 30 0 First fax no.: dialling
1 code+number
BANK_ACCOUNT_NUM BANKN CHAR 18 0 Bank Account Number
BANK_KEY BANKK CHAR 15 0 Bank Key

Payer Details /ARBA/PAYER

Component Component Data Type Length Decimals Short Description


Type
INVOICE_NUM XBLNR CHAR 16 0 Reference Document Number
FISCAL_YEAR GJAHR NUMC 4 0 Fiscal Year
PAYER CHAR 10 0 PAYER
LANGUAGE SPRAS LANG 1 0 Language Key
PAYER_NAME NAME1 CHAR 30 0 Name
POSTAL_ADDRESS ADRNR CHAR 10 0 Address
STREET1 AD_STREET CHAR 60 0 Street
STREET2 AD_STRSPP1 CHAR 40 0 Street 2
STREET3 AD_STRSPP2 CHAR 40 0 Street 3
CITY AD_CITY1 CHAR 40 0 City
STATE REGIO CHAR 3 0 Region (State, Province,
County)
Copyright © 2013–2014 Ariba, Inc. All rights reserved. 16 Revised 25, April 2014
POSTAL_CODE AD_PSTCD1 CHAR 10 0 City postal code
COUNTRY LAND1 CHAR 3 0 Country Key
EMAIL AD_SMTPADR CHAR 241 0 E-Mail Address
PHONE AD_TLNMBR1 CHAR 30 0 First telephone no.: dialling
code+number
FAX AD_FXNMBR1 CHAR 30 0 First fax no.: dialling
code+number

Bank Details /ARBA/REC_BANK

Component Component Data Type Length Decimals Short Description


Type
INVOICE_NUM XBLNR CHAR 16 0 Reference Document
Number
FISCAL_YEAR GJAHR NUMC 4 0 Fiscal Year
RECV_BANK BANKK CHAR 15 0 Bank Key
LANGUAGE SPRAS LANG 1 0 Language Key
BANK_NAME BANKA CHAR 60 0 Name of bank
CITY ORT01_GP CHAR 35 0 City
STATE REGIO CHAR 3 0 Region (State, Province,
County)
COUNTRY LAND1 CHAR 3 0 Country Key
BANK_ACCOUNT_NUM BANKL CHAR 15 0 Bank Number

Pseudo Code:

1. Only users who are having authorization will be able to execute this RFC. If this
authorization object is not added, then RFC execution will be terminated with an exception
‘No Authorization to execute the transaction’.

2. Get all AN enabled vendors from /ARBA/AN_VENDOR .

3. The invoice document types and partial payment document types are picked from
/ARBA/PARAM_TAB.

4. Get all the invoice accounting documents created or changed after last run date for all the
AN enabled vendors from BKPF and BSIK(user inner join and to filter the credit memo’s use
the BKPF-TCODE <> ‘MR8M’)

5. If the documents are created on the same day as last run date consider only those which are
created after the time in the last run date

6. If AVOID_DUPLICATE_ISU_PP parameter is maintained, then while fetching the invoice


documents which got changed after the last run date and time, the documents will be only

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 17 Revised 25, April 2014
picked if the following fields are changed. This is to ensure duplicate entries are not sent to
Ariba Network.

a. Payment Method
b. Discount Dates
c. Payment Terms
d. Payment Block Key

By maintaining this parameter AVOID_DUPLICATE_ISU_PP, it will send only the documents


which are already sent to AN.

7. If the partial payment is done for the invoices after the last run date get the partial
payment details using the BSIK. Get the invoice details for the same using BSIK and BKPF
(document type, Invoice information for the partial payment will be stored in field REBZG,
REBZJ, REBZZ) and update the Payment schedule with the total unpaid amount details
(Invoice amount – partially paid amount)

8. Logic for populating proposal ID: Proposal ID is a concatenation of Invoice Number, Fiscal
Year, Item Number, Company Code and System ID.

9. If the invoice document has a payment block then the operation field is set to ‘hold’ else the
operation field is populated as ‘new’.

10. Logic for populating Discounts: If the customer does not want any discount and he want to
pay only the net amount, then the parameter NET_DISCOUNT_DAYS need to be maintained.
If the NET_DISCOUNT_DAYS is not maintained, then the discount is calculated based on the
payment terms and due dates maintained in the invoice.

11. Payment Method description is populated.

12. The discount amount is calculated by multiplying the discount rate with gross amount
divided by 100.

13. Based on INVOICE_DOC_OPTION parameter, invoice number or Reference document


number is populated.

14. Other Payment Proposal Related data’s are populated by taking them directly from
BSIK/BKPF.

15. If the ERP_INV_PROCESSED_STATUS parameter is maintained, then the payment proposal


RFC will query the /ARBA/AN_ERPINV table and will send the invoices that are available in
table. To ensure that PP should not send the invoice that is not available in AN.

16. Populate Payer Details. These data’s are picked from T001.

17. Populate Payee Details. These data’s are picked from LFA1 and ADRC.
Copyright © 2013–2014 Ariba, Inc. All rights reserved. 18 Revised 25, April 2014
18. Populate the Bank Details if the payment method is bank transfer only(T or U). The details
are fetched from BNKA.

Data Filters

1. Last Pull Date: This is the date with timestamp of the last pull/run date/time of this batch
integration process.

2. Customers need to populate all the AN enabled vendors in /ARBA/AN_VENDOR for which the
invoice data’s needs to be pulled.

3. Invoice Document type and partial payment document type should be maintained in
/ARBA/PARAM_TAB.

Error Handling

1. If the invoice document type is not maintained in /ARBA/PARAM_TAB, then transaction is


terminated with message ‘Maintain INVOICE_DOC_TYPE parameter in /ARBA/PARAM_TAB’.

2. If the user who is executing the transaction is not having authorization, then the transaction is
terminated with a message ‘No Authorization to execute the transaction’.

Globalization

Time zone: In SAP time zone data of the invoice is not maintained hence we have provided a Time zone
as the global variable in NetWeaver XI.

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 19 Revised 25, April 2014
Integration of ERP-Initiated Invoice with Ariba
Network
Summary

This document describes design, functionality within SAP and pseudo code for the ERPCC invoice
[Carbon Copy of Invoice]. The invoices created in SAP are fetched in regular time intervals based on date
and time stamp and sent to Ariba Network.

Design

This would be schedule task which can be run at regular interval. This process will be initiated from the
proxy program /ARBA/ERPINVOICE_EXPORT which calls the RFC function /ARBA/INVOICE_GET_DETAILS
which takes the input as last run date-time stamp got from the table /ARBA/PROXYPARAM to pull the
ERPCC information from SAP. Data from SAP is mapped to AN’s cXML and the data is posted to ASN
using NetWeaver XI.

Prerequisite/Setup:

1. /ARBA/AN_VENDOR should be populated with AN enabled vendors for which the invoices
should be pulled.

2. Invoice document type should be maintained in /ARBA/PARAM_TAB.

3. The Authorization object ZARIBA_RFC need to be added to the user who is executing the
function module.

Parameters:

NAME FIELDNAME SIGN OPTI LOW HIGH DESCRIPTION

CHECK_XBLNR_EMPTY K~XBLNR I NE If
INVOICE_DOC_OPTION
parameter is set and if
the XBLNR field is not
filled in invoice, then
those invoice
documents are not
sent to AN.

INVOICE_DOC_OPTION I EQ XBLNR To send output invoice

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 20 Revised 25, April 2014
number as XBLNR.

INVOICE_DOC_TYPE KR I EQ KR To store general


document type.

ERP_INV_PROCESSED_STATUS X I EQ X The invoices that are


created in your SAP
ERP system and sent to
Ariba Network are
stored in the table
/ARBA/AN_ERPINV.
When the ISU and PP
scheduled tasks run at
their scheduled time,
the scheduled tasks
query the
/ARBA/AN_ERPINV
table and send ISU and
PP only for the invoices
that are available in
the table. To ensure
that ISU and PP
scheduled tasks can
query the table, you
must provide the
required value for this
parameter.

ACCRUAL_TRANSACTION_KEY MW1 I EQ MW1 Transaction Key for


Accrual Tax

ACCRUAL_CONDITION_TYPE JP1U I EQ JP1U Accrual Condition Type

RFC Pseudo Code:

Import Parameters:

DATE_IN Like SY-DATUM

TIME_IN Like SY-UZEIT

INVOICE_DOC_TYPE Like SELOPT-LOW

Export Parameters:
Copyright © 2013–2014 Ariba, Inc. All rights reserved. 21 Revised 25, April 2014
DATE_OUT Like SY-DATUM

TIME_OUT Like SY-UZEIT

Tables:

HEADER_DETAILS Like /ARBA/INVOICE_HEADER_DETAILS

LINE_DETAILS Like /ARBA/INVOICE_LINE_DETAILS

Function Module Name:

/ARBA/INVOICE_GET_DETAILS

Output Structures of ERP-Initiated Invoice


Header Details /ARBA/INVOICE_HEADER_DETAILS

Component Component Data Type Length Decimals Short Description


Type
BELNR XBLNR CHAR 16 0 Reference Document Number
GJAHR GJAHR NUMC 4 0 Fiscal Year
PURPOSE CHAR 20 0 Invoice type for AN
OPERATION CHAR 5 0 Operation for AN
SPRAS SPRAS LANG 1 0 Language Key
BLART BLART CHAR 2 0 Document Type
BLDAT BLDAT DATS 8 0 Document Date in Document
BUDAT BUDAT DATS 8 0 Posting Date in the Document
CPUTM CPUTM TIMS 6 0 Time of Entry
BKTXT BKTXT CHAR 25 0 Document Header Text
LIFNR LIFNR CHAR 10 0 Account Number of Vendor or
Creditor
WAERS WAERS CUKY 5 0 Currency Key
EBELN EBELN CHAR 10 0 Purchasing Document Number
WMWST WMWST CURR 13 2 Tax amount in document
currency
WRBTR WRBTR CURR 13 2 Amount in document currency
GROSS_AMOUNT WRBTR CURR 13 2 Amount in document currency
WERKS WERKS_D CHAR 4 0 Plant
NAME1 NAME1 CHAR 30 0 Name
NAME2 NAME2 CHAR 30 0 Name 2
STRAS STRAS CHAR 30 0 House number and street
PSTLZ PSTLZ CHAR 10 0 Postal Code
ORT01 ORT01 CHAR 25 0 City
REGIO REGIO CHAR 3 0 Region (State, Province, County)
LAND1 LAND1 CHAR 3 0 Country Key
Copyright © 2013–2014 Ariba, Inc. All rights reserved. 22 Revised 25, April 2014
TEL_NUMBER AD_TLNMBR1 CHAR 30 0 First telephone no.: dialling
code+number
TEL_EXTENS AD_TLXTNS1 CHAR 10 0 First Telephone No.: Extension
FAX_NUMBER AD_FXNMBR1 CHAR 30 0 First fax no.: dialling
code+number
FAX_EXTENS AD_FXXTNS1 CHAR 10 0 First fax no.: extension
BUKRS BUKRS CHAR 4 0 Company Code
B_NAME1 NAME1 CHAR 30 0 Name
B_NAME2 NAME1 CHAR 30 0 Name
B_STRAS STRAS CHAR 30 0 House number and street
B_PSTLZ PSTLZ CHAR 10 0 Postal Code
B_ORT01 ORT01 CHAR 25 0 City
B_REGIO REGIO CHAR 3 0 Region (State, Province, County)
B_LAND1 LAND1 CHAR 3 0 Country Key
B_TELNUM AD_TLNMBR1 CHAR 30 0 First telephone no.: dialling
code+number
B_TEL_EXTENS AD_TLXTNS1 CHAR 10 0 First Telephone No.: Extension
B_FAX_NUMBER AD_FXNMBR1 CHAR 30 0 First fax no.: dialling
code+number
B_FAX_EXTENS AD_FXXTNS1 CHAR 10 0 First fax no.: extension
ZTERM DZTERM CHAR 4 0 Terms of Payment Key
ZBD1T DZBD1T DEC 3 0 Cash discount days 1
ZBD2T DZBD2T DEC 3 0 Cash discount days 2
ZBD3T DZBD3T DEC 3 0 Net Payment Terms Period
ZBD1P DZBD1P DEC 5 3 Cash Discount Percentage 1
ZBD2P DZBD2P DEC 5 3 Cash Discount Percentage 2
ISTAXINLINE CHAR 3 0 Indicator for tax in line item
ISACCOUNTINGINLINE CHAR 3 0 Indicator for accounting in line
item
ISSPECIALHANDLINGINLINE CHAR 3 0 indicator for special handling in
line item

Line Details /ARBA/INVOICE_LINE_DETAILS

Component Component Data Type Length Decimals Short Description


Type
BELNR XBLNR CHAR 16 0 Reference Document Number
SPRAS SPRAS LANG 1 0 Language Key
BUZEI BUZEI NUMC 3 0 Number of Line Item Within
Accounting Document
WERKS WERKS_D CHAR 4 0 Plant
EBELN EBELN CHAR 10 0 Purchasing Document Number
EBELP EBELP NUMC 5 0 Item Number of Purchasing
Document
Copyright © 2013–2014 Ariba, Inc. All rights reserved. 23 Revised 25, April 2014
PO_DATE BLDAT DATS 8 0 Document Date in Document
MENGE MENGE_D QUAN 13 3 Quantity
MEINS MEINS UNIT 3 0 Base Unit of Measure
PEINH BPREI CURR 11 2 Net Price in Purchasing
Document (in Document
Currency)
KOART KOART CHAR 1 0 Account Type
SHKZG SHKZG CHAR 1 0 Debit/Credit Indicator
WRBTR WRBTR CURR 13 2 Amount in document currency
WMWST WMWST CURR 13 2 Tax amount in document
currency
TXJCD TXJCD CHAR 15 0 Tax Jurisdiction
MWSK1 MWSKX CHAR 2 0 Tax Code for Distribution
TAX_CATEGOR TEXT1_007S CHAR 50 0 Name for value-added tax
Y
WAERS WAERS CUKY 5 0 Currency Key
SGTXT SGTXT CHAR 50 0 Item Text
KOSTL KOSTL CHAR 10 0 Cost Center
KOKRS KOKRS CHAR 4 0 Controlling Area
SAKNR SAKNR CHAR 10 0 G/L Account Number
AUFNR AUFNR CHAR 12 0 Order Number
ANLN1 ANLN1 CHAR 12 0 Main Asset Number
ANLN2 ANLN2 CHAR 4 0 Asset Subnumber
PROJK aa CHAR 20 0 WBS Element
LINETYPE aa CHAR 1 0 Indicator regular line or service
line(R or S)
BPRME BBPRM UNIT 3 0 Order Price Unit (Purchasing)
BPUMZ BPUMZ DEC 5 0 Numerator for Conversion of
Order Price Unit into Order Unit
BPUMN BPUMN DEC 5 0 Denominator for Conv. of Order
Price Unit into Order Unit
PRICE_UNIT EPEIN DEC 5 0 Price Unit

Pseudo Code:

1. Only users who are having authorization will be able to execute this RFC. If this
authorization object is not added, then RFC execution will be terminated with an exception
‘No Authorization to execute the transaction’.

2. The invoice document types are picked from /ARBA/PARAM_TAB.

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 24 Revised 25, April 2014
3. The invoices that are created after the last run date for all AN enabled vendors from BKPF
and BSIK is picked.

Filters:

a. Only Normal Invoice Documents are picked [BSTAT = Blank]


b. The invoices that are created in Ariba Network are not picked again and resent.

4. Invoice Line items are picked from BSEG.

Invoice Header Details:

1. Based on invoice doc option parameter, SAP Invoice Number or Reference document
number is populated.

2. Header details like fiscal year, document type, document date, posting date, document
time, header text and currency are populated.

3. The field operation is set to NEW.

4. Purchase Order Number is populated if it’s a PO based Invoice. The purchase order number
is picked from BSEG-EBELN.

5. Plant address details are populated. Every Plant will be having address number. Address
number is picked from T001W and the address details are fetched from ADRC by passing the
plant address number.

6. Populating Gross Amount Tax Amount and Purpose fields:

a. The purpose field is used for identifying whether the document is credit memo/Line
level credit memo/Standard Invoice.

If the debit/credit indicator is S and the document is created with reference to PO,
then it’s a credit memo.[Purpose - creditMemo]

If the debit/credit indicator is S and the document is created without reference to


PO, then it’s a Line Level Credit Memo.[Purpose - lineLevelCreditMemo]

If the debit/credit indicator is H, then the document is Standard Invoice.[Purpose -


standard]

b. If the invoice is not created via MIRO, then gross amount and tax amount are taken
from BSIK.

c. If the invoice is created via MIRO and the calculate flag is not set(Tax is manually
entered by user), then tax amount is taken from RBKP-WMWST1 and gross amount
is populated.

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 25 Revised 25, April 2014
d. If the invoice is created via MIRO and Calculate flag is set, then tax amount is
automatically calculated.

e. Payment Term and Cash Discounts are also populated.

7. Company Code address details are populated. Every company code has address number.
Address Number is fetched from T001 and the address details are fetched from ADRC by
passing the company code address number.

8. If the invoice has a special handling cost at line level, then field isspecialhandlinginline is set
to yes. If this indicator is set to yes, then the special handling cost will be populated at line
level in Ariba Network.

9. If the invoice has tax at line level, istaxinline is set to yes. Indicator isaccountinginline is also
set to yes.

Invoice Line item Details:

1. If the invoice has a unplanned delivery cost, then one more service line item will be created
under a normal line item in AN. The line type field determines whether the line item is
service line item or normal line item.

S = Service Line

R = Normal Line

2. If the invoice has a tax, then the tax is calculated from the gross amount by using function
module CALCULATE_TAX_FROM_GROSSAMOUNT. The accrual transaction key and accrual
condition type are two parameters which need to be maintained by the user who is
executing the transactions if he wants accrual tax functionality. If the invoice has an accrual
tax, then a flag is set.

3. If the invoice is created via MIRO and the tax code entered in invoice is accrual tax code or
calculate tax is not set in MIRO [If this calculate tax check box is not ticked, then the user will
enter the tax manually in header level. But system will not populate the tax automatically in
the invoice lines proportionately], the line item net amount is taken from RBCO. If the
invoice is not created via MIRO and the tax code entered in invoice is accrual tax code or
calculate tax is not set, then take the Original tax base amount from BSEG.

4. If the tax code is not having accrual condition, then the line item net amount is summed up
and taken into a separate variable. In the same way the total line level tax is also summed
up and taken in a separate variable. If the invoice is created via MIRO, then the gross
amount is calculated by using the below formula.

Gross Amount = Individual line item amount + [ (Individual line item amount * Total tax
amount) / (Total line item amount) ].
Copyright © 2013–2014 Ariba, Inc. All rights reserved. 26 Revised 25, April 2014
5. The line level tax is calculated only if the calculate tax checkbox is ticked. The tax lines and
accrual taxes are fetched using function module CALCULATE_TAX_FROM_GROSSAMOUNT.
If the invoice has a accrual tax, then accrual tax lines are not taken into account while
calculating the line level tax amount. Formula for calculating the line level tax amount.
Accrual tax is also calculated based on the final tax amount.

Tax Amount = Invoice Line Item Amount * Tax Rate / 100

6. Tax Jurisdiction code, Tax code, item text, Cost Center, GL Account, Order number, Asset
Number, Quantity, Unit of Measure, Purchase order Number details are populated in Line
items.

7. If the document is Non PO Invoice, then quantity is defaulted to 1 and unit of measure is
defaulted to EA.

8. The price unit is calculated by dividing the line item amount by line item quantity.

9. The Tax Category is sent to AN. The table /ARBA/TAXCAT_MAP will be containing the tax
category. For e.g.

Fieldname Value

MWSKZ I1

TAX_CATEGORY Sales Tax

In the above scenario, I1 tax code will not be sent. Sales Tax will be sent to AN.

10. If the parameter ERP_INV_PROCESSED_STATUS is set, then the Invoices which are sent to
AN are stored in /ARBA/AN_ERPINV.

Data Filters

1. Last Pull Date: This is the date with timestamp of the last pull/run date/time of this batch
integration process.

2. Customers need to populate all the AN enabled vendors in /ARBA/AN_VENDOR for which the
invoice data’s needs to be pulled.

3. Invoice Document type should be maintained in /ARBA/PARAM_TAB.

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 27 Revised 25, April 2014
Error Handling

1. If the invoice document type is not maintained in /ARBA/PARAM_TAB, then transaction is


terminated with message ‘Maintain INVOICE_DOC_TYPE parameter in /ARBA/PARAM_TAB’.

2. If the user who is executing the transaction is not having authorization, then the transaction is
terminated with a message ‘No Authorization to execute the transaction’.

Globalization

Time zone: In SAP time zone data of the invoice is not maintained hence we have provided a Time zone
as the global variable in NetWeaver XI.

Copyright © 2013–2014 Ariba, Inc. All rights reserved. 28 Revised 25, April 2014

You might also like