When creating IDOCs in SAP to send Invoices to customers via EDI you will likely have to send the customers their internal partner numbers on the EDI ANSI X12 810 Invoice Document. In almost all cases this will not be the same as the SAP partner numbers. So how can we set up a cross reference of SAP and external partner numbers? Well, the answer is simple because SAP has set up a utility to handle this for you. All you need to do is populate the EDPAR table in SAP using the VOE4 transaction. Once this is completed the IDOC_OUTPUT_INVOIC function module will read the EDPAR table when the Invoice document output is processed and populate the LIFNR element of the E1EDKA1 or E1EDPA1 segments of the INVOIC IDOC with the external partner number. Entries in EDPAR can be set up for multiple partners including the Sold-to, Ship-to, and Bill-To numbers so that external customer number cross-references can be passed on the IDOC if needed.
Let’s look at how this process works. Let’s say we have created an invoice document in SAP. In this case, the Sold-to, Ship-to, and Bill-to partners are all SAP customer number 15. If we want to create an INVOIC02 IDOC on which the external customer numbers are populated for all three of these partners we would have to set up three EDPAR entries as displayed on the below screen shot. The Customer field will contain the SAP partner number (Sold-to, Ship-to, Bill-to). The Ext. Function field will contain the Partner Function (SP = Sold-to, SH = Ship-to, BP = Bill-to). The External Partner field will contain the external partner number that the customer is expecting on the EDI file. And the Int. no. field will contain the SAP partner number (Same as the Customer field).
After we have set up the Partner Profile (WE20) for the INVOIC for this customer we can produce the output through transaction VF02 to create the IDOC. The INVOIC02 IDOC will display the Sold-to and the Bill-to partners at the Header level in the E1EDKA1 segments, but because we could have multiple Ship-tos on an invoice the Ship-to partner(s) are located at the Item level in the E1EDPA1 segments. In both segments, the external partner numbers will be populated in the LIFNR element. The segments for the three partners are displayed below:
As you have probably noticed, the Partner Functions on the IDOCs do not match the Partner Functions in the EDPAR table. Those would translate as follows: SP in EDPAR = AG in the IDOC, SH = WE, BP = RE. As you can see the LIFNR field is populated with the values in the External Partner field of the EDPAR table. These values can now be used in the EDI mapping tool to send the value to the customer.
This is a useful tool as new partners can be added easily using the VOE4 table by a customer service representative. It also keeps the cross reference within SAP so that the EDI group does not have to build their own functionality to convert the partner numbers and maintain it as new customers are added or locations are changed.
This table can be used for other partner types and other outbound IDOCs. You would need to check the function module that processes the output to see if it uses the EDPAR table and for which partners. Another internal SAP table that is used for partner cross reference is the PUMA table. This is used when creating DELVRY and SHPMNT IDOCs whose function modules do not use the EDPAR utility. The use of the PUMA table will be discussed in a separate blog.
Interesting SAP Infographic – http://www.lovehatedata.com/download/love/infographic2 may be of interest