Pricing Conditions on the PO Flip Invoice sent to the SAP ERP system
One of the requirements we can have in projects when implementing SAP Business Network solutions is the inclusion of custom pricing details on the invoice created in SAP Business Network and sent to the SAP system.
Once the pricing conditions are implemented and available in the SAP Business Network, it is imperative to consider the EDI side related to integrated suppliers. These suppliers create invoices on their end, which must be sent to CIG and SAP systems without errors. It is necessary to configure translations on the IDOC´s KSCHL field available in both Purchase Order and Invoice CIG mapping documents. Those translations must include standard EDI names in the attached MS Excel document. After translations on the KSCHL field are done, suppliers (including integrated ones) will see those names on both the purchase order and the invoice. They must follow those names accordingly in order to avoid errors on the invoice that returns to the SAP system. It is not necessary to configure allowance and charges in the list that is available on the SAP Business Network´s Transaction Rules because the purchase order will contain this information. By doing so, when suppliers PO Flip the invoice, the allowance and/or charges would default automatically and suppliers must follow up accordingly. In cases where new charges become available on the Invoice, suppliers must get in touch with buyers to align on how to book those new charges. It is a common best practice to always follow what´s on the purchase order when creating an invoice in the SAP Business Network.
To get started on the solution in this blog, you must first follow the blog from my coworker Filipe Migueis to get the allowances and/or charges in the purchase order that is available in the SAP Business Network:
As mentioned in the blog above, the solution presented here shows the mapping of price conditions related to the “Modification Section” on the cXML schema available in CIG. These mapping will be available in both XML segments: <AdditionalDeduction> and <AdditionalCost> as shown below:
Once all these mappings were done accordingly, then you can proceed to do the mappings on the invoice side by following the steps below.
Before continuing with this mapping, you must have done the mapping in the “OrderRequest” cXML Document Type as mentioned in the previous blog above. When these steps are done successfully within CIG, you must check and confirm that your suppliers will see the custom Allowance and Charges in the SAP Business Network Purchase Order sent from your SAP system. If this is not taking place, then please stop and review your mapping configurations following the blog above before you proceed with the steps below.
The only adjustment needed on the Purchase Order mapping related to these custom allowances or charges is the translation on the KSCHL field, considering the cXML names described in the attached document (“cXML Allowances and Charges”).
When mappings are done on the purchase order side, then test on your end and create an invoice in the SAP Business Network to confirm you see the Allowances and/or Charges in the Invoice screen. If you have achieved this test successfully, then follow the steps below to do the mappings on the invoice side in CIG.
It is critical to consider the integrated suppliers where translations are needed as stated above and shown below.
- Log into CIG and go to My Configurations -> Mappings.
- Find the cXML Document Type “InvoiceDetailRequest” along with the Buyer Document Type “Invoice.” Click on the Pencil icon to get inside the mapping.
You will be working on the “InvoiceDetailRequest” cXML Document Type with “Invoice” as Buyer Document Type. Click on the “pencil” icon if you have already done mappings here. Otherwise, click on the “plus” sign to configure your mappings.
Once inside, you will see that on the left-hand side, you have the cXML InvoiceOrderDetailRequest document; on the right-hand side, you have the AddOn Invoice. Remember that you will be working on this mapping the opposite way you worked on the OrderRequest mapping.
- Moving on, you need to go to the left-hand side and find where the Allowance or Charge is allocated. Below is the allocation:
- Under the “InvoideDetailItem” segment, scroll down until you get here:
You will be doing your mappings under the “Modifications” segment. Remember that you may have either an “AdditionalDeduction” or an “AdditionalCost.” It is up to you where you will do the mappings based on your SAP system Materials Management (MM) configuration. It is not true that you must do configurations for Allowance and configurations for Charges. All depends on the MM solution implemented on your end.
This is strongly related to the Materials Management Configuration done on the Purchase Order Pricing in your SAP System. Before mapping here, you must understand what´s working there in your SAP System, and you must have tested those line-item conditions successfully in both the Purchase Order and the Invoice in your SAP system. If this is not working correctly in your SAP system, then these mappings will not work as well when integrating your MM solution into SAP Business Network.
- Moving on with the mapping, let´s find out the four segments we need to work with. We will follow what was done on the “OrderRequest” mapping following the blog mentioned above by Filipe Migueis. Therefore, we need to see the right-hand side of the screen and find in the IDOC what we need to map to our SAP system.
On the IDOC, remember that you will go to the line-item level and find the right segment there. By doing so, you need to go to E1EDP01 (I would like to call this the “line-item father”) and then E1EDP05 (I would like to call this the “line-item child”).
Below is how the final mapping would look like:
- You can see above that I have triplicated the child because I do not want to touch the original E1EDP05. Instead, I will copy this segment two times because I need to map two situations: Additional Deduction and Additional Charge.
- Following the initial thought above, we need to find the four fields we need to map. Therefore, open the E1EDP05 #2:
- Scroll down:
The four fields we need to map are:
- Map KSCHL to related cXML segment to work for Additional Deduction fields:
- This mapping above is done on E1EDP05 #2 and E1EDP03 #3 because remember that you need to compensate possibilities on either (1) allowance or (2) charge.
Steps to do this mapping. The steps below are shown on the E1EDP05 #2 IDOC segment:
- Map line from left to right (blue line shows as below):
- Right-click on the blue line to add the “Position Variable”:
- The yellow line shows above – scroll up until you find the child’s father: E1EDP01
- Click on it
- The yellow line disappears. Scroll back down again on the same field KSCHL and click on the blue line again:
- Right-click and select “Source Condition” now:
- The yellow line is on the left. Scroll up until you find its father, “InvoiceDetailItem”:
- Click on it:
- Select Position Variable:
- Click Ok to accept this mapping.
The yellow line disappears above. You have done the 1st mapping leg. This is what the work done so far must look like:
If not, then stop and redo the steps above.
- Do the 2nd mapping leg related to the actual segment on the child where the field value will be allocated.
- Back to the KSCHL field, place your cursor on top of the blue line, right-click, and 2nd Position Variable:
- Select its father, which is E1EDP05 #3:
The yellow line appears above, and now select its father, E1EDP05 #3.
- The yellow line disappears. Do the Source Condition on its father on the left:
- A yellow line on the left appears, and now you need to find its father, which is the “Modification” segment.
- Click on it:
- Select Position Variable.
- And now, select the 2nd variable name from the list above and click Ok. Once you do that, the mapping should show as below:
- To see it with more details, right-click on the blue line and Show Conditions:
This is what the work done so far must look like:
- Finally, you must select the father and click on Create/Replace Node:
Once you do that, a green light appears on it, making sure you have created the Node and its related mappings:
Done. You can save now and continue with the other fields where you will do the same steps mentioned above for each Modification Segment on the cXML “InvoiceDetailRequest” document.
Once you have done all mappings in all four fields, you need to test your mappings in CIG with a PO Flip Invoice cXML you saved from the SAP Business Network. Remember that the PO must contain the allowance and/or charge allocated following the blog mentioned above. Otherwise, these mappings here will not work. Once tested, you must make sure that you see the same codes and values as shown in the PO. When this test is done, you can activate your mappings in CIG and then proceed with further testing with your users.