SQL Open Sales Orders Value using today's currency rates

Hi experts,
I am creating a report for displaying the open sales order values (and other fields) using current currency rate (where applicable). I developed the below query. The only problem with this query is that it ignores the order rows in which the currency field is blank (Don't understand why this happens in SAP). Do you have other ideas?
Thanks & Regards,
IC
SELECT 
T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date",  T0.CardCode as "Cust Code",  T0.CardName as "Customer Name",  T1.ItemCode, 
T1.Dscription,  T3.ItmsGrpNam,  T1.U_SU,  T1.U_SULEN,  T1.U_SUQTY,  T2.InvntryUom as 'Stock UOM',  T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered", T1.OpenQty as 'Bal Qty', T1.Price*T1.Quantity/T4.Rate AS "Ord Value (GBP)", T1.Price*T1.OpenQty/T4.Rate  AS "Open Qty Val (GBP)", T1.Price/T4.Rate  AS "Price (GBP)", T1.Price*T1.OpenQty as "Ord Value (BP Currency)", T1.Price as 'Price (BP Curr)', T1.Currency as 'Cur Ind', T4.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date",  T1.WhsCode as 'Del WHG'
FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod, ORTT T4 WHERE T0.DocCur <> 'GBP' AND T1.Currency=T4.Currency AND T4.[RateDate] = [%0] AND T1.OpenQty > 0
UNION ALL
SELECT
T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date", T0.CardCode as "Cust Code", T0.CardName as "Customer Name", T1.ItemCode, T1.Dscription, T3.ItmsGrpNam, T1.U_SU, T1.U_SULEN, T1.U_SUQTY, T2.InvntryUom as 'Stock UOM', T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered", T1.OpenQty as 'Bal Qty', T1.LineTotal AS "Ord Value (GBP)", T1.LineTotal/T1.Quantity*T1.OpenQty AS "Open Qty Val (GBP)", T1.LineTotal/T1.Quantity AS "Price (GBP)", T1.Price*T1.OpenQty as "Ord Value (BP Currency)",T1.Price as 'Price (BP Curr)', T1.Currency as 'Cur Ind', T1.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date", T1.WhsCode as 'Del WHG'
FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod WHERE T0.DocCur = 'GBP'  AND T1.OpenQty > 0 ORDER BY 2,1

Hi,
Try:
SELECT 
T0.DocNum as 'Sales Ord No', T0.DocDate as "Ord Date",  T0.CardCode as "Cust Code",  T0.CardName as "Customer Name", 
T1.ItemCode,  T1.Dscription,  T3.ItmsGrpNam,  T1.U_SU,  T1.U_SULEN,  T1.U_SUQTY,  T2.InvntryUom as 'Stock UOM', 
T1.Quantity as 'Ord Qty', T1.Quantity*T2.U_ITWTSTU as 'Weight (KG)', T1.Quantity-T1.OpenQty as "Qty Delivered",
T1.OpenQty as 'Bal Qty', T1.Price*T1.Quantity/T4.Rate AS "Ord Value (GBP)",
T1.Price*T1.OpenQty/T4.Rate  AS "Open Qty Val (GBP)", T1.Price/T4.Rate  AS "Price (GBP)",
T1.Price*T1.OpenQty as "Ord Value (BP Currency)", T1.Price as 'Price (BP Curr)',
T1.Currency as 'Cur Ind', T4.[Rate] AS 'Curr Rate', T0.DocDueDate as "Due Date",  T1.WhsCode as 'Del WHG'
FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
LEFT JOIN ORTT T4 ON T1.Currency=T4.Currency AND T4.[RateDate] = [%0] AND T4.Rate != 0
WHERE T0.DocCur != 'GBP' AND AND T1.OpenQty > 0
Thanks,
Gordon

Similar Messages

  • Open sales orders value not updating currectly in sales value of CM

    Hi SAP experts,
    I have an issue some of customers credit exposure value showing worng value.We are using static credit limit check.
    customers credit limit RM20000,
    open sales order valueRM6,073.77
    open delivery=0
    open billing =0
    open items(recievables)=3,464.39
    Credit exposure =9,538.16.
    But i have checked in VA05 its showing 13,001.10 value, i have checked all areas didnt get any solution.
    I have run the reports RVKRED09 and RVKRED77 , RVKRED88 also no updates in the credit management.
    is there any other areas i need to check, advise me.
    Regards,
    Nooka

    The only thing you really need to check is RVKRED88.
    It is not the correct procedure to compare the open sales order value with the sum net value of VA05.
    In VA05 open documents are displayed indifferent whether they are already part-delivered or not. That's why the open values from the VA05 are not directly comparable with the values in RVKRED77.
    As described in OSS note 716141; reports RVKRED88/77 shows the correct value which should be in your system.
    If you need to know more let me know.
    Thanks,
    Gerard

  • Open sales order value for credit check need to be changed (S066)

    Hi all,
    I need to change open sales order value which is already there in S066 table.
    Previously we had used open order value for credit check. Open order values are already updated in the S066 table.
    Now we dont want to consider open order value for credit check (which is already included in the credit exposure field in FD32).
    When we create sales order system is taking old open order value for credit. Now i have changed not to update open order value for credit check. Now its not updating open order value. But my issue is how to change existing or (previous) open order value for credit?
    Can i change S066 table data directly to '0'. Is it advisable to chage open order value directly from this table?
    Please advise me.
    Regards,
    Babu
    Edited by: babs on May 19, 2010 4:26 PM

    Hi Babs,
    If you doesn't want to reflect the open order value in the structure for this order value ,If the order is not processed kindly delete the line items and the order. Then save the document. Then try to see the structure S066.. This will be modified.
    If you want to modify the value then follow the below process.
    Otherwise delete the line item in the order and change the pricing date and the document date. Re enter the line item again so that it will take it up the new changes.
    I hope it will help.
    Regards,
    SK

  • Open Sales Order values not getting updated after run RVKRED77 & RVKRED88

    Hiiii,
    In Production Server. We run the reports RVKRED77 & RVKRED88. Credit info structure and and Open Sales Order values not getting updated. In FD32, Status - Sales value it showing '0". At the time of creating Sales Order Dynamic Credit check not happening coz of Tables S066 not updating. Please provide me Solution.
    Best Regards,
    Sridhar . P

    Dear Heagal,
    I followed your suggestions and implemented in the Development and moved the changes in to Quality Server. I tested it thoroughly by creating New Customer and maintained Credit Limit. I come to know that Problem is in all Servers. I made 3 changes.
    1. In Pricing Procedure Sub Total A it was not maintained against Net value. I placed it.
    2. Removed Credit groups for Delivery Type.
    3. In OVA8 i maintained Max. Doc Value :99,999,999.00 before it was with 1.00
    I checked the OMO1 Settings it was Asynchronous. As SAP Notes Suggesting to use Synchronous but here it's a client setting. So, It's Can't possible to change. Changes will affect other Company Codes.
    Tested both in DVP and QTY Dynamic Credit Check is working Perfectly and Status in FD33 Sales Value field getting update.
    If i move these changes in to Production, Will i need to run the reports again or not? How it will affect on Old Cusomer Billing and  Credit Limit data. For few of the Customers the Credit Limit data it was exceeded. Please provide me advice. The issue need to be Solved immediately.
    Best Regards,
    Sridhar

  • How to Avoid Open Sales Order Value from Credit Check

    Hello Everyone,
    We have a problem with Credit Management, When my user run the execute credit master sheet, system is considering open sales order value under Credit limit used. My user do not want consider open sales order value, they want only Open delivery and Open Billing value need to appear in Credit limit used.
    Is it possible to avoid open sales order values, if yes what setting i need to do....please help me.
    Thanks
    Sudheer

    Sudheer,
    You need to check the update rule given in the definition of the Credit control Area which you are using for credit management. If you want only the open deliveries then you need to have update rule 15 in the credit control area.
    In the credit controal settings, you need to have settings for the credit check at the delivery level.
    Hope this will solve your issue.
    Regards,
    Chetan
    Edited by: Chetan Gupte on Jul 15, 2010 8:56 PM

  • Where is Open Sales Order Value coming in Credit Master sheet?

    We have a customer whose credit exposure is below credit limit. I'm in Customer Credit Management overview screen and I ran Credit Master sheet report (for this CMR) under Environment -> Reporting -> Credit Master Sheet.
    I see value in Receivables and Open Sales Order Value which sums up to Credit Exposure Value. I'm wondering which sales orders are considered to calculate open sales order value?
    I ran different order reports like VA05 and some custom reports available, but I could not find a direct report that matches the open sales order value.
    I manually compared Open Sales orders based on Horizon date, the value that I'm arriving is kind of close of Open Sales Order Value in Credit master sheet report.
    Update rule used is 000012 in automatic credit control screen.
    Please let me know if there is an easiest way to find data behind Open Sales Order Value in Credit master sheet report.
    Appreciate any help!

    . I'm wondering which sales orders are considered to calculate open sales order value?
    Those customer orders which are relevant for credit limit. Please let me know if you are talking about something different?
    I ran different order reports like VA05 and some custom reports available, but I could not find a direct report that matches the open sales order value
    .You can not compare the VA05 open sales order report with FD32 open sales order report.
    You can find out the open order values of Credit manangement(FD32) in S066 table.
    Please let me know if there is an easiest way to find data behind Open Sales Order Value in Credit master sheet report.
    For open sales order you can find out  in S066 table and sales values in KNKK table

  • Open Sale Order Value (FD33) not getting diminished even after closing SO?

    Hi,
    Upon Executing FD33 and clicking the status view for a Customer say XYZ , and then choosing EXTRAS-Open Sale Order . Say the value of open sale orders being shown is 75000. Even after closing the open sale orders (By Selecting VA05 and Putting reason for Rejection), and then also the Open Sales Order value is not getting diminished.
    What could be the reason ?
    Pls help.
    Regrds,
    Binayak

    Hi Binayak,
    As mentioned by you, running of Credit re-org program 'RVKRED77' is the only solution for this problem and it is known problem in SAP.
    Some precautions
    1. Always run the program in background by scheduling a job.
    2. The idle time is around midnight when no user is working on SAP.
    3. Some time the job fails as some other program may be updating same tables as this program. In such cases re-schedule the job at different time.
    4. You may run the program 'RVKRED88' which will simulate without actual updation of credit values.
    Hope this clarifies..
    Regards,
    Madhu.

  • Rajesh/Sadhu/RobertoUrgent :- Open Sale Order Value not getting Reduced?

    Hi,
       Upon Executing FD33 and clicking the status view for a Customer say XYZ , and then choosing EXTRAS-Open Sale Order . Say the value of open sale orders being shown is 75000. Even after closing the open sale orders (By Selecting VA05 and Putting reason for Rejection), and then also the Open Sales Order value is not getting diminished.
       What could be the reason ?
       Pls help.
    Regrds,
    Binayak
    Message was edited by:
            Binayak Ghosh
    Message was edited by:
            Binayak Ghosh

    Hi Binayak,
    As mentioned by you, running of Credit re-org program 'RVKRED77' is the only solution for this problem and it is known problem in SAP.
    Some precautions
    1. Always run the program in background by scheduling a job.
    2. The idle time is around midnight when no user is working on SAP.
    3. Some time the job fails as some other program may be updating same tables as this program. In such cases re-schedule the job at different time.
    4. You may run the program 'RVKRED88' which will simulate without actual updation of credit values.
    Hope this clarifies..
    Regards,
    Madhu.

  • Not Updating Open Sales Orders Value for CreditManagement

    Hi Frendz,
    This is the first time am implementing creditmanagement in my system tested simple credit limit check working fine.
    Now testing Static and Dynamic(Automatic) it also working fine but Its not caliculating open sales orders value either static or dynamic while Creating s.o, settings made clicked on open s.o, i have already created sales orders value of 10th.
    EX:- customer balance is 2lacs, credit limit is 1lac while creating s.o it always showing balance 1lac only(Instead of 1lac10th) with open sales order value  is 10th.
    Let me know Where i have missd settings.
    Hari Prasad

    hello,
    it is maintained against the cr control area in ent structure.
    one needs to change there.
    r u in prd system or development?
    becoz if prd, then this change will effect a lot of ongoing docs.
    rgs,
    AK

  • Update open sales order values. - Update rule.

    Hi
    In library below information given for the updation of open sales order value in infostructure. Can any one please explaing how can we configure below two rules.
    An update rule describes the set up of the open sales order value, i.e., the open sales order quantity. The second update rule describes the reduction of open sales order value, i.e., the open sales order quantity by the corresponding deliveries.
    http://help.sap.com/saphelp_47x200/helpdata/en/96/dfec3410b5f563e10000009b38f83b/frameset.htm
    Path: LIS - SIS - How the key figures are calculated - open sales order value.
    Thanks in advance.
    Raj.

    Any inputs please.....

  • Open sales order migration using lsmw

    Hello guys iam migrating open sales order and iam having header  fields
    AUART
    VKORG
    VTWEG
    SPART
    KUNNR
    KUNNR
    BSTKD
    BSTDK
    VBEGDAT
    VENDDAT
    item fields  are
    MATNR
    ZMENG
    SPART
    ISMACTIVATION
    what is the standard object available for this migration in lsmw.?i thought of using
    0090 salesdocument standrd object using direct input method but field ismactivation is not available in that object.
    if i go for bapi method salesorder_createfromdat2 i couldnt find the above fields for mapping in that object.but some of the guys in this forum used this bapi method  for this type of migration i dnt how they did it can u please suggest solution for this .
    Regards
    Janapathi

    Hi!
    In the given BAPI, the field names are different. You have to match them using their description or data type.
    If you check this BAPI in transaction SE37, on hte Import tab, click on the BAPISDHD1ref type.
    Here you can find the field DOC_TYPE (type AUART). With this way, you can find the matching fields.
    Regards
    Tamá

  • Open Sales Order Values in Credit Managment

    Hi,
    1. I want to include the open sales orders that were created before implementing the functionality of  Credit Managment.  How to check the credit limits for that sales orders.
    Fro Example. If i want do the credit checks for 1000 open sales orders.
    2. How to reset the customer credit limit in FD32. I tried using the t.code f.28, but it will not be reset to zero(0).
    Thank you,
    Ravi

    Hello Ravi,
    You can try this: in table VBAK, you might have the date when this a particular order was created( ERDAT or sometihng like that..). You'll have to join table VBAK/VBAP/VBRK(billing table)/VBFA and the logic should be that the program should pick up all the orders created before 1 yr and should also check that the items are not rejected, and the delivery not yet created.
    Check the following fields:
    VBAK-ERDAT, VBAP-ERDAT, VBAP-ABGRU, VBAP-AEDAT.
    Regards,
    Raghu.

  • Rg: Open Sales Order Uplaod Using BAPI (BAPI_SALESORDER_CREATEFROMDAT2)

    Hi Frinds..
    I am Creating Program Sales Order Uplaod Progrm using BAPI BAPI_SALESORDER_CREATEFROMDAT2.
    All header and Po data uploaded Properly . But Item Leal data not updated.. Please let me know any Conditions need to pass to update item data.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
            EXPORTING
              salesdocumentin      = v_extr
              order_header_in      = l_vbak
              order_header_inx     = l_vbakx
              behave_when_error    = 'P'
            IMPORTING
              salesdocument        = v_vbeln
            TABLES
              return               = return
              order_items_in       = l_vbap
              order_items_inx      = l_vbapx
              order_partners       = l_vbpa
              order_schedules_in   = l_shline
              order_schedules_inx  = l_shlinex .
    I can pass like that.

    hi Prabu,
    It is not uploading for company code 1100 ..

  • Incorrect Sales order value was updated in credit Master data(FD32 in open

    Hi All
    User created a sales order with 10 lineitems and Net value&total value is same for this sales order - 4010 Dollers,but when we check in Report(RVKRED88)the same order value is displaying as 7,8912 Dollers instead of 4010 Dollers and same amount(7,8912 dollers)is updated in open sales order value in credit master data(FD32) for that peritculer customer code,now credit percentage showing 430%, due to this reason the user is unable to release a new sales order for this customer code.
    Already we run the credit re-organization program - RVKRED77 to correct value in credit master data(FD32) for this customer code but still it was not updated in FD32 and the report RVKRED88
    because  of this user's are unable to release the next sales order due to this problem for this particular customer,i would  highly appriciate if i get a solution.
    Thanks & Regards
    Nagesh,Paruchuri

    Hi
    Check whether you have entered the credit control area to that customer in XD02.
    Use the Update group 000012
      o   Sales order
          -   Increases open order value from delivery-relevant schedule lines
      o   Delivery
          -   Reduces open order value from delivery-relevant schedule lines
          -   Increases open delivery value
      o   Billing document
      Reduces open delivery value
      Increases open billing document value
    Financial accounting document
      Reduces open billing document value
    regards
    Edited by: Prashanth on Jun 10, 2009 2:52 PM

  • Getting the open sales orders and open deliveries valies

    Hi SDNs,
    I have a requirement that i need to get the all sales orders open values and delivery values. I need to build a logic for this scenario. could you please provide the logic for getting the open sales order values for respective customer.
    Please provide logic instead of standard reports. That would be very useful
    Thanks in advance
    Regards,
    K

    Please provide logic instead of standard reports.
    Really surprising !!!!!!!!!
    But still I would like you to have a look at VA05 where both open quantity and open order value will flow.  If you still feel to get the related tables, you can consider VBBE where you can get open order quantity
    thanks
    G. Lakshmipathi

Maybe you are looking for

  • Error message: Bind operations are only supported in a single data view.

    I created a new connection handler and data view. When I started ldapsearch I got the above error message. Would like to know how caused that and how to fix it. I tried to roll back all my modification and use the default connection handler and it ev

  • Headers and footer formatting changes when word docs are loaded to pages

    I have loaded template word documents from my Imac to ipad pages. If I turn around and email the template out, the heading formatting has changed. Is there a list of specific fonts I can import word-docs with to not do this? Also, when I click on the

  • Green and purple coloured highlights

    I am getting green and puple colours all over my raw photos where highlights are present, like on  wet objects such as pebbles on a beach, I don't get this using lightroom so it isn't a camera problem. I use a number of cameras and it happens on all

  • Create a new EngineProvider for bea Netio

    Hello, I want to implement an CEP adapter using UDP. To do that I created a new Netio EngineProvider an ConnectionProvider classes implementing com.bea.core.netio.spi.EngineProvider and com.bea.core.netio.spi.ConnectionProvider interfaces. Then using

  • New Workstation Setup

    Hey guys, I'm planning to build/upgrade to a new workstation and just wanted to have some input, especially regarding the GPU. Working hours with PR AE PS LR is quite balanced. Setup at the moment (considering a pricerange of aproximately 1100€) , wo