Anyone could help me with this report. ?

Hi to all, anyone could help me with this report ?
I have this one:
SELECT 'Factura',T0.ItemCode, T0.Dscription, SUM(Quantity) as Cantidad, Sum(LineTotal)  as Total
FROM INV1 T0 INNER JOIN OINV T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OCRD T2 ON T1.CardCode = T2.CardCode
INNER JOIN OSLP T3 ON T1.SlpCode = T3.SlpCode
WHERE ((T1.CardCode >= '[%1]' AND  T1.CardCode <= '[%2]'))
AND T1.DocDueDate >= '[%4]' AND T1.DocDueDate <= '[%5]'
AND T3.SlpName >= '[%6]' AND T3.SlpName <= '[%7]'
GROUP BY T0.ItemCode, T0.Dscription
UNION
SELECT 'Abono',T0.ItemCode, T0.Dscription, SUM(Quantity * -1 ) as Cantidad, Sum(LineTotal * - 1) as Total
FROM RIN1 T0 INNER JOIN ORiN T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OCRD T2 ON T1.CardCode = T2.CardCode
INNER JOIN OSLP T3 ON T1.SlpCode = T3.SlpCode
WHERE ((T1.CardCode >= '[%1]' AND  T1.CardCode <= '[%2]') )
AND T1.DocDueDate >= '[%4]' AND T1.DocDueDate <= '[%5]'
AND T3.SlpName >= '[%6]' AND T3.SlpName <= '[%7]'
GROUP BY T0.ItemCode, T0.Dscription
But now I want to introduce this sentence in:
Select I.ItemCode,I.ItemName,
(select price from ITM1 where ItemCode=I.ItemCode and PriceList=1),
(select price from ITM1 where ItemCode=I.ItemCode and PriceList=2),
(select price from ITM1 where ItemCode=I.ItemCode and PriceList=3),
(select price from ITM1 where ItemCode=I.ItemCode and PriceList=4)
From OITM I
Could you help me ?
Many thanks.

Please try this one:
SELECT 'Factura',T0.ItemCode, T0.Dscription, SUM(Quantity) as Cantidad, Sum(LineTotal) as Total,
(select price from ITM1 where ItemCode=T0.ItemCode and PriceList=1) 'Price List 1',
(select price from ITM1 where ItemCode=T0.ItemCode and PriceList=2) 'Price List 2',
(select price from ITM1 where ItemCode=T0.ItemCode and PriceList=3) 'Price List 3',
(select price from ITM1 where ItemCode=T0.ItemCode and PriceList=4) 'Price List 4'
FROM INV1 T0 INNER JOIN OINV T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OCRD T2 ON T1.CardCode = T2.CardCode
INNER JOIN OSLP T3 ON T1.SlpCode = T3.SlpCode
WHERE ((T1.CardCode >= '[%1]' AND T1.CardCode <= '[%2]'))
AND T1.DocDueDate >= '[%4]' AND T1.DocDueDate <= '[%5]'
AND T3.SlpName >= '[%6]' AND T3.SlpName <= '[%7]'
GROUP BY T0.ItemCode, T0.Dscription
UNION
SELECT 'Abono',T0.ItemCode, T0.Dscription, SUM(Quantity * -1 ) as Cantidad, Sum(LineTotal * - 1) as Total,
(select price from ITM1 where ItemCode=T0.ItemCode and PriceList=1) 'Price List 1',
(select price from ITM1 where ItemCode=T0.ItemCode and PriceList=2) 'Price List 2',
(select price from ITM1 where ItemCode=T0.ItemCode and PriceList=3) 'Price List 3',
(select price from ITM1 where ItemCode=T0.ItemCode and PriceList=4) 'Price List 4'
FROM RIN1 T0 INNER JOIN ORiN T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OCRD T2 ON T1.CardCode = T2.CardCode
INNER JOIN OSLP T3 ON T1.SlpCode = T3.SlpCode
WHERE ((T1.CardCode >= '[%1]' AND T1.CardCode <= '[%2]') )
AND T1.DocDueDate >= '[%4]' AND T1.DocDueDate <= '[%5]'
AND T3.SlpName >= '[%6]' AND T3.SlpName <= '[%7]'
GROUP BY T0.ItemCode, T0.Dscription
Thanks,
Gordon

