To get a row of value by taking table name and primary key value

i can't find out what's wrong.. pliz help.. m a fresher in SAP.
code is here
PARAMETER tname(10) TYPE c.
PARAMETER pkv(10) TYPE c.
DATA:
lt_dd03l TYPE STANDARD TABLE OF dd03l,
ls_dd03l TYPE dd03l.
DATA: my_table TYPE REF TO data,
wa_ref TYPE REF TO data.
FIELD-SYMBOLS: <it_tname> TYPE STANDARD TABLE,
  <tname_wa> TYPE ANY,
   <primary_key> TYPE ANY,
  <is_tname>.
SELECT * FROM dd03l INTO TABLE lt_dd03l
             WHERE tabname EQ tname.
LOOP AT lt_dd03l INTO ls_dd03l.
  IF ls_dd03l-fieldname NE 'MANDT' AND ls_dd03l-keyflag = 'X'.
WRITE:/ ls_dd03l-fieldname.
   primary_key = ls_dd03l-fieldname.
    EXIT.
  ENDIF.
ENDLOOP.
CREATE DATA my_table TYPE STANDARD TABLE OF (tname).
ASSIGN my_table->* TO <it_tname>.
CREATE DATA wa_ref LIKE LINE OF <it_tname>.
ASSIGN wa_ref->* TO <tname_wa>.
WRITE: / ls_dd03l-fieldname.
ASSIGN ls_dd03l-fieldname TO <primary_key>.
SELECT * INTO TABLE <it_tname>  FROM (tname)
WHERE <primary_key> =  pkv.
WRITE sy-subrc.
*WRITE : /   primary_key,
kv .
LOOP AT <it_tname> INTO <tname_wa> .
  DO.
    ASSIGN COMPONENT  sy-index
             OF STRUCTURE <tname_wa> TO <is_tname>.
   WRITE:/ <is_tname>-(primary_key).
    IF sy-subrc <> 0.
      WRITE :/ 'sy-subrc is not zero'.
      EXIT.
    ENDIF.
IF ls_dd03l-fieldname = pkv.
    WRITE: <is_tname>.
ENDIF.
  ENDDO.
ENDLOOP.
*ASSIGN <t_itab> TO <t_isturct>.
*SELECT * FROM (tname) INTO TABLE <t_itab>.
*LOOP AT <t_itab> INTO <t_isturct>.
WRITE :/
  <t_isturct>.
*ENDLOOP.

Please check whether bname has any conversion exits.
try hardcoding the value like '0000105397' and passing into the query.
SELECT * FROM (tname) INTO table <it_tname>
where <primary_key> = '0000105397'.  "If it works then use conversion exit.
or try like this
types : begin of ty_where,
        line type char100,
        end of ty_where.
data:it_where type table of ty_where.
data:wa_where type ty_where.
data:val type char100.
concatenate <primary_key> 'EQ' into wa_where-line seperated by space.
concatenate `'` pkv `'` into val. condense val no-gaps.
concatenate wa_where-line val into wa_where-line seperated by space.
append wa_where to it_where.
SELECT * FROM (tname) INTO table <it_tname>
where ( it_where ).

