SQL Question : get latest message from messages table

Hi,
I have a table messages and i need to get the latest message by userto where userfrom='a'
MESSAGES
userfrom,userto,timestampsend,subject
a ................b.............xx16h00mn.........hi
a.................b.............xx16h01mn.........hi2
a.................b.............xx16h02mn.........hi3
a.................c.............xx16h00mn.........hi4
a.................c.............xx16h01mn.........hi4
d.................c.............xx16h01mn.........hi6
The result i excpected is ;
a b xx16h02mn , hi3
a c xx16h01mn , hi4
But i don t found the good SQL request.
Anyone can help me?
Thanks

Thanks for your help, but i want the latest messages sent by user for each differents conversation with another user, so
If we have this table
MESSAGES
userfrom,userto,timestampsend,subject
a.................c .............xx16h00mn "hello0"
a.................b .............xx16h01mn "hello1"
c.................a,.............xx16h02mn "hello2"
a.................b.............xx16h03mn "hello3"
c.................b.............xx16h04mn "hello4"
The result was a c hello0
But the expected result will be
a.................c .............xx16h00mn "hello0"
a.................b.............xx16h03mn "hello3"
Have you any idea?

Similar Messages

  • How to get string value from database table using Visual Studio 2005?

    Hi,
    Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
    Im using the below code to get the values from database table
    bool Table::Get(char* FieldName,int& FieldValue)
        try
            _variant_t  vtValue;
            vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
            FieldValue=vtValue.intVal;
        CATCHERRGET
        sprintf(m_ErrStr,"Success");
        return 1;
    Im using the below code to get the values.
    AIErr getProjects()
        char buf[5000];
        int i;   
        std::string  catName;
        ::CoInitialize(NULL);
        Database db;
        Table tbl;
        errno_t err;
        err = fopen(&file,"c:\\DBResult.txt","w");
        fprintf(file, "Before Connection Established\n");
        //MessageBox(NULL,CnnStr,"Connection String",0);
        if(!db.Open(g->username,g->password,CnnStr))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        fprintf(file, "After Connection Established\n");
    if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        int ProjectID;
        int UserID;
        int ProjectTitle;
        char ProjectName[ProjectNameSize];
        if(!tbl.ISEOF())
            tbl.MoveFirst();
        ProjectArrCnt=0;
        for(i=0;i<128;i++)
            buf[i]='\0';
            int j=0;
        while(!tbl.ISEOF())
            if(tbl.Get("ProjectID",ProjectID))
                fprintf(file,"Project ID: %d ",ProjectID);
                ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
                sprintf(buf,"%d",ProjectID);
                //MessageBox(NULL, buf,"f ID", 0);
                j++;
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            //if(tbl.Get("ProjectTitle",ProjectName))
            if(tbl.Get("ProjectName",ProjectName))
                MessageBox(NULL,"Inside","",0);
                fprintf(file,"ProjectTitle: %s\n",ProjectName);
                //catName=CategoryName;
                ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
                //sprintf(buf,"%s",ProjectName);
                MessageBox(NULL,(LPCSTR)ProjectName,"",0);
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            ProjectArrCnt++;
            //MessageBox(NULL, "While", "WIN API Test",0);
            tbl.MoveNext();
        //MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
        ::CoUninitialize();
        //sprintf(buf,"%s",file);
        //MessageBox(NULL,buf,"File",0);
        fprintf(file, "Connection closed\n");
        fclose(file);
        for(i=0;i<ProjectArrCnt;i++)
            sprintf(buf,"%i",ProjectInfo[i].ProjectID);
            //MessageBox(NULL,buf,"Proj ID",0);
            //MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
        return 0;
    In the above code im geeting project D which is an integer value. But not able to get the project name.
    Please some one guide me.

    As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.

  • How to get the data from Pooled Table T157E.

    Hi Experts,
    How to get the data from Pooled Table T157E.
    Any help.
    Thanks in Advance,
    Ur's Harsha.

    create some internal table similar to T157E and pass all data as per SPRAS.
    After that use internal table in your program as per the requirement.
    Regds,
    Anil

  • Question reg. how to get a field from a table

    What is EIN? (I think it is employer identification number). My functional consultant told me to get this value from company code. Can you tell me from which table and field I can get this value?
    Thanks,
    Krishen

    i think these tables are helpfull
    /SAPPCE/TDPC01
    /BEV1/RBVBAK
    /BEV1/RBVBAP
    VSVBAK_CN
    VSVBAp_CN
    VBAK and VBAP.
    Regards,
    Pradhan.

  • Optimization of getting the Discount from KONV table

    Sir\Gurus ; Im having trouble on optimizing of my sales report when i put the discounts data from KONV table . I hope you can help about this as it took so long to generate the report or worse it gets runtime error when i included the KONV table. Hope you can help me find a better way of getting the discount Below is my codes:
      select single kbetr kwert krech
          into (ls_data-zp01, ls_data-zp01v, ls_data-zp01t)
           from konv
          where knumv eq ls_data-knumv
            and kposn eq ls_data-posnr
            and kschl eq 'ZP01'.            "FA - Price Off Disc
        if ls_data-zp01t = 'A'.   "percentage
          ls_data-zp01 = ls_data-zp01 / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zp02, ls_data-zp02v, ls_data-zp02t)
           from konv
          where knumv eq ls_data-knumv
            and kposn eq ls_data-posnr
            and kschl eq 'ZP02'.    "Volume Discount
        if ls_data-zp02t = 'A'.   "percentage
          ls_data-zp02 = ls_data-zp02 / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zp03, ls_data-zp03v, ls_data-zp03t)
        from konv
       where knumv eq ls_data-knumv
         and kposn eq ls_data-posnr
         and kschl eq 'ZP03'.              "Opening Support Disc
        if ls_data-zp03t = 'A'.   "percentage
          ls_data-zp03 = ls_data-zp03 / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zp04, ls_data-zp04v, ls_data-zp04t)
         from konv
        where knumv eq ls_data-knumv
          and kposn eq ls_data-posnr
          and kschl eq 'ZP04'.              "Introductory Discount
        if ls_data-zp04t = 'A'.   "percentage
          ls_data-zp04 = ls_data-zp04 / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zp05, ls_data-zp05v, ls_data-zp05t)
          from konv
         where knumv eq ls_data-knumv
           and kposn eq ls_data-posnr
           and kschl eq 'ZP05'.             "Mailer Discount
        if ls_data-zp05t = 'A'.            "percentage
          ls_data-zp05 = ls_data-zp05 / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zp06, ls_data-zp06v, ls_data-zp06t)
       from konv
      where knumv eq ls_data-knumv
        and kposn eq ls_data-posnr
        and kschl eq 'ZP06'.              "%Price Off Disc
        ls_data-zp06 = ls_data-zp06 / 10.   "convert to percentage display  "+dv 8mar2011
        if ls_data-zp06t = 'A'.   "percentage
          ls_data-zp06 = ls_data-zp06 / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zp07, ls_data-zp07v, ls_data-zp07t)
          from konv
         where knumv eq ls_data-knumv
           and kposn eq ls_data-posnr
           and kschl eq 'ZP07'.       "Christmas Basket
        if ls_data-zp07t = 'A'.   "percentage
          ls_data-zp07 = ls_data-zp07 / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zp08, ls_data-zp08v, ls_data-zp08t)
         from konv
        where knumv eq ls_data-knumv
          and kposn eq ls_data-posnr
          and kschl eq 'ZP08'.         "Move Out Disc
        if ls_data-zp08t = 'A'.   "percentage
          ls_data-zp08 = ls_data-zp08 / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zp09, ls_data-zp09v, ls_data-zp09t)
          from konv
         where knumv eq ls_data-knumv
           and kposn eq ls_data-posnr
           and kschl eq 'ZP09'.         "Other Promotional Disc
        if ls_data-zp09t = 'A'.   "percentage
          ls_data-zp09 = ls_data-zp09 / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zsdt, ls_data-zsdtv, ls_data-zsdtt)
          from konv
         where knumv eq ls_data-knumv
           and kposn eq ls_data-posnr
           and kschl eq 'ZSDT'.       "Subdi. Trade Disc
        if ls_data-zsdtt = 'A'.   "percentage
          ls_data-zsdt = ls_data-zsdt / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-ztrd, ls_data-ztrdv, ls_data-ztrdt)
         from konv
        where knumv eq ls_data-knumv
          and kposn eq ls_data-posnr
          and kschl eq 'ZTRD'.        "% Trade Discount
        if ls_data-ztrdt = 'A'.   "percentage
          ls_data-ztrd = ls_data-ztrd / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-ztrf, ls_data-ztrfv, ls_data-ztrft)
         from konv
        where knumv eq ls_data-knumv
          and kposn eq ls_data-posnr
          and kschl eq 'ZTRF'.       "FA Trade Discount
        if ls_data-ztrft = 'A'.   "percentage
          ls_data-ztrf = ls_data-ztrf / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zvol, ls_data-zvolv, ls_data-zvolt)
          from konv
         where knumv eq ls_data-knumv
           and kposn eq ls_data-posnr
           and kschl eq 'ZVOL'.      "Volume Discount
        if ls_data-zvolt = 'A'.   "percentage
          ls_data-zvol = ls_data-zvol / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zwho, ls_data-zwhov, ls_data-zwhot)
          from konv
         where knumv eq ls_data-knumv
           and kposn eq ls_data-posnr
           and kschl eq 'ZWHO'.      "Whole Sale Discount
        if ls_data-zwhot = 'A'.   "percentage
          ls_data-zwho = ls_data-zwho / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zsbo, ls_data-zsbov, ls_data-zsbot)
          from konv
         where knumv eq ls_data-knumv
           and kposn eq ls_data-posnr
           and kschl eq 'ZSBO'.       "Subdi .BO Allowance
        if ls_data-zsbot = 'A'.   "percentage
          ls_data-zsbo = ls_data-zsbo / 10.   "convert to percentage display
        endif.
        select single kbetr kwert krech
          into (ls_data-zrnd, ls_data-zrndv, ls_data-zrndt)
        from konv
       where knumv eq ls_data-knumv
         and kposn eq ls_data-posnr
         and kschl eq 'ZRND'.          "Rounding Discount
        if ls_data-zrndt = 'A'.   "percentage
          ls_data-zrnd = ls_data-zrnd / 10.   "convert to percentage display
        endif.
        "Freight
        select single kwert
          into ls_data-zhd0
          from konv
         where knumv eq ls_data-knumv
           and kposn eq ls_data-posnr
           and kschl eq 'ZHD0'.          "Freight
        "+dv 3mar2011
        " Depending on Price Procedure, Get gross price
        data: lc_kwert type konv-kwert.
        case ls_data-kalsm.
          when 'ZBENBY' or 'ZRETRN'.
            "Gross Price
            clear lc_kwert.
            select single kwert
              into lc_kwert
              from konv
             where knumv eq ls_data-knumv
               and kposn eq ls_data-posnr
               and kschl eq 'PR01'.
            ls_data-gross_price = lc_kwert.
            "Net Price
            ls_data-kzwi3 = ls_data-netwr.
            "Gross Price net of disc  as is kzwi2(subtotal)
          when 'ZRVA01'.
            "Gross Price
            clear lc_kwert.
            select single kwert
              into lc_kwert
              from konv
             where knumv eq ls_data-knumv
               and kposn eq ls_data-posnr
               and kschl eq 'PR00'.
            ls_data-gross_price = lc_kwert.
            "Net Price
            ls_data-kzwi3 = ls_data-netwr.
            "Promo
            clear ls_data-kzwi1.
            "Trade
            clear ls_data-kzwi6.
            "Gross Price net of disc
         ls_data-kzwi2 = ls_data-netwr + ls_data-mwsbp.  "-dv 8mar2011
            ls_data-kzwi2 = ls_data-netwr - ls_data-zhd0.    "+dv 8mar2011
        endcase.
    Thanks & God Bless
    Moderator message : Duplicate post locked.
    Edited by: Vinod Kumar on Oct 10, 2011 1:51 PM

    sql>select * from t22;
    ID C_DT M_DT 
    1  27-DEC-06  06-JAN-07 
    1  06-JAN-07  11-JAN-07 
    1  12-JAN-07  14-JAN-07 
    1  15-JAN-07  16-JAN-07
    sql>
    select sum(decode(to_char(c_dt,'mon'),'jan',1,0))/count(*) c_per,sum(decode(to_char(m_dt,'mon'),'jan',1,0))/count(*) m_per
    from t22;
    C_PER M_PER
    .75  1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • CE function to get distinct values from Column table

    Hi All,
    Could you please let me know the appropriate CE function to get the distinct values from column table.
    IT_WORK = SELECT DISTINCT AUFNR FROM :IT_WO_DETAILS;
    Thank you.

    Hi,
    If you have 10g, you can use Model( with model performance is better than connect by )
    Solution
    ========================================================================
    WITH t AS
    (SELECT '0989.726332, 1234.567432, 3453.736379, 3453.736379, 0989.726332, 3453.736379, 1234.567432, 1234.567432, 0989.726332'
    txt
    FROM DUAL)
    SELECT DISTINCT TRIM(CHAINE)
    FROM T
    MODEL
    RETURN UPDATED ROWS
    DIMENSION BY (0 POSITION)
    MEASURES (CAST( ' ' AS VARCHAR2(50)) AS CHAINE ,txt ,LENGTH(REGEXP_REPLACE(txt,'[^,]+',''))+1 NB_MOT)
    RULES
    (CHAINE[FOR POSITION FROM  1 TO NVL(NB_MOT[0],1) INCREMENT 1] =
    CASE WHEN NB_MOT[0] IS NULL THEN TXT[0] ELSE REGEXP_SUBSTR(txt[0],'[^,]+',1,CV(POSITION)) END );
    =========================================================================
    Demo
    =======================================================================
    SQL> WITH t AS
    2 (SELECT '0989.726332, 1234.567432, 3453.736379, 3453.736379, 0989.726332, 3453.736379, 123
    4.567432, 1234.567432, 0989.726332'
    3 txt
    4 FROM DUAL)
    5 SELECT DISTINCT TRIM(CHAINE)
    6 FROM T
    7 MODEL
    8 RETURN UPDATED ROWS
    9 DIMENSION BY (0 POSITION)
    10 MEASURES (CAST( ' ' AS VARCHAR2(50)) AS CHAINE ,txt ,LENGTH(REGEXP_REPLACE(txt,'[^,]+',''))+1 NB_MOT)
    11 RULES
    12 (CHAINE[FOR POSITION FROM  1 TO NVL(NB_MOT[0],1) INCREMENT 1] =
    13 CASE WHEN NB_MOT[0] IS NULL THEN TXT[0] ELSE REGEXP_SUBSTR(txt[0],'[^,]+',1,CV(POSITION)) END );
    TRIM(CHAINE)
    3453.736379
    1234.567432
    0989.726332
    SQL>
    ========================================================================

  • How to get selected entity from ADF Table

    I'm using EJB and ADF Faces.
    I have an ADF Table, and when a row is selected I'd like to be able to get the EJB Entity that was selected, is this feasible?
    The reason I would like to do it, is for a Dialog. I have a popup dialog, and in the popup the user can do a search. The results are displayed in the ADF table. When supplying the return value from the dialog:
    AdfFacesContext.getCurrentInstance().returnFromDialog(?, null);
    I would like ? to be the EJB entity representing the row, because I need to return the value of more than one of the columns. Is this not realistic, or should I just add then to a List and pass that back?
    thanks
    R

    Thanks KUBA,
    I hacked some code from the inbuilt JDeveloper Help. Are you saying there is an easier way than this, or did I state the question poorly and you gave an answer to something else? My english is not always perfect.
    This is the code that works for me. (cmdSelect is the submit button on the table)
    public String cmdSelect_action() {
    //Access the tableSelectMany1 table. Note that the table name
    //is taken from the id of the table in the JSF page.
    CoreTable table = this.getUserResultsTable();
    //Obtain a list of all selected rows from the table
    Set rowSet = table.getSelectionState().getKeySet();
    Iterator rowSetIter = rowSet.iterator();
    //Use the declarative method to get the ADF bindings
    BindingContainer bindings = getBindings();
    //Get the object to delete. To do this, you must get the
    //iterator binding for the Products in the page definition file,
    //and cast it to DCIteratorBinding for further processing
    DCIteratorBinding pr_dcib = (DCIteratorBinding)
    bindings.get ("queryUserVFindByFullNameIter");
    //Loop through the set of selected row numbers and delete the
    //equivalent object from the Products collection.
    UserV userV = null;
    while (rowSetIter.hasNext()){
    //get the table row
    Key key = (Key) rowSetIter.next();
    //set the current row in the ADF binding to the same row
    pr_dcib.setCurrentRowWithKey(key.toStringFormat(true));
    //Obtain the Products object to delete
    RowImpl prRow = (RowImpl) pr_dcib.getCurrentRow();
    //using the generated code to execute the declarative method
    userV = (UserV)prRow.getDataProvider();
    break;
    AdfFacesContext.getCurrentInstance().returnFromDialog(userV, null);
    return null;
    }

  • How to get the StatusText from XMII_JCOMESSAGES Table

    Hi all,
    I need to show the Status as well as StatusText from XMII_JCOMESSAGES table for a particular message in a custom User Interface. I have checked through Read Message action block and Query Message action block. Read Message action block returns two XML structure like JCOMessage and MessageDocumentXML. JCOMessage xml does not contain the StatusText field. The structure of JCOMessage is like
    <JCOMessage>
    <MessageId/>
    <JcoServerName/>
    <MessageName/>
    <Category/>
    <MessageType/>
    <Status/>
    <DocNumber/>
    <DocCount/>
    <Function/>
    <PacketID/>
    <ProcessingTimeStamp/>
    <ReceivedTime/>
    </JCOMessage>
    But I have checked the XMII_JCOMESSAGES table from NWA  and the structure of XMII_JCOMESSAGES table is
    MESSAGEID
    RECEIVEDDATETIME
    JCOSERVERID
    MESSAGETYPE
    MESSAGENAME
    PROCESSINGDATETIME
    DOCNUMBER
    DOCXML
    CATEGORY
    PACKETID
    STATUS
    STATUSTEXT
    SERVER
    So, how can I fetch the STATUSTEXT field. Can anybody help me.
    Thanks in advance
    Chandan

    Aside from the Update Message block status text (integer values 1 - 4 coincide with the options in the drop down box on the configure dialog) that you can see in the link editor, you may need to use the Message Monitor status flag on the web page to determine what the number means in relation to friendly status text.
    Probably worth logging a ticket for consideration to add this into the actions.  I would assume this string might be translated into a local languague for the user but I'm not sure.

  • Question about retrieving data from two tables

    Hi everyone.
    I've been working on this and was wondering what the correct way of handling this would be.
    I have two tables, a Billing Table that contains invoices and related information, and a Payments Table that contains payments and related information to that.
    Both tables contain a Date Column for the date that the Invoice was generated or the Payment was made.
    I want to get a list of all Invoices and the respective payments if the invoice was generated between two dates OR the payment was made between these two dates.
    I can get a list of the invoices and their payments if the invoice was generated between those dates.  I can get a list of the payments if they were made between those dates.  But I can't seem to figure out how to do both.
    How do I Join two tables and have it return the data from both tables if either meets the required Date Period?
    Here is the SQL that I have so far.  This SQL returns all of the Invoices and Payments IF the Invoice was generated between these two dates (Or updated). 
    SELECT Billing.ID AS [BID], Billing.AttachmentName, Billing.BillingType, Billing.Invoice, Billing.Description, Billing.Amount, Billing.DateCreated AS [BillingDate],
    Payments.ID AS [PID], Payments.Type AS PaymentType, Payments.Payment, Payments.PaymentNote, Payments.Reason AS [BillReason], Payments.DateCreated AS [PaymentDate],
    Customers.ID AS [CID], COALESCE(NULLIF(Customers.Company,'') + ' - ','') + Customers.LName + ', ' + Customers.FName AS [Name],
    Jobs.ID AS [JID], Jobs.JobType, Jobs.JobStatus, Jobs.JobStatusDate
    FROM Billing LEFT OUTER JOIN Payments ON Payments.BillingID = Billing.ID
    RIGHT OUTER JOIN Customers ON Customers.ID = Billing.CustomerID
    RIGHT OUTER JOIN Jobs ON Jobs.ID = Billing.JobID
    WHERE
    Billing.BillingType = 'Invoice' AND Billing.PaidInFull = 'No' AND Billing.Collections = 'No' AND Billing.ChargeOff = 'No' AND Billing.Lien = 'No' AND Billing.InvoiceCanceled = 'No'
    AND (Billing.DateCreated >= '1/1/2014' AND Billing.DateCreated <= '8/13/14') OR (Billing.DateUpdated >= '1/1/14' AND Billing.DateUpdated <= '8/13/14')
    ORDER BY Name Asc, Billing.Invoice, PID
    Thanks for your help, I really appreciate it.
    -Matt-

    I don't quite follow your query, but your description leads me to think that you need the set of Billing IDs for bills that were created as defined or that have payments that were created as defined.  From that set of IDs you then simply want all Bills
    and their associated payments.  So how do you get that set of IDS?  One way is the union operator: 
    with allbill (billID) as (
    select ID from dbo.Billings where DateCreated between ...
    union 
    select BillingID from dbo.Payments where DateCreated between ... )
    select ...
    from allbill inner join dbo.Billings as bill on allbill.billID = bill.ID inner join dbo.Payments as pay 
    on bill.ID = pay.BillingID 
    order by ... ;
    Your description leads me to believe that you query is much more complicated, but the basic idea is the union in the CTE - generate one combined set of bill IDs that identify all your bills of interest.  Note that I assumed that a payment cannot exist
    with an associated billing.  

  • Get selected elements from a table

    Hi all,
    I have a requirement like i m enhancing standard component in that i have added one button on click of that i want fetch the selected line item from the table ( which is a normal table). selection mode is auto.
    i tried with  the following code.
    DATA:lr_element                   TYPE REF TO if_wd_context_element,
           lv_index                     TYPE i.
    *--Get selected element
      lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
    ****Here itself its throughing dump because lr_element is initial***************
    *--get selected element index.
      lv_index = lr_element->get_index( ).
    can any one help me what is the wrong.. else suggest me how to get the selected elements from a table....
    Thanks in advance.

    *--Get selected element
    lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
    if  lr_element is bound.
    lv_index = lr_element->get_index( ).
    endif.
    Instead you can directly read the node if that row is a lead selected one.
    lo_node = wd_context->get_child_node( name = 'EMP' ).  "Emp is node name
    lo_ele = lo_node->get_lead_selection( ).
    or
    lv_index = lo_node->get_lead_selection_index( ).
    where is the above code written..is it written in OnLeadSelect event of the TABLE..
    can any one help me what is the wrong.. else suggest me how to get the selected elements from a table....
    As the selection mode is Auto there is no multiple selection..hence try to use the lead selection only.
    Edited by: Lekha on Jan 3, 2012 6:47 PM

  • Get cell value from Woodstock table

    Hello,
    I am using a Woodstock Basic Table from the NB palette.
    One of the columns is editable and I need to get the updated values upon a button click event.
    How do I get the value of a specific cell from the table?
    Thanks

    Hi Rajashekar ,
    here is the code :
    // Get a handle to the table footer bean
    OATableBean tableBean = ...;
    OATableFooterBean tableFooterBean = tableBean.getFooter();
    if (tableFooterBean != null)
    // Get a handle to the total row bean
    OATotalRowBean totalRowBean = tableFooterBean.getTotal();
    --Keerthi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get multiple rows from database table?

    hello !
    I need to get multiple rows from a OLEDB database table and display them on a table object.
    I did "Wrap in subfrom" on the table,  set  subform of the table to "flowed", and checked "Repeat row for each data item" of Row1 of the table.
    But I can get only one row on the table object.
    I need your help.
    Thanks

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • How to get multiple records from internal table through BDC

    PERFORM DYNPRO USING:
      'X'  'SAPMM61L'  '0500',
      ' '  'BDC_OKCODE'  '=NEWC',
      'X'  'SAPMM61L'  '0500',
      ' '  'BDC_CURSOR'  'PLPTU-PLWRK(01)',
      ' '  'BDC_OKCODE'  '=TAKE',
      ' '  'PLPTU-PLWRK(01)' '2531'. (2531 is a plant)
    This is the recording used to get plant via BDC of MS31.
    Using this code i can get only single plant...
    If i want to get multiple plants from an internal table,how i can change this code?
    Since it is a recording i cant put this code in LOOP..ENDLOOP.
    Suggest any method for doing this....
    Awaiting for ur reply...

    Hi,
    While recording also record the scroll down button.
    The you can place different plant in the BDC using loop and endloop
    Regards
    Arun

  • How to get the links from Master table

    Hi,
    I need to show url on the jsp page which should be taken from Backend "Master Table".
    say an example like some value CRM_IMAGE =  ZWEB CRMIMAGE.I need to show CRM_IMAGE as  Hyperlink on the product detail.jsp.
    Can anyone help me for this.
    Regards,
    Deepika
    Edited by: Ecom Dev on Dec 21, 2009 11:05 AM

    Hi Ecom,
    To retrieve value on product detail page you have to develop your custom code in which you have to create BO, BOM, BEI and BEO to access Your master table data from ISA page.
    You also need to create Custom RFC in which you pass porduct ID and retrieve related value from Master Table.
    You can find example in ISA tutorial how to get value from Back-end via JCO.
    eCommerce Developer
    Edited by: Ecommerce Developer on Dec 21, 2009 11:44 AM

  • Performance Issue - Fetching latest date from a507 table

    Hi All,
    I am fetching data from A507 table for material and batch combination. I want to fetch the latest record based on the value of field DATBI. I have written the code as follows. But in the select query its taking more time. I dont want to write any condition in where claue for DATBI field because I have already tried with that option.
    SELECT kschl
               matnr
               charg
               datbi
               knumh
        FROM a507
        INTO TABLE it_a507
        FOR ALL ENTRIES IN lit_mch1
        WHERE kschl = 'ZMRP'
        AND   matnr = lit_mch1-matnr
        AND   charg = lit_mch1-charg.
    SORT it_a507 BY kschl matnr charg datbi DESCENDING.
      DELETE ADJACENT DUPLICATES FROM it_a507 COMPARING kschl matnr charg.

    Hi,
    These kind of tables will be storing large volumes of data. Thus while making a select on it, its important to use as many primary key fields as possible in the where condition. Here you can try mentioning KAPPL since its specific to a requirement. If its for purchasing use 'M' and try.
    if not lit_mch1[] is initial.
    SELECT kschl
    matnr
    charg
    datbi
    knumh
    FROM a507
    INTO TABLE it_a507
    FOR ALL ENTRIES IN lit_mch1
    WHERE kappl = 'M'
    AND kschl = 'ZMRP'
    AND matnr = lit_mch1-matnr
    AND charg = lit_mch1-charg.
    endif.
    SORT it_a507 BY kschl matnr charg datbi DESCENDING.
    DELETE ADJACENT DUPLICATES FROM it_a507 COMPARING kschl matnr charg.
    This should considerably increase the performance
    Regards,
    Vik

Maybe you are looking for

  • Wireless options anyone?

    Hey guys, I've moved my desk to another room that has no internet or network access. What are my options for the Mac Mini now besides the Airport/Bluetooth upgrade kit? Currently, I have a PC running WindowsXP Pro that has a wireless Dlink G adapter

  • How to execute a shell script which is present in remote machine using ODI

    I have requirement of executing a batch (shell script) which is present in the remote machine. i have an ODI agent in remote machine as well. I have created agent locally by using the remote machine IP and port. I am able to test the agent successful

  • Viewing TIF files in Mac OS X v4

    Hello: I have been sent some files in TIF format but I cannot find a way to view these files in Mac OS X (10.4). I have confirmed that the files are not corrupted, since I can transfer them to a Windows PC and view them there, but OS X does not appea

  • My phone will not turn on after downloading ios 8

    I updated to the IOS 8 this morning and now my phone will not turn on, it just keeps directing me to itunes and every time I try there is some kind of error, what do I need to do?

  • Newbie to MAC-How can I check my .mac email from my work PC?  Thanks!

    Hi there. I am a new MAC user and not the brightes bulb with computers... how can I check my .mac email from my pc at work? Do I just go to mac.com? Thanks!