Read elements of a table

HI all,
         I have a table with about 100 rows and 6 columns. I want to read each and every element of the table for implementing some checks and using each of them individually further. Could you please help me, how to do so.
Cheers Umang

Hi,
use the following code choose one of them based on your requirement
code is based on the node called "Orders" and its Elements so you need to change this according to yours
for(int x=0; x<wdContext.nodeOrders().size(); x++)
            //Generic Approach
            IWDNodeElement element = wdContext.nodeOrders().getElementAt(x);
            Object obj = element.getAttributeValue("<Your Attribute Name>");
            //Typed Approach
            IOrdersElement element2 = wdContext.nodeOrders().getOrdersElementAt(x);
            String type = element2.getOrderType();
Regards
Ayyapparaj

Similar Messages

  • 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

  • Regarding Link to URL UI Element in a table

    Hi All,
    I am using "link to url" UI Element in a table column. I have mapped the column (i mean the "reference" property of "link to url" UI to a bapi node). Now, when I am populating the table, for some rows the bapi is not returning the url links. So, the column is getting disabled and not even showing the links for the rows which are getting the url link from the bapi.
    Is there any way to set the mapping row wise, so that the rows which have data get enabled with the link and which do not have data will be disabled.
    Also, can I make the whole table readonly, except for one column.
    Please help me in this regard.
    Regards,
    Murthy.

    Hi Armin,
    Thank you very much. The problem is solved. 10 points for you.
    Another Question.......
    Can we make the table readonly, leaving just one column to select.(that is the column with link to url). Is it possible? If so, please tell me how....
    Also, can you tell me the reason for the following exception.....
    <b>com.sap.tc.webdynpro.progmodel.context.ContextConfigurationException: DataNodeInfo(CreateTemplateComp.Zad_Bapi_Get_Template_Details_Input.Output.T_Template_Details): structure field Ad_Height not found
        at com.sap.tc.webdynpro.progmodel.context.DataAttributeInfo.init(DataAttributeInfo.java:299)
        at com.sap.tc.webdynpro.progmodel.context.NodeInfo.initUnmappedAttributes(NodeInfo.java:687)
        at com.sap.tc.webdynpro.progmodel.context.DataNodeInfo.doInit(DataNodeInfo.java:238)
        at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:671)
        at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)
        ... 49 more</b>

  • FileDownload UI Element in a table

    I'm tryign to use FileDownload UI Element in a table, but it seems not to work.
    I have defined a binary, an IWDAttributeInfo and a IWDModifiableBinaryType attributes in the same context node of the table.
    In wdDoInit() I wrote the following code:
    for (int i=0;i<wdContext.nodeFileTab().size();i++)
    try {
    wdContext.nodeFileTab().getFileTabElementAt(i).setAttInfo(wdContext.nodeFileTab().getNodeInfo().getAttribute(IPrivateView_pdfView.IFileTabElement.T_FILE_DOWNLOAD));
    wdContext.nodeFileTab().getFileTabElementAt(i).setBinaryType((IWDModifiableBinaryType)wdContext.nodeFileTab().getFileTabElementAt(i).getAttInfo().getModifiableSimpleType());
    wdContext.nodeFileTab().getFileTabElementAt(i).getBinaryType().setFileName(wdContext.nodeFileTab().getFileTabElementAt(i).getFilename());
    wdContext.nodeFileTab().getFileTabElementAt(i).getBinaryType().setMimeType(WDWebResourceType.PDF);
    wdContext.nodeFileTab().getFileTabElementAt(i).setTFileDownload(this.getByteArrayFromResourcePath("/sapmnt/PCD/global/config/cm/etc/pdf/"+wdContext.nodeFileTab().getFileTabElementAt(i).getFilename()));
    catch (Exception e)
    wdComponentAPI.getMessageManager().reportException(e.toString(),true);
    As result each row download the file in the last row. Is there any other way I can try?

    Hi Anita,
    you cannot set metadata at element level of a node. When you set the metadata ( example mime type or file name ) for a particular element in the node , it changes for all the element. So you are always getting the file for the last row. ( most recent set metadata ).
    Try using the inteface IWDCachedWebResource for file download.
    For each row add a button, and associate an action "DownloadFile" for it. Use the following "onAction" for the said action. 
    public void onActionDownloadFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionDownloadFile(ServerEvent)
        int selectedIndex = wdContext.nodeFileTab().getLeadSelection();
        IPrivateView_pdfView.IFileTabElement file = wdContext.nodeFileTab().getFileTabElementAt(selectedIndex);
        try {
         IWDCachedWebResource webResource = WDWebResource.getWebResource(
              this.
              getByteArrayFromResourcePath("/sapmnt/PCD/global/config/cm/etc/pdf/"+
              wdContext.nodeFileTab().getFileTabElementAt().getFilename(selectedIndex),
              WDWebResourceType.PDF);
         wdComponentAPI.getWindowManager().createExternalWindow(webResource.getURL(),"Download File",true).open();
       catch(Exception e) {
         // take some action
         wdComponentAPI.getMessageManager().reportException(e.toString(),true);
        //@@end
    Hope you get a solution.
    Regards
    KK.

  • How to get selection screen elements and its table reference of a report ?

    halo experts
    How can I get selection screen elements and its table reference of a report ? . I tried rs_refresh_from_select_options. But I am unable to get the table and field it is referring to
    For eg if my selection screen 1000 is
    parameters: p_carrid type spfli-carrid,
    select-options :s-_connid type sflight-connid.
    is there any Fm or method which gives me what are the screen elements( p_carrid and s_connid ) and what table( splfi and sflight ) and field ( carrid and conid )it is referring to ?

    The following code is an example of how you might dynamically determine all your PARAMETERS and SELECT-OPTIONS variables at run time.  The PARAMETERS and SELECT-OPTIONS only point to a dictionary element--not a specific table.  Even though you may say "spfli-carrid" or "sflight-connid", the data type really references the dictionary type and not a specific table/structure.
    REPORT  ZTEST_PROG.
    TABLES sflight.
    DATA:
           screen_tab TYPE STANDARD TABLE OF screen,
           wa_screen TYPE screen,
           scrn_nm TYPE string,
           scrn_leftover TYPE string,
           l_type TYPE REF TO cl_abap_typedescr,
           typ_nm TYPE string,
           typ_pre TYPE string.
    FIELD-SYMBOLS <fs_data> TYPE ANY.
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECT-OPTIONS s_connid FOR sflight-connid.
    INITIALIZATION.
      LOOP AT SCREEN.
        IF screen-group3 = 'PAR'
          OR screen-group3 = 'LOW'.
            APPEND screen TO screen_tab.
        ENDIF.
      ENDLOOP.
    START-OF-SELECTION.
      LOOP AT screen_tab INTO wa_screen.
        ASSIGN (wa_screen-name) TO <fs_data>.
        l_type = cl_abap_typedescr=>describe_by_data( <fs_data> ).
        IF wa_screen-group3 = 'LOW'.
          SPLIT wa_screen-name AT '-' INTO scrn_nm scrn_leftover.
          TRANSLATE scrn_nm TO UPPER CASE.
        ELSE.
          scrn_nm = wa_screen-name.
        ENDIF.
        SPLIT l_type->absolute_name AT '=' INTO typ_pre typ_nm.
        WRITE:
                 / 'Screen Name:  ', scrn_nm,
                 / 'DDIC Type:    ', typ_nm.
      ENDLOOP.
    When you get into defining internal tables you can determine those at run time with cl_abap_structdescr.  The following is an example of how you might do that.  You can loop through the "components_table" and evaluate each field of the structure in this way.
    DATA: structure_reference TYPE REF TO cl_abap_structdescr,
          components_table TYPE abap_compdescr_tab,
          components_structure LIKE LINE OF components_table.
    structure_reference ?= cl_abap_structdescr=>describe_by_data( any_structure ).
    components_table = structure_reference->components.
    I don't know if this answers any of your questions but I hope that some of it is useful.

  • REG: How to add elements onto htmlb table cell.. URGENT PLZ HELP

    Hi all,
    I have created a htmlb table. And the jsp code is as follows
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <jsp:useBean id="myBean" scope="application" class="com.linde.myaccounts.util.TableBean" />
    <hbj:content id="myContext">
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId" >
       <hbj:tableView id="myTableView1"
                          model="myBean.model"
                          design="ALTERNATING"
                          headerVisible="false"
                          footerVisible="false"
                          fillUpEmptyRows="true"
                          visibleFirstRow="1"
                          visibleRowCount="5"
    </hbj:form>
      </hbj:page>
    </hbj:content>
                          width="500 px" >
    </hbj:tableView>
    I have used a table bean by which I am getting the column header names. I have 5 columns, I have to add input field in the first column, checkbox in the second column, leave the third column blank, checkbox in the fourth column and again a input field in the fifth column. I am not understanding on how to add this elements onto the table. Will I add it from the JSP using <hbj:tableViewColumns> tag or I have add them in the bean or in the dynpage. Kindly someone give me the code for this...
    This is very urgent..Kindly help...
    Thanks in advance,
    Priyanka

    Hi,
    Have you tried looking at the examples that come with the PDK for all of the HTMLB elements?  From memory, there should be a small table example or 2 that have different types of columns shown similar to what you want - they have the full source code with them for you to look at.
    If you are working in a portal, go to the Java Developer tab and I "think" there should be a tab linking to HTMLB documentation and examples - sorry I can't be more specific but I don't have access to a portal at the moment so am trying to remember.
    Gareth.

  • Reading data from BSEG table with Non-key fields in where clause

    Hi All,
        I have to read data from BSEG table based on WBS element field (PROJK). As I'm not passing key fields to WHERE clause system couldnt run the select statement. Since BSEG is a cluster table I cant even create secondary index on PROJK field.
       Could you please tell me, how to improve its performance.
    Regards
    Jaker.

    SELECT bukrs
                 belnr
                 gjahr
                 shkzg
                 dmbtr
                 hkont
                 lifnr
                 matnr
                 werks
                 menge
                 meins
                 ebeln
            FROM bseg
            INTO TABLE it_bseg
            PACKAGE SIZE 10
            FOR ALL ENTRIES IN it_final
            WHERE  bukrs EQ it_final-bukrs
               AND belnr EQ it_final-belnr
               AND gjahr EQ it_final-gjahr
               AND buzei EQ it_final-buzei
               AND hkont EQ it_final-hkont
               AND werks IN s_werks.
    By using package and fetch from BSEG table. gathering all other information to a final internal table.This will reduce the hit to database.And also try to put that data in hashed internal table which is it_bseg....then definetly improve the performance.
    <REMOVED BY MODERATOR>
    Dara.
    Edited by: Alvaro Tejada Galindo on Apr 21, 2008 12:47 PM

  • ERROR WHEN READING ELEMENT IN SAPSCRIPT

    Hi All,
    In a custom PO form, I am getting error when reading element in WRITE_FORM.
    This element 'ITEM_MPN_LISTLINE' and 'ITEM_MPN_LISTHEADER' are in the standard form and I copied the same to custom form and added the relevant coding in the driver program. But in the WRITE_FORM, it always throw the error 1.
    which is after this statement in WRITE_FORM
    read table elements with key tdwindow = window
                            tdevent  = element
                           binary search.
    Sy-subrc is 1 since it is not able to find the element 'ITEM_MPN_LISTLINE' and 'ITEM_MPN_LISTHEADER'  from the table elements.
    Any help is appreciated
    Thanks

    I want the form to be printed with the values of elements mentioned above. There is no error coming up for the script. But the values of elements ITEM_MPNLISTLINE and ITEM_MPN_LISTHEADER are not getting displayed in the form output. Any help is really appreciated. This is very urgent
    Thanks
    Ricky

  • Is it possible for the JDBC Lookup in PI 7.1 to read other user's table?

    Hi,
    I have the requirement of using the standard JDBC Lookup in PI 7.1. The user setup in the receiver JDBC adapter is only a service user that has a read access on some tables that are owned by another user or schema. When I am trying to do the import of Table's metadata, I can only see tables that are owned by the user setup in the receiver JDBC adapter.
    Is there any any ways on how the user used in the receiver JDBC adapter can read another user's table (given that it has read access) during the import of Table's metadata?
    Thank you in advacne for any response.
    -Niro

    Hi Matt,
    I am struck in a similar kind of problem.
    I have to do lookup from a view(not a table) available in a particular schema.
    When i am using the external definition --> category dbtab
    I am able to see all the tables available in the schema.Whereas i not able to see any views.
    Please let me know how to proceed in such scenario?
    Thanks,
    Sudhansu

  • How to get Index of a single element in a table

    Hi Gurus,
    I need to get the index number of the element in a table even if the row is not selected.
    I've already searched the forum for this but all i'm getting are selected rows in the table.  I need to get the index even if that elemen's row is not selected in the table.
    Please advise.
    Regards,

    Hi,
    Could you please specify what exactly you want to do?
    You said you want to get the index of an element even if the corresponding row is not selected. But there might be more than one element where the correponding rows are not selected. So it would be better if you could be more specific about what you want to achieve.
    Regards,
    Srilatha

  • How to insert a text edit UI element  in a table

    hi all,
    I want a text edit UI element in a table .I do not want input field because text entered can be very long and whole text cant be seen then.Is there any way to increase the width of input field if i insert an input field ? or what can be other solution for this?

    Hi Govind,
    You can't insert Text Edit as a cell variant in table. But you can increase the 'Width' property of Input Field, say to 500px or as per your requirement, so that you can display the full text at one go. Or you can bind the 'Width' property to a context and set the width at run time as per the text length.
    Thanks,
    Sumit

  • Insert a new Dropdown UI-Element in a Table header

    Hello,
    i need to insert a Dropdown UI-element in a Table header, i was looking in the forum and the Web, BUT i didnt find anythinf that can help.
    please schow me how can I insert a DropDown UI-Element in the Header.
    thank you all

    Hello,
    You can normally create a table. Insert a table column and for the table column you need to give Dorpdown by Key / index as a cell editor.
    Thanks,
    Raju Bonagiri

  • Clickable UI element in a table tree as a child

    Hi experts,
    I haev created a tree in a table column. And in a treebykeytable coumn of a table, what type of cell editor can be included so that we can capture a event on a click of it.
    I.e once a child is clicked- I want to caoture the value of child clicked and navigate further.
    I dont want to use linktoaction UI element and moreover table need initialze lead selection and on using linktoaction, for clicking any child it capture only root value i.e lead selected by default.
    Thanks
    Depesh

    https://www.sdn.sap.com/irj/sdn/nw-70
    would help you
    regards
    nag

  • How to add a new data element for existing table filed(Primary key field)

    Hi Experts,
    How to add a new data element for existing table field(Primary key field)
    For this filed ther is no foreign key relation ships and even check table.
    while activating table it is giving message like below.
    can you help any one to solve this and wil steps to add new dataelement for existing primary key filed of a table.
    Check table (NAMING SPACE/TABLE NAME(EX:/TC/VENDOR)) (username/19.02.10/03:29)           
    Primary key change not permitted for value table /TC/VENDOR
    Check on table  /TC/VENDOR resulted in errors              
    Thanks
    Ravi

    Hi,
    Easiest way is to download the table eg into an Excel table (if possible) or text table. Drop the table from the database. Build your table with the new key field. Build the database table again and fill it.
    You can do it also over the database into a new table. Drop the old one. Build the enhanced one and fill it. Afterwards drop your (temporary) table.
    Maybe there are other ways, but this works.
    Success,
    Rob

  • Reading Data from a Table With an Expert

    Hi all - I'm trying to write an Expert in OWB that would read data from a table and create a new table based on that information. I have the table creation part down, but how can I read data from a table with an Expert? From what I've read, Experts only deal with metadata, and there is no mechanism in Experts to actually read data in the tables. Does OraTcl work in Experts? Has anyone ever came across this problem, and if so, how did you solve it? Thanks in advance for your time! - Don

    Hi Don
    Can also use Java and JDBC from within Tcl, see the routines in this file below, take modify or whatever;
    http://blogs.oracle.com/warehousebuilder/ombora.tcl
    source <dir>\ombora.tcl
    set g_user scott
    set g_upwd zzzzzz
    set g_hostname localhost
    set g_port 1521
    set g_srvname ora111
    oraconnect $g_user $g_upwd $g_hostname:$g_port:$g_srvname
    oraselect "select * from emp" ""
    As well as dumping the results to stdout (you probably want to comment that part out and change any other part you don't like), g_res is a ResultSet object you can use to do whatever.
    Cheers
    David

Maybe you are looking for

  • Photoshop Trial

    I previously tried to download a trial of Photoshop CS5 but it didn't work (is extracting(?)) and now, a few days later, I have tried to download a trial of Photoshop CS6 but it won't be added to the queue and I can't cancel the CS5 trial for some re

  • Import files from Sony HDD to iMovies '08

    This worked for me with iMovies '08 (7.1.1).... First connect the camera and sync (disc burn) when you can see the camera icon in the finder window, open iMovies and hopefully you will see your files ready to import.... hope this helps and if it dose

  • Safari keeps crashing, blaming flashplayer 10.4-10.5 plug-in?

    I read somewhere that it could be because I don't have the latest version of FlashPlayer, but I downloaded it and it's still doing it. It crashes at least once a day. Process:         Safari [9208] Path:            /Applications/Safari.app/Contents/M

  • How to total No. of employees based on Org unit as well as Job ID in ALV

    Hi , I need to subtotal no. of employees in an org unit and also another subtotal for employees under same job ids using ALV Grid display. Regards, Sarika.

  • Log sequence

    In production database 8.1.6 I got a message at a particular time cannot allocate log sequence seq# Thread 1 advanced log sequence seq# After this, I increased the log buffer value and number of log files also. But I am getting the same error. Is the