How to extract field name, length, descrip & field type out of repository

How can I  extract field name, length, descrip & field type out of repository?  Or is it possible?

Hi Victor,
To get any info about any field you should know the code of that field that we specify in console while  creating field.
Using this code you will get property whatever you defined in consloe.
RepositorySchemaEx repositoryschema= MetadataManager.getInstance().getRepositorySchema(usrCtx);
where usrctx is usersession context that you create to access yr repository
FieldProperties fProp = repositoryschema.getField(tableName,fieldCode);
where tablename is tablecode in which field belong
field code is code of field that you define in console for that field
if you check with frop then it will show  the general properties like type etc.
suppose yr field of type text field then you can acces all properties that is coomon as well that is respective to text type field.
FixedWidthTextFieldProperties textField = ( FixedWidthTextFieldProperties) fProp
if you have other field type then that use thta properties . you will get in java api docs on help.sap.com whatever the properties MDM supporting.
Hope ot helps  you get the solution
thanks,
sudhanshu

Similar Messages

  • Field name lengths

    The field name lengths in the Citadel database are approaching 80 characters when Citadel adds the total path to each field. I am saving data from a process running on computer #1 to computer #2. I am using OPC and to select the analog input values require an extremely long length to the field names.
    i.e.
    "\\Dispatchbd1\Freq_Process\FreqOPC.'OPC DAQ Items'.'Analog Input'.'PHS Narrow Freq'" is just one of my field names. When you have 75 values in a database that you want to look at this long name gets discouraging. Any help would be appreciated.

    Hi Wapa,
    You are right the names are a bit long. Citadel stores the absolute names (includes computer and process name), to make sure the names are unique. For example if process1 and process2 have both Pot1 and you are storing the data to the same database, unless you log it with a process name and computer name you would get a conflict - (if there is just Pot1 you would not know from which process).
    So, the computer and process parts are always there. The Item name has to be also included, but you have more choise there. The member ('OPC DAQ Items'.'Analog Input'.''PHS Narrow Freq') can be aliased to anything you want (and is valid). Go to the Edit database - select the item in the second window - select the datatype - type in alias (for example item1) - check the log to
    historical database and hit save (you are going to get a warning - don't worry about it, just make sure the alias (item1) you typed is is not already an existing item - because of the folder structure exposed by DAQ OPC you'll be fine).
    Now instaed of using "\\Dispatchbd1\Freq_Process\FreqOPC.'OPC DAQ Items'.'Analog Input'.'PHS Narrow Freq'" you can go with "\\Dispatchbd1\Freq_Process\FreqOPC.item1" - you can stop loggin the original member.
    If you need to go even shorter, you can create an expression object for every member you want to log and then log the expression. Then you get to something like:
    "\\Dispatchbd1\Freq_Process\Exp1"
    I hope this helps.
    Martin

  • Field Name  of the field on the Selectiion Screen

    Hi,
    I am executing report program and we get a Selection Screen .The question is  can we catch the field names of the fields on the selection screen dynamically.
    We can find the field name by pressing F1 and looking into the Technical Information of that perticular field.
    But can we fetch the field name dynamically.
    Any pointers/information in this regard will be highly helpful.
    Thanks & regards,
    Abhijeet

    Hello Abhijeet,
    Here's what I think you're looking for -
    tables spfli.
    parameters     : p_test   like spfli-carrid.
    select-options : s_carrid for  spfli-connid.
    DATA:
      descr_ref TYPE ref to cl_abap_elemdescr.
    START-OF-SELECTION.
      descr_ref ?= cl_abap_typedescr=>describe_by_data( p_test ).
      WRITE: / 'Typename     :', descr_ref->absolute_name.
      WRITE: / 'Kind         :', descr_ref->type_kind.
      WRITE: / 'Length       :', descr_ref->length.
      WRITE: / 'Decimals     :', descr_ref->decimals.
      WRITE: / 'Output Length:', descr_ref->output_length.
      WRITE: / 'Help ID      :', descr_ref->help_id.
    Kind------> data type (C , I , etc.,)
    Help ID---> data element (usually).
    There are other classes in ABAP of the form CLABAPDESCR which can provide you with other information. These classes all belong to what is called RTTI (Run Time Type Identification). However, these are available only from 46c. You can explore the other classes, as I think they would be very interesting and useful in the future.
    Regards,
    Anand Mandalika.

  • Trying to reference field name of my record Type in my procedure!

    Hello,
    I am stuck. I am trying to reference field names in my record type declared in my Package declaration.
    Here is an example. Don't be scared, it's a very simple package. I just need some directions what to use to accomplish this.
    --look into this part of the package body
    FOR cur_rate IN c_rate
    LOOP
    rate_data(1).field_name := cur_rate.rate_pct;
    --field name = AK_PCT, AL_PCT and so on ...
    END LOOP;
    END rate_tab_qry;
    CREATE OR REPLACE PACKAGE rate_pkg IS
    TYPE rate_rec IS RECORD (
    id cycle_rates.id%TYPE
    ,cycle cycle_rates.cycle%TYPE
    ,scac cycle_rates.scac%TYPE
    ,gbloc cycle_rates.gbloc%TYPE
    ,code cycle_rates.code%TYPE
    ,AK_PCT cycle_rates.rate_pct%TYPE
    ,AL_PCT cycle_rates.rate_pct%TYPE
    ,AR_PCT cycle_rates.rate_pct%TYPE
    ,so on...
    TYPE cycle_rate_tab IS TABLE OF rate_rec INDEX BY BINARY_INTEGER;
    PROCEDURE rate_tab_qry(rate_data IN OUT cycle_rate_tab,
    p_id cycle_rates.id%TYPE,
    p_cycle cycle_rates.cycle%TYPE,
    p_scac cycle_rates.scac%TYPE,
    p_gbloc cycle_rates.gbloc%TYPE,
    p_code cycle_rates.code%TYPE);
    END;
    CREATE OR REPLACE PACKAGE BODY rate_pkg IS
    PROCEDURE rate_tab_qry(rate_data IN OUT cycle_rate_tab,
    p_id cycle_rates.id%TYPE,
    p_cycle cycle_rates.cycle%TYPE,
    p_scac cycle_rates.scac%TYPE,
    p_gbloc cycle_rates.gbloc%TYPE,
    p_code cycle_rates.code%TYPE)
    IS
    CURSOR c_rate IS
    SELECT state, rate_pct
    FROM cycle_rates
    WHERE cycle = p_cycle
    AND scac = p_scac
    AND gbloc = p_gbloc
    AND code = p_code;
    BEGIN
    rate_data(1).id := p_id;
    rate_data(1).cycle := p_cycle;
    rate_data(1).scac := p_scac;
    rate_data(1).gbloc := p_gbloc;
    rate_data(1).code := p_code;
    FOR cur_rate IN c_rate
    LOOP
    rate_data(1).field_name := cur_rate.rate_pct;
    --field name = AK_PCT, AL_PCT and so on ...
    END LOOP;
    END rate_tab_qry;
    I need to know, how to reference my field name for each state in my procedure that are in my record type. The problem is it won't allow me to use something like this.
    select state || '_PCT
    from cycle_rates;
    which would eventually show me each state concatenated with '_PCT, e.g. AK_PCT and that's my field names.
    For example,
    FOR cur_rate IN c_rate
    LOOP
    rate_data(1).field_name := cur_rate.rate_pct;
    --field_name = AK_PCT, AL_PCT and so on...
    END LOOP;
    I would appreciate it if somene can direct me. Thanks.
    Message was edited by:
    [email protected]

    This is a sample output from my cusror. Just to make it easier for you guys to see it.
    ST RATE_PCT
    AK 0
    AL 2
    AR 2
    AZ 2
    CA 2
    CO 2
    CT 2
    DC 2
    DE 2
    FL 2
    Hope it helps.

  • How to extract channels names from PhotoShop-written TIFFs?

    Hi,
    Does anybody know how to extract channel names from PhotoShop-written TIFFs? (I'm really asking about spot color channel names, as basic channel names, such as "Red," "Green," "Blue" or "Cyan," "Magenta," "Yellow," and "Black" can obviously be derived from the color space tag.)
    There's some XMP data in those TIFFs, but manual inspection does not seem to reveal channel names. So, this may not be an XMP question, after all. There's also a larger (for metadata) data block associated with a private (Adobe) tag, which could contain the information. It's binary, though, and I wouldn't know how to crack it open.
    The data must be present somewhere in the file, as PhotoShop will show the channel names on re-open of the TIFF.
    There's a TIFF/IT TIFFTAG_INKNAMES tag, which PhotoShop doesn't utilize.
    Any pointers greatly appreciated.
    Thanks,
    Oliver

    Solution is to speak to Adobe directly and receive confidential info.

  • How to find table name for the fields from Standard Extractor in CRM system

    How to find table name of fields from the standard extractor in CRM system ?
    e.g. We use LBWE TCode in R/3 system to find table name for the field from Extractor VCSCL(e.g.).
    Likewise is there any way to find table name for the fields from Standard extractor like 0CRM_LEAD_I.

    Hi ,
    Please find the link below for understanding BW CRM analysis.
    http://help.sap.com/bp_biv135/html/bw.htm
    activate the CRM DSs by scenario:
    1) Activate the application component hierarchy (tcode RSA9). Changes made to the application component hierarchy in the CRM system can be transferred to the BW using the "Edit Application Component Hierarchy" (SBIW - Postprocessing of DataSources).
    SAP Note 434886 must be implemented in CRM 3.0 before the application component hierarchy is activated.
    2) Activate the Business Content DataSources (tcode RSA5).
    Select/enter the application component and choose Execute (F8).
    To compare the shipped and active versions, choose the 'Select Delta' pushbutton. If there is no active version of the DataSource, it is selected automatically.
    To activate the shipped version, choose the 'Transfer DataSources' pushbutton.
    3) Management of the versions of the BW-Adapter metadata (tcode BWA5). All DataSources are displayed that are managed by the BW Adapter.
    As in transaction RSA5 (Service API Metadata Activation), the 'Select Delta' function can be used to select the inactive DataSources or compare shipped and active versions.
    You can also go directly to the screen for maintaining DataSources that are managed by the BW Adapter.
    The 'Compare Version' function makes a detailed comparison of the shipped and active versions.
    All BW-Adapter metadata is considered when versions are compared:
    Header information (Table SMOXHEAD)
    Mapping information (Table SMOXRELP)
    Global selection conditions (Table SMOXGSEL)
    Attribute key fields (Table SMOXAFLD)
    Hope this helps.
    Regards,
    csm reddy

  • How to view field name for a field in Oracle form?

    I was told you can do this but I forgot how.
    If you want to build a report, but don't know what the field name is in Oracle, you can open up the Oracle form and find the screen with that field name and do a trick that tells you the Oracle field name. Any help?

    Try this....
    REPORT ZZDYNAMIC_FIELD.
    DATA: BEGIN OF it1 OCCURS 0,
    printer(10) TYPE c,
    paper1(20) TYPE c,
    paper2(20) TYPE c,
    paper3(20) TYPE c,
    END OF it1.
    DATA: descr_ref TYPE REF TO cl_abap_tabledescr,
          i         TYPE i.
    FIELD-SYMBOLS:
      <key_comp_wa> TYPE abap_keydescr,
      <field>       TYPE ANY.
    it1-printer = 'MUC123'.
    it1-paper1 = 'KBLOGO'.
    it1-paper2 = 'BLANK'.
    it1-paper3 = 'DINA5'.
    APPEND it1.
    it1-printer = 'MUC123'.
    it1-paper3 = 'KBLOGO'.
    it1-paper2 = 'BLANK'.
    it1-paper1 = 'DINA5'.
    APPEND it1.
    TRY.
        descr_ref ?= cl_abap_typedescr=>describe_by_data( it1[] ).
      CATCH cx_root.
    ENDTRY.
    LOOP AT it1.
      i = 0.
      WHILE 1 = 1.
        i = i + 1.
        ASSIGN COMPONENT i OF STRUCTURE it1 TO <field>.
        if <field> is not assigned.
          EXIT.
        endif..
        IF <field> IS ASSIGNED AND <field> EQ 'KBLOGO'.
          READ TABLE descr_ref->key INDEX i ASSIGNING <key_comp_wa>.
          WRITE <key_comp_wa>-name.
          exit.
        ENDIF.
      ENDWHILE.

  • How to list "Tabel Name,Tabel Description, Field Name, Field Description...

    Dear All,
    I'm trying to produce a list , using query , to produce the following list:
    Table Name, T.Description, Field Name, F.Description, FieldType, Length
    I use DD02L, DD02T and DD03L, DD03T.
    Somehow - I dont get the same results as I see in the SE16, or SE11. Especially I mis some descriptions on filed level, and I do see them in the SE11.
    Using a query, save effort of exporting the DD for evry table sepratlly.
    This is strange.
    Your help is greatly Appriciated.
    Kind Regards,
    Doron Zaccai

    Helle Andreas, and all Others,
    Thanks very mucht for the input!
    The DD03M has the:
    Tabel name, Field Name, Field Description, Type, Length, Decimals
    Table description is abscent.
    I have joind the DD02T, (Tabelname, and language).
    And now I have all of them.
    Thank you all very much.
    I will try the FM mentioned, in the mentioned program. And will report on the result.
    Kind Regards,
    Doron Zaccai.

  • How to change the name of the field in a ztable

    hi all,
    i have created a ztable with few fields, now i want to modify the name of the
    primary key field,means i want to change the name which i have given under the
    FIELDS tag. can anyone tell me how to do this.
    Thanks,
    satish.

    Hi,
    Please try this ...
    1. Go to SE11.
    2. Enter database table name.
    3. Click on change button.
    4. Then overwrite with the old field with new field name including the data element.
    5. Save and activated.
    6. Go to SE14 and enter above table.
    7. Click on edit button.
    8. Click on activate and adjust database with save data option.
    Regards,
    Ferry Lianto

  • How to control the name of custom field in data base table, added by AET

    Hi,
    I have added the one custom field by Application Enhancement Tool (AET).
    The name of custom field has been added in the data base table as ZZFLD000004 by AET.
    I need to add the some meaningful name like that ZMYPROB.
    How can I control the name of custom field in the database field through AET?
    Thanks,
    Amit

    Got the answer.
    Need to click on the Enable Expert mode, then custom field name will be editable.

  • How to get the name of a field without specifying it as a string (somehow v

    Is it possible to get the name of a field (or method) somehow via the class in which it is declared?
    The reason why I ask is, that quite often the name of a field is important, because the name is the anchor for further processing, like for example when using reflection (e.g. Class.getfield(“NameOfTheField”)).
    Assume you have class FooSimple with the field “String firstName”.
    Now you would do something like this:
    Class<FooSimple> cls = FooSimple.class;
    Field f = cls.getField("firstName");
    The problem is, that the string “firstName” is kind of “hard coded”. When the name of the field in class FooSimple changes (e.g. to “theFirstName”), the invocation will not work anymore when you forget to change the string too.
    I think it would be very helpful to have access to the name of the field directly via the class by doing something like this.
    Class<FooSimple> cls = FooSimple.class;
    Field f = cls.getField(FooSimple.firstName.fieldName);
    The Java Compiler would then resolve “FooSimple.firstName.fieldName” to the string “firstName”. When later the name of the field is changed, the IDE would change the name everywhere where it is used. So if the name of the field would be changed to “theFirstName” the IDE would also change the statement to
    Class<FooSimple> cls = FooSimple.class;
    Field f = cls.getField(FooSimple.theFirstName.fieldName);
    A technique like this would be in my opinion much more safety and more generic.
    Any ideas?
    Best Regards.

    Well, I think the discussion is going in a wrong direction because the original issue was not to discuss if it is worth coding some helper classes or a framework or that like. Let me bring it back to my original point.
    Basically you can reduce my original question to this:
    Currently it is possible to use the reflection API on a class level without specifying the name of the class with a string constant.
    My issue is, that I think it would be a nice extension for Java, if the same would be possible for field variables of a Java class. Currently the only way you can do this is by specifying the field variable with a string constant.
    Let me bring some motivations which brought me to this issue.
    Assume you have an entity bean which represents a DB table and you use Java Persistence (either JPA or something like Hibernate). Then you would have a class looking like this (very simple sample to make this reply shorter).
    @Entity
    @Table(name = "PERSON")
    public class Person implements Serializable {
         @Column(name = "NAME")
         private String name;
    // … constructor, getter, setter, etc. not listed here
    }The whole issue of the design of JPA is, that such entity beans represent the mapping between the object model and the DB model, the mapping is expressed with annotations.
    Okay, now let’s assume you write a query in Query Language, e.g.
    String sql = “select p from Person p where name = :name”;“name” is the name of the field variable, “:name” is the parameter you later set with “Query.setParameter” method.
    What is not so nice is the fact, that you use the name of the class and the name of the field variables “hardcoded” to construct the query. Now you could think that basically this information is part of your entity class. First you start with the name of the class (i.e. the table name) to decouple this “hardcoding”.
    You could write instead:
    String sql = “select p from “ + Person.class.getSimpleName() + “ p where name = :name”;This is really nice, because whenever you change the name of your Person class, this change happens automatically for the sql statement as well.
    I think the next thoughts are obvious, now, since you have decoupled the “hardcoded” part of the name of the class, you would like to do the same for the names of the field variables. But now you are stuck, there is no way to do this using a similar technique like for the name of the class. Either you stay with the query as it is now, or, to make it a little bit better, you code string constants for the field variables and use them. This issue brought me to the point that I think it would be nice to have the possibility to get the name of a field variable in a similar way as you can get it for the name of the class.
    Conceptually it is just to go one level deeper, i.e.
    first level is to get the name of a class
    second level is to get the name of the field variable of a class.
    Another sample would be, if you want to code something by using reflection. You have perfectly access to the reflection API starting at the class level like Person.class.allTheNiceReflectionMethods. There is no need to specify the class first with a string constant first, you directly start with the class, you can even be generic and just work on the Class.class level and still have access to all these nice methods to get out the information you need.
    But if you need to start with a very specific field variable (like in the sample above), you must go by using a string constant like Person.class.getDeclaredField(“name”).
    So basically I think that there exist already millions of lines of Java code where a field variable is specified for further processing, especially in combination with the reflection functionality and everywhere the field variables are specified by these string constants in double quotes. I would assume, that everyone has the same problem, once changing the name of the field variable means to take care that also the content of the string which specifies the name of the field variable is changed.
    I am wondering why one of the replies commented, why the name of a field variable is changed, it sounds to me that this is something which basically never happens. I don’t know, I think that this happens actually quite often and thanks to all these nice IDEs and their “rename” feature this is usually no problem. From time to time names of classes change, name of field change, yes, they are often even completely rewritten, new field variables come in some are deleted, whatever it is. The way I currently can access the name of a class makes the code safer, because when I consequently go with Class.class.getSimpleName I always know, that when I rename the class all these statements are changed too If I delete such a class, I at least get a compile error.
    My very simple issues is, that I think it would be nice to have the same comfort not only on a class level but also on the level of field variables, nothing more, nothing less.
    To be honest, I have not browsed the forum yet if such an issue was already raised by other people (I will do this now), but somehow it is hard to imagine, that I am the first one.
    Best regards.

  • Field name referenced by field symbol

    Hi,
    I would like to get the field name referenced by a field symbol at rutime. In the code below, besides the type and length of the field, I also would like to get the field names 'AA', 'BB' and 'CC' .
    Can you please tell me how I can get this information?
    DATA: BEGIN OF g_test,
           aa(10)    TYPE c,
           bb        TYPE i,
           cc(20)    TYPE c,
         END OF g_test.
    DATA: l_type(20),
          l_len   TYPE i.
    FIELD-SYMBOLS <fs>.
    START-OF-SELECTION.
      DO 3 TIMES.
        ASSIGN COMPONENT sy-index OF STRUCTURE g_test TO <fs>.
        DESCRIBE FIELD <fs> TYPE l_type OUTPUT-LENGTH l_len.
        WRITE: /5 sy-index, l_type, l_len.
    Would like output as:
       1  AA    C 10   instead of  1    C 10
       2  BB    I 11    instead of  2   I 11
       3  CC    C 20   instead of  3    C  20
      ENDDO.
    Regards,
    Rao A

    Hi,
    Using your sample structure you can do it using such a code:
    DATA: BEGIN OF G_TEST,
            AA(10) TYPE C,
            BB     TYPE I,
            CC(20) TYPE C,
          END OF G_TEST.
    TYPE-POOLS: ABAP.
    DATA: COMP TYPE LINE OF ABAP_COMPDESCR_TAB.
    DATA: STRUCT_REF TYPE REF TO CL_ABAP_STRUCTDESCR.
      STRUCT_REF ?= CL_ABAP_STRUCTDESCR=>DESCRIBE_BY_DATA( G_TEST ).
      LOOP AT STRUCT_REF->COMPONENTS INTO COMP.
        WRITE:/ COMP-NAME, COMP-TYPE_KIND, COMP-LENGTH, COMP-DECIMALS.
      ENDLOOP.
    Krzys

  • Field name retrieval from field symbols after assigning to field in a struc

    We have an internal table of about 100 columns. First 7 of them have key values and other fields are data fields. Out of remaining 93 fields, any 2 to 3 fields have data stored in it in each record. Using field symbols in a loop (93 fixed iterations), we are identifying which fields has a data in it. Once we identify the field, how do we retrieve the name of the field / column of the table. We are performing further processing based on name of the field.
    Any ideas how to get the name of the column assigned to field symbols?
    sample raw code piece is as below:
    clear n.
    Do 93 times.
      n = n + 1.
      assign component n of structure itab to <fs>.
      if not <fs> is initial.
       Get name of the field in cfname.
        perform process_record using cfname.
      endif.
    enddo.
    Thanks.
    Regards.

    Hi,
    Try this..use the function module GET_COMPONENT_LIST to get the fields of the internal table and store it in an internal table ITAB_COMP..
    Then use READ TABLE ITAB_COMP INDEX sy-index..
    You can get the field name from the work area..
    Thanks,
    Naren

  • How to extract register names & their addresses from .inc file of a microcontroller

    Hi,
    I want to extract register names to a dropdown and their corresponding addresses from .inc file in such a way that when I select a register from dropdown, it has to also show its address in a string indicator.
    However, only a part of .inc file consists of register definitions and the rest has bit definition of registers (unwanted). How can I extract this using labview?
    Attached is a sample .inc file for PIC18F4620 device.
    Attachments:
    p18f4620.inc ‏48 KB

    Read the file line by line until you find "Register Files" (use for example Search/Split String).
    Then, read again splitting each line in its tokens (use Scan String for Tokens).
    Keep the first token as name and convert the proper substring of the third token to the address value.
    Terminate when line is empty.
    Paolo
    LV 7.0, 7.1, 8.0.1, 2011

  • Please validate giving field names to the field (built in data type) in TMG

    I have added fields with built in types….And I added header text ( heading of each field ) in Table maintenance generator   by se11 -&#61664; table maintenance generator  &#61664; delete &#61664; create new one TMG &#61664; then go to se11 &#61664; utilities &#61664; create entries &#61664; status &#61664; Screen number  &#61664; layout &#61664; in screen painter &#61664; give desired field for that particular field

    I have added fields to ztable with built in types….And I added header text ( heading of each of my field ) in Table maintenance generator by following procedure
    go to se11 -> utilities->table maintenance generator  -> delete -> create new one TMG ->
    then go to se11 -> utilities -> create entries -> status -> Screen number  -> layout -> in screen painter -> give desired field for that particular field.
    Am I right ? Please validate my procedure of giving field names to appear in Table maintenance generator.

Maybe you are looking for

  • NetConnection and NetStream in Director: Is it impossible to have more than one incoming Stream?

    Hi there, I'm working on a Director 11.5 video chat for 3 people. You shall see your webcam video as a little and the two you are connected with as a big video panel. So good so far, I managed to show my own webcam video without streaming it and mana

  • OIM 9.1.0.2 - Track request

    Hi Gurus, I have a group that should track all the requests. How should I configure that group? Which permissions should I give to it? I have given the Track request menu item as well as all the permission with the word Request, but it doesn't work.

  • The Durability of Macbooks is not worth the money.

    I was playing xbox on my couch with my mac book beside me, i moved my elbow and is slid off the couch and landed on it's back and the screen slammed shut. This was probably a 1.5 ft drop into well-cushioned carpet. I pick it up and now my screen is t

  • Not able to deploy Analytics.war in Tomcat.

    Hi, I have configured Tomcat v6.0 server with OBIEE. I am able to successfully deploy the xmlpserver.war and login into http://localhot:8080/xmlpserver and able to view the BI Publisher. But tried deploying the analytics.war. It throws the following

  • IOS Update Problem

    I just got the latest IOS update and I can't get through the Terms & Conditions page. There is an agree button, but when I press it (and the subsequent confirmation box button) nothing happens. I'm not sure what to do because now I can't use my phone