Freight based on sales order total - FMS

I have created the query below which works if I hard code the document number, or include the variable [%].   I get internal error when I use where T0.DocNum - $[$8.1.0] or where DocNum = $[ORDR.DocNum], I have also tried where T0.DocEntry = $[ORDR.DocEntry]
Does anyone kno where I am going wrong?
SELECT case when      T0.DocTotal >= 1 and T0.DocTotal <= 250 then 10.00
               when      T0.DocTotal >= 251 and T0.DocTotal <= 500 then 7.50
               when      T0.DocTotal >= 501 and T0.DocTotal <= 1500 then 5.00     else 0.00 end
FROM DBO.ORDR T0
INNER JOIN dbo.RDR3 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.DocNum = $[$8.1.0] and T1.[ExpnsCode] ='3'

Hi Sandra,
Try this,
SELECT case when T0.DocTotal >= '1' and T0.DocTotal <= '250' then '10.00'
when T0.DocTotal >= '251' and T0.DocTotal <= '500' then '7.50'
when T0.DocTotal >= '501' and T0.DocTotal <= '1500' then '5.00' else '0.00' end
FROM ORDR T0
INNER JOIN RDR3 T1 ON T0.DocEntry = T1.DocEntry
Auto Refresh of TAX Code.
SELECT case when T0.DocTotal >= '1' and T0.DocTotal <= '250' then '10.00'
when T0.DocTotal >= '251' and T0.DocTotal <= '500' then '7.50'
when T0.DocTotal >= '501' and T0.DocTotal <= '1500' then '5.00' else '0.00' end
FROM ORDR T0
INNER JOIN RDR3 T1 ON T0.DocEntry = T1.DocEntry
WHERE
T1.DocEntry = $[ORDR.DocNum]  AND T1.ExpnsCode ='3'
Regards,
Madhan.

