About the fetching the data

Here is the requirement for a new Z report that lists customer addresses in an ALV display for customers with activity over a certain period. 
Use database table VBRK - the billing document header and customer master table KNA1.
1.            Selection on sales org.  VBRK-VKORG
2.            Selection on activity period based on Billing Date VBRK-FKDAT
3.            Selection on the payer customer  VBRK-KUNRG
4.            List u2013 Customer number,
                           country,
                           Name 1,
                           Name 2,
                           Street ,
                           Postal Code
                           city,
                           Region,
           PO Box,
           PO box postal code
                          last activity date ( last VBRK-FKDAT value fetched from VBRK selection )
So for each customer on the selection screen , there will be 1 record in the output.
  how ot read the data... from this table....

Hi ,
The tables VBRK and KNA1 are linked using the field :
VBRK-KNKLI   = KNA1-KUNNR.
Make inner join on those two tables and get the values u need. In the inner join put where as :
SELECT a~<field name>
             a~<field name>
             b~<field name>
             b~<field name>
INTO CORRESPONDING FIELDS OF TABLE <internal table name>
FROM VBRK AS a INNER JOIN KNA1 AS b
ON aKNKLI = bKUNNR
WHERE <condition>.
Regards,
Raghu

Similar Messages

  • On my iPod touch I can't get the fetch new data to open my e-mails, On my iPod touch I can't get the fetch new data to open my e-mails

    iPod touch 4th generation

    Has it ever worked?    If it has worked and stopped could be a memory issue that would be fixed with a restart/reset? Is it hanging on one particular item? 
    http://support.apple.com/kb/HT1430

  • Update the fetched/uploaded doc?

    Hello,
    My requirement is as follows (i have to develop a report/prog./FM to meet the following functionality),
    1) MicroSoft word documents are available in the LAN, say, my_ms_word_doc
    2) I need fetch my_ms_word_doc and add some text (at a fixed position in my_ms_word_doc), text/value/data will be pulled from SAP data base
    3) after the 2nd step, send (updated) my_ms_word_doc to outlook email inbox
    or we can convert my_ms_word_doc into a PDF doc and send this converted PDF to outlook inbox.
    Here, main point is UPDATing the fetched the my_ms_word_doc
    Pls. let me know How can i get achieved this requirement?
    Thank you

    Thank you.
    Actually, fetching the MS Word from LAN  - i knew it
    Sending the doc (MS Word or PDF)  - i knew it
    If required converting the MS Word to PDF - i knew it
    The chanllenge is UPDATING/CHANGING the doc data
    Any additional inputs pls?

  • Fetch New Data shows two entries for one account

    I have on a variety of accounts on my iPhone and my iPad: an iCloud, an Exchange, a IMAP, and a couple of Gmail accounts.
    Earlier this week, I noticed that in the "Fetch New Data" setting (Settings > Mail, Contacts, Calendar > Fetch New Data), there are TWO entries for one of the Gmail accounts.
    One entry lists "Mail and Calendars." I use this for this particular Gmail account. I have these selected in the "Accounts" section of Settings > Mail, Contacts, Calendar.
    The other entry lists "Contacts and Calendars." I don't sync Contacts, but I do sync Calendars. Why is it listed twice?
    I tried deleting
    the offending Gmail account, but it did not delete the duplicate entries.
    erasing all settings
    all of my accounts, including iCloud, IMAP, and other accounts.
    The ghost account is still there, fetching calendars and contacts.
    Has anyone else seen this behavior?
    I considered erasing settings and content, but that seems pretty extreme for something that might not be that big of an issue.

    Exact same problem here!!! Iphone 5s with IOS 7.0.3, using Gmail among other email providers.
    So it is definately a bug - the "fetch new data ghost account". I hope it will be solved in a newer release. In the meantime, I switched the ghost account to "manual" so it shouldn't interfere...

  • Individual settings under "Fetch New Data" not working

    Hi.
    I'm having problems getting the individual push/fetch/manual settings to work. Here's the scenario.
    I have three mail accounts set up on my iPhone 3G. They are "MobileMe," "GMail" and "Work."
    I go to "Settings" -> "Fetch New Data" and turn "Push" OFF. I then go to "Advanced" at the bottom and set "MobileMe (Mail)" to PUSH. I thought this would enable PUSH on my MobileMe account while keeping it disabled on the other accounts.
    However, my iPhone still won't get new mail automatically.
    What am I doing wrong?

    One thing to try that might help.
    If you turn push off in the fetch new data screen, then it is a global effect for all accounts.
    In advanced is how you want the accounts to behave.
    So, if you turn push off in the 1st screen, then go to advanced and set mobileme to push, push is still off until you go back to the first screen and turn it back on.
    Here is an article from the apple support website that might help out.
    http://support.apple.com/kb/HT2625
    Hope this helps.

  • Fetch Rx Data questions

    The Fetch Rx Data vi contained in the Rx Streaming (Host) example doesn't seem to want to time out for me.  When a data underflow occurs, instead of timing out and giving up (per the documentation), it just locks up whatever loop it's in until the application is restarted.  Is there a way to modify this vi to prevent it from stalling my RX loop?
    If I drill down to the Fetch Rx Data (U32) vi, I can see that the Timeout method in the Invoke function is grayed out.  Is that significant? 
    Thanks.

    Thanks for the suggestion.  I see now that the timeout does actually do something.  Just not what I want it to do. 
    If I don't wire the Timeout input and then I stop the FIFO data, it stalls the loop while it's waiting for more  data.  If I feed it more data then it's happy and the loop iterates.  If I wait until it times out (10 seconds by default) the loop stays locked up for good.  If I stop the application I get no error, but if I stop just the loop it throws a -50400 at me.
    If I wire a 0 to the timeout it doesn't work at all because there are gaps in my FIFO data (the FPGA won't send any unless it's triggered).
    So I guess my question becomes this: does anyone know of a way to poll the DMA FIFO status so that I can execute Fetch RX Data conditionally?
    Thanks again.

  • Report is not fetching the data from Aggregate..

    Hi All,
    I am  facing the problem  in aggregates..
    For example when i  am running the report using Tcode RSRT2, the BW report is not fetching the data from Aggregates.. instead going into the aggregate it is scanning whole cube Data....
    FYI.. Checked the characteristcis is exactely matching with aggregates..
    and also it is giving the  message as:
    <b>Characteristic 0G_CWWPTY is compressed but is not in the aggregate/query</b>
    Can some body explain me about this error message.. pls let me know solution asap..
    Thankyou in advance.
    With regards,
    Hari

    Hi
    Deactivate the aggregates and then rebuild the indexes and then activate the aggregates again.
    GTR

  • Couldn't fetch the data from the data source...[nQSError: 16023]

    Hi all.
    I think that the problem I want to discuss is well-known, but still I got no answer whatever I tried ...
    I installed the BIEE on Linux (32 bit, OEL 5 - to be more precise), the complete installation was not a big deal. After that I installed the Administration tool on my laptop and created the repository. So... my tnsnames.ora on the laptop looks like this:
    TESTDB =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.5)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = testdb)
    And the tnsnames.ora on server, in its turn, looks like this:
    TESTDB =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = testdb.localdomain)
    The database worked normally and I created and transferred the repository to the server and started it up.
    It started without any errors, but when I tried to fetch the data via the representation services I got the error:
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred.
    [nQSError: 16023] The ODBC function has returned an error. The database may not be available, or the network may be down. (HY000)
    I discovered, that the ODBC on my laptop was named not correctly (it should have been identical to tnsnames entry) - so I corrected it, saved and replaced the repository on the server and restarted it... - and still got the same error.
    Apparently, something is wrong with the data source. So let me put here some more information...
    My user.sh looks like this:
    ORACLE_HOME=/u01/app/ora/product/11.2.0/dbhome_1
    export ORACLE_HOME
    TNS_ADMIN=$ORACLE_HOME/network/admin
    export TNS_ADMIN
    PATH=$ORACLE_HOME/bin:/opt/bin:$PATH
    export PATH
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH
    and my odbc.ini looks like this:
    [ODBC]
    Trace=0
    TraceFile=odbctrace.out
    TraceDll=/u01/OracleBI/odbc/lib/odbctrac.so
    InstallDir=/u01/OracleBI/odbc
    UseCursorLib=0
    IANAAppCodePage=4
    [ODBC Data Sources]
    AnalyticsWeb=Oracle BI Server
    Cluster=Oracle BI Server
    SSL_Sample=Oracle BI Server
    TESTDB=Oracle BI Server
    [TESTDB]
    Driver=/u01/OracleBI/server/Bin/libnqsodbc.so
    Description=Oracle BI Server
    ServerMachine=local
    Repository=SH
    Catalog=
    UID=
    PWD=
    Port=9703
    [AnalyticsWeb]
    Driver=/u01/OracleBI/server/Bin/libnqsodbc.so
    Description=Oracle BI Server
    ServerMachine=local
    Repository=
    Catalog=
    UID=
    PWD=
    Port=9703
    [Cluster]
    Driver=/u01/OracleBI/server/Bin/libnqsodbc.so
    Description=Oracle BI Server
    ServerMachine=local
    Repository=
    FinalTimeOutForContactingCCS=60
    InitialTimeOutForContactingPrimaryCCS=5
    IsClusteredDSN=Yes
    Catalog=SnowFlakeSales
    UID=Administrator
    PWD=
    Port=9703
    PrimaryCCS=
    PrimaryCCSPort=9706
    SecondaryCCS=
    SecondaryCCSPort=9706
    Regional=No
    [SSL_Sample]
    Driver=/u01/OracleBI/server/Bin/libnqsodbc.so
    Description=Oracle BI Server
    ServerMachine=localhost
    Repository=
    Catalog=SnowflakeSales
    UID=
    PWD=
    Port=9703
    SSL=Yes
    SSLCertificateFile=/path/to/ssl/certificate.pem
    SSLPrivateKeyFile=/path/to/ssl/privatekey.pem
    SSLPassphraseFile=/path/to/ssl/passphrase.txt
    SSLCipherList=
    SSLVerifyPeer=No
    SSLCACertificateDir=/path/to/ca/certificate/dir
    SSLCACertificateFile=/path/to/ca/certificate/file.pem
    SSLTrustedPeerDNs=
    SSLCertVerificationDepth=9
    Can anybody point a finger where the error line is? According to the documentation it should work fine.Maybe the driver name is wrong? What driver I need then?
    Cause I can't find it.
    I'm really sorry to bother, guys :) Let me know if you get some ideas about it (metalink didn't help).

    OK, several things wrong here. First the odbc.ini is not meant to be used for Oracle databases, that's not supported on Linux. On Linux you should OCI (Oracle native drivers) and nothing should be added on odbc.ini. Your user.sh seems to be pointing to your DB installation path. This is not correct. It should point to your Oracle client installation so you need to install the Oracle FULL client somewhere. Typically this is normally done with the same OS account as the one used for OBIEE whereas the DB normally runs with the oracle account. Once you got the client installed test it under the OBIEE account doing tnsping and sqlplus to your DB. Also the LD_LIBRARY_PATH should point to $ORACLE_HOME/lib32 not lib as the lib directory is the 64bits and OBIEE uses the 32bits libraries even in 64bits OSes. Finally change your RPD connection to use OCI. Make all those changes and you should be good.

  • Customer Exit Variable to fetch the data from the cube..

    Hello Gurus,
    I am having a requirement to select the latest changed record from the cube while executing the query.  where we are having the Calday as the date with a variable .
    I suggested my client we can filter it at the DSO leve or Data loading level but my client dont want to distrurb the existing design so he want to perfrom the changes at the Query level only.
    For Example we are having below records in the cube.
    PO             Material     Calday       Qty         Price
    101            ABC          1/12           100         10
    101            ABC          2/12            100         10
    101            ABC          3/12            100         11
    I am having Calday in the selection screen as the variable.
    Now from the above example i need to show the record which has been changed on 3/12.
    For this i am planning to write the customer exit variable on the calday , when the user enter the range of Calday then i will fetch the whole records which fall in between the range and i will sort each PO with respect to the date and i will pick those which are the latest records.
    My Concerns:
    !. Kindly let me know if it is possible and what are the other things that i need to consider.
    2. Did it will impact the performance.
    Waiting for your quick replies
    Thanks & Regards
    KK

    Hi Mate,
    Sorry for late reply.
    By d way in your word.
    initially when the user enter the date range as the vairable input. suppose 1/12 to 31/12 then i will pick all those records which fall in this range.
    suppose the records are
    PO Date
    P1 01/12
    P1 02/12
    P2 02/12
    P2 03/12
    P3 03/12
    P3 04/12
    In the customer exit variable Now for each PO i will sort the date in ascending order and i will pick the last record to display it in the Report.
    The ouput will be
    PO Date
    P1 02/12
    P2 03/12
    P3 04/12
    Now hope you are aware about exit variable concept.
    so what value will pass in the calday filter.
    here after sorting on each PO , you will get 3 different dates, 02/12 for P1
    03/12 for P2
    and 04/12 for P3
    Now if you are aware about exit variable concept, then you will pass this three date to CALDAY(I_t_VAR_Range-low = ...)
    but how query will understand that for P1 calday filter value is 02/12, for P2 calday filter value is 03/12.... and so on...
    actually i have also experienced this kind of issue 1-2 years before, i have tried same thing at that time without thinking and stuck with this problem..
    By d way you can also learn from your mistake.. so just try ur logic and then you will understand what is the problem?
    By d way this will not work, parallel you can work on other solution.

  • Proper approach for fetching the data

    Hello all,
    I am currently using some logic to fetch the following data from the SD tables.
    VBELN Delivery           LIPS
    LSTEL Loading Point   LIKP
    LFIMG Actual quantity delivered (in sales units) LIPS
    KTGRM Account assignment group for this material VBRP
    EXDAT J_1IEXCHDR.
    I have to join all the tables LIKP, LIPS, VBRP and J_1IEXCHDR. Is there an alternate way of fetching the data?
    A Sample Query is written below.
      SELECT  B~VBELN A~LSTEL B~LFIMG        
      C~KTGRM E~EXDAT AS WADAT_IST
        INTO  CORRESPONDING FIELDS OF TABLE LIT_TY_LIPS_S
       FROM   LIKP AS A
        INNER JOIN  LIPS AS  B     ON  A~VBELN       =  B~VBELN
        INNER JOIN VBRP  AS  C     ON  C~VGBEL       =  A~VBELN
        INNER JOIN J_1IEXCHDR  AS E ON E~RDOC        =  C~VBELN
        WHERE B~WERKS     =  SO_PLANT
        AND E~EXDAT   BETWEEN V_START_F AND SO_DATE
        AND C~AUTYP IN s_AUTYP
        AND E~STATUS = 'C'.
    Thanks in advance.
    Regards,
    Harshad.
    Edited by: Harshad Mishrikotkar on Sep 12, 2011 12:08 PM

    Harshad, if your target good performance? if yes then generally I don't prefer to join more than 3 tables at a time..
    and join only logical tables in 1 query and then use for all entries clause and move to another query..
    In your case, I would suggest join LIKP and LIPS and try to put as many where conditions as possible..
    then join VBRP, not sure about the table J_1*.. based on for all entries in query 1.
    I hope this helps.
    Regards
    Raghu.

  • To fetch  the Data from Tibico

    Dear Friends,
         Kindly share your knowledge
            <b>Scenerio - one end Tibico  other end SAP</b>
    I want to fetch the data from Tibico, there is no FTP server, and out of  network, Suggest me to select which appropriate adapter i should go far.

    Hi,
    You can think of SOAP adapter or java proxy  for this.
    Also look into similar discussions~
    XI integration with Tibco
    XI Integration with Tibco EMS (Using JMS Adapter)
    Following document will give good idea about 3rd party adapters-
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d9faa8c4-0801-0010-de99-82601fed569a
    Regards,
    Moorthy

  • In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    The query is re-issued as a flashback query and the client process can continue to fetch from the cursor. This is described in the Net Services Administrators Guide, the section on Transparent Application Failover.

  • Not able to fetch the data by Virtual Cube

    Hi Experts,
    My requirement is I need to fetch the data from Source System (From Data base table) by using Virtual Cube.
    What I have done is I have created Virtual Cube and created corresponding Function Module in Source System.
    That Function MOdule is working fine, if Data base table is small in Source System.But If data base table contains huge amount of data (millions of record), I am not able to fetch the data.
    Below is the code I have incorporated in my function module.
    c_th_mapping TYPE CL_RSDRV_EXTERNAL_IPROV_SRV=>TN_TH_IOBJ_FLD_MAPPING.
      DATA:
        l_s_map TYPE CL_RSDRV_EXTERNAL_IPROV_SRV=>TN_S_IOBJ_FLD_MAPPING.
      l_s_map-iobjnm = '0PARTNER'.
      l_s_map-fldnm  = 'PARTNER'.
      insert l_s_map into table l_th_mapping.
    create object l_r_srv
        exporting
           i_tablnm              = '/SAPSLL/V_BLBP'
          i_th_iobj_fld_mapping = l_th_mapping.
      l_r_srv->open_cursor(
        i_t_characteristics = characteristics[]
        i_t_keyfigures      = keyfigures[]
        i_t_selection       = selection[] ).
       l_r_srv->fetch_pack_data(
        importing
          e_t_data = data[] ).
      return-type = 'S'.
    In the above function Module,Internal table L_TH_MAPPING contains Info Objects from Virtual Cube and corresponding field from Underlying data base table.
    The problem where I am facing is, in the method FETCH_PACK_DATA, initially program is trying to fetch all the recordsfrom data base table to internal table.If Data base table so lagre, this logic is not working.
    So would you please help me how to handle these kind of issues.

    Hi Experts,
    My requirement is I need to fetch the data from Source System (From Data base table) by using Virtual Cube.
    What I have done is I have created Virtual Cube and created corresponding Function Module in Source System.
    That Function MOdule is working fine, if Data base table is small in Source System.But If data base table contains huge amount of data (millions of record), I am not able to fetch the data.
    Below is the code I have incorporated in my function module.
    c_th_mapping TYPE CL_RSDRV_EXTERNAL_IPROV_SRV=>TN_TH_IOBJ_FLD_MAPPING.
      DATA:
        l_s_map TYPE CL_RSDRV_EXTERNAL_IPROV_SRV=>TN_S_IOBJ_FLD_MAPPING.
      l_s_map-iobjnm = '0PARTNER'.
      l_s_map-fldnm  = 'PARTNER'.
      insert l_s_map into table l_th_mapping.
    create object l_r_srv
        exporting
           i_tablnm              = '/SAPSLL/V_BLBP'
          i_th_iobj_fld_mapping = l_th_mapping.
      l_r_srv->open_cursor(
        i_t_characteristics = characteristics[]
        i_t_keyfigures      = keyfigures[]
        i_t_selection       = selection[] ).
       l_r_srv->fetch_pack_data(
        importing
          e_t_data = data[] ).
      return-type = 'S'.
    In the above function Module,Internal table L_TH_MAPPING contains Info Objects from Virtual Cube and corresponding field from Underlying data base table.
    The problem where I am facing is, in the method FETCH_PACK_DATA, initially program is trying to fetch all the recordsfrom data base table to internal table.If Data base table so lagre, this logic is not working.
    So would you please help me how to handle these kind of issues.

  • Query on fetching the no.of days between Invoice date and due date in rtf template embedded BI Publisher Report

    Hi Experts,
    We have a requirement to fetch the value of 'No of days' between Invoice date and due date (Two variable date fields on the template) in an Analysis.
    Please let me know the procedure of how to achieve the same.
    Regards,
    Rev

    it's good for ideas but implementation a bit different
    Oracle Business Intelligence Publisher Report Designer's Guide
    This function provides a method to get the difference between two dates in the given locale. The dates need to be in "yyyy-MM-dd" format. This function supports only the Gregorian calendar. The syntax is as follows:
    <?xdoxslt:date_diff(‘format’, ‘YYYY-MM-DD’, ‘YYYY-MM-DD’, $_XDOLOCALE, $_XDOTIMEZONE)?>
    where
    format is the time value for which the difference is to be calculated
    Example:
    <?xdoxslt:date_diff(‘d’, ‘2006-04-08’, ‘2006-04-01’, $_XDOLOCALE, ‘America/Los_Angeles’)?>
    returns
    -7

  • Reg: fetch the data by using item_id which is retuned by In line View Query

    Hi all,
    create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
    insert into xxc_transactions values(null,null,null,null);
    create table xxc_items1(item_id number,org_id number,item_no varchar2(10));
    insert into xxc_items1 values(123,12,'book');
    create table xxc_headers(header_id number,order_id number);
    insert into xxc_headers values(null,null);
    create table xxc_lines(header_id number,item_id number,line_id number);
    insert into xxc_lines values(null,null,null);
    create table xxc_types_tl(transaction_id number,NAME varchar2(10));
    insert into xxc_types_tl values(106,'abc');
    create table xxc_quantity(item_id number);
    insert into xxc_quantity values (123);
    create table xxc_quantity_1(item_id number);
    insert into xxc_quantity_1 values (123);
    SELECT union_id.item_id,
           b.org_id,
           e.name,
           fun1(union_id.item_id) item_no
    FROM   xxc_transactions a,
           xxc_items1 b,
           xxc_headers c,
           xxc_lines d,
           xxc_types_tl e,
           (SELECT item_id
            FROM   xxc_quantity
            WHERE  item_id = 123
            UNION
            SELECT item_id
            FROM   xxc_quantity_1
            WHERE  item_id = 123
            UNION
            SELECT item_id
            FROM   xxc_transactions
            WHERE  item_id = 123) union_id
    WHERE  a.type_id = 6
           AND a.item_id  = b.item_id
           AND union_id.item_id = b.item_id
           AND a.org_id = b.org_id
           AND c.header_id = d.header_id
           AND d.line_id = a.trx_line_id
           AND d.item_id = b.item_id
           AND c.order_id = e.transaction_id
           AND b.org_id = 12
    GROUP  BY union_id.item_id,
              b.org_id,
              e.name
    ORDER  BY union_id.item_id;
    create or replace function fun1(v_item in number)
    return varchar2
    is
    v_item_no
    Begin
       select item_no from xxc_items1
       where item_id=v_item;
       return v_item_no ;
        Exception
         When Others Then
          v_item_no := null;
          return v_item_no;
    END fun1;
    I  need  fetch the data by using item_id which is retuned by In line View Query(UNION)
    item_id  org_id  name    item_no
    123        12        abc       book
    Version: 11.1.0.7.0  and 11.2.0.1.0
    Message was edited by: Rajesh123 Added test cases script
    Message was edited by: Rajesh123 changed Question as fetch the data by using item_id which is retuned by In line View Query(UNION)

    Hi Master , sorry for the late reply and can you please help on this?
    create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
    insert into xxc_transactions values(null,null,null,null);
    create table xxc_items(item_id number,org_id number,item_no varchar2(10));
    insert into xxc_items values(123,12,'book');
    create table xxc_headers(header_id number,order_id number);
    insert into xxc_headers values(null,null);
    create table xxc_lines(header_id number,item_id number,line_id number);
    insert into xxc_lines values(null,null,null);
    create table xxc_types_tl(transaction_id number,NAME varchar2(10));
    insert into xxc_types_tl values(106,'abc');
    create table xxc_uinon_table(item_id number);
    insert into xxc_types_tl values(123);
    SELECT   union_id.item_id,
             b.org_id ,
             e.name ,
             fun1(union_id.item_id) item_no   --> to get item_no
             FORM xxc_transactions a,
             xxc_items             b,
             xxc_headers           c,
             xxc_lines             d,
             xxc_types_tl          e,
             ( SELECT item_id
                 FROM   xxc_uinon_table ) union_id
    WHERE    a.type_id= 6
    AND      a.item_id = b.item_id
    AND      union_id.item_id = b.item_id
    AND      a.org_id = b.org_id
    AND      c.header_id = d.header_id
    AND      d.line_id= a.trx_line_id
    AND      d.item_id= b.item_id
    AND      c.order_id= e.transaction_id ---106
    AND      b.org_id = 12
    GROUP BY union_id.item_id,
             b.org_id ,
             e.name
    ORDER BY union_id.item_id;
    Note: xxc_uinon_table is a combination of UNION's
    select 1 from dual
    union
    select 1 from dual
    union
    select no rows returned  from dual;
    I will get 1 from the above Query
    Thank you in advanced

Maybe you are looking for