Similar Messages

  • PLEASE, ANYONE COULD HELP ME WITH THIS !!!

    PLEASE, ANYONE COULD HELP ME WITH THIS !!!

    hi, i was facing this problem from past few days...solution... WE JUST HAVE TO USE A USB 2.0 HUB... this solved my problem....E1713 is not able to connect to usb 3.0 as it does with 2.0.

  • Any one could help me with this soap client program?

    Any one could help me with this soap client program?
    Below is the request format my partner is expecting to see:
    POST /Service.asmx HTTP/1.1
    Host: 192.168.1.1
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "https://api.abcdefg.com/GetList"
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
         <soap:Body>
              <GetList xmlns="https://api.abcdefg.com/">
                   <username>string</username>
                   <password>string</password>
              </GetList>
         </soap:Body>
    </soap:Envelope>The java client I wrote is blow:
    import javax.xml.soap.*;
    import java.util.Iterator;
    import java.net.URL;
    import java.io.*;
    public class Client {
        public static void main(String [] args) {
            try {
                SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
                SOAPConnection connection = soapConnectionFactory.createConnection();
                SOAPFactory soapFactory = SOAPFactory.newInstance();
                MessageFactory factory = MessageFactory.newInstance();
                SOAPMessage message = factory.createMessage();
             // addd SOAPAction;
             MimeHeaders hd = message.getMimeHeaders();
             hd.addHeader("SOAPAction", "https://api.abcdefg.com/GetList");
                // get env and body;
                SOAPPart soapPart = message.getSOAPPart();
                SOAPEnvelope envelope = soapPart.getEnvelope();
             SOAPBody body = envelope.getBody();
                Name bodyName = soapFactory.createName("GetList", "", "https://api.abcdefg.com/");
                SOAPBodyElement bodyElement = body.addBodyElement(bodyName);
                //Constructing the body for the request;
             SOAPElement username = bodyElement.addChildElement("username");
             username.addTextNode("1234567");
             SOAPElement password = bodyElement.addChildElement("password");
             password.addTextNode("7654321");
                System.out.print("\nPrinting the message that is being sent: \n\n");
                message.writeTo(System.out);
                System.out.println("\n\n");
                URL endpoint = new URL ("https://api.abcdefg.com/Service.asmx");
                SOAPMessage response = connection.call(message, endpoint);
                connection.close();
                response.writeTo(System.out);
            }catch (Exception e) {
                 System.err.println("ERROR: ******* " + e.toString());
    }The response my partner's server returned is:
    <faultstring>Server did not recognize the value of HTTP Header SOAPAction:. </faultstring>I used similar code to access the web services provides via tomcat, it works fine...however, for this .NET services it does not work.
    By the way, I also have another version of the clirnt, using JDOM to construct a XML request and wrap with axis message. I got the same error message as above.
    Can anyone point out something for me?
    Any kind of comments will be appreciated!!
    Edited by: Nickolas.Chen on May 6, 2008 7:20 PM

    You will need to Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Hii, i got an iTunes card for $15 and only used $6 in it, but it say I only have $0.37 left. If any one could help me with this, I will be forever grateful.

    Hii, i got an iTunes card for $15 and only used $6 in it, but it say I only have $0.37 left. If any one could help me with this, I will be forever grateful.

    You will need to Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • I just buy a imac 27inch when after intalling everthing for windows 7 and all the drivers i need and goes to the restard part my imac just goes to a black screen with a blinking cursel and it just wont proceed anyone can help me with this?

    i just buy a imac 27inch when after intalling everthing for windows 7 and all the drivers i need and goes to the restard part my imac just goes to a black screen with a blinking cursel and it just wont proceed anyone can help me with this?

    Support articles for things like this would be here:
    http://www.apple.com/support/bootcamp

  • I've bought the first season of Death Note on itunes, and i've was never able to download the 11th episode (Assault), it gives me error -50 each time I try. Can anyone please help me with this?

    the title pretty much has my question i guess. it's my first post so i'm not sur if you'll see all of it. I'll just copy paste it anyhow.
    i've bought the first season of Death Note on itunes, and i've was never able to download the 11th episode (Assault), it gives me error -50 each time I try. Can anyone please help me with this?

    Perhaps try the "Error -50," "-5000," "8003," "8008," or "-42023" section in the Specific Conditions and Alert Messages: (Mac OS X / Windows) section of the following document:
    iTunes: Advanced iTunes Store troubleshooting

  • HT201401 Q) Can anyone please help me with this: My in coming call ringing tone not working?

    Q) Can anyone please help me with this: My in coming call-messges ringing tone not working? All I am getting in Vabration + Flashing light when receiveing messages or incoming Calls. I am missing my phone Calls constantly. Please Help me?
    I have just received this phone as a replacement from my insurance company, as I had lost my own phone. It has taken them 3 weeks to sort this out. This has ruined my business because it has taken so long. I really do not have time to send it back to them. Because it will waist another three weeks for them to sort it out again. Please Help!

    HA! By Jove I've Got it! it was simples..
    TURN ON THE RINGING ON / OFF BUTTON ON THE SIDE OF YOUR PHONE JUST ABOVE THE VOLUME BUTTONS. THEN MAKE SURE THE VOLUME IS UP TO THE HIGHEST. NOW JUST TRY THIS!
    I ALSO LOOKED UP A MANUAL ON IPHONE4:
    Ringtones, Ring/Silent switch, and vibrate
    iPhone comes with ringtones that sound for incoming calls, Clock alarms, and the Clock timer.
    You can also purchase ringtones from songs in iTunes. See Chapter 22, iTunes Store, on page 94.
    Set the default ringtone: Go to Settings > Sounds > Ringtone.
    Turn the ringer on or off: Flip the switch on the side of iPhone.
    Important:  Clock alarms still sound even if you set the Ring/Silent switch to silent.
    Turn vibrate on or off: Go to Settings > Sounds.
    Assign a different ringtone for a contact: In Contacts, choose a contact, tap edit, then tap
    Ringtone and choose a ringtone.
    For more information, see Sounds on page 139.
    THE REASON MY PHONE HAD NO RING TONE, WAS SIMPLY BECAUSE THE VOLUME WAS TURNED DOWN. :-/
    I HOPE THIS HELPS OTHERS INFUTURE!   :-D

  • Hello, I have accidentially deleted files in root folder of my iPad(1). Now iPad is dead completely. I would really appreciate if anyone could help me fix this. Thanks in advance.

    Hello,
    I have accidentially deleted files in root folder of my iPad(1). Now iPad is dead completely. I would really appreciate if anyone could help me fix this.
    Thanks in advance.

    Support for jailbroken devices cannot be given here. Go to the website that helped you get root access in the first place.

  • Hi, I was wondering if anyone can help me because I cant find my external Hardrive on My Macbook Air running OSX Mavericks. If anyone could help me solve this it would be highly appreciated Thanks

    Hi, I was wondering if anyone can help me because I cant find my external Hardrive on My Macbook Air running OSX Mavericks. If anyone could help me solve this it would be highly appreciated Thanks

    Click once on the Desktop to switch to the Finder.
    Command and , (comma) keys to open its preferences.
    General tab. Make sure the show hard and external disks is checked.

  • TS1538 Im having trouble connecting my ipod touch to itunes, i have the device plugged in but its not been recognized on itunes! i have plugged my iphone in and that has been recognized but not the ipod and i was wondering if anyone could help me sort thi

    i have recently purchased an ipod touch 5th generation ipod for my girlfriends daughters! im trying to sync some music onto the device but it is not been recognized on itunes. i have the device plugged in but i cant find the device on itunes! I have plugged my phone in to check if its the cable but the cable is fine as my iphone synced up perfectly! wondering if anyone could help me out??

    Hello there, dtumman.
    It seems that for the issue you are describing you were referred to us from the very article that provides the troubleshooting steps to help resolve your issue:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Keep in mind:
    Follow these steps, testing to see if the issue is resolved after each section.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Hi,after upgrade to OS x mavericks i can't open my windows at BOOTCAMP, anyone can help me with this situation?

    HI after i upgrade to new Os x Mavericks i found that i cant open my WINDOWS in my BOOTCAMP, its always appear asking me to windows running or not well shut down properly message, after i try to go to RUNNING WINDOWS NORMALLY it stil cant open and auto open and running on MAC. anyone please help me. Thank you

    Ok this worked to solve the error.
    Use cmd prompt in windows 7 or 8 and run as admin:
    sc config lanmanworkstation depend= bowser/mrxsmb10/nsi
    sc config mrxsmb20 start= disabled
    No need for all that power shell nonsense as shown elsewhere for windows 8.
    That's it. Also force smb2 disabling on the apple side for good measure.
    With the above I was able to network mavericks and windows 8.1 pro flawlessly. He issues I had before where I could not read video, ISO and audio files (but could open documents and pictures from the windows machine connected to an apple network share folder went away.

  • Anyone could help m with caracters?

    Hello people!!
    can anyone help me with caracters?
    Well, I'm using jsf to get the data from the
    mysql database and caracters like "�"
    , "�" and "�" are not shown properly
    in my web page. Does anyone have a solution?
    Thanks!!

    What character encoding are you using?

  • Hi to everybody, I'm new of the community and I'd like to know if anybody could help me with this issue. I have differente itunes libraries stored in differente hard disks, and I' d like to merge them all in one unique library

    Hi, I' m new of the community and I hope I'm not asking something that has been already discussed. I have different iTunes libraries on different hard disks and I would like to merge them in an unique library - mantaining all the metadata - so that I can use this new one with iTunes Match. Could anybody help me?

    PowerTunes - http://www.fatcatsoftware.com/powertunes/ (commercial software)
    syncOtunes - http://homepage.mac.com/oligrob/syncOtunes/syncOtunes.html
    Alison 1231, your question is not identical to the original poster's so perhaps you could start a new topic with the question since the answers will be different and not apply to the OP's post.

  • Unable to Intialize HDV deck - can anyone pls help me with this FCE Issue?

    I have recently moved from a MacBook Pro (circa 2 yrs old) to a new MacBook Pro with the NEW firewire 800 port. I have bought a new firewire cable and my camera does not want to be capture from my Sony A1E.
    I have a MacBook Pro 2.8ghz running on OS X 10.6.2 and have all the updates installed for FCE.
    Every time i try to capture the message comes up "Unable to Intialize HDV deck. Please make sure a deck is connected and try again".
    The System is set up to receive the correct frame rate footage and type of footage (which is: HDV-Apple Intermediate Codec 1080i50. Formats: All formats). I am running on PAL, so 25fps.
    Is there any advice / direction that you could give me at all as I am struggling!
    Any help support would be appreciated!
    Thanks, Martin

    Hi,
    Would you confirm that you are using a 9-pin to 4-pin FW cable to connect to your camcorder and that your camcorder is the only FW device connected to your Mac.
    When you start up FCE with the camera connected to your Mac and already powered on in VTR mode, does FCE 'see' the camera, or do you get a warning message that FCE is "Unable to locate the following external devices ..." ?

  • Getting an error while using if statement in calculated column.can anyone please help me with this issue

    I am trying to learn HANA on my own.i have product id,product name,delivery date and Grossamount in my calculated view.i am trying to create calculated column where i need Grossamount in two columns based on delivery date.I have 2012 and 2013 as values for my delivery date.so i have created two column as grossamount_2012 and grossamount_2013.if i have delivery date as 4thdec,2012 i want the grossamount value to be in coloumn grossamount_2012 and the grossamount_2013 should be blank.i have written an expression like this
    if("Deliverydate" <= longdate(2012-12-04),"Grossamount","0")
    and it looks like this is wrong.i am getting the text Grossamount rather than values for that field in my output.so can anyone help me please?

    Hi chandra
    i am trying to get the same result by using sql script and CE functions.i have written the following code
    select A."PRODUCTID",
           E."TEXT" as "PRODUCTNAME",
           C."COUNTRY",
           D."DELIVERYDATE",
           Sum(D."GROSSAMOUNT") as "GROSSAMOUNT"
           from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Products" as A     
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.BusinessPartner" as B
           on A."SUPPLIERID" = B."PARTNERID"      
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses" as C
           on B."ADDRESSID" = C."ADDRESSID"
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.Purchase.Item" as D
           on A."PRODUCTID" = D."PRODUCTID"
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.Util.Texts" as E
           on A."NAMEID" = E."TEXTID"
           GROUP BY A."PRODUCTID",E."TEXT",C."COUNTRY",D."DELIVERYDATE"; 
    this is working fine but i want to split the grossamount based on current year and last year.Any idea how to do this
    In calculation view using script can we use if and case statements?

Maybe you are looking for

  • PS CS6 Sign in

    Hola, Ok so I have a Macbook Pro and last week I purchased photoshop CS6 and I updated it to the latest patch. Photoshop itself works fine except every time I open photoshop a message appears that I have to sign in and register the product or it will

  • Load Java Program AT STartup

    Hi I need to want to load a java program on startup and I don't know how. Is it possible to have a script that tells the operating system to load it on startup or can it only be done through the operating system's settings?

  • Retrieve taxonomy terms maintaining the hierarchy(sub terms) using JSOM

    I believe the title is self explanatory . I've tried SPServices but it results in to many round trips as the number of terms and sub-terms increases. THe whole idea behind using term set it to set up an Global Navigation (having sub menus )across sit

  • Image quality clarification

    Hi I'm a newbie when it comes to video. I too was disappointed with the result of my 1st iDVD project. The images where soft, desaturated and there appeared to be some digital artefacts around type in the menu themes etc. So I read the forum extensiv

  • Saving finished project to disk

    I now seem to have fixed the 'dropout' prob with various things including a major boost of RAM ! Please could somone tell me how and what files I need to save to disk at the end of a successful DVDSP4 project? I want to remove the film sequences from