How to get the field in table.

hi Guru,
My Requirment is I hava table ZSample.
Field:
1.Name
2.Age
3.Class
4.Country.
Is it possible to get the field . Bye Coding.
And i want store it in a StringTable.
Regards
Vivekananthan.S

Hello,
You can use ABAP RTTS for that.
Follow the examplo below:
DATA: itab TYPE TABLE OF sflight.
DATA: ref_table        TYPE REF TO cl_abap_tabledescr,
      ref_struct        TYPE REF TO cl_abap_structdescr,
      fields_table     TYPE abap_compdescr_tab.
FIELD-SYMBOLS: <field> LIKE LINE OF fields_table.
ref_table  ?= cl_abap_tabledescr=>describe_by_data( itab ).
ref_struct ?= ref_tb->get_table_line_type( ).
fields_table[] = ref_struct->components.
LOOP AT fields_table ASSIGNING <field>.
  WRITE: / <field>-name.
ENDLOOP.
The reference variable to CL_ABAP_TABLEDESCR describes the table . You have to cast from CL_ABAP_TYPEDESCR in order to have the reference variable ref_tb accessing both CL_ABAP_TABLEDESCR and CL_ABAP_TYPEDESCR.
After this, you need to identify the line of this table, you do so using a reference for CL_ABAP_STRUCTDESCR. Again, cast is needed here CL_ABAPTYPEDESCR reference is
returned from GET_TABLE_LINE_TYPE( ) method. By this way you will have access to the
table where the fieldnames you need are described.
After that, you can use as a common internal table.
I've done this on WebAS 6.20, maybe in SAP 4.6 (and below) these classes won't be available.
Also, there's an eLearning on SDN about generic programming.
Regards,
Eduardo

Similar Messages

  • How to get the field name of an internal table during runtime?

    How to get the field name of an internal table during runtime?

    Hi  Sudhir,
    Declare and Use Get Cursor Field in Your Prm to get the field Name of the Intenal Table
    Example Code:
        <b>  DATA: v_field(60).                        " Insert this code.
         GET CURSOR FIELD v_field.        " Insert this code.</b>
         <b>CHECK v_field = 'ITAB-KUNNR'.    " Insert this code. (or)
    Write: v_field.</b>
    Regards,
    Ramganesan K.

  • How to get the field COMPLETION in extract layout

    Hi,
    Does anyone knows How to get the field COMPLETION in extract layout? i have not been able to find it and it is imperative to have it for implementing a new evaluation.
    Thanks a lot for your help.
    CAMILO URIBE

    Hi Neil,
    The following steps describe what we did to get the new evaluation:
    1. Define Attributes and Object Types for Evaluations: here we added a new field for evaluation. The field was COMPLETION (degree of processing in percent), with relevant object "TASK". "No Summarization" was configurated as Rule for Summarization
    2. Define Extract Layouts: here we created a new extract layout for evaluation. The objects and attributes to be used were defined (the field COMPLETION  was defined as attribute).
    3. Assign Extract Layouts to Project Types.
    4. Define Evaluations: the new layout for evaluation were created using the attributes.
    5. Define Severity.
    6. Define Threshold Values. In the new evaluation the field COMPLETION was used in the formula.
    After configurating and testing, we have noticed that the values of field COMPLETION are not taking into account. It does not matter which value it has, evaluation always take 0.
    Thanks for your help,
    CAMILO URIBE

  • How to get the field texts from abap dictionary into screen Text fields

    Hi SapAll.
    here i have got to modify one zscreen by adding 1 more field,when i added one field in teh screen by just writng the code in program as SELECT-OPTIONS ilart FOR CAUFVD-ILART.
    but iam unable to get the field text for the text field from teh table CAUFVD.
    CAN ANY BODY HELP ME IN THIS.
    regards.
    varma

    Hi Varma,
    Even if you want to personalise the Text also you can do without checking the DICTREF checkbox. Dirctly you can give the text in the Text elements by using the Menu GOTO -> Text Elemetns -> Selection Texts.
    Regards
    Thiru

  • How to get the field's type in the database with jdbc?

    How to get the one filed's type(varchar,int,long...etc) with jdbc??
    Can u help me??
    It's best that giving a sample code..

    Thx for your reply,BheegaChicken! But i use it with
    oracle9i jdbc..It doesn't return to my the fields
    type correctly..
    This is problem is caused by oracle jdbc??
    Can u tell me??It depends on the driver classes you are using... some of them don't have an implementation for those methods and you won''t get anything useful. Check the driver documentation.
    ***Annie***

  • How to get the field of customer PO no

    I cannot get the field of customer PO no in 2LIS_11_VAHDR and 2LIS_11_VAITM , please give me a hand to tell me where to get it or how to do can get the customer PO no which in sales order overview,thanks

    Hi Jeff
    please refer SAP approved doc for data source enhancement..
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/302d4b15-5847-2a10-93bb-9c45d9f06b16
    hope this works and if still issue persists try searching in SDN for documents relating to datasource enhancement , sure u will get a lot of it.
    Thanks
    Manesh

  • How to get the field type from the database dictionary in screen painter

    hi,
    I wanted to create a new input field that input field should have the data element from the structure that i have created. How to get the data field type from the database dictionary in the screen painter

    hi
    good
    there is two kinds of evernt
    PROCESS ON HELP-REQUEST
    PROCESS ON VALUE-REQUEST.
    which ll help you to give two types of help one is f1 help and another one is f4 help
    go through this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/47/e07f622b9911d2954f0000e8353423/content.htm
    thanks
    mrutyun

  • How to make the fields of table clickable?

    Hi Experts,
    I have created one RFC based WD program. We are displaying data in a table. Now I have to make some of the fields of table clickable.
    When the user will click on some of the fields, another RFC should be called.
    How I can do so?
    Regards,
    Gary

    hi
    when you try to select the attributes of the table that has to be  populated
    you may have  to right click on the rootuicontainer and select apply template and select table
    and select the attributes from the node that has to be populated in the table and click next
      and you can find the attributes name and textview which is by default that would be shown inthe table
      instead you can  change the textview and select from the dropdown select the linktoaction and linktourl
      and or you can go other way as add a new column to the table and select buttons to the table .
      and for each each row and on click of the button you can call the RFC .
    Thanks

  • HOW TO MAKE THE FIELDS ON TABLE CONTROL SCREEN FIXED!!

    Dear all,
    Can you please tell me as to how to make the fields on the table control screen fixed (not respond to the scroll bar) i.e. simillar to MC88 screen , the first two fields are fixed and don't respond to the scroll.
    Please Help!!!!
    Vj

    Hi
    In TC, goto attributes and set 'Fixed columns' as 2. This will fix the first 2 columns.
    Regards
    Navneet

  • How to get the list of tables?

    How can I get the list of tables in database using SQL/PLSQL?
    Thank you.

    It depends what Data Dictionary views you have access to.
    SELECT table_name
    FROM user_tables
    will tell you all the tables in your schema.
    SELECT table_name
    FROM all_tables
    WHERE owner = 'XXX'
    will tell you all the tables that you have some kind of access to. You may be able to get similar information from
    SELECT table_name
    FROM dba_tables
    WHERE owner = 'XXX'
    Leave out the WHERE clause if you're not interested in restricting by owner
    You may need to get your DBA to grant access to ALL_TABLES and DBA_TABLES.
    Define these as (parameterised) Cursors if you want to do this work in PL/SQL. Return the results into a PL/SQL table (of xxx_tables.table_name%ROWTYPE) if you want return the list as a parameter. Bulk Collect the results into the PL/SQL table if you're using Oracle 8i.

  • How to get the final internal table after the ALV is modified?

    Dear experts,
    My WebDynpro application allows users to delete row, sort the column. After all this modification, I need to get the final internal table of ALV to generate a csv.file. Are there any methods to get the final interal table content of ALV?
    Many thanks!
    meer

    Hi Friend  ,
    Please see this  link for wiki of  WDA Alv Hierarchy : [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f&overridelayout=true]
    Regards,

  • How to get the field names of a table

    hi all,
    i need to get all field names of a table. here i dont need any data. i need only field names.
    initially i used this query, select * from tname;
    the problem is if table have 1000 records, all records will be in memory.
    how to get this one.
    regards
    pavan.

    hi all,
    thanks a lot. the query is working.
    initially i given this query
    select column_name from user_tab_columns where table_name='mytable';
    but no rows selected.
    and i tried with this,
    select column_name from user_tab_columns where table_name='MYTABLE';
    this is working fine.
    thanks
    pavan.

  • How to get the values from table SKB1 R/3  to SRM

    Hi Gurus,
    My requirement is to get all the values from the table SKB1 to SRM (i.e. in to an internal table) for doing some validation(G/L account XXXXXX requires an assignment to a CO objectXXXXXX.)
    Like wise I have many tables for doing validation in SRM
    Help me how to get this, suggest me any Function module with sample code.
    OR
    Any Standard FM which will give all the values of the fields in the table SKB1 when I pass the key fields G/L account & company code alone so that I can improve the performance.
    Suggest me.
    Regards
    Paul

    Hi,
    You can use the FM 's META_READ_TABLE Or RFC_READ_TABLE
    Which SRM / Backend system version are you using ?
    Are you taking care of the Importing paramater - DELIMITER in this case.. ??*
    See related links ->
    Re: Retrieving data from R/3 into SRM
    Re: Product Search TIME lag
    Else you can just call the remote enabled  FM "BAPI_GL_ACC_GETDETAIL"  from SRM.
    BR,
    Disha.
    Do reward points for useufl answers.

  • How to get the values from table region and how to set

    Hi,
    I have a requirement as Seeded Page Having One Table Region having around 8 columns, In That Item Description field is there. My Requirement is I need add one more field for that Region and assign the value depending Item Description.
    I will create one new Item in that region and will give name as Item, But how to set the values to Item Depending on Item Description.
    Is it possible to through CO Extension, If yes..Pls help how to get it.
    Thanks in Advance,
    Hanimi

    Hi Hanimi,
    1. You need to extend the VO, add a new Attribute.
    2. In VORowImpl of the extended VO, you can find the getter for your new attribute (example getItem())
    3. In this getter method you can write some code like:
    if("ABC".equals(getItemDescription())
    return "XYZ" ;
    -Prince
    http://princekapoor82.blogspot.com

  • How to get the data of table from JSP to Servlet?

    Hi,
    I have a dynamic editable table of 3 columns on a jsp. On click on any cell the usr can edit the data. Now on click of submit button on the jsp I need to submit or get the whole data of all the rows to a servlet which would further process it.
    How do I do that?
    TIA.

    I am not sure whether u r getting my doubt or not
    properly. I am populating the table data in an
    arraylist of DO. with this arraylist I am displaying
    the data on the Screen.
    <%
    for(int i=0;i<alList.size();i++)
    DO d = alList.get(i);
    %>
    <Table>
    <tr>
    <td><%=d.getfirstField()%></td>
    <tr>
    </Table>
    <%
    %>
    The above code sniipet displays the data on screen.
    But as table being editable i would change the data
    in the cell and submit .
    So how do i capture this data? I cannot name the cell
    becos I am not sure how many rows would be displayed.
    In servlet I would use request.getParameter(?);
    TIAIf you table is editable nad has input field to edit then "malcolmmc's " answer will work perfectly.
    you can also use hidden form fields to use those vaues at servlet like this
    <input type="hidden" name="UniqueName' value="<%=d.getfirstField()%>'>
    Here UniqueName should be the unique for each cell value so that on servlet you can fetch these values using request.getParameter("UniqueName").

Maybe you are looking for

  • Is it possible to have more than one iTunes store account on one computer?

    Hi everyone, We have a MacBook, one iTunes store account, and four iPod Touch devices. We usually redeem iTunes gift cards for purchases instead of using our credit card. Once in a while we give our children an iTunes gift card, but then the card val

  • Can I change an existing Apple ID into a child Apple ID?

    With Family Sharing I need to change some of my children's existing Apple ID's over to child Apple ID's.  How do I accomplish this?

  • How can I use system call in kernel loadable module?

    Hi, I want to use system call (shmat, mmap,...) in kernel module. When kernel module is loaded, it cause system error (undefined symbol name 'shmat', 'mmap'). How can I use system call in kernel module ? Thanks in advance. david joo

  • Account still has credits but call blocked

    HI,  I just created this new account yesterday, and subscribe to unlimited world, however when i make phone calls today, they say calls are blocked, and when i file online customer service request, they asked me to provide 5 contact names, but it is

  • SAP Workflow - WD Java - Adobe forms

    Hi experts. I had a question regarding on workflow. We have an adobe interactive form inside a webdynpro java application, once the form is submitted its passed on as an attachment to an SAP business workflow. Inside the workflow we need to extract t