Similar Messages

  • Getting errors when updating a column on a table having a primary key

    Hi,
    I have an application on Oracle APEX that raises the following error after an attempt (through the application) to update a column with no specific constraint on it:
    ORA-06550: line 1, column 17: PL/SQL: ORA-00936: missing expression ORA-06550: line 1, column 9: PL/SQL: SQL Statement ignoredUnable to fetch row.
    The involved table has a primary key conatraint and the corresponding column can be populated by a sequence (but there is no trigger to manipulate the sequence).
    The sequence is mentioned in the involved page definition for populating the primary key.
    If I disable the primry key and set to null the corresponding value for the primary of the record to be updated, then it is possible to update that record (thus the above column) through the application.
    Did someone encountered this situation before?
    If yes, what was then your workaround/solution?
    Kind Regards.

    Dear user8058501 ,
    Firstly) Did you check
    Auto Row Fetch (After upgrade to 4.0.1)
    Automated Row Fetch on Table with Synonym causes ORA-00936: missing expr.
    Secondly) If the problem is not resolved, Would you provide a sample on apex.oracle.com with workspace/developer account to be able to help you
    Please, if this solves your question, mark it as Correct. Otherwise as helpful.
    Best Regards
    Mahmoud

  • Insert values of form on a table with compound primary keys in APEX

    Good evening,
    I have a table with compoud primay keys. On ER model I had a many to many relation and when I coverted to relational model I've got a table with the primary keys of the two entities.
    My problem now is that I am trying to build an APEX application with a Form/Report and I want to insert a tuple both on the "entity" and on the table with two primary keys.
    I created a trigger with
    CREATE OR REPLACE TRIGGER ins_key_elem
    INSTEAD OF INSERT
    ON v_key_elem
    REFERENCING NEW AS NEW
    FOR EACH ROW
    BEGIN
    INSERT INTO elem_type (elem_key, type_key)
    VALUES (:NEW.elem_key, :NEW.type_key);
    INSERT INTO elem(elem_key, name)
    VALUES (:NEW.elem_key, :NEW.name);
    END;
    Is that ok? If it is, now how I can use that trigger to do what I need? i.e. insert the tuple on the two tables when I use the create button of the form
    Edited by: 934530 on May 15, 2012 2:36 PM

    Nevermind...figured it out. Was able to set the value on the Report Attributes page.

  • Get Target table name and its count

    Hi Experts,
    I have created a Procedure where I want to get the Target table name and its count of the previous Interface in a Package and insert these values into the Audit table.
    I am able to get the number of Inserts in previous step using getPrevStepLog() API, but I also want the Target table name and its total count of the previous Interface. Is there any generic way or code to bring these Information without hardcoding the table name. Kindly help to sort this issue.Thanks!
    Warm Regards,
    VBV

    Hi VBV,
    Please follow the below steps to audit ur execution.
    Please note i coded in such a way that u can use ur existing procedure to capture the table name no need to query ur repository as its not advisable to query the repository as Oracle may change the structure in future which i personally feel right.
    I created a Audit table with the below structure.
    CREATE TABLE AUDIT_TABLE
    INSERT_COUNT VARCHAR2(100 BYTE),
    TABLE_NAME VARCHAR2(4000 BYTE)
    Step 1 :
    This step needs to be added in ur existing IKM after Commit step where i am using API to capture the target table name.
    Step Name: Get Table Name
    Command On Source
    Technology: Oracle
    Schema: Any Oracle related Schema
    Command:
    SELECT '<%=odiRef.getTargetTable("RES_NAME")%>' AS TGT_NAME FROM DUAL
    Command On Target
    Technology: Jython
    Command:
    TargetTable='#TGT_NAME'
    Step 2:
    In ur existing procedure add the below or add a new procedure.
    Step Name: Audit Log
    Command on Source
    Technology : Oracle
    Schema: Whichever schema holds the audit table
    Command on Target
    Technology : Jython
    Command:
    import java.sql as sql
    import java.lang as lang
    myCon =odiRef.getJDBCConnection("SRC")
    MyStmt=myCon.createStatement()
    myRs = MyStmt.executeQuery("INSERT INTO ODITGT.AUDIT_TABLE (INSERT_COUNT,TABLE_NAME) VALUES (<%=odiRef.getPrevStepLog("INSERT_COUNT")%>,'"+TargetTable+"')")
    Thats it.
    OTN doesnt allow me to put + sign in front of any word ( its assume its a Italic) so please add + (plus) sign before and after TargetTable in the above script.
    This way u can capture the table name, insert count in to ur audit table.
    Please note u need to call this Procedure after the successful completion of the interface in a package and make sure u selected the right IKM which capture the table name as in Step 1.
    I tested in my local and its working fine. Let me know if u find any difficulties in implementation.
    Thanks,
    Guru

  • Table and Primary Key Case Sensitive in Automated Row Fetch

    Why are the table and primary key fields case sensitive in the Automated Row Fetch process? I'm debugging an error in this process and I'm not sure what the case should be.

    Russ - It's a defect of sorts. Use upper case in the process definition. I don't think these processes will work with tables or columns whose names are not known to the database as upper-case values, i.e., defined using double-quoted non-upper case.
    Scott

  • What is the diffrence between Row id and primary key ?

    dear all
    my question is about creating materialized views parameters (With Rowid and
    With Primary kry)
    my master table contains a primary key
    and i created my materialized view as follow:
    CREATE MATERIALIZED VIEW LV_BULLETIN_MV
    TABLESPACE USERS
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    REFRESH FAST ON DEMAND
    WITH PRIMARY KEY
    AS
    SELECT
    BCODE ID, BTYPE BTYPE_ID,
    BDATE THE_DATE,SYMBOL_CODE STOCK_CODE,
    BHEAD DESC_E, BHEADARB DESC_A,
    BMSG TEXT_E, BMSGARB TEXT_A,
    BURL URL, BTIME THE_TIME
    FROM BULLETIN@egid_sefit;
    I need to know is there a diffrence between using (with row id) and (with primary key) on the performance of the query?

    Hi again,
    fast refreshing complex views based on rowids, according to the previous subject.
    (You're example shows that) are not possible.
    Complex remote (replication) snapshots cannot be based on Rowid too.
    for 10.1
    http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_6002.htm#sthref5054
    for 10.2
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6002.htm#sthref6873
    So I guess (didn't check it) that this applies ONLY to replication snapshots.
    This is not documented clearly though (documentation bug ?!)
    Documentation states that the following is generally not possible with Rowid MVIEWS:
    Distinct or aggregate functions
    GROUP BY or CONNECT BY clauses
    Subqueries
    Joins
    Set operations
    Rowid materialized views are not eligible for fast refresh after a master table reorganization until a complete refresh has been performed.
    The main purpose of my statements was to try to give a few tips how to avoid common problems with this complex subject, like for example: being able to CREATE an MVIEW with fast refresh clause does not really guarantee that it will refresh fast in the long run (reorganisation, partition changes) if ROWID based, further the rowid mviews have limitations according to the documentation (no group by, no connect by, link see above) plus fast refresh means only to use filter columnns of the mview logs, plus for aggregates you need additional count (*) pseudo columns.
    kind regards
    Karsten

  • Insert values in multiple tables. One of the tables has complex primary key.

    Hello, I am using Jdeveloper version 11.1.2.3.0
    I have a table FORM_TYPE and another table Str. The Str table is used to translate strings from the table name which are read from another program from the database and used to generate forms..
    The FORM_TYPE  table has a relation to the STR table via formtype.title_str_id = str.str_id.
    The STR table has a primary key that is depending on mf_language and str_id columns. I generated entity for the STR table but can't insert from the application module new values for some reason... It says the record invalidates its own entity..
    I am trying to create a table that will be editable and will have the columns Description, Name, Str in English, Str in French etc...
    Want to create a Form_Type and in the same time to insert new values for each language... But can't make the inserts of the new STR work..
    Also the    FormType.TITLE_STR_ID has many values null already in the database.
    SELECT FormType.DESCRIPTION,
           FormType.FORM_TYPE_ID,       
           FormType.NAME,
           FormType.PAPER_REPORT_FORMAT,
           FormType.PAPER_REPORT_NAME,
           FormType.TITLE_STR_ID,
           en.str en_str,
           en.str_id,
           en.object_name en_object_name,
           fr.str,
           fr.str_id,
           fr.object_name,
           du.str,
           du.str_id,
           du.object_name,
           bg.str,
           bg.str_id,
           bg.object_name      
    FROM FORM_TYPE FormType,
    (select str.str_id, str.mf_language_id, str.str, str.object_name
    from mf_language ml,  str
    where ml.mf_language_id = str.mf_language_id
    and ml.code ='en') en
      , (select str.str_id, str.str, str.object_name
    from mf_language ml,  str
    where ml.mf_language_id = str.mf_language_id
    and ml.code ='fr') fr,
      (select  str.str_id,   str.str, str.object_name
    from mf_language ml,  str
    where ml.mf_language_id = str.mf_language_id
    and ml.code ='du') du,
      (select  str.str_id,  str.str, str.object_name
    from mf_language ml,  str
    where ml.mf_language_id = str.mf_language_id
    and ml.code ='bg') bg
    WHERE
    formtype.title_str_id = en.str_id and
    formtype.title_str_id = fr.str_id and
    formtype.title_str_id = du.str_id and
    formtype.title_str_id = bg.str_id  

    Tried that I made view links and associations but still can't insert in both tables at once... Could be because the tables aren't having relationship between them or because the STR table has a (STR_ID, MF_LANGUAGE_ID) primary key...

  • Initially stating No authorization required using Adobe.  When I try to change it so I can transfer downloaded books by my Nook e-reader it I get an error message stating the Adobe user name and password is associated with another computer.  What gives?

    When I set up Adobe reader on my computer to be able to download books from a library and then transfer to my Nook e-reader, I initially stating No authorization required using Adobe.  When I try to change it so I can transfer downloaded books by my Nook e-reader it I get an error message stating the Adobe user name and password is associated with another computer.  What gives?

    This is pretty surprising and wierd that even Reader 10.1.1 is crashing on your system. It works pefectly for me.
    Would it be possible for you to get the crash dump, and upload it, so that I can have a look at the same.
    Download PROCDUMP from <http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx> and extract it to a folder, say, c:\temp\procdump.exe
    Open cmd prompt and type "cd c:\temp".
    Launch the browser and open the PDF.
    Open task manager, sort processed by name. Two AcroRd32.exe instances  should have been launched. Note the PID (a small integer like 5588) corresponding to the AcroRd32.exe with the higher memory usage; this is the process that must be crashing. Note this PID.
    On the cmd window, type "procdump -e -ma 5588 c:\temp\01.dmp" (replace 5588 with the actual PID of the process noted in Step 4). Procdump will now wait for the aoolication to crash. If it throws a EULA, accept it.
    Perform your steps to cause the crash.
    Procdump will have created a dump file at "c:\temp\01.dmp". Zip it up (since it will be 100s of MBs otherwise) and share with me.
    Thanks in advance for all your help
    Ankit

  • When I try to install flash player on my mac, I get to the panel that asks for my name and password, and it will not take my password.  tried changing to a new password and same result

    When I try to install flash player on my Mac, I get to the panel that asks for my name and password, but it will not take my password.  Tried changing the password, but same result.  Suggestions??

    This password prompt is presented by your operating system, and is intended to keep you from accidentally installing software.
    If this is your personal machine and you don't need a password to log into the computer when it first starts up, you can probably leave the password blank and click OK to get past this prompt.  If this is your personal machine and your normal password isn't working, check to make sure that CAPS LOCK is off, and type the password carefully.
    If this is your work machine and it's asking for an Administrator password, well, you'll need to have a conversation with your friendly IT person.

  • On Yahoo Mail...and ONLY Yahoo Mail..I get a 404 error after entering my user name and password. This doesn't happen with IE, just Firefox, and just Yahoo Mail. Yahoo was absouletly no help whatsoever; can you solve the mystery? Thanks

    On Yahoo Mail...and ONLY Yahoo Mail..I get a 404 error after entering my user name and password. This doesn't happen with IE, just Firefox, and just Yahoo Mail. I tried uninstalling and reinstalling FF; no change. Yahoo was absolutely no help whatsoever; can you solve the mystery? Thanks

    HI Emmet,
    thanks so much for your posts back. I really appreciate it and yes that does help to know that you could not get it working.
    I did have some success, in removing the SSL Authentication checkbox in the smtp server settings - I found that this allowed my friend to be able to send mail from the mail app via his sbcglobal (yahoo) account.
    So that did help but of course the messages do not have ssl encryption and I'm not sure how big a deal that is for an individual. He is able to receive mail but unless the SSL authentication box is unchecked, he cannot send.
    i hope that helps anyone out there also!
    Thanks also for the tip about sparrow - yes I have heard of it and it is very popular, he may end up using that in the end.    
    Thanks again, much appreciated.
    Felix    

  • I have a form that has multiple fields but has 5 sections. I have used mail merge to insert information but I can't get Excel to recognize that I need different names and addresses for each section. Please help.

    I have a form that has multiple fields but has 5 sections. I have used mail merge to insert information but I can't get Excel to recognize that I need different names and addresses for each section. Please help.

    Thanks for your response. I do believe I have the information needed for each form on a separate line in Excel. There is a first name, middle name, last name, city, and zip column. And field is entered on a different line for all the information. I'm really stuck.

  • Skydiver. After using separate apple ID's our two iPad minis still get things mixed up like Siri changes our names and some phone

    Skydiver. After using separate apple ID's our two iPad minis still get things mixed up like Siri changes our names and some phone#'s

    but I would like to be able to dowload content to the Ipad as well.
    I'm afraid that you can't sync content to an iOS device via Home Sharing (you can only stream it to an iOS device via Home Sharing).

  • How to get selected Row/Cell value in i5Grid

    Hi Friends,
    Can anyone help to how to find the selected Row/Cell value of a i5Grid object. I am able to register the event handlers which are getting invoked on row/cell selection. But I want to know how can I get the value of selected Cell/Row. I would like to add selected Items from one i5Grid to another one.
    So want to know how can I get and set the value of i5Grid object.
    MII version 14.0 SP4 Patch
    Thank in advance
    Shaji Chandran

    Hi Shaji,
    Here is my code.
    <!DOCTYPE HTML>
    <HTML>
    <HEAD>
        <TITLE>Your Title Here</TITLE>
        <META http-equiv="X-UA-Compatible" content="IE=edge">
        <META http-equiv='cache-control' content='no-cache'>
        <META http-equiv='expires' content='0'>
        <META http-equiv='pragma' content='no-cache'>
        <SCRIPT type="text/javascript" src="/XMII/JavaScript/bootstrap.js" data-libs="i5Chart,i5Grid,i5SPCChart"></SCRIPT>
        <SCRIPT>
            var Grid = new com.sap.xmii.grid.init.i5Grid("STC/C5167365/i5Grid_TagQuery", "STC/C5167365/TagQuery");
            Grid.setGridWidth("640px");
            Grid.setGridHeight("400px");
            Grid.draw("div1");
        function setCellValue()
        Grid.getGridObject().setCellValue(1,1,"Set");
        function setCellValueAgain()
        Grid.getGridObject().setCellValue(1,1,"Changed Again");
        </SCRIPT>
    </HEAD>
    <BODY>
        <DIV id="div1"></DIV>
        <INPUT type="Button" value="setCellValue" onClick="setCellValue()"/>
        <INPUT type="Button" value="setCellValueAgain" onClick="setCellValueAgain()"/>
    </BODY>
    </HTML>
    Regards,
    Sriram

  • Get default row fillColor value

    Hello,
    Sorry for my english it's not my native language.
    The problem i have is that i am using a table that grow each time a row is filled in.
    When some value's are chosen in a dropdownlist the backgroundcolor has to change in red.
    This part is working good already.
    The problem is that the table has alternating row shading.
    So when the specified values are chosen the color changes to red.
    But when the form filler chose another value the color stays red.
    Now i want to get the default fillColor value as a variable and use it for the else color.
    So the variable = the default background color of the alternathing row.
    This i the code i got already:
    form1.InventarisKoelinstallaties.Subform4.Table1.Row1.Cell8::change - (JavaScript, client)
    var RowDefaultColor = Row1.fillColor();
    if (xfa.event.newText == "R22"){
    Row1.fillColor = "255,0,0";
    else if (xfa.event.newText == "R12"){
    Row1.fillColor = "255,0,0";
    else if (xfa.event.newText == "R409a"){
    Row1.fillColor = "255,0,0";
    else if (xfa.event.newText == "R408a"){
    Row1.fillColor = "255,0,0";
    else{
    Row1.fillColor = "RowDefaultColor";
    I hope someone can help me.

    What you want to do is access the template object (as it exists in Designer) of your subform. Here's a function I found awhile back that John Brinkman wrote:
    function findTemplateField(vField)
    var vSOM = vField.somExpression.replace(/\[[0-9]*\]\./g, ".");
    vSOM = vSOM.replace(/xfa\.form/, "$template");
    return xfa.resolveNode(vSOM);
    Put that any where in your change event or even reference it through a script object, your choice.
    Edit the final else line in your code to:
    Row1.fillColor=findTemplateField(Row1).fillColor;
    Kyle

  • How to get selected row data of an ADF table in HashMap?

    Hi,
    Can anyone please tell me how to selected row data of an ADF table in HashMap like :
    Object obj = pageTable.getSelectedRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)obj;
    Now in above code I want the convert rowData in HashMap.
    Can anyone please tell me how to do that? Its urgent.
    Thanks,
    Vik

    Vik,
    No need to ask the same question 3 times...
    In [url http://forums.oracle.com/forums/message.jspa?messageID=4590586]this post, Nick showed you how to get the Row.
    If it were so urgent, you could have done a little reading of the javadocs to come up with code like this (not tested, up to you to do that)
    HashMap m = new HashMap();
    Row r = get it like Nick showed you to;
    Object values[]=r.getAttributeValues();
    String names[]=r.getAttributeNames();
    for (int i=0; i<r.getAttributeCount(); i++)
    m.put(names, values[i]);

Maybe you are looking for

  • Formula Columns are not appearing in pdf format

    hi all, i have a report that contains some formula columns, the report is running correctly in the report builder, but when running the report through the web as .pdf format all report field appear except those formula columns, is there anyone who ca

  • Error processing in PI

    Hi experts, We are using XI to send orders to external suppliers. We use the IDOC adapter for inbound IDOCs (ORDERS05) from our ERP system and the plain http adapter to send the XML document to the supplier. So, it is an asynchronous-synchronous scen

  • Problem in curve 9320 after software update

    Hi, i had updated my curve 9320 with new software as recommended by blackberry desktop software. After the update i am facing many issues after software update: 1. whenever I am trying to make a call or opening any message my phone power suddenly goe

  • Faster way of doing this?

    Is there a faster way to do either of these and accomplish the same result?      public int getXPForLevel(int level) {           int points = 0;           int output = 0;           for (int lvl = 1; lvl <= level; lvl++) {                points += Mat

  • Cost to change hash partition key column in a history table

    Hi All, I have the following scenario. We have a history table in production which has 16 hash partitions on the basis of key_column. But the nature of data that we have in history table that has 878 distinct values of the key_column and about 1000 m