Skip to Content
author's profile photo Former Member
Former Member

Re:Structures

HI Experts,

I have structure say cdfgxx and it has ten fields in it..... so how can i able to get the data from it and pass to internal table & display it in an output...i hope from structures we cant take data if so how we need to find & get data with respect to that structure cdfgxx if possible give example.. rewarded if helpful.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2008 at 10:41 PM

    Hi Moni_abap,

    When I understand your question correctly, do this:

    DATA: BEGIN OF st_test, 
            a(5) TYPE c       VALUE 'Here', 
            b(8) TYPE c       VALUE 'I am', 
            c(32) TYPE c      VALUE ' and where are you?', 
            d    TYPE d       VALUE '20991231', 
           END OF st_test. 
    
    FIELD-SYMBOLS: <pointer> TYPE ANY. 
    
    
    DO. 
      ASSIGN COMPONENT sy-index OF STRUCTURE st_test TO <pointer>. 
      IF sy-subrc <> 0. EXIT. ENDIF. 
      WRITE / <pointer>. 
    ENDDO.

    Using the same technique you can populated an internal table as well and then display the values of the structure. This example has only fields but you can extend it nearly unlimited.

    Have fun,

    Heinz

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 14, 2008 at 07:57 AM

    hi this is not possible to get the values from the strucute..

    but we use the structure for defining the internal table ..becase it is reusable..

    for getting the values from structures check value tables..

    check this example..

    go to se11-- > data type - MCMSEG

    double click on the matnr data element..

    double click on the matnr domain..

    go to value range tab in that...

    check the value table MARA for the field matnr.

    regards,

    venkat

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 17, 2008 at 02:40 PM

    Is your problem how to retrieve the data from the database or how to output?

    If it is how to retrieve and you want the table from which the standard structure is filled sorry there is no quick answer but try the following:

    - where used on the data element for elements in the structure

    - where used on the domain then for data elements the domain is used in

    - st05 trace on the program that fills the structure to see which tables are accessed

    - debug the program which fills the structure

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 04:47 AM

    Hi Moni,

    Structure are like metadata - they only hold the structural information like the Field Lengths, Field Types, Reference Field and Table Names.

    They will never Hold data.

    For Holding of data in database you have transparent Tables and other tables(Hash, Sorted, Buffered, Pooled, cluster tables) etc.

    So data is stored in above Database(DB) Tables.

    So if you want to retrieve data related to your structure cdfgxx

    then go to the Transaction SE11 and in Data Type type in cdfgxx and click on the Yellow Icon with three arrows on top which is called Where-Used List and it will list all the Database Tables(transaparent Tabels) where data is stored so you can refere to this DB Tables in your Report/ Program for data retrieval and output.

    Hope this Helps you.

    Help the U.N World food Programmme by rewarding points and it will encourage others to answer your queries too.

    Thanks

    Venugopal

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.