Showing results for 
Search instead for 
Did you mean: 

External system invoice number pass to SAP

0 Kudos


I have a requirement to pass the external billing system invoice number and also the same number into FI document for further usage for payment clearing SAP.     The external system invoice number will be passed on in a flat file  via interface which we use to create first the sales order using BAPI and further on billing using the standard job using the sales order (This is order related billing). We will agree with the external system to give us the external number range which we will define in the SAP system and make the number range to be external (or) we use a z-table to take the number range object to create the billing document in the specific number range within that range. 

1) My question how do we force the system to use the external number (probably we will keep the external system invoice number in some field like PO number while creating the sales order) to use while creating the billing.  Does the system always take sequential number from the external number range and create the invoice (or) can we force the number in some billing user exit to have overwritten with the number I want taken from sales order PO field  ? Can we have technical details how to achieve this please ?

2) Once I achieve the question 1  then I can use the order to billing copy control to populate the current billing document  as assignment or reference number via config, I guess  ?

3) Another question related to the process - we will be disabling the MWST tax calculation in SAP and take the tax amount from the external system to directly pass in the pricing...currently we have existing process to populate the prices...which tax condition type will be suitable for passing the external system tax amount it MWEX (External VAT) ?  If it so, how do we associate with a tax code for the tax amount passed externally ?  do we have pass the tax code as well ?

<Text removed by Moderator, as it suggest points/rewards>



Message was edited by: Jyoti Prakash

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos


Thanks we don't want to disturb the MWST as it is being used across the pricing procedures, instead I created ZTAX condition for manual entries assigned for input in the PP.

But the problem is when I am adding the manual tax condition value  in the ZTAX the MWST is not going to 'Inactive'  I don't want two tax conditions going into billing and screw up.

I even tried with the cond exclusion with two groups one for MWST and the other for ZTAX and assigned to the PP with 'D' - Exclusive.  Its not working.

1) How can we achieve to inactive the MWST - is it because not happening as the conditon automatic and with the required setting ?  Is there a standard routine with which we can achieve this ?  or write a ABAP routine to inactive  in case ZTAX is inputted.

2) How can we calculate the % value for ZTAX  if I am passing only the calculated tax value from the interface file into the sales order creation programme ?  Do we do hard calculation with the tax value to the net value and pass the % to the cond type or we get the % also along with the value in the interface file and pass ?

Could you or someone please clarify ?



0 Kudos

Hi Murali,

1.) You should have the ZTAX before the condition MWST. In the rule for your condition MWST you have to read XKOMV, if there is a condition ZTAX. If you find one, you have so exclude MWST by sy-subrc =4 .

2.) Right, you need to code this and do a "hard calculation".



Active Contributor
0 Kudos

Hi Murali,

This is in regard to your query 3)

Keywords for me from your post:

- take the tax amount from the external system

- which tax condition type will be suitable for passing

- MWEX (External VAT) ?

- how do we associate with a tax code

I haven't seen condition type MWEX in any of the customer or demo clients I have worked.

Well, you can use MSWT for the external reference of tax value. The critical part of this is to get a value into the pricing based on the assignment of Routine in the Alternate Condition Type in your pricing procedure against your tax condition type. SAP provides standard Routine 300 that uses FM COLLECT_AND_CALCULATE_TAX_DATA for import of tax value. Now, to have this working and get a relevant tax code determined you have to maintain 100% value in condition record for this tax condition type. Refer following screen shot for tax condition type, pricing procedure & condition record as an example.

Thanks, JP

Active Contributor
0 Kudos

As others already mentioned, external numbering for billing documents is not possible in SAP.

A couple of other things to point out - you pass the official number at sales order creation - I hope your legislation allows gaps, because there will be cases when an order will not result in final billing (all items rejected for some reason). In some countries you are expected to provide a separate report for these numbers - check with the legal consultant about the format.

Also check if it is acceptable to have more than one invoice with the same external number - it can happen that you get more than one SAP invoice for the same sales order, if not - you will have to ensure that invoice split will never occur (challenging).

I would also explore the possibility to populate order assignment number instead of PO with this external number (ask the FI consultants if they like the idea).

Active Contributor
0 Kudos

Hi Murali, here are my inputs:

1/2- Mapping external number range to PO number field seems logical. As far as I know, external number ranges are not possible for billing documents, though I must say I'm not definitely sure. But even if it was possible, I'd recommend against it in this scenario. Copying PO number from sales order to billing document and by mapping it to Reference number in customizing will be enough to fulfill your requirement.

3- I do not have experience with external system tax mapping, is there a field ready for input in your interface (Idoc, bapi vs) for tax code?

0 Kudos

Yes for billing external no. range is not possible in SAP.