2 Queries

Hello,
I have 2 queries shown in a workbook.
The top one is a hierarchy.
The bottom one is a Calculate KF displayed in Rows.
When launched, this workbook will show the top query in expanded form. The query below is also shown.
But when I collapse one of the nodes in query 1, query 2 remains where it is shown. This creates many blank lines between the 2 queries. I wonder if there is a way to automatically make query 2 follow query 1 such that the gap between the 2 queries is always maintained at , say 2 lines apart.
Thanks in advance!
Regards,
Mirella Russo

Hi Mirella,
Happy New Year too!
You may write a code in SAPBExOnRefresh subroutine. It’s a std routine for placing a code in and changing output in Excel.
Yes, it’s rather common practice to place several queries into Excel. But, if the queries presentation should be changed depending on user action, you have to write a code. Don’t think that any patches may help – user actions may be very different.
As an example of simplier problem with hierarchy expanding in Excel look here:
Re: VBA Code to Expand a Hierarchy
Best regards,
Eugene

Similar Messages

  • Could I have CASE or IF statement in FMS queries?

    Is it possible to have case statements in FMS queries:
    For example:
    SELECT T0.[U_DepoistfeeON] case
          when T0.[U_DepoistfeeON] is NOT BLANK  then $[$38.111.160]='Deposit Fee'
          when T0.[U_DepoistfeeON] is BLANK  then  then $[$38.111.160]=BLANK
    end FROM OITM T0
    What is wrong with above query please? Thank you very much.
    I do not mind even if above query is doable with an IF statement in it.

    Hi Rahul, this is what I want -
    I have a user defined field attached to item master OITM. The field is called : U_DepoistfeeON
    The above field contains additional depositFee taxes for selling beer bottles.
    I have also created a new tax as part of Freight handling. While on Sales Order screen, the Freight (unhide first through forms field) drop down can have the new tax type selected automatically "Deposit Fee".
    Thus, if the line item is of beer type that has U_DepositfeeON, then Freight field should automaticlally pick the type "Deposit Fee".
    If U_DepositfeeON is zero then I would like the Freight field on Sales Order screen ($38.111.160) set to blank.
    I tried to achieve this through following using case statement.
    select T0.U_DepoistfeeON
    from oitm t0
    case
    when T0.U_DepoistfeeON 0
    then $http://$38.111.160='Deposit Fee'
    when T0.U_DepoistfeeON = 0
    then $http://$38.111.160=''
    else
    $http://$38.111.160=''
    end;
    Of course it doesn't work. Note: I know I typed in DepoistfeeON, the error is not due to that.
    Thanks.

  • How to Dene a Data Link Between Queries: Bind Variables

    This is an interesting topic and I cannot get it to work using Bind Variables.
    I have 2 queries: Q1 and Q2. Q2 needs c_id, account_code and account_type from Q1.
    Whe I run the data template below, I get only the data for Q1.
    Now people may argue that there is no data in Q2 for the relevant clause. So if I even remove the where clause in Q2 I still get no joy i.e Data appears for Q1 but not for Q2
    <dataTemplate name="FLCMR519_DATA_SET" description="Termination Quote Report">
         <parameters>
              <parameter name="cid" dataType="number" defaultValue="1"/>
              <parameter name="p_cln_id" dataType="number" defaultValue="62412"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="Q1">
                   <![CDATA[SELECT qm.qmd_id,
    qm.contract_period,
    qm.quo_quo_id||'/'||qm.quote_no||'/'||qm.revision_no reference_no,
    qm.contract_distance,
    qm.mdl_mdl_id,
    q.qpr_qpr_id,
    q.quo_id,
    q.drv_drv_id,
    qm.revision_user username,
    pb.first_name||' '||pb.last_name op_name,
    pb.telephone_no,
    pb.facsimile_no,
    pb.email,
    q.c_id c_id,
    q.account_type account_type,
    q.account_code account_code,
    m.model_desc,
    ph.payment_description payment_head_desc,
    cl.fms_fms_id,
    cl.start_date,
    cl.end_date,
    cl.actual_end_date,
    cl.con_con_id,
    cl.cln_id,
    cl.term_qmd_id term_qmd_id,
    qm2.contract_period term_period,
    qm2.contract_distance term_distance
    FROM quotations q,
               quotation_models qm,
               contract_lines cl,
               personnel_base pb,
               models m,
               model_types mt,
               payment_headers ph,
               quotation_models qm2
    WHERE q.quo_id = qm.quo_quo_id
           AND cl.cln_id = :p_cln_id
           AND qm.qmd_id = cl.qmd_qmd_id
           AND qm2.revision_user = pb.employee_no (+)
           AND qm.mdl_mdl_id = m.mdl_id
           AND m.mtp_mtp_id = mt.mtp_id
           AND qm.payment_id = ph.payment_header_id
           AND qm2.qmd_id (+) = cl.term_qmd_id
    ]]>
              </sqlStatement>
              <sqlStatement name="Q2">
                   <![CDATA[SELECT ea.c_id,                  ea.account_type,ea.account_code,ea.account_name
    FROM external_accounts ea
                 WHERE ea.c_id = :c_id
                   AND ea.account_type = :account_type
                   AND ea.account_code = :account_code
    ]]>
              </sqlStatement>
         </dataQuery>
    </dataTemplate>

    Defining dataStructure section is mandatory for multiple queries.

  • How to use one WAD template for all the available queries

    Hi,
    I have created a WAD template... Now we have close to 25 queries which will use that template for displaying their output at Portal...
    Is there any way that i don`t have to create multiple copies of my WAD template...
    I.e. all queries would call that same template through portal...

    Hi,
    The Bex report uses the Standard Template 0ANALYSIS_PATTERN while it is executed.
    So if your sure that the look and feel of all the Reports is going to remain same, you don't need to even attach all these Queries to Templates in WAD.
    When you execute the BEx query, it would pick up the standard template and run it in portal.
    But if you want to customize the Report Template:
    1) You can change this standard template 0ANALYSIS_PATTERN  and customize it according to ur requrement in WAD.
    2) Or you can create a copy of this standard template and change it as required. Then change the template in spro (transaction RSCUSTV27) to point to this Z template.
    Let me know if you need more details.
    Regards,
    Forum

  • Error while Activating / running Bex queries/reports

    Hello
    I have following ERRORs while activating / running BEx reports/queries.
    1. While Activating BEx reports, I keel getting following ERRORS
    Object directory entry R3TR ELEM E341OIR6G715GUMGN0MRXP3MA does not exist
    Error when activating element BX7FOOKQB4588RROCBTC2YVZN
    BEx transport request 'BIDK901352' is not available or not suitable
    2. While running the BEx report/query in Bex Analyzer, I'm getting ERROR in entering the parameters, its NOT allowing / giving me option to select the parameters, for example for 0COSTCENTER, it is NOT displaying list costcenters to select before I can RUN that particular report.
    3. How can I trouble shoot ERRORs related to BEx and Portal connectivity.
    4. How would I setup the Variants for a Bex query/report ? Are these Variants for per user basis / per report basis. Can I have each variant for particular users OR all users must select their own variant each time when they RUN the report ? 
    Thanks, Sorry I have asked multiple questions, in jst one thread.
    BI

    Goto SE03 -->Search for Objects in Requests/Tasks  option , select the object type and execute it will give all the transports it has collected before ..
    Also you can use transport connection in RSA1 and select the query and find out all the objects in query locked by what request etc ..
    Thanks,
    Ravi

  • Error while transporting Queries

    Hi,
    I am getting this error while transporting queries!!
    Object '!ZTIC_UKA' (ELEM) of type 'Query' is not available in version 'A'
    Message no. RSO252
    Diagnosis
    You wanted to generate an object with the name '!ZTIC_UKA' (in transport request ELEM) of type 'Query' (TLOGO). This is, however, not available in the BW Repository database. It does not exist in the requested version A. If the version is 'D' then it is possible that an error arose during the delivery or installation. If the version is 'A' then the Object was either not created or not activated.
    System Response
    The object was not taken into account in the next stage of processing
    Thanks

    Hi Murali,
    YOu are trying to transport the element ZTIC_UKA'  of the query,may be an variable  which is not colelcted in the request.
    Try to transport the query through RSA1> Transport connection->Query-->give you query name -->Drag and Drop to Right hand side  and Click on collect all dependent objects and check whetehr they have collected in the same request.Make sure ur variables are collected.
    Tranport it now and Check.
    Rgds
    SVU123
    Edited by: svu123 on Mar 4, 2010 7:41 AM

  • Need procedure for creation of BW Roles, Assigning Queries,Publishing Roles

    Hi Experts,
      Could you please let me know the procedure for creation of BW Roles, Assigning Queries,Publishing Roles in Business Explorer (BEx - BW 3.5)
    Thanks in advance,
    Andy

    Hi,
    Creating BW Roles
    http://help.sap.com/saphelp_nw04/helpdata/en/52/6714b6439b11d1896f0000e8322d00/frameset.htm
    Assigning Queries
    After creating the query, save the query to a role from the query designer.
    Publishing Roles in Business Explorer
    https://websmp101.sap-ag.de/~sapdownload/011000358700002894802003E/HowToBIPortal1.pdf
    Hope this helps you..!
    -Pradnya

  • Problem using DECODE() function with a Query of Queries

    I
    posted
    on my blog about an issue I was having trying to use the PL/SQL
    DECODE() function with a Coldfusion Query of Queries. This function
    works fine when you query a database for information. However, when
    you query another query, it seems that CF doesn't recognize it. I
    got errors stating that it found a left parenthesis where it
    expected a FROM key word. Here is a simplified version of what I am
    trying to do:
    quote:
    <!--- Simulated query; similar to what I was calling from
    my database --->
    <cfscript>
    qOriginal = queryNew("Name,Email,CountryCode",
    "VarChar,VarChar,VarChar");
    newRow = queryAddRow(qOriginal, 5);
    querySetCell(qOriginal, "Name", "Joe", 1);
    querySetCell(qOriginal, "Email", "[email protected]", 1);
    querySetCell(qOriginal, "CountryCode", "AMER", 1);
    querySetCell(qOriginal, "Name", "Sally", 2);
    querySetCell(qOriginal, "Email", "[email protected]", 2);
    querySetCell(qOriginal, "CountryCode", "AMER", 2);
    querySetCell(qOriginal, "Name", "Bob", 3);
    querySetCell(qOriginal, "Email", "[email protected]", 3);
    querySetCell(qOriginal, "CountryCode", "ASIA", 3);
    querySetCell(qOriginal, "Name", "Mary", 4);
    querySetCell(qOriginal, "Email", "[email protected]", 4);
    querySetCell(qOriginal, "CountryCode", "EURO", 4);
    querySetCell(qOriginal, "Name", "John", 5);
    querySetCell(qOriginal, "Email", "[email protected]", 5);
    querySetCell(qOriginal, "CountryCode", "EURO", 5);
    </cfscript>
    <cfquery name="qCountries" dbtype="query">
    SELECT DISTINCT(CountryCode) AS CountryCode,
    DECODE(states, "AMER", "North America &amp; Canada",
    "EURO", "Europe &amp; Africa", "ASIA", "Japan &amp;
    Asia","") CountryName
    FROM qOriginal
    ORDER BY CountryCode
    </cfquery>
    <cfdump var="#qCountries#">
    <!--- ========== END OF CODE ========== --->
    So running this returned the following error:
    Query Of Queries syntax error.
    Encountered "(. Incorrect Select Statement, Expecting a
    'FROM', but encountered '(' instead, A select statement should have
    a 'FROM' construct.
    Does anybody know why this doesn't work? Is it just not
    supported? Please note that I have also tried to use the CASE()
    function instead of DECODE() and that resulted in basically the
    same error. For now I an looping over my distinct query with a
    switch statement and manually loading a new query with the data how
    I want it. But it would be a lot cleaner and less code to have the
    DECODE() to work. Thx!

    DECODE() is an Oracle function, not generic SQL. Q-of-Q is a
    very limited subset of SQL and lacks many functions and clauses
    available in standard SQL, especially what you may be used to using
    in your particular RDBMS.
    See
    Query
    of Queries user guide
    Phil

  • Report Developer Control Of Applying Hints to Analytics Queries

    There are numerous ways to apply hints to the queries generated by Analytics:
    - Table level
    - Join level
    - Evaluate calculation
    Each has its advantages and drawbacks.
    - Table level: applies the hint to every query that references the table.
    - Join level: applies the hint whenever the join is used in the query.
    - Evaluate: allows the report developer to include a hint, but can't control where Analytics decides to apply the hint.
    I propose another method for the report developer to apply hints, when needed, that uses join level hints. All the report developer
    does is add the hint column to the Answer or add a filter based on the hint column to the Answer to apply the hint.
    Setup
    NOTE: I suggest you do consistency checks along the way, especially before starting work in the next Layer, to be sure that all setup errors are resolved early.
    1) Start by defining a Logical SQL table in the Physical Layer using the following SQL: Select 1 Hint from dual
    2) Alias this table for each hint to be defined for report developer usage. As an example, alias the hint table, creating
    No Star and Parallel alias tables.
    3) Join each alias to the physical layer fact tables, using a complex join, where the hint could be applied. In the Join definition screen, put the hint in the HINT field and enter 1=1 for
    in the Expression section. Yes, we are creating a cartesian join between the hint and the other joining table. As the hint table always returns one and only one row, there
    is no effect on the rows returned by the query. For No Star, you
    put NO_STAR_TRANSFORMATION in the Hint field. For Parallel, you put PARALLEL(<physical table name>, default, default), where the physical table name
    is the name of the actual database table, not the name of the alias table (Analytics will put the alias in the place of the database table name
    when it generates the SQL). Additionally, for hints that have no parameters, you only need to join it
    to the Fact tables in a query and not necessarily the dimensions. If you include fields from multiple fact tables, the hint will be applied
    for each fact table. So, you may see the hint multiple times in the SQL (something like SELECT /*+ NO_STAR_TRANSFORMATION NO_STAR_TRANSFORMATION */ t00001.col1...)
    4) Add the hint alias tables to the BMM Layer.
    5) Rename the Hint field in each of the BMM hint tables to identify the hint being applied. For No Star, change the column name from Hint to No Star Hint. For Parallel,
    change the column name from Hint to Parallel Hint.
    6) Set the hint column as a key.
    7) Join the BMM hint tables to the appropriate fact tables, using a complex join.
    8) Define each hint table as a dimension.
    9) Set the Logical Level in the Content tab in each of the sources of the joined tables to use the Detail of the hint dimension.
    10) Create a folder in the Presentation Layer called Hints
    11) Place each BMM hint field into the Presentation Layer Hints folder.
    To apply a hint to your Answer, either add the Hint field to your Answer or create a filter where the Hint field is equal to/is in 1 (the number one). Check that the SQL generated
    contains the hint, in Answers, go into Administration, Session Manager, and view the log for the user (the user log level will need to have been set to 7 to see the SQL generated).
    Use of hints in more complex setups can be done by performing a setup of the hints that is parallel to the fact table setup. As an example, if you specify fragmentation content and a where
    clause in your BMM for your fact tables, you would setup parallel physical layer hint tables and joins, BMM objects and joins, fragmentation content, and where clauses based on the
    hint tables (only hint tables are referenced in the where clause).
    As any database person knows, hints can either help or degrade the performance of queries. So, taking the SQL of the pre-hint Answer and figuring out which hints give the best
    performance is suggested, prior to adding the hint fields/filters to the Answer.

    Hi Oliver,
    I would suggest you to have a look at the below WLST script which would give you the required report of the active threads and it would be send an email too.
    Topic: Sending Email Alert for Threads Pool Health Using WLST
    http://middlewaremagic.com/weblogic/?p=5433
    Topic: Sending Email Alert for Hogger Threads Count Using WLST
    http://middlewaremagic.com/weblogic/?p=5423
    Also you can use the below script in case of the stuck threads, this script would send you an email with the thread dumps during the issue occurred.
    Topic: Sending Email Alert For Stuck Threads With Thread Dumps
    http://middlewaremagic.com/weblogic/?p=5582
    Regards,
    Ravish Mody

  • I can not see the physical queries into NQQuery file

    Hi all,
    I have set the logging level for the Administrator to 4 but I can not see any query into NQuery.log file. I only can see the queries from the initialization blocks.
    Could someone please provide me some help on that?
    Thanks in advance!
    Víctor.

    Hi all,
    For all users information:
    In the repository OracleBIAnalyticsApps.rpd provided by BI Apps there is a system variable named LOGLEVEL. I have modified this variable to 7 value and then the physical queries are showed in the NQQuery.log file.
    Thanks to all for your inputs!!
    Víctor.

  • Manual refresh of queries in the Web

    Hello,
    in the web the default action following any change to the navigation state of the query-result is that an automatic refresh of the query is performed.
    We want to enter a series of navigation-steps. It would be inefficient for the query
    to automatically refresh each time a navigation-step was entered. Is it possible to halt the auto refresh from executing and instead switch to a manual refresh mode which means that the users can enter a series of navigation-steps and when they are ready, they simply press a refresh button?
    Thanks in advance!
    Regards,
    Birgit.

    Birgit,
    options could be ..
    1. Have the query automatically expand to a specific level for all queries...
    2. Have a prequery window where the selection parameters are specified and then let the user enter the drilldown level for the query and then take the values from this template and then pass the same to the main query as URL parameters .. you can refer the Web API 3.x to find out how to do the same and also search for Command Line URLs.. this option would require some innovative javascript and command Line specifications..
    Arun
    Assign points if useful

  • Nao quer carregar meu iphone

    preciso admitir , que porcaria que ficou o ios 7 , querem copiar , tao sem ideias , olha na boa , fikei com raiva , meu iphone como nao mostra mais que precisa de bateria como mostrava no ios 6 , esta na terceira vez que terei q mandar dar o choque , antes de estalar o ios 7 não dava este problema , espero que voces estejam muitissimos felizes com o transtorno que esta me causando i perca grande de dinheiro , desenbolsei uma grana alta para comprar o iphone 5 ávista , e quando pego depois que baixo esta porcaria de ios 7 , parabens , fizeram minha vida se fuder , comprei uma porcaria cara i que nao quer funcionar , olha APPLE  eu quero agradecer pela merda que estao fazendo a minha vida
    com atençao Rodolfo Santana , pensem um pouco , não sou apenas eu que esta com este problema , conseguirao fazer a maior cagada de vocês , parabens !!

    Boa noite amigo estou com o mesmo problema mei iphone 5s nao carrega e aparece a menssagem que o cabo nao pode ser original, como não a nao ser se a apple estiver mandando o carregador nao original tem 15 dias que comprei o meu e já esta com esse problema

  • Recopilatorio de Queries

    Hola buenas tardes.
    A modo granito de arena adjunto recopilatorio de queries que pueden serles de ayuda.
    No adjunto el autor de cada uno porque sería un trabajo minucioso. Si alguno de Ustedes quiere aportar algún otro sería estupendo.
    Gracias a todos! Un saludo.
    CLIENTES, TOTAL FACTURADO,IVA, GANACIA Y TOTAL FACTURADO.
    SELECT T0.CardCode, T0.CardName, Count(T0.DocNum)'NºDoctos', SUM(T0.DocTotal)'Total Facturas', SUM(T0.VatSum)'Total Impuesto', SUM(T0.DocTotal-T0.VatSum)'Total Base o neto', SUM(T0.GrosProfit)'Ganancia', SUM(T0.DocTotal-T0.PaidToDate)'Pendiente'
    FROM OINV T0
    WHERE T0.DocDate BETWEEN '[%0]' AND '[%1]'
    GROUP BY T0.CardCode, T0.CardName
    UNION
    SELECT T0.CardCode, T0.CardName, Count(T0.DocNum)'NºDoctos', -SUM(T0.DocTotal)'Total Facturas', -SUM(T0.VatSum)'Total Impuesto', -SUM(T0.DocTotal-T0.VatSum)'Total Base o neto', -SUM(T0.GrosProfit)'Ganancia', -SUM(T0.DocTotal-T0.PaidToDate)'Pendiente'
    FROM ORIN T0
    WHERE T0.DocDate BETWEEN '[%0]' AND '[%1]'
    GROUP BY T0.CardCode, T0.CardName
    PAGARÉS EN EL CAJÓN:
    SELECT T0.BoeStatus As "Status de efecto", T0.CardCode As "Código IC", T0.CardName As "Nombre de interlocutor comercial", T0.BoeNum As "Número de efecto", T0.BoeType As "Clase de efecto", T0.DueDate As "Vencimiento de efecto", T0.BoeSumSC As "Importe de efecto (MS)", T0.DpsBankCod As "Proyecto", T0.BPBankCod As "IC Código de banco", T0.BPBankNam As "IC Nombre de banco", T0.BPBankAct As "Cuenta bancaria IC", T0.BPBankBrnc As "IC Sucursal bancaria", T0.BPBankCtr As "IC País del banco", T0.ControlKey As "ID interna control bancos IC", T0.PayMethCod As "Total del documento sin IVA", T0.PymMethNam As "Saldo Haber", T0.AgentCode As "Código de agente" FROM OBOE T0 WHERE T0.BoeStatus = N'G'   ORDER BY T0.BoeStatus,T0.CardCode
    LISTADO DE INCIDENCIAS
    SELECT Num=T0.[ClgCode],Año=year(T0.[Recontact]),Mes=month(T0.[Recontact]) ,Fecha=T0.[Recontact], Hora=T0.[BeginTime],
    T3.[Name] as 'Tipo',
    T2.[Name]  as 'Asunto',
    T1.FirstName+' '+T1.LastName as 'Responsable',
    T0.[Details] as 'Comentarios', T0.[Notes] as 'Contenido', T0.[U_SEIAcInm] as 'Acción Inmediata', T0.[U_SEI_feAc] as 'Fecha Acción Inmediata', T0.[U_SEI_Resp] as 'Responsable Acción Inmediata', T0.[U_SEI_Desc] as 'Descripción Cierre', T0.[U_SEI_RespC] as 'Responsable Cierre',T0.[Closed] as 'Cerrado', T0.[CloseDate] 'Fecha Cierre Sistema' , U_SEI_fecc as' Fecha Cierre', T0.[U_SEICOST]  as 'Cost' FROM OCLG T0 LEFT JOIN OHEM T1 ON T0.AttendEmpl = T1.empID
    LEFT JOIN [dbo].[OCLS] T2  ON T2.[Code] = T0.[CntctSbjct] 
    LEFT JOIN [dbo].[OCLT] T3  ON T3.[Code] = T2.[Type]
    INCIDENCIAS SIN CERRAR:
    SELECT T0.[ClgCode], T0.[CardCode], T0.[Notes], T0.[Action], T0.[CntctType]
    FROM OCLG T0
    WHERE ISNULL(cast(T0.[Notes] as varchar(10)), '') <> '' and closed='N'
    QUE TRANSFERENCIA HEMOS RECIBIDO DEL CLIENTE Y EN QUE DIA:
    SELECT DISTINCT
    T1.DocDate,
    T0.CardCode,
    T0.CardName,
    T2.DocNum AS 'Inc Pay Nbr',
    T1.DocTotal AS 'Appl Amt'
    FROM OCRD T0
    LEFT OUTER JOIN ORCT T1
    ON T0.CardCode = T1.CardCode
    INNER JOIN ORCT T2
    ON T1.DocNum = T2.DocNum
    AND T2.TrsfrAcct IS NOT NULL
    WHERE
    T1.DocDate >= '[%0]'
    AND T1.DocDate <= '[%1]'
    ORDER BY
    T1.DocDate DESC,
    T0.CardCode,
    T0.CardName,
    T2.DocNum,
    T1.DocTotal
    FOR BROWSE
    ¿Cuánto DEBEN LOS CLIENTES Y EL TOTAL DE FACTURAS?:
    SELECT T0.[CardCode], T0.[CardName], T0.[Balance], T0.[OrdersBal],  T0.[DNotesBal], T0.[ChecksBal],
         'Pedidos'=(SELECT SUM(T10.DocTotal) FROM ORDR T10 WHERE T10.CardCode = T0.CardCode
         AND T10.DocDate BETWEEN '[%0]' AND '[%1]'),
         /* Trae la suma de total de documento de pedidos en rango de fechas*/
         'Facturas'=(SELECT SUM(T10.DocTotal) FROM OINV T10 WHERE T10.CardCode = T0.CardCode
         AND T10.DocDate BETWEEN '[%0]' AND '[%1]' AND T10.DocSubType NOT LIKE 'DN'),
         /*Trae  suma facturas en el rango de fechas*/
         'NC'=(SELECT SUM(T10.DocTotal) FROM ORPC T10 WHERE T10.CardCode = T0.CardCode AND T10.DocDate
         BETWEEN '[%0]' AND '[%1]'),
         'ND'=(SELECT SUM(T10.DocTotal) FROM OINV T10 WHERE T10.CardCode = T0.CardCode AND T10.DocDate
         BETWEEN '[%0]' AND '[%1]' AND T10.DocSubType LIKE 'DN')
    FROM OCRD T0
    WHERE T0.[CardType] LIKE 'C'
    TOP 10 CLIENTES:
    SELECT TOP 10 T0.CardCode, MAX(T0.Cardname) as Customer, SUM(T0.doctotal) as "Amount(LC)"
    FROM dbo.OINV T0
    WHERE t0.docdate BETWEEN [%0] AND [%1]
    GROUP BY T0.CardCode
    Order by SUM(T0.doctotal) DESC
    ALARMA STOCK AL MINIMO:
    SELECT T0.ItemCode, T0.ItemName, T0.OnHand, T0.SuppCatNum, T0.MinLevel
    FROM   OITM T0
    WHERE  MinLevel ! = 0 and OnHand < MinLevel
    ¿QUE HAY EN EL ALMACEN?
    SELECT T0.[WhsCode], T2.[WhsName], T0.[ItemCode], T1.[ItemName],
    ROUND(SUM(CASE M.InQty
              WHEN 0 THEN -1*M.CalcPrice*M.OutQty
              ELSE M.CalcPrice*M.InQty
    END),2) AS [Valor],
    (ISNULL(SUM(M.InQty)-SUM(M.OutQty),0)) AS [Stock]
    FROM OINM M
    INNER JOIN OITW T0 ON M.ItemCode=T0.ItemCode AND M.Warehouse=T0.WhsCode
    INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
    INNER JOIN OWHS T2 ON T0.WhsCode = T2.WhsCode
    WHERE M.DocDate <= '[%1]'
    GROUP BY T0.WhsCode, T2.WhsName, T0.ItemCode, T1.ItemName
    ORDER BY T0.[WhsCode], T0.[ItemCode]
    FACTURAS DE PROVEEDORES PAGADAS POR MES Y DIA EN TABLA CALENDARIO:
    SET LANGUAGE Spanish   
    DECLARE @TOP INT, @F_INI DATETIME, @F_FIN DATETIME, @COND_1 CHAR(1), @COND_2 CHAR(1) 
    SET @TOP=(SELECT TOP 1 A.TransId FROM [dbo].[JDT1] A WHERE A.RefDate>='[%0]' AND A.RefDate<='[%1]')   
    SET @F_INI='[%0]'   
    SET @F_FIN='[%1]' 
    SET @COND_1='N' 
    SET @COND_2='S' 
    SELECT DISTINCT B.DocDate AS DocDate, CONVERT(NVARCHAR, B.DocDate, 103) AS Fecha 
    INTO #FECHAS 
    FROM OVPM B 
    WHERE B.DocDate BETWEEN @F_INI AND @F_FIN   
    ORDER BY 1 
    DECLARE @pvt_table NVARCHAR(MAX)   
    SELECT @pvt_table = COALESCE(@pvt_table + ',[' + C.Fecha + ']', '[' + C.Fecha + ']')   
    FROM #FECHAS C 
    ORDER BY C.DocDate  
    DECLARE @Pvt NVARCHAR(MAX)   
    SET @Pvt =    
    N'   
    SELECT *   
    FROM ( 
    SELECT DISTINCT T0.CardCode AS CardCode, T0.CardName AS CardName, CONVERT(NVARCHAR, T0.DocDate, 103) AS Fecha, SUM(T0.DocTotal) AS Pagos 
    FROM OVPM T0 
    WHERE T0.DocDate BETWEEN (@INI) AND (@FIN) AND T0.Canceled=(@C_1) AND T0.DocType=(@C_2)
    GROUP BY T0.CardCode, T0.CardName, T0.DocDate    ) AS A  
         PIVOT (
      SUM(Pagos)
    FOR Fecha IN ('+ @pvt_table +')   
        ) AS Pvt
    ORDER BY 1,3
    EXEC sp_executesql @pvt, N'@pvt_table NVARCHAR(MAX), @INI DATETIME, @FIN DATETIME, @C_1 CHAR(1), @C_2 CHAR(1)',@pvt_table, @F_INI, @F_FIN, @COND_1, @COND_2 
    DROP TABLE #FECHAS
    VACACIONES (RESUMEN EMPLEADOS)
    SELECT T1.[empID], T1.[firstName], T1.[lastName], T0.[u_seiany], [Dias Pendientes]=SUM(T0.[U_Dias]) FROM HEM1 T0  INNER JOIN OHEM T1 ON T0.empID = T1.empID left JOIN [dbo].[@SEITIPVAC]  T2 ON T0.U_SEITIPO = T2.Code
    group by  T1.[empID], T1.[firstName], T1.[lastName],  T0.[u_seiany]
    RELACION MERMAS LOTE:
    SELECT  T3.Docentry, T0.DocLine, T1.*,
    --T0.ItemCode,T0.CardName,T0.ItemName ,T0.DocDate ,T0.DocType ,T0.DocNum as [Nº ALBARAN], T0.LocCode as [Cod. Almacén] ,t4.DistNumber as [Nº Lote], T1.Quantity,  SELECT T3.Docentry, T0.DocLine, T1.*,
    --T0.ItemCode,T0.CardName,T0.ItemName ,T0.DocDate ,T0.DocType ,T0.DocNum as [Nº ALBARAN], T0.LocCode as [Cod. Almacén] ,t4.DistNumber as [Nº Lote], T1.Quantity, T3.U_SEIECOE, T3.U_SEIECOC, T3.U_SEICALE, T3.U_SEITEOK,
    Tipo= CASE T0.[DocType]
    WHEN  '59 ' Then 'Entrada'
    WHEN  '15 ' Then 'Salida'
    Else 'Otros'
    End,T4. U_SEIM1 ,T4.U_SEIM2,U_SEIMerma
    FROM   OITL T0
              INNER JOIN [ITL1] T1  ON  T1.[LogEntry] = T0.[LogEntry] 
              INNER JOIN  OBTN T4 on T1.MdAbsEntry=T4.AbsEntry
                       INNER  JOIN DLN1 T3 ON T3.[DocEntry] = T0.Docentry and T0.DocLine=T3.Linenum
              WHERE isnull(U_SEIM1,0)+isnull(U_SEIM2,0)<>0 and T0.[DocType]='15'
              and YEAR(T3.Docdate)>'2013'
    LISTA DE FACTURAS QUE SE HAN PAGADO, COMO Y CUANDO:
    SELECT distinct
    T0.DocNum 'Factura',
    T0.DocStatus 'Estatus',
    T0.DocDate 'Fecha',
    T0.CardCode 'Cliente',
    T0.CardName 'Nombre',
    T0.DocCur 'Moneda',
    T0.DocTotal 'Total Factura',
    T0.PaidToDate 'Total Pagado',
    T1.SlpName 'Vendedor',
    T2.PymntGroup 'Cond. Pago',
    T0.DocTotalSy 'Total USD',
    T3.DocNum 'No.Doc. Pago',
    T3.CashSum 'Efectivo',
    T3.CreditSum 'T.Crédito',
    T3.CheckSum 'Cheque',
    T3.TrsfrSum 'Transf',
    T3.DocTotal, 'Total Pago',
    T3.DocDate 'Fecha Pago'
    FROM OINV T0
    INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode
    INNER JOIN OCTG T2 ON T0.GroupNum = T2.GroupNum
    INNER JOIN ORCT T3 ON T0.[ReceiptNum] = T3.DocNum
    INNER JOIN NNM1 T4 ON T3.Series = T4.Series
    INNER JOIN RCT2 T5 ON T3.DocEntry = T5.DocNum
    WHERE T0.DocDate <= '[%1]'
    AND T3.Canceled = 'N'
    ORDER BY T0.DocNum
    FACTURAS PROVEEDORES PROXIMAS A VENDER PARA EL CEO DE LA EMPRESA:
    SELECT T0.DocNum AS 'Factura', T0.DocDueDate AS 'Fecha de vencimiento', T0.CardCode AS 'Código cliente',
    T0.CardName AS 'Nombre'
    FROM OPCH T0
    WHERE DATEDIFF (DD, T0.DocDueDate, GETDATE( )) BETWEEN -7 AND 365
    AND T0.DocStatus = 'O'
    ORDER BY T0.DocDueDate
    FOR BROWSE
    PARA SABER QUE PRODUCTOS ESTAN EN NEGATIVO EN LOS ALMACENES:
    SELECT T0.ItemCode AS 'Código', T1.ItemName AS 'Descripción', T0.WhsCode AS 'Almacen',
    T0.OnHand AS 'Cantidad', T1.OnHand AS 'Disponible total'
    FROM OITW T0
    LEFT OUTER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
    WHERE T0.OnHand < 0
    FOR BROWSE
    PARA SABER DE QUE ARTICULOS TENGO MINIMOS Y HAY QUE COMPRAR:
    SELECT
    T0.CardCode AS 'Pref Vend',
    T2.CardName AS 'Pref Vend Name',
    T0.ItemCode AS 'Item Code',
    T0.ItemName AS 'Item Description',
    T1.ItmsGrpNam AS 'Item Group',
    T0.LeadTime AS 'Lead',
    CASE
    WHEN T0.MinLevel - (T0.OnHand + T0.OnOrder - T0.IsCommited) > T0.MinOrdrQty
    THEN T0.MinLevel - (T0.OnHand + T0.OnOrder - T0.IsCommited)
    WHEN T0.MinLevel - (T0.OnHand + T0.OnOrder - T0.IsCommited) < T0.MinOrdrQty
    THEN T0.MinOrdrQty
    END AS 'To Purch',
    T0.MinOrdrQty AS 'Min Ord',
    T0.DfltWH AS 'Whs',
    T0.MinLevel AS 'Min Inv',
    T0.PrchseItem AS 'Buy',
    T0.OnHand AS 'On Hand',
    T0.OnOrder AS 'On Order',
    T0.IsCommited AS 'Committed'
    FROM OITM T0
    LEFT OUTER JOIN OITB T1
    ON T0.ItmsGrpCod = T1.ItmsGrpCod
    LEFT OUTER JOIN OCRD T2
    ON T0.CardCode = T2.CardCode
    WHERE
    T0.InvntItem = 'Y'
    AND T0.PrchseItem = 'Y'
    AND T0.MinLevel - (T0.OnHand + T0.OnOrder - T0.IsCommited) > 0
    AND T0.ItmsGrpCod <> 108
    ORDER BY
    T2.CardCode,
    T0.ItemCode
    FOR BROWSE

    Excelente aporte, gracias por compartir.
    Salu2
    César

  • Problem with Join Queries using PHP and an Orcale Database

    Ok, I am trying to build a simple php querying tool for my oracle database and for the most part it is working however I am having a problem getting data from my join queries. If I run the following query :
    QUERY:
    SELECT lastfirst,EnteredBy,Debit FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    Lastfirst     EnteredBy     Debit
    caiu, test      204     1
    But when I run the query correctly I get no results
    QUERY:
    SELECT sts.lastfirst,gl.EnteredBy,gl.Debit FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    sts.lastfirst     gl.EnteredBy     gl.Debit
    and if I run the query combining the two above methods and adding a field (schoolid) that has the same name on both table I get the following result sets
    QUERY:
    SELECT lastfirst,EnteredBy,Debit,sts.schoolid FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    lastfirst     EnteredBy     Debit     sts.schoolid
    caiu, test      204     1     
    QUERY:
    SELECT lastfirst,EnteredBy,Debit,schoolid FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    NONE
    Therefore, I have to have something written incorrectly in my php code and I just can not figure it out. My entire code is pasted below please provide me with an assistance you might have to offer. I have change the odbc_connec line so I could post it to this forum. In addition, I had to phrase out the column headers there for when you write the column headers you have to use ~ instead of , as the separator and then I turn back into the correct format for sql.
    //These scripts just open help windows if somone clicks on the icon
    <script>
    function submit()
    {document.sqlform.submit();}
    </script>
    <script>
    function colwin(){
    window.open("colnames.php",null,"height=300,width=400,scrollbars=1");}
    </script>
    <script>
    function tabwin(){
    window.open("tablenames.php",null,"height=300,width=400,scrollbars=1");}
    </script>
    <script>
    function help(){
    window.open("http://www.w3schools.com/sql/default.asp",null,"height=500,width=700,scrollbars=1");}
    </script>
    <form method="post" action="<?php echo $PHP_SELF;?>" name="sqlform">
    <?php
    //Cookie to check for authorization to the site
    if($_COOKIE['cookie']=="CheckCookieForAuth")
    //These get the values of the textareas after the form has been submitted
    $sqlSELECT = $_POST["SELECT"];
    $sqlFROM = $_POST["FROM"];
    $sqlJOIN = $_POST["JOIN"];
    $sqlWHERE = $_POST["WHERE"];
    $sqlOTHER = $_POST["OTHER"];
    $sqlSELECTTYPE = $_POST["SELECTTYPE"];
    //This is the variable used to parse out my headers the user entered
    $sqlColNames = split('~',$sqlSELECT);
    //This converts the ~ separator to , so I can actually use it as part of my sql string
    $search = array('~');
    $replace = array(',');
    $mystring = $sqlSELECT;
    $sqlString = str_replace($search, $replace, $mystring);
    //These are the textareas and the drop down options that the end users has to create queries
    echo "<table border=0>";
    echo "<tr><td valign='top'>";
    echo "<B>SELECT TYPE</B> <BR><SELECT NAME=SELECTTYPE>
    <OPTION VALUE='SELECT' SELECTED>SELECT</OPTION>
    <OPTION VALUE='SELECT DISTINCT'>SELECT DISTINCT</OPTION>
    <OPTION VALUE='INSERT'>INSERT</OPTION>
    <OPTION VALUE='UPDATE'>UPDATE</OPTION>
    <OPTION VALUE='DELETE'>DELETE</OPTION>
    </SELECT>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=SELECT wrap=physical>$sqlSELECT</textarea>";
    echo "</td><td valign='top'>";
    echo "<img src='images/sqlC.jpg' width='25' height='25' onclick='colwin()'>";
    echo "</td></tr>";
    echo "<tr><td valign='top'>";
    echo "<b>FROM</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=FROM wrap=physical>$sqlFROM</textarea>";
    echo "</td><td valign='top'>";
    echo "<img src='images/sqlT.jpg' width='25' height='25' border=0 onclick='tabwin()'>";
    echo "</td></tr>";
    echo "<tr><td valign='top'>";
    echo "<b>JOIN</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=JOIN wrap=physical>$sqlJOIN</textarea>";
    echo "</td></tr>";
    echo "<tr><td valign='top'>";
    echo "<b>WHERE</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=WHERE wrap=physical>$sqlWHERE</textarea>";
    echo "</td></tr>";
    //This is where the end user would enter group by, having, order by, etc..
    echo "<tr><td valign='top'>";
    echo "<b>OTHER</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=OTHER wrap=physical>$sqlOTHER</textarea>";
    echo "</td></tr>";
    This is a run query icon and a help icon
    echo "<tr><td colspan=2 align=right>";
    echo "<img src='images/RunQuery.jpg' width='30' height='28' onclick='submit()'> <img src='images/qm.jpg' border=0 width='25' height='25' onclick='help()'>";
    echo "</td></tr></table>";
    echo "<br>";
    echo "<br>";
    //This is where I connect to my remote oracle database
         $conn=odbc_connect('ODBC_ConnectionName','USERNAME','PASSWORD');
    //This is the sql string created by the end users
         $sql="$sqlSELECTTYPE $sqlString FROM $sqlFROM $sqlJOIN $sqlWHERE $sqlOTHER";
    //This executes the connection string and the sql string
         $rs=odbc_exec($conn,$sql);
    //This will display the query or a message if the query is empty
         if($rs!=NULL){
         echo "<table border=1>";
         echo "<tr>";
    //This loops through the string array the end user enter the field name text area to get column headers
         for($i=0; $i<count($sqlColNames); $i++)
         echo "<td>";
         print_r($sqlColNames[$i]);
         echo "</td>";
         echo "</tr><tr>";
    //This actually fetchs the rows from the statement and then display the data based on the column names the end user speificed
         while (odbc_fetch_row($rs))
              for($i=0; $i<count($sqlColNames); $i++)
                   $results=odbc_result($rs,$sqlColNames[$i]);
                   echo "<td>$results</td>";
              echo "</tr>";
         odbc_close($conn);
         echo "</table>";}else{echo "Results will be displayed here";}
    echo "<br><br>";
    echo $sql;
    else
    echo "Not logged in";
    ?>
    </form>

    This looks more like a SQL question than a PHP issue. There are a couple of JOIN examples at http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#i2066611 that might you work through the problem.

  • How to create a verification pop-up message for queries executed on Web

    I have implemented the function RRMS_MESSAGE_HANDLING in my customer exit variable code for step 2  in the customer include ZXRSRU01.  I am able to get warning and error messages to appear in Bex Excel queries, but not queries executed on the Web.  I have also tried implementing these queries in a Web Template which allows system messages and warning messages, but still these messages are suppressed.
    Is anyone aware of how to create warning messages that appear both in Bex Excel and Bex Web queries?
    Thanks for you help,
    Curt Timmerman

    On the Comments screen, just select the notes tool to add the note. When you are done, click to close the note.

  • Service desk: Hide links (queries) in the work center view

    Hi,
    we are using the service desk towards our customers.
    Basically we have to sets of roles: one for consultants (ourselves) and one for our customers.
    Our customers are entering the service desk through a web-interface.
    If the consultants enters the web-interface, they can see reports and queries to the left, and they can open and edit tickets.
    If the customers enters the web-interface, they cannot see queries and reports in the left navigation bar, and they can not open and edit tickets.
    Now we need a third possibility:
    A customer need to open and edit tickets, but they should not be allowed to define (or even execute) queries.
    Because when they can define queries, they get access to see all other customers tickets. And that is not good.
    How to obtain this?
    Thanks a lot in advance.
    / peter

    Based on your comments, I take it that you may not implementing a formal first level support who can perform these tasks as recommended by solman standard. If you are, your customer can request reassignment using their reply option, and the support tech performs the task. You can implement some sort of email notification process to inform the new BP.
    Alternatively, I can suggest two modifications if you have a developer at your disposal:
    1) in your solution manager system, clone the incident create web dynpro to ensure population of the required fields to the customer and to suit your requirement. Here you can also remove the SU15 text id checks.
    2) in your satellite system, modify the function group which triggers the create incident process and have it launch the cloned web dynpro above.
    My apologies, I don't have access to a solman system immediately to give you the exact object names for the above suggestions.
    Cheers,
    P

Maybe you are looking for

  • SAP R/3 Problem

    I need some detail solutions and suggests about below these problems [SAP R/3] : Problem 4: Problems in the installation of SAP R/3 Server • Problem 4.1: Computer Name of the SAP R/3 server has been changed after the full installation of Oracle 9i an

  • How to import MP3 with file name into library, rather than tag?

    I've been given a CD with about 200 MP3s of lectures. They are to be listened to in order, and the file names reflect the order number, like "lecture 1", "lecture 2", etc. However, when I drag them all into iTunes, the names in the iTunes library don

  • Wifi keeps cutting out after updating to 5.1

    Hey everyone, just wanted to ask if this was a common problem. I updated to iOS 5.1 the day it got released and quickly realised that my wifi kept cutting out, usually after I had locked the phone and started using it again. I didn't think much of it

  • My iPad air keeps turning itself off,why?

    My iPad air -purchased Oct 13 keeps turning itself off. Software updated. Can take up to 2 hours to turn on again. Anyone know why?

  • Solution to photo imports into IDVD

    Much discussion months ago about the poor quality of photos imported into iMovie then exported to DVD. Software "Photo to Movie" by LQ Graphics that does a beautiful job of setting up your photos then render them to full quality QT. From there, impor