Similar Messages

  • Fixing forwarding Agent based on Sales Order volume

    Hi Experts,
    Based on the Sales Order total volume, how can I fix a forwarding agent for that. Eg. If the Sales Order volume (Pls note this is not order Quantity) is more than 500 lbs that has to be despatch only through forwarding agent DHL.
    Waiting for the help to solving this issue.
    Christine.

    You will need to add code to do you determination via a user exit or badi.
    Take a look at mv45afzz or some of the include exits around it in sapmv45a.
    You will need to supplement delivered logic with your own in order to do what you want to do.

  • Restriction for items from Purchase Order based on Sale Order

    Hi !
           We create PO directly from Sale Order ( by ticking Option under Logistic tab, 'Purchase Order') for customer C01 (for eg).
    From the PO created, we post GRPO.
    Now our need is,
    Assume if 10 Qty is been ordered in such a way and been received (GRPO posted). it 'll add on to the stock account i.e will increase stock qty at our whse.
    is it possible to restrict these 10 qty of item from being sold to any other Customer other than whom hav ordered i.e if we create sale order for C02 the SBO should not take the items received from PO created based on Sales Order created for C01?
    Meera.

    Meera,
    Which version of SBO are you using 2005 or 2007?
    I don't think Serial numbers can help in this scenario.  There is no hard allocation or blocking possible using Serial numbers.
    This is the Work around I am thinking about.
    Set the items to be Batch Managed - On Every Transaction
    When performing Goods Receipt, enter the Sales Order Number as the Batch Number
    When creating the delivery, using SBO_SP_TransactionNotification we can easily check the Batch of the Item being selected and verify it with the BaseRef of Delivery lines to match with Sales Order number.
    If the numbers don't match we can warn user with message, "The items batch reserved for Sales Order xyz"
    Even if you make a mistake when entering the batch number same as Sales Order number when doing a goods receipt. It can still be traced and blocked during delivery.
    Hint: The Batch table records the Goods Receipt transaction along with the BaseDocument number, Base Ref, etc
    If you decide to go this route, I could help you further.
    Let me know
    Suda

  • Migo based on sales order error -Require CO object

    Dear Experts,
    We have one process,
    Where we are creating sales order and based on sales order, we are doing migo and miro. final entry will be consumption a/c dr to vendor then we are doing billing for the same.
    We got error in migo based on sales order stated that 'please enter co account assignment object.
    where i will cpature this cost on sales order or cost center.
    I think must be part of sales order becoz we are doing consumption based on sales order and revenue and csot must be flow to copa in billing. M i correct?
    If cost object is sales order or PSG in migo? what setting need to be done for the same.
    What will be the ideal process for the same.
    regards
    RR

    hi ajay,
    I have used AAC -X with item category 's' for third party that was suggested by sap
    and the gl i have defined in okb9 with PSG tick.So consumption account linked to my PSG. becoz i m doing migo/miro based on sales order and final entry will be consumption a/c to vendor in my case.
    System will determine PSG in migo and then billing will happened for the same.So my cost and revenue will flow to COPA.
    We have one programme SDVPRSUPDATE that need to execute every monthend.In order to flow cost to COPA for some cases where Billing happened but no GR happened for the same.then this prograame will flow VPRS cost to COPA.
    regards
    RR

  • Sales order Total = Zero (0) No Sales order Lines

    Hi,
    Is there any possibility to accept Sales order Total = Zero (0) - No Sales order Lines for a specific customer?
    I assume it should be a parameter in SBO somewhere...
    Thank you,
    Rune

    Hi Rune,
    i think there's no parameter for this.
    Link
    "You cannot have a Sales Order without items unless it is a Service Invoice"
    regards
    David
    Edited by: David Nussböck on May 3, 2008 1:15 PM

  • I want to pick up Schedule line Delivery date based on Sales Order of Mater

    Hi Experts,
    I have one scenario like,
    I want to pick up Schedule line Delivery date based on Sales Order of Material.
    For example :
    Go to va03
    Give the order no
    Press the enter
    Double click on material.
    Go to Schedule line Tab
    Then we can find out the Delivery date .
    I want to pick up the that Delivery date. Could you please help on that.
    Thanks,
    Amjad.

    Hi,
    schedule line dates are available in VBEP.
    VBEP-VBELN = sales order number.
    VBEP-EDATU = schedule line date.
    REgards,
    Raghavendra

  • Purchase order based on Sales order

    Hi,
    I try to create Purchase order based on Sales order.
    The error message :
    "Base document card and target document card do not match"
    My code:
    oPurOrder.Lines.BaseEntry=oSalesOrder.DocEntry
    oPurOrder.Lines.BaseLine=oSalesOrder.Lines.Linenum
    oPurOrder.Lines.BaseType=17
    Could you help me please ?
    Tks.
    Laetitia

    Hi,
    Looking at your code I will check how you fill the fields in the oPurOrder object because the code you copied is only for the document lines and the error refers to the document itself (maybe you forgot to assign the cardcode property).
    If you are basing the document, a good and reliable method is to export the base to a xml file and load the target using this file. This way you garantee that all the info of the document is copied. After that you could use your code to update the info you want to change the same way you pasted it in your post.
    Hope it helps,
    -M

  • Material documents based on Sales order

    Dear Experts,
    We are developing a report where I need to extract the list of material documents with movement type 411E and 412E based on the sales order. This data is available in MSEG but after designing the report, Its performance was  very poor hence we could not move the report to production.
    As MSEG is a cluster table it is taking to much time. I checked other tables MKPF MSSA but nothing is working out. Is there any way out to improve the performance of the report by taking the list of material documents based on sales order and movement types 411E and 412E .
    Please suggest me with suitable solution.
    I will reward the points immediately.
    With Regards
    Uday

    Hope you are not trying to join MKPF and MSEG currently:
    821722 - Performance of the join on MSEG and MKPF
    If you are below release 606 in your system, this note will have to be implemented in your system to bring redundant fields of MKPF into MSEG for performance improvement:
    1516684 - MKPF fields added to MSEG - Performance optimization
    The blog shared by Jurgen is pretty well explained. In addition have a look at these notes:
    1638997 - Performance: CKMDUVMAT selection with new fields in MSEG
    1558298 - MB5B: Redesign of selection for performance optimization
    1550000 - MB51: Redesign of selection for performance optimization

  • Revenue Account Determination based on Sales Order Document Type & Service Order Type

    Hi Expert,
    I have Customer Service Module with Resource Related Billing for services attached with SD.
    When DP90 runs sales document debit memo request is created & then debt memo is created.
    I need to configure Revenue Account Determination based on Sales Order Type and also based on Service Order Type.
    I did not see any field catalogue in revenue account determination for order type, For communication structure KOMKCV Header and KOMPCV Item level there is no field for sales order type nor service order type.
    Is it possible to bring in both order types? Can ABAP person do it?
    How to bring these fields?
    Is it possible & recommendd to have service order type filed AURAT for service order into this sturcture?
    Is this configuration is OK acceptable by SAP? If so is there any chnace for issues errors & wrong determination from FI CO view?
    Your valued input is highly appreciated.
    Thanks
    Prakash Parikh

    Hi Prakash,
    Yes, you can certainly add new table fields into the field catalog KOMKCV and KOMPCV and use it during account determination. You will also have to add these new fields in the user exit RV60AFZZ for it to work. I believe you will need ABAPer's help to make this work. The abaper will have to crate a ZZFIELD (ZZAUART for example) and put it in the structure and use the same in the user exit to pass the values.
    In your case, what I am not sure is, are you looking to modify the existing standard tables or creating new ones. My suggestion is to create the new condition tables with these new fields (like document type) after adding it to the field catalog. Only modify the access sequence (KOFI) in such a way that your new tables are access first before it goes into standard tables (or you can adjust it according to your scenario.
    We have done it in our company and it is working fine. Basically what we have done is to create new tables instead of modifying the standard ones. We have adjusted the access sequence in such a way that some of our custom tables are accessed first before the standard SAP tables (C001 to C005).
    I found a similar requirement on SCN. This might help.
    Adding New Field in Account Determination
    Hope this helps.
    Regards,
    Mukund S

  • What setting to mandate that invoice is created based on sales order NOT...

    Hi,everyone
    Could you tell me the detailed configuration  to mandate that invoice is created based on sales order NOT delivery documents.
    Additionaly, I need to define this rule at headquarter and apply it all lower-level companies.  how to do it.
    thanks you very much

    Dear Humility,
    Could you tell me the detailed configuration to mandate that invoice is created based on sales order NOT delivery documents.
    This is quite possible through copy control settings between sales order and billing document
    In standard billing type F1 will billed with reference to the sales order OR,so you can copy those settings then rename to your document types and itemcategory.
    Go to VTFA transaction click n change icon then select billing type F1 and order type OR then click on Copy As icon (F6)and change the document types(maintain your docuemnt types).
    To copy item level settings
    Now you come back to initial screen agin you select billing type F1 and order type OR then click on item here you select standard item category then click on Copy as Icon (F6) here you maintain your itemcategory.
    Note:- Don't change the satndard settings you just copy
    Additionaly, I need to define this rule at headquarter and apply it all lower-level companies. how to do it.
    For this you can take help of your BASIS people they will full fill with the roles and authorisation settings.
    I hope this will help you,
    Regards,
    Murali.

  • Creating Mulitile Billing documents based on Sales order

    Hi All
    My requirement is to create a billing documents based on sales order. Item category is SERVICE.
    For example : In Sales Order the quantity is 100.
    1 st billing doument user can create of 10.Then after 1 month 2nd billing document of 9 and so on.
    when i create billing document related with sales order . the billing document is created with 100 quantity.
    i know it is possible with delivery but my requirement is billing document should be created related to service.
    Appreciate your time.
    Thanks and Regards
    Mahesh

    Hi ,
    You can use mile stone billing concept for this requirement.In mile stone billing ,we enter the billing dates and quanitity to be billed.We can bill the required quantity once the billing date reaches the system date.
    Hope it helps.
    Regards,
    Pasapula.

  • Search Production Orders based on Sales Order

    HI,
    Ours is MTO scenario.
    How to find Production Order number(s) based on Sales Order.
    We are getting in AFPO, but if the process starts from Enquiry or Quotation then there is difficulty.
    Because there can be multiple documents of enquiry or quotation.
    Kindly suggest.
    Thanks
    Ramakanth

    Ramakanth
    Did you try T code  COOIS - Order Information System?
    Here you can enter the sales order # ( Single values, range etc.) and get a list pf Production Orders?

  • Invoice Receipt document (TABLE RBKP) based on Sales Order (table VBAK).

    Hi Folks,
       I have to find Invoice Receipt document (Table RBKP) based on Sales Order (table VBAK).
       Please tell me how the two documents are linked.
    Thanks,
    Punit

    I don't know table RBKP, but I would start by seeing if I could find the value of RBKP-BELNR or XBLNR as the next document in table VBFA.  If found, then you know how to read VBFA forward from sales order (VBAK) to VBFA with correct next document type, then to RBKP with the document number....
    Don't know if this will work, but this is the first approach I would take.

  • Create Purchase Order based on Sales Order through DI

    Hi All,
    As per my requirment i need to create PO based on Sales Order by Using DI object.
    By using the UI i am able to create a PO. i.e,.  in the Sales Order Form , in logistic tab when the purchase check box is checked and when the SO is added there is a work around form poped up where we give the vendor information and create PO.
    Code:
          objPurchaseOrder = objSBOAPI.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)
                                        objPurchaseOrder.CardCode = "V1010"
                                            objPurchaseOrder.CardName = "Far East Imports"
                                            objPurchaseOrder.DocDate = "02/24/05"
                                            objPurchaseOrder.DocDueDate = "02/24/05"
                                        objPurchaseOrder.Lines.BaseType = "17"
                                        objPurchaseOrder.Lines.BaseLine = "0"
                                         objPurchaseOrder.Lines.BaseEntry = "35"  
                                             objPurchaseOrder.Add()                                                          
    Error Description : Base Doc Type donot match with target Doc type
    PLease help me
    Thanks and Regards
    Sandeep

    hi,
    try removing the double quotes for basetype, baseline, baseentry.
    if it doesn't solve the problem
    make sure that you are assigning the docentry only but not the docnum of the sales order to the purchase order lines' baseentry.
    rgds,laks.

  • How to Add Delivery Note based on sales Order

    How to add a delivery note based on sales order.
    say i have a order no. 10 and linenumber 0 to 3.
    each time i book with order no 10 and line no.3,i need to add to delivery note.
    i also in need of adding just one Header and Multiple lines(Header for order Number - 10 and multiple lines for each Booking ).
    How can i achieve this.

    Hi
    You can search the samples....C:\-->Program files->SAP----->SDK->Samples->DiAPI----->OrderandInvoice...
    Here invoice is added for a particular sales order.....the same can be done for delivery.....
    Hope it helps

Maybe you are looking for

  • How Can i Read data From Maintainance View

    I Want read data from Maintainance View. i written select query SELECT * FROM J_1yyyyV INTO TABLE GT_BUSPLACE. WHERE BUPLA = LV_BUPLA. this is giving following error "J_1yyyyV" is not defined in the ABAP Dictionary as a table, projection view, or dat

  • How to write this logic  in EL expression ? (new line characters in string

    iam using JSTL EL expression in my JSP. iam printing a string in JSP as ${vobject.rmessage} where rmessage is a string . problem is i want to identify the newline characters in the above rmessage string and print the line break <br> in html where eve

  • TimesTen 7.0.6.9: Replication Agent fails with Error 17029 and 8191

    The replication agent failed to start with error 17029 and 8191. /etc/hosts look like: 1.1.1.1 server1.tt.com server1 => `hostname` returns this 2.2.2.2 server1-2.tt.com server1-2 SQL statement to create a replication schema looks like: CREATE REPLIC

  • HT6114 about the update 10.9.2

    always we ask all respensables and devellopers of Apple to remember arabic language in the programms iWork pocket and microsoft office of MAC and package of iLIFE

  • I receive this message and so do people who email me any ideas how to solve

    This report relates to a message you sent with the following header fields: Message-id: <[email protected]> Date: Tue, 20 May 2014 20:03:36 +0100 From: Mark hutton <********> To: dD <********> Subject: Dave. Genius.  Laughed a load!!!!!!!!!!! Your me