Hi,
We need to charge as a separate line item (material) 'Insurance' as a % based on the total value of the order less one line item. Our orders are created on the web and posted via a BAPI.
(a) depending on where the customer is located, we charge a certain added shipping cost.
(b) the customer has the choice to ask for insurance or not.
The actual order may be 10 lines totaling $1,000 and due to location, the BAPI slaps on an added line item of $100. If the customer chose the insurance option, the BAPI needs to slap on another line item whose value would be, say 2% of the total order, i.e. 2% of 1000 (instead of on 1000+100). Of course, if the customer doesn't choose this option he is not charges this extra line and further if the customer is not in the particular region, the 100 charge may also not be there.
The 2% can vary time to time so needs to be driven by a condition record based on %.
How can we achieve this in the pricing procedure? The logic of how the BAPI will function is clear to us, we are stuck on the pricing procedure configuration.
Glad to answer any further questions you may need for clarifications.
Many thanks!
Line item pricing based on total value of the order
Moderators: Snowy, thx4allthefish, mike_ac, Lost Identity

 Posts: 17
 Joined: Fri May 20, 2011 8:54 am
Re: Line item pricing based on total value of the order
Hi,
What if BAPI can check item types of the line items and use only amounts from the lines with specific item types for insurance calculation? Then you would be able to calculate insurance based on $1000 rather than $1100. Does it make any sense for you?
Ghanem
What if BAPI can check item types of the line items and use only amounts from the lines with specific item types for insurance calculation? Then you would be able to calculate insurance based on $1000 rather than $1100. Does it make any sense for you?
Ghanem
Re: Line item pricing based on total value of the order
Thanks, ghanem, yes it kind of does...then we 'insert' another line on the order only for the insurance  if so, then that brings me to the next question, do we do the calculation of this 2% (or whatever it is time to time) in the BAPI and post that value as the item condition value for the 'insurance' material?
Re: Line item pricing based on total value of the order
The easiest way would be to charge the 2% on each relevant item, but not print invoices, etc, that way. You can itemize the insurance on the outputs.
"If a cluttered desk is a sign of a cluttered mind, of what, then, is an empty desk?" â€“Albert Einstein, when confronted by a neat freak about the disarray in his work space

 Posts: 17
 Joined: Fri May 20, 2011 8:54 am
Re: Line item pricing based on total value of the order
I don't think that you need a special 'insurance' material, just modify your pricing procedure by adding a pricing condition for insurance. Then assign a formula to this insurance pricing condition, in the formula you can write ABAP code to calculate 2% of the price of the items with specific item types. You can also use BAPI instead of formula.sapnov05 wrote:Thanks, ghanem, yes it kind of does...then we 'insert' another line on the order only for the insurance  if so, then that brings me to the next question, do we do the calculation of this 2% (or whatever it is time to time) in the BAPI and post that value as the item condition value for the 'insurance' material?
With this approach you might face rounding problem: if you have several items in SO and you first calculate 2% individually for each item and then sum these calculated amounts, you could get amount, which is slightly different from the amount that you get when you first sum all the relevant items and then calculate 2% of the total. It happens due to the fact that SAP rounds numbers to 2 digits after a dot. For some companies these several cents of difference matter.mike_ac wrote:The easiest way would be to charge the 2% on each relevant item, but not print invoices, etc, that way. You can itemize the insurance on the outputs.
Re: Line item pricing based on total value of the order
Not really. Group the conditions, and you're set to the fraction of a penny. You can always work out rounding issues. Or, let standard SAP handle it  you'll see the difference at the header level, and you can adjust back down as needed.ghanem1245 wrote:With this approach you might face rounding problem: if you have several items in SO and you first calculate 2% individually for each item and then sum these calculated amounts, you could get amount, which is slightly different from the amount that you get when you first sum all the relevant items and then calculate 2% of the total. It happens due to the fact that SAP rounds numbers to 2 digits after a dot. For some companies these several cents of difference matter.mike_ac wrote:The easiest way would be to charge the 2% on each relevant item, but not print invoices, etc, that way. You can itemize the insurance on the outputs.
"If a cluttered desk is a sign of a cluttered mind, of what, then, is an empty desk?" â€“Albert Einstein, when confronted by a neat freak about the disarray in his work space