Ad Hoc Query from table PPDIT

Hi,
I'm creating an ad hoc query to retrieve data from table PPDIT by filtering the transaction key. This is to get a list of amounts posted to the technical accounts(Transaction key HRA). However, the query output and the output from table PPDIT through SE16 are different. It seems like the query only picks up transaction key HRF. Anyone with any ideas why?

Hi,
Than you add the additional field from extras option.
click on extras tab.
From there add table add field add structure.
If you want to add a field write the name of the field and continue.
suppose the field is matnr.
Long text = material number
header = material number
and in like reference = mara-matnr.
tablename-field name.
let me know if this helps you.
Regrds,
Nikhil.

Similar Messages

  • J2IUN Mismatch with query from table J_1IPART2

    Hi experts,
    If I run the TCODE J2IUN there is a marked difference for the RG23C register BED, AED, Cess, and HCess values that have been taken from table J_1IPART2 for the same period. What could be the cause for these differences and why did they occur or do I have to take addtional records from another table also. Well I am considering the Opening balances also.
    Please can you help me regarding this.
    Regards
    Yao Chhang

    You will have to first trace the difference. In the next step, go through J2IUN in debug mode with Abaper & check from where all the data is being picked. Next check whether all the data pick point are considered in Query.
    Regards,
    Rajesh Banka
    Reward suitable points.

  • Help in query from table

    Hi,
    I am having a strange issue,
    i have a table containing the following amgst others
    rec_time sys_date
    7:00 04/08/2010
    8:00 04/08/2010
    9:00 05/08/2010
    I need to query this table and return the max(rec_time) for all sys_date = sysdate
    its not working if i do the following
    select max(rec_time) from table
    where sys_date = sysdate;

    hello,
    this is my table structure for hourly_sales
      ID                 NUMBER,
      PRODUCT            VARCHAR2(25 BYTE)          NOT NULL,
      GAME_ID            NUMBER                     NOT NULL,
      SYS_DATE           DATE                       NOT NULL,
      CONFIRMED          CHAR(1 BYTE)               DEFAULT 'N',
      ACT_AMT            NUMBER                     NOT NULL,
      CUMM_AMT           NUMBER                     NOT NULL,
      COUNT_SALES        NUMBER                     NOT NULL,
      CREATED_BY         VARCHAR2(25 BYTE),
      CREATION_DATE      DATE,
      LAST_UPDATED_BY    VARCHAR2(25 BYTE),
      LAST_UPDATED_DATE  DATE,
      REC_TIME           VARCHAR2(25 BYTE)          NOT NULL,
      ORDER_ID           NUMBERI have created a small application in APEX that has an LOV for rec_time from 7.00 to 22.00. this is just an indication to the times that values are being entered.
    Now those geezers were making mistakes and the reason why i wanted my query was to enable them to roll-back on a button click
    delete from hourly_sales
    where rec_time = max(rec_time)
    and trunc(sys_date) = trunc(sysdate);but when i was querying it was not returning any values.

  • Ad hoc Query - Add table to an existing Infoset

    Hi,
    I have an Infoset created based on PNP database table. Now I wanted to add certain fields from a table (not from logical database table) to same Infoset. Can I add the table to the existing Infoset? If yes could please guide me how to do it.
    From one thread I found out using Extras tab, in change Infoset screen we can add table. But not able to proceed further.
    I will be grateful for your help.
    Thank you.
    GRM

    Hi GRM,
    As u have mentioned that u have used LDB, PNP. Now ur query is that u want to add a table into the query.
    Firstly check in which Infotype that Table and field is being called.
    Then, go to T.Code - SQ02
    Select ur query that u have used in that LDB - PNP. Click change.
    Then from the Menu bar, Select EDIT & then CHANGE INFO-TYPE SELECTION.
    After the above activity, a selection screen will appear. From that Selection screen, select the appropriate Infotype then add it and it'll bring all related Tables used in that Infotype.
    Accordingly u may select and deselect as per ur requirement. Generate the Infoset Query once again after coming out of the screen.
    Hope this helps,
    ARNAV...

  • How to Query from table and insert into another table.

    Hi
    I am using the following query in VO and all the columns are attached to EO ( table name emp_temp)
    select a.npw_number, a.person_id,b.assignment_id,a.title,a.last_name,a.first_name,a.date_of_birth,a.sex,
    b.organization_name,b.organization_id,b.job_id,b.job_name,b.position_id,b.position_name,b.supervisor_id,
    b.supervisor_name,b.location_id,b.effective_start_date,b.effective_end_date
    from per_all_people_f a,per_assignments_v b
    where a.person_id=b.person_id
    and a.npw_number=:1
    I can query the data in screen. I need into insert the data into the emp_temp.
    I don't know how to do this . Please help me.
    Thanks
    Subra

    You can create a VO based on EO on emp_temp table.....
    And u have attached a Different VO on the page... Right...
    Now what u can do is....once u click on apply....
    u can set the each attributes of EO based VO explicitly via code, from the values of second VO.... and then commit.....
    Perhaps this might help...

  • How to query from tables?

    Hi!
    I have two table, and I want to execute a query statement from them. How to do this?
    Thanks so much!

    Hi,
    If you go to otn.oracle.com/products/jdev you find tutorials and Oracle By Example (OBE) instructions.
    These get you started
    Frank

  • Fetch Insert / Update Query From Table Trigger

    Hi everyone !,
    I have a situation, is there any way where I can get insert/update query by before-insert / after insert trigger when a user inserts/updates any row in the table.
    Plz....help me....champs.....
    Regards,
    Naushad

    That was a nice thing but it works only on some oracle 9i with DML statements.
    On database versions 9.2.0.1 to 9.2.0.6 ora_sql_text works and returns the calling text for dml triggers, where as starting from 9.2.0.7 the behavior has changed and returns NULL.
    Cause
    This issue had surfaced from 9.2.0.7.0 patchset. After discussions in Bug 4171597 which was closed as a duplicate of Bug 4230721 it was concluded that it was the expected behavior i.e ORA_SQL_TXT should return null when dml triggers are used.
    ORA_SQL_TXT is a "System defined event attribute" and is supposed to work only with "System triggers". This is also what the Documentation says - "Application Developers Guide : Fundamentals(9.2)
    Chapter 16 Working with System events".
    Bye Alessandro

  • Query from table a and insert to table b

    Hi,
    I would like to create an attendance page to record student's attendance on a particular dates.
    I have 2 tables - students and attendance tables; in which attendance table will consist of PK from students table and date.
    How do I create a form that display all the students record in a page with checkbox and date column; and when user check the boxes and click save; it will insert record into attendance table? Thanks!
    Layout similar to the below:
    Date: 1/1/2010 (user input)
    Name: Attend
    student 1 (checkbox)
    student 2 (checkbox)
    student 3 (checkbox)
    student 4 (checkbox)
    .....

    Hi Aaron,
    For this you can do the following
    1. Create a Tabular Form on The STUDENT table, i.e. the table you are using as a Fecth only table
    2. Make the ApplyMRU and ApplyDRD process conditions Never so they will not be executed
    3. Write your own custom process to write the checked rows into Attendence Table.
    In the process you will have to refer to the checkbox f+nn+ item using APEX_APPLICATION.G_F+nn+ array and write from similar arrays for the other tabular form items
    You will find useful code snippets in the Apex Help , Advanc3ed Tutorials as well as here http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html#MANUAL
    Regards,

  • Pulling Job short text in Ad Hoc query

    Hi All,
    I want to pull the 'short text' field defined in Job into my ad-hoc query. If we select the Output as 'Text only' for Job in IT0001 the output is always the long text e.g. Director of Human Resource. I want to output the short text e.g. DIRHR in my ad hoc query. Both short text and long texts are defined in IT1000 while creating a new Job however the queries from infoset PNPCE only pulls the long text. I can pull the short text in ad hoc query from a OM infoset but for the business requirements we have to use PNPCE. Is there a way to achieve this?
    Thanks for your help.
    Sanghamitra

    This field's text is not available in PNPCE based infosets, you have to create a custom field and write a select statement to fetch the data from table HRP1000. You can find the steps on [how to create custom fields here|/people/shafiq.rehman3/blog/2008/06/16/sap-adhoc-query-sq01-sq02-sq03]:

  • Capture SAP Ad-Hoc query output in report

    Hi All,
    I have to run an Ad-hoc query from report (se38 program) and after execution of that Ad-hoc query I have to capture the output of that query and use in Report.
    I am trying the follwing approach but getting Run time error (internal Error)
    SUBMIT XXXXX EXPORTING LIST TO MEMORY
    Data:
    v_spool like pri_params-plist,
    v_text like pri_params-prtxt,
    v_print_parms type PRI_PARAMS,
    V_valid       TYPE c LENGTH 1,
    v_spool = sy-uzeit.
    v_text = sy-uname.
    call function 'GET_PRINT_PARAMETERS'
    exporting
    destination = 'locl'
    list_name = v_spool
    list_text = v_text
    user = sy-uname
    importing
    out_parameters = v_print_parms
    valid = v_valid
    exceptions
    archive_info_not_found = 1
    invalid_print_params = 2
    invalid_archive_params = 3
    others = 4.
    IF V_valid = 'X' AND sy-subrc = 0.
      SUBMIT SAP_QUERY_AD_HOC
                        TO SAP-SPOOL
                        SPOOL PARAMETERS v_print_parms
                       ARCHIVE PARAMETERS archi_parameters
                        WITHOUT SPOOL DYNPRO
                        WITH p_wsid = 'X'
                        WITH p_bgname = 'ZHR_OM_PA'
                        WITH p_sgname = 'ZHR_PA_PERSONNELADMIN'
                        WITH  p_quname = 'Z_HRDATA' AND RETURN.
    ENDIF.
    Thanks in Advance

    My friend. Runtime error is like saying "it doesn't work please help me". You need to give more details if you want someone give detailed anwser. It's technical forum so please try to explain technical nature of your problem. In other words, what is the dump saying?
    Regards
    Marcin

  • Query to return list of all missing primary key ids from table T1

    I found this query online that returns a start and stop for a range of all missing primary key id values from table T1. However i want to rewrite this query to return a whole list of all the missing primary key ids and not a start and stop range. any help plz?
    select strt, stp
    from (select m.id + 1 as strt,
    (select min(id) - 1 from T1 x where x.id > m.id) as stp
    from T1 m left outer join T1 r on m.id = r.id - 1 where r.id is null)x where stp is not null

    with t as
              select  1 as id from dual union all
              select  2 as id from dual union all
              select  3 as id from dual union all
              select  5 as id from dual union all
              select  8 as id from dual union all
              select 10 as id from dual union all
              select 11 as id from dual union all
              select 20 as id from dual
    select  id_start + level missing_id
      from  (
             select  id id_start,
                     nullif(lead(id) over(order by id) - 1, id) id_end
               from  t
      start with id_end is not null
      connect by prior id_start = id_start
             and prior dbms_random.random is not null
             and level <= id_end - id_start
    MISSING_ID
             4
             6
             7
             9
            12
            13
            14
            15
            16
            17
            18
    MISSING_ID
            19
    12 rows selected.Or:
    with t as
              select  1 as id from dual union all
              select  2 as id from dual union all
              select  3 as id from dual union all
              select  5 as id from dual union all
              select  8 as id from dual union all
              select 10 as id from dual union all
              select 11 as id from dual union all
              select 20 as id from dual
    select  id_start + level - 1 missing_id
       from  (
              select  min(id) id_start,
                      max(id) id_end
                from  t
       connect by level <= id_end - id_start
    minus
    select  id
       from  t
    MISSING_ID
             4
             6
             7
             9
            12
            13
            14
            15
            16
            17
            18
    MISSING_ID
            19
    12 rows selected.SY.

  • SAP Query - Additional field that collects information from table RESB

    Hello gurus. I have a question.
    I want to create a SAP Query that shows me the stock level of a list of materials, and also show me the total quantity of order reservations in an additional field.
    I created an InfoSet with table MARD, which is the one that holds the Stock information in a plant. Then I created an additional field which would read information from table RESB, the table that holds order reservations per material.
    So I wrote this piece of code:
    SELECT * FROM RESB
    WHERE MATNR EQ MARD-MATNR and
           WERKS EQ MARD-WERKS.
    ENDSELECT.
    if ( sy-dbcnt NE '0').
          MOVE RESB-BDMNG to ZQTY.
    ELSE.
          MOVE '' to ZQTY.
    ENDIF.
    This works fine. However, this is currently just catching the first record in table RESB that matches my condition.
    What I would like is to collect every instance of RESB-BDMNG and add them to field "ZQTY", have it loop in RESB until it finishes finding every record that match the MATNR and WERKS. With this I could get the total number of order reservations that this material has in that table.
    Could someone share some coding that would help me achieve this?

    Yes! That did it. That's what I needed to do. Thank you so much.
    While I'm at it, let me ask you a related question.
    When I execute the query, in the first records of the query where there's no value from RESB to transfer, the value of field ZQTY appears empty. Once it finds the first record in RESB and it populates ZQTY with a value, then the rest of the records with no hit get the proper value of 0.
    Do you know why the first records in the query appear empty and not with a 0? Is there anything I should add to the coding to fix this?

  • Query from oracle to MySql using dblink fetch all the rows in MySql table

    Hello,
    I am using Heterogeneous connectivity between oracle 10204 to Mysql database.
    I have a database link in the oracle side .
    I am query a table in MySql that have 10 million rows.
    Its doesnt matter if i am running :
    select * from "CDR_Accounts"@mysql where "id"=7675405;
    or
    select * from "CDR_Accounts"@mysql ;
    There is an index on the id column.
    Yet, it seems that the Mysql is feteching all the rows from the table , all the data is transfering to oracle over the dblink , and only after that the requested rows are get back to the client.
    The /etc/odbcinst.ini file is as follow:
    [odbcprd:oracle@odbc /software/oracle]$ cat /etc/odbcinst.ini
    [myodbc3]
    Description             = Mysql connector to mysql version 3.5
    Driver          = /software/oracle/MysqlOdbc/3.52/lib/libmyodbc3-3.51.25.so
    Driver64                = /usr/lib
    Setup           = /software/oracle/MysqlOdbc/3.52/lib/libmyodbc3S-3.51.25.so
    Setup64         = /usr/lib
    UsageCount              = 1
    CPTimeout               = 3600
    CPReuse         = Please advice
    Thanks

    When using a gateway it is always possible that a where clause is not sent to the remote database. This is called post processing and depends on several factors like the used ODBC driver, the columns and its data types but also if you specify certain functions in the where clause.
    The fastest way to see if post processing happens is in Oracle 11g the explain plan for a query. In 10g the plan does not always match the statement sent to the foreign database. Here it would be better to enable gateway tracing and setting the trace level to ON. This will log the statements sent to the foreign database and you can compare what statement was sent with the statement you've tried to execute.

  • Dbms_xmlgen.newcontext query from multiple tables and ||

    I have two questions
    How do I get a dbms_xmlgen.context to query from multiple tables? I have been able to make it work with using one table only, but not with multiple tables.
    And how to get the || (concat) to work within my query for my output to an xml file?
    Here is my current query:
    create or replace function get_xml return clob is
    result clob;
    qryctx dbms_xmlgen.ctxHandle;
    SELECT DBMS_XMLGEN.getxml('select prefix, suffix, fiscal_yr
    FROM rcv.recv_accessions ra
    where ra.prefix = 8 and ra.fiscal_yr = 11')xml into result FROM dual;
    result := DBMS_XMLGEN.getXML(qryCtx);
    This is what I desire:
    SELECT DBMS_XMLGEN.getxml('select ra.prefix||'-'|| ra.suffix||'-'|| ra.fiscal_yr accession, ss.date_in, st.test
    FROM rcv.recv_accessions ra, ser.sero_samples ss, ser.sero_tests st
    where ra.prefix = 8 and ra.fiscal_yr = 11 and ss.raid = ra.id and st.ssid = ss.id')xml into result FROM dual;
    On this both the reference to multiple tables and the concat function cause errors.
    Thank you
    Edited by: user583094 on Mar 2, 2011 3:36 PM

    Hi,
    for the concat do I use xmlconcat?No, XMLConcat is used to concatenate XMLType fragments.
    The || operator will do fine, but you must escape any single quote inside the string :
    SELECT DBMS_XMLGEN.getxml(
    'SELECT ra.prefix ||''-''|| ra.suffix ||''-''|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = 8
    AND ra.fiscal_yr = 11
    AND ss.raid = ra.id
    AND st.ssid = ss.id'
    INTO result
    FROM dual;Or, use the quoting operator to define a custom string delimiter :
    SELECT DBMS_XMLGEN.getxml(
    q'{SELECT ra.prefix ||'-'|| ra.suffix ||'-'|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = 8
    AND ra.fiscal_yr = 11
    AND ss.raid = ra.id
    AND st.ssid = ss.id
    INTO result
    FROM dual;BTW, a good practice would be to use bind variables for the query. DBMS_XMLGEN can handle them nicely :
    CREATE OR REPLACE FUNCTION get_xml
    RETURN CLOB
    IS
    qryctx   DBMS_XMLGEN.ctxHandle;
    v_out    CLOB;
    qrystr   VARCHAR2(4000) :=
    'SELECT ra.prefix ||''-''|| ra.suffix ||''-''|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = :b_prefix
    AND ra.fiscal_yr = :b_fiscal_yr
    AND ss.raid = ra.id
    AND st.ssid = ss.id';
    BEGIN
    qryctx := DBMS_XMLGEN.newContext(qrystr);
    DBMS_XMLGEN.setBindValue(qryctx, 'b_prefix', '8');
    DBMS_XMLGEN.setBindValue(qryctx, 'b_fiscal_yr', '11');
    -- to generate empty elements if necessary :
    DBMS_XMLGEN.setNullHandling(qryctx, DBMS_XMLGEN.EMPTY_TAG);
    v_out := DBMS_XMLGEN.getXML(qryctx);
    DBMS_XMLGEN.closeContext(qryctx);
    RETURN v_out;
    END;

  • Querying from 3 tables

    i want to display the records for this day. the thing is that the data comes from 3 different tables.
    the query contains the ff columns:
    date         tableA
    entryid      tableA
    audittype   tableA
    name        tableB
    shift          tableA
    package    tableC
    machine    tableA
    tableB has
    badge
    name
    tableC has
    id
    packageplease help
    thanks

    Try this:
    with tableA as
    (select to_date('02-16-07','mm-dd-yy') date1, 1 entryid, 'prod' audittype, 1 badge, 'N' shift, 1 pkgid, 'Mach1' machine from dual
      union all
      select to_date('02-16-2007','mm-dd-yy') date1, 2 entryid, 'prod' audittype, 2 badge, 'N' shift, 2 pkgid, 'Mach1' machine from dual),
         tableB as
    (select 1 badge, 'Amy' name1 from dual
      union all
      select 2 badge, 'Zach' name1 from dual),
         tableC as
    (select 1 pkgid, 'Pkg1' package1 from dual
      union all
      select 2 pkgid, 'Pkg2' package1 from dual)
    select a.date1, a.Entryid, a.Audittype, b.name1 Name, a.Shift, c.package1 Pkg, a.Machine
    from tableA a
    join tableB b
    on  a.badge = b.badge
    join tableC c
    on  a.Pkgid = c.pkgid;

Maybe you are looking for

  • Pedido de Compra - Envio de e-mail para o fornecedor

    Boa tarde pessoal Estou com uma dúvida sobre o processo para envio de e-mail do Pedido de Compra para o fornecedor. Hoje utilizamos o e-mail do último aprovador no Pedido de Compra para que seja enviado ao fornecedor. Existe alguma configuração para

  • Trying to read from a socket character by character

    Hi all, I have a problem with reading from a socket character by character. In the code shown below I try and read each character, and then write it to a file. The information sent to a socket sent from a file, and EOF is marked with character of asc

  • Videos unwatchable under Windows Vista and current versions of iTunes/QT

    I know this has been brought up before, but all of the previous suggestions do not apply to my situation. Ever since upgrading to iTunes 7.2, no iTunes or QuickTime videos play properly. The audio generally works just fine, but the video is jumpy and

  • Safe boot vs normal start up

    I used the safe boot feature to fix a glitch but i want to go back to my normal start up. how do i do that?

  • Results are different when printing from CS5 and CS4

    A file that printed fine with Photoshop CS 4 printed very dark when printed with CS5, with no changes made to the settings. Has anyone else had this problem?