Link between queries

I have 2 cursor queries:
<dataQuery>
     <sqlStatement name="Q_1"><![CDATA[
          select XX_PACKAGE_PKG.Header_Data (:p_invoice_num_from, :p_invoice_num_to, :p_invoice_date_from, :p_invoice_date_to, :p_customer_name) from dual
          ]]>
</sqlStatement>
     <sqlStatement name="Q_2"><![CDATA[
          select XX_PACKAGE_PKG.Lines_Data(:CUSTOMER_TRX_ID) from dual
          ]]>
</sqlStatement>
</dataQuery>
First statement returning customer_trx_id which is parameter in second statement.
In data output I have always the same lines for every invoice.
To function XX_PACKAGE_PKG.Lines_Data always is setting customer_trx_id from first printing invoice.
I don't now why this run in this way.
Thanks for any help.
MS

I believe Q_1 returns only one column CUSTOMER_TRX_ID.
You can try having an alias for the column like
select XX_PACKAGE_PKG.Header_Data (:p_invoice_num_from, :p_invoice_num_to, :p_invoice_date_from, :p_invoice_date_to, :p_customer_name) CUSTOMER_TRX_ID
from dual

Similar Messages

  • Link between queries and roles

    Hello,
    Could someone tell me if there is a way to have an overview on the link between roles and queries?
    For example a table which give us a role and the liste of queries which are linked to this role.
    Thanks in advance.
    Hicham

    Hi,
    I also had same query :
    mapping between the query/report and the role with technical names - BI Sec
    Its a bit tricky.
    Actually there are no direct linkage between queries and roles. However, you can look up S_RS_COMP in the roles that will help you identify which all queries the role gives access to.
    Regards,
    Zaheer
    Edited by: Zaheer on Aug 28, 2008 4:19 PM

  • 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 find the link between strcture and query technical name

    Hi Guru's
    How to find the link between Strcture in the query and query technical name. In other way where used list of the structure  used in queries?
    I know we have table called RSZELTDIR which have the values of strcuture name. from here i do not find any link to query technical name.
    Please can anyone help me?
    Regards,
    Sirisha

    Hi ,
    For structure and query relationship, the structure has to be a reusable structure( a global one). Then you can right click in on the structure name (in BEX query designer) and select the where used list. You will find all the query names where it is being used.
    U can also check out tables RSRREPDIR and RSZCOMPDIR for other query properties.
    Thanks,
    Amit

  • Link between reports and universes and universe name change

    I want to change a universe name.
    What is the impact on my WebI reports and DeskI reports ?
    Is it risky ? Will the link between reports and universes be saved ?
    Does someone know how the link between reports and universes works for WebI reports and DeskI reports ?
    Thanks

    Hello Umberto,
    I recommend to post this query to the [WEBI|SAP BusinessObjects Web Intelligence; and [DESKI|SAP BusinessObjects Desktop Intelligence; forums.
    These forums are monitored by qualified technicians and you will get a faster response there.
    Also, all Webi and Deski queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • DB LINK between XE and 11g instances

    Hello ,
    I am facing the following problem.
    I have 3 databases instances on 3 servers on is Xe,the second is 10 R2 and
    the third instance is 11g.
    I have create db link between Xe and 10g and vice-versa (10g and Xe)
    the db links in the two senses are working fine.
    But i could not create db link between xe and 11g nor between 11g and Xe.
    I will give some detail
    On Xe dblink pointing to 11g , when accessed give the message :
    "ORA-01017 : Invalid username/password;logon denied ORA-02063 preceding db11g"
    i am sure that user name and password i give in db link creation are correct and tried it many times.
    From the other side
    On 11g dblink pointing to Xe instance when ,accessed give the folowing result :
    i could access some table (select * from t1@dbxe)
    but some times i got message : "Internal server Error" for the same select on the same table.
    When i try to access fonction f1 on dbxe from 11g instace , i got the message
    "ORA-04052 : Error when quering remote object f1@dbxe ORA-00604.."
    Does any body have some idea about the issue ?
    thanks in advance.

    Is your 11g database configured to use case-sensitive passwords? If so, are you specifying a case-sensitive (quoted) password in the creation of your database link?
    Joel

  • Delete the link between the BEx Query and workbook

    Hi Experts,
    I have a workbook it contains 6 querirs, now i want to delete both.
    insteated of delete the first queries in workbook, i deleted directly workbook.
    now its not allowing me to delete queries.
    i think internally it will maintain a link in some table and there was a programme to delete that link between the queries and workbooks.
    Please let me know the programme name which we can delete the links between the queries and workbooks.
    Thanks,
    Babu

    Before even going for changing the table entries.
    You can go to query and do "Where used" list if it refers only to the same workbook(which you deleted) then it may be inconsistency.
    But the chances are the query is used in workbook or WAD etc and is present in someone else's favorites so that would make the workbook void.

  • Link between Delivery and Sales Order Schedule Line

    Hi Gurus,
    I have a requirement in which i need to display quantity and amount at schedule line level and also the delivery and delivery item for each schedule line.
    For example, if there is a sales order O1 and item 10 for which we have 3 schedule lines and 3 deliveries as well say D1, D2 and D3.
    Report should be something like this
    Sales Order    Item   Schedule Line    Delivery    Del Item   Confirmed Order Qty
    O1                 10      1                       D1           10            5
    O1                 10       2                      D2            10            5
    O1                 10       3                      D3            10            4
    How can i determine that a particular delivery corresponds to which schedule line of that saler order-item?
    We have the link between delivery and sales order but is there any way that we can get the link of delivery at schedule line level?
    Please help.
    Regards,
    Gaurav

    Hi,
    I suppose you must check with SD functional consultant and the post should also be in the logistics SD forum and not BI. But I suppose there is know specific link between the schedule line of SO to the Delivery. It is more like a bucket flow for ex.
    Sale order   Item    Schedule line  qty
    SO1            Item1     Sch1            10
    SO2            Item1      Sch2           10
    Delivery Item QTy
    DO1       IT1   15
    DO2       IT1    5
    In this case qty 15 is distributed over both SO1 and SO2, and SO2 ITem1 Sch2 has link to both the DOs
    So I am not sure if you can establish a one to one link, please check with your SD consultants.
    Regards,
    Ashwin G

  • Is there a DIRECT link between SD schedule lines and delivery lines?

    Is there a direct link (db table) between schedule lines on a sales order (VBEP) and the delivery lines (LIPS)? 
    Is there a function module to retrieve the data?
    Example-
    One order line with 3 schedule lines.
    Each schedule line is for 2 units (total of 6 units).
    Three deliveries made.  1st is for 2 units, 2nd is for 1 unit (backorder), 3rd is for 3 units.
    You can use document flow (table VBFA) or examine the SD document in the delivery line (LIPS) and link the delivery line to the order line.  The schedule line already references the order line.
    I am using math to decrement the schedule lines used and make the link between VBEP and LIPS.  It works fine.  I need four records back....
    1st schedule line for 2 units uses delivery 123
    2nd schedule line for 1 unit (partial) uses delivery 124
    2nd schedule line for 1 unit (partial) uses delivery 125
    3rd schedule line for 2 units uses delivery 125
    Like I said, it works. Just wondering if I missed a more direct link.

    As far as Db link is concern , I don’t remember exactly , but 3 years before I had written a report which see Sales order schedule lines and devilry note lines against sales order.  If you see process wise…. when ever you create PO ( production order you assign some qty using 101 movement type .. and against production order you also give sales order . When you do delivery ( run seclude run ) it delivers against that material number , its movement is 601 ...
    but I remember there’s a link between these tables, VBAP,VBFA AND VBEP , LIPS ...  against every sales order you can see sales invoice ( VBRP,VBRK) and you can also see your delivery note number in document flow .
    I hope this’ll give you some guide line, as right now I can not tell you the exact business process but I remember I written a report in SD 4 years before , in which they required Delivery against production order and sales order ... One more thing you also have production order reference on delivery item number. ( field :Empst ) . I think in my project they were maintaining this field .
    Thanks

  • Change or delete the docflow link between two existing documents

    Hi All,
    Is there any FM or soulution to change the doc flow link between two documents .
    For ex .. i have document A and document B , and created a doc flow link from A to B , Now i have to change the succeeding document  to C
    I have tried to modify the doc link ,but its not working using crm_order_maintain.I thought of deleting the link between A and B and then create a new link Between A and C , but deletion of link bewteen A and B is also not working.
    I have checked with FMs CRM_DOC_FLOW_DELETE_CHECK_EC and CRM_DOC_FLOW_DELETE_EC, followed by CRM_ORDER_SAVE AND COMMIT . i could not find any exception from this FMs , but still the doc link is not deleted.
    Pls share if you have any suggestions.
    Regards,
    Nithish

    Hello
    I wrote a report to delink items from document flow. I uploaded it [here|http://wiki.sdn.sap.com/wiki/display/CRM/Removelinksfromdocumentflow].
    Please, use with caution and always perform careful tests before you run it in a production envinronment.
    Hope it helps
    Joaquin
    Edited by: Joaquin Fornas on Nov 15, 2011 11:49 AM

  • How can i create link between ipad(xcode) and webserver?

    Hi, I'm a new to iPad development and i need help,
    i'm not good with english but i try to explain my question:
    how can i create link between ipad(xcode) and webserver?
    (the webserver ".NET" with driver odbc is connected with DB Oracle)
    so, how can my ipad application access to the Oracle DB?
    Create a webservice (.NET) to be place between iPad and DB, is this correct?
    how can i do it?
    which are libraries to include in the xcode's framework?
    thx

    I think the following URL will be your best answer:
    http://stackoverflow.com/questions/3510468/connecting-iphone-to-an-odbc-database

  • Link between Invoice and Payments

    As I understand the link between the A/R Invoice table and the Incoming Payment table is OINV.ReceiptNum = ORCT.DocEntry. My question is when does the ReceiptNum field get filled in? We have many closed Invoices that have a payment linked (viewed by going to Applied Transactions when on the Invoice) but the ReceiptNum field is still NULL in the database. Shouldn't these invoices all have a linked payment if they are closed?
    Regards,
    Jeremy

    Hi Steven,
    The reciptnum field is populated when the payment is created and the Invoice is a part of that payment. If you do a manual reconciliation this field is not populated.
    Open the payments that you see in Applied transactions to see if the Invoices are in the rows.
    Hope it helps,
    Jesper

  • One to One link between VBRP items and BSEG items

    Hi All,
    I am working on a program where I have to link between VBRP table items against BSEG table items.
    But in BSEG, the invoice items are summarised based on Material Number, profit center etc..
    Is there a way to divide them, like any other table which holds the data transferred to accounting from sales exactly as it is in the invoice tables (VBRP).
    If there is no such table, can any one help me figure out a logic where I can didvide the items of BSEG table exactly like the items of table  VBRP.
    Any help or input will be very highly appreciated.
    Thanks in advance
    Phani

    Thanks for the Replies Ramani and Monika...
    I alraedy have a relation between the Accounting Doc and Billing Doc (VBRP-vbeln to BSEG-belnr).
    what I am looking for is the Item wise one to one mapping.
    i.e  Assume that we have 4 items in VBRP under one Billing Doc....
    2 items have Similar Materials (Assume XYZ) and same Profit center (eq..MNO123)
    and the Other 2 items have material (ABC) and Profit center (PQR6789).
    Now these appear in Bseg as only 2 items, all the items with similar materials, profit center etc will be clubbed in Bseg (While Accounting). I.e In BSEG you will only find 2 entries for the above 4 items of VBRP.
    I need to divide the data that I am getting from BSEG exactly as they are in VBRP.
    Pls suggest if you know of any table where I can find this.....If not a table.., then a way to figure out the division of these BSEG items exactly as the VBRP items.
    Brgds
    Phani

  • FAX Sending - Link between SOST items and PO Data

    Hi all,
    We have a message type to send FAX to the vendors.
    This is tracked in SOST.
    There are some FAXes which get failed and are to be tracked individually in SOST.
    We need to make a report which gets all the failed PO #s.
    We are not able to arrive at the db link between the items in SOST and the PO data.
    Can anyone of you let us know how this can be done ?
    Thanks in advance.
    Regards,
    Vivek K

    Thanks for the Replies Ramani and Monika...
    I alraedy have a relation between the Accounting Doc and Billing Doc (VBRP-vbeln to BSEG-belnr).
    what I am looking for is the Item wise one to one mapping.
    i.e  Assume that we have 4 items in VBRP under one Billing Doc....
    2 items have Similar Materials (Assume XYZ) and same Profit center (eq..MNO123)
    and the Other 2 items have material (ABC) and Profit center (PQR6789).
    Now these appear in Bseg as only 2 items, all the items with similar materials, profit center etc will be clubbed in Bseg (While Accounting). I.e In BSEG you will only find 2 entries for the above 4 items of VBRP.
    I need to divide the data that I am getting from BSEG exactly as they are in VBRP.
    Pls suggest if you know of any table where I can find this.....If not a table.., then a way to figure out the division of these BSEG items exactly as the VBRP items.
    Brgds
    Phani

  • Link between Material Document number & Accounting document number

    Hi All,
    For material document there is a corresponding accounting document number generated.However this is not the rule in all cases.
    Where is the link between the two(Material Document & Accounting Document) ?
    In other words i want to list those material documents only, for which accounting documents are generated.
    Regards
    Piyush Kothari

    STEP 1
    SAP query way to extract your information.
    Create an infoset SQ02 with a single table MKPF. (include key fields in the field group)
    Step 2
    From Extras
    Create an additional field called zawkey (like bkpf-belnr) which will concatenate the MM document number MKPF-MBLNR and MKPF_MJAHR. The sequencing shall be number 1.
    You may use this code below and paste also (this needs authorization as well)
    data: zzawkey like bkpf-awkey.
    clear: zawkey, zzawkey.
    concatenate mkpf-mblnr mkpf-mjahr into zzawkey.
    zawkey = zzawkey.
    Add another field called ACCDOCNO (accounting documnet number) with sequencing number 2 with following code.
    data: zaccdocno like bkpf-belnr..
    clear: zaccdocno, accdocno.
    select belnr from bkpf into zaccdocno where
      bukrs = ccode and
      GJAHR = MKPF-MJAHR and
      awkey = zawkey.
    endselect.
    accdocno = zaccdocno.
    Step 3
    Include the additional fields  into the field group.
    Step 4
    Click on the selection tab and create a parameter called ccode with a description Company Code and  against
    LIKE    BKPF-BUKRS 
    Extras  OBLIGATORY 
    Step 5
    Click on the selection tab and create a seelction criteria pdate with a description Posting Date for the field MKPF-BUDAT
    Extras  OBLIGATORY 
    Step 6
    Save, Generate and assign the infoset to a user group.
    Step 6
    Create a SQ01 query under the usergroup with all the fields in the infoset. and Execute. Enter a company code and one date of a working day where you expect material transactions.
    The result will be all the material documents and their corresponding accounting documents, if available. If you want to see only those material document that do not have corrsponding accounting documnet, then while you are in the selection screen say accounting document number is not equal to blank.

Maybe you are looking for

  • Powermac G5 won't boot - but safe mode works fine!!!

    [The computer described below is a Powermac G5 dual core 2.7gHz, purchased in late 2005, running OS X 10.4.11] Here's an odd thing... a few months back, my powermac stopped booting. It wasn't a power supply issue. I would get the white screen with th

  • Password Self-Service for AE 2.1

    Does anyone know how to setup employee self services for password resets in Access Enforcer 2.1? I know how to navigate to that selection, but I am not sure what value to add in the required fields? Anyone have any ideas? I had a document from SAP an

  • Adobe Software keeps "not responding"

    Hello, Within the past 2 months all of my Adobe software keeps going into "not responding" mode. This happens daily with ALL of my design software. Illustrator, InDesign and Photoshop. Sometimes it happens multiple times in an hour. I try and save of

  • Enregistrer des valeurs dans un tableau

    Bonjour J'utilise LabView 2011 et je souhaite enregistrer les valeurs que me retourne mon codeur incrémental dans un tableau, qui ensuite les affiche sur un graphe. Comme ca ne marchait pas, je me suis aidé de l'aide labview : J'ai donc défini une ta

  • No audio on fast forward or frame-by-frame

    I accidentally pushed some button combination that caused FCP to go into this mode where there's no sound any time I fast forward, reverse faster than 1x speed, or shuffle through a clip frame by frame. Before I could hear the sound while doing all o