Tabel fields

How to get the number of fields of any DB table programmatically in the SAP environment of whether it is SAP table or custom table?
Is there any table to store such a criteria?
I Appreciate your help. thanks

Here is a short sample program.
report zrich_0003.
data: ifields type table of dfies with header line.
data: no_of_fields type i.
parameters: p_table type ddobjname.
call function 'DDIF_FIELDINFO_GET'
     exporting
          tabname        = p_table
     tables
          dfies_tab      = ifields
     exceptions
          not_found      = 1
          internal_error = 2
          others         = 3.
describe table ifields lines no_of_fields.
write:/ p_table, 'has', no_of_fields, 'fields'.
Welcome to SDN.  Please remember to award points for helpful answers and mark your posts as solved when solved completely.  Thanks.
Regards,
Rich Heilman

Similar Messages

  • Field symbol with top of page in reuse_alv_list

    When using the top_of_page in REUSE_ALV_LIST_DISPLAY
    I had in the old programm reference to values in the outtab for the header in the new programm I use dynamic tables and I wonder how to add those values in a header.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
             EXPORTING
                  i_callback_program       = h_repid
                  i_callback_pf_status_set = 'SET_PF_STATUS'
                  i_callback_user_command  = 'USER_COMMAND'
    *            i_structure_name         = 'ZDOORBEL_ALV'
    *            IT_EVENTS                = TEVENTS
                  is_layout                = slayout
                  it_fieldcat              = it_fieldcat[]
                  it_sort                  = tsort[]
                  i_save                   = a_save
                  is_variant               = variant
             TABLES
                  t_outtab                 = <ta_output>
    in my top_of_page I try to read the current row of <ta_output> but I have no clue on how to do it. I gives the error that there is no workarea assigned to <ta_output>
    anybody knows how to read the current line of <ta_output>  in top_of_page ?
    kind regards
    arthur de smidt

    I have
    * fieldsymbols voor dynamische ALV tabel
    FIELD-SYMBOLS: <ta_output> TYPE table ,
                  <ta_color> TYPE table,
                  <l_line>  TYPE ANY,
                  <wa_output> type any,
                  <wa>  TYPE ANY,
                   <l_field> TYPE ANY,
                   <fs> TYPE ty_pernrs.
    FORM top_of_page.
      CREATE DATA new_line LIKE LINE OF <ta_output>.
      ASSIGN new_line->* TO <wa_output>.
      read table <ta_output> assigning <wa_output> index sy-tabix.
    if ra_pernr = 'X'.
      if <wa_output>-week = space or <wa_output>-pernr = '00000000'.
    but still it says that the
    The data object "<WA_OUTPUT>" has no structure and therefore no
    component called "WEEK" . .
    Edited by: A. de Smidt on Jun 26, 2008 11:07 AM

  • "[Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition

    I am creating a program in Java which has a Database reference application.The Database I am using is MS Access.But whenever I am trying to run the program from DOS Prompt(ie executing the program:java <program name>) I am unable to connenct to the database.The compiling of the program doesn't show any error(ie javac <program name>) The following error is displayed at the DOS Prompt:
    "[Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition."
    Pls give me a detailed help report.If it is a Machine side problem do help me to solve it.Mine is a Compaq Presario Machine,OS:Windows 98,Database:MS Access(Office XP)
    I request you to help me in this matter.Pls email ur responses to:
    [email protected]
    [email protected]

    hi there
    did u configure ur ODBC setting if no then try these steps
    ================== ODBC Settings ========================
    step 1 : go to control panel
    step 2 : ODBC Data Sources
    step 3 : click UserDSN Tab
    step 4 : click ADD Button , Select Microsoft Access Driver , Finish
    step 5 : Give Datasource Name as "DATABASE_NAMEXXX" , no double quotes
    step 6 : use Select and select Database_NAME.mdb from <INSTALL DIRECTORY>\DATABASE_NAME.mdb
    click ok , ok finish
    <INSTALL DIRECTORY> is where yr database is
    =========================================================
    then in yr program
    URL for yr database
    "jdbc:odbc:DATABASE_NAMEXXX" // as name in step 5
    and Driver is
    "sun.jdbc.odbc.JdbcOdbcDriver"
    if u done all these steps then check yr spelling of table and tabel field in yr program
    hope this works for u
    regards
    Satinderjit

  • Search Help from SAP values using WebDynpro ABAP in ADOBE Interactive Form

    Hi,
    How to populate search help on ADOBE interactive online form which is residing on a WebDynpro ABAP application?
    Thanks & Regards,
    Sandip amar

    HI,
    Adobe from is integraated with R/3 just like smartform.
    So if u use any DDIC tabel field which have inbuilt search help then it will automatically intergrated with Adobe form.
    If not then u have to make at ztable via foreign key or via FM at program level.
    Regards
    ricky

  • Example for function module

    Dear Friends,
    Could you please provide me the abap code (Select * ) for the below.
    I want to make a data source using Functional module.
    and the data is (tabel~field)
    VBRK-VBELN
    VBRK-FKART
    VBRK-WERKS
    VBRP - POSNR
    VBRP-NETWR
    VBRP-WAERK
    Where VBRK-VBELN = VBRP-VBELN.
    ur help will be highly appreciated... and rewarded too...
    Kind Regards
    Paddy

    select  VBRK~VBELN
    VBRK~FKART
    VBRK~WERKS
    VBRP~POSNR
    VBRP~NETWR
    VBRP~WAERK
    into table it_tab
    from VBRK INNER JOIN VBRP  ON
    VBRKVBELN = VBRPVBELN
    where  ( if you have any further condition e.g VBELN = current CVBELN in a internal table)
    Structure of it_tab
    data : begin of it_tab occurs 0 ,
    VBELn LIKE VBRK-VBELN,
    FKART LIKE VBRK~FKART,
    WEARKS LIKE VBRK~WERKS,
    POSNR LIKE  VBRP~POSNR,
    NETWR LIKE VBRP~NETWR,
    WAERK LIKE VBRP~WAERK,
    end of it_tab.
    Priya

  • Updating MARC not happening eventhough return type 'S'

    Hi Experts,
    i am updating MARA , MARC  through BAPI_MATERIAL_SAVEDATA ,  i am getting RETURN-TYPE = 'S'  and MARA is updating but MARC is not updating
    PLANTDATA -PLANT = 2013
    PLANTDATAX -PLANT = 2013
    PLANTDATAX-COUNTRYORI = 'US'
    PLANTDATAX-COUNTRYORI = 'X'
    but values are not updating ...  is there any mandatory thing i am missing while updating ..
    please help me out
    Thanks,
    Shrikanth

    Hello SHRIKANTH R  ,
                            Here is the model code for populating the MARC entry tabel fields:
    Check this link too:
    http://blog.esnai.com/arrow/archive/2007/08/30/208744.aspx
    CLEAR bapi_marc.
    bapi_marc-plant       = i_tvkwz-werks.
    bapi_marc-pur_group   = c_ekgrp.
    bapi_marc-mrp_type    = u2018NDu2019.
    bapi_marc-period_ind  = u2018Mu2019.
    bapi_marc-lotsizekey  = u2018EXu2019.
    bapi_marc-proc_type   = u2018Fu2019.
    bapi_marc-spproctype  = c_sobsl.
    bapi_marc-availcheck  = u201802u2032.
    bapi_marc-profit_ctr  = c_prctr.
    bapi_marc-sloc_exprc  = c_lgort.
    IF i_tvkwz-werks = u20188300u2032.
       bapi_marc-mrp_ctrler  = u201813u2032.
       bapi_marc-mrp_group   = u201813u2032.
    ELSEIF i_tvkwz-werks = u20188400u2032.
       bapi_marc-mrp_ctrler  = u201814u2032.
       bapi_marc-mrp_group   = u201814u2032.
    ELSEIF i_tvkwz-werks = u20188500u2032.
       bapi_marc-mrp_ctrler  = u201815u2032.
       bapi_marc-mrp_group   = u201815u2032.
    ELSEIF i_tvkwz-werks = u20188600u2032.
       bapi_marc-mrp_ctrler  = u201816u2032.
       bapi_marc-mrp_group   = u201816u2032.
    ELSE.
       bapi_marc-mrp_ctrler  = u2018001u2032.
       bapi_marc-mrp_group   = u20180001u2032.
    ENDIF.
    CLEAR bapi_marcx.
    bapi_marcx-plant      = i_tvkwz-werks.
    bapi_marcx-pur_group  = u2018Xu2019.
    bapi_marcx-mrp_type   = u2018Xu2019.
    bapi_marcx-period_ind = u2018Xu2019.
    bapi_marcx-lotsizekey = u2018Xu2019.
    bapi_marcx-proc_type  = u2018Xu2019.
    bapi_marcx-availcheck = u2018Xu2019.
    bapi_marcx-profit_ctr = u2018Xu2019.
    bapi_marcx-sloc_exprc = u2018Xu2019.
    bapi_marcx-mrp_ctrler = u2018Xu2019.
    bapi_marcx-mrp_group  = u2018Xu2019.
    bapi_marcx-spproctype = u2018Xu2019.
    Thanks,
    Greetson

  • Qualified table

    Dear all,
    I have a requirement, for a single vendor record need to maintain multiple License details.
    ie., main table 'Vendor' will hold Vendor record and each vendor record may have multiple License's. Do i maintain the license table as 'multivalued' Qualified flat. If yes how do i link vendor and License tables and what field properties do i need to set.
    ex: a field as qualified/non-qualifier ?
    Sonali

    Hi Sonali,
    Vendor ID, Vendor Name, Description  can be placed in the main table Vendor.
    License Number, Date, Description can be placed in the Qualified table with the License number as NQ and the determining fields ie Date and Description as Qualifiers.
    Now When you do mapping of the Qualified table you will be bale to see only the non qualifier fields there.Map those fields with the main table fields and import in the Qualified table.
    Now when you perform the main table mapping you will be able to see the Qualifiers as well as the non qualifiers fields and the lookup qualified field as well.
    Firstly map all the main table fields such as Vendor ID, Vendor Name and Description  then map the qualified tabel fields this will establish the mapping between the main table nad the qualified tabel records.
    Follow this below link which will explain you better on qualified atbel mapping:
    Taming the animal - Qualified Tables
    Hope It Helped
    Thanks & Regards
    Simona Pinto

  • 2LIS_11_VAHDR-CX_SY_IMPORT_MISMATCH_ERROR

    hi gurus,
    I posted a more or less query few days back but was not able to get to the solution thne but now it has become critical then. I am extracting 2LIS_11_VAHDR using RSA3.
    The same function and the extractor is working fine in develoment and fetching records but in Q§A it gives me a short dump and error as follows:
    when importing object mc11VA0HDR_TAB structure did not match the target structure . Error occured in component no 49. possible reasons are
    1 structure is actually different.
    2 same sequence of components were exported and imported but from different include units.
    Now i have compared versions of testing and develoment and i find that everything is same.
    can you please suggest me if u have faced like nething this before?
    thanks in advance,
    Gaurav

    Hi,
    I think you have added some Z fields in your Strut MC
    and the Currecny field is refering to some other structure currency field.
    go to structure MC11VA0HDR
    then in Currency/quantity fields..check whether it is
    reference tabel  field
    MC11VA0HDR     WAERK
    also check out this...
    ABAP Dump after Extending MC02M_0ITM for data source 2LIS_02_ITM
    Regards,
    San!

  • For All Entries..........with inner loop. good or bad ?

    Hello Friends,
    i am using 3 tables VBAK, VBAP and KNA1.
    for that i have created 3 internal tables named IT_VBAK, IT_VBAPand IT_KNA1.
    I have created SQL queries using FOR ALL ENTRIES.
    now i want to use AT NEW on KUNNR  (KAN1 tabel field)
    So, for that i have to use 3 internal table loops ??
    Sujjest me idea by giving example !Thanks in advance !!

    yes we can use both
    if not it_matnr[] is initial.
    select amatnr bmaktx into table it_itab from
            mara as a inner join
            makt as b on
            amatnr = bmatnr
            for all entries in it_matnr
            where a~matnr = it_matnr-matnr.
    endif
    1. in the innerjoin system will hit the databasa one time.. then fetch the data..for the tables u have joined... when u use the join make sure the query shold not effect the performance.. try to paas all the primary key values.. then link the tables using the complete primary...
    2. when u use the FOR ALL ENTRIES.. the system will retrive all the records which matches the FIELDS which u r refering in the Internal tabel... while using the FOR ALL ENTRIES.. creal the duplicate entries.. other wise it select the record more number of time at data base level... but u will get the entries properly
    Regards

  • Finding where data from database being fetched

    Hi all,
    I am calling a script from driver program
    Certain fields in script are not displaying correct values.Values are T166P tabel fields.
    I tried to debug, but couldnt find from where select queries executed in flow of execution.
    Can anybody suggest me how to find where the logic for fetching values from T166P is coded.
    Thanks.

    Can you please guide where can i search in script as i have not worked in script before.
    Moderator message: Sorry, these forums cannot replace training classes.
    Edited by: Thomas Zloch on Oct 14, 2010 6:02 PM

  • How to make a PDF form with expanding tabel or expanding fields, like in Word.

    How to make a PDF form with expanding tabel or expanding fields, like in Word.

    This is currently not possible in Formscentral. It is something we are working on for the future. Please stay tuned.
    Andrew Yarborough

  • 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.

  • What is the field in the tabel "Send mail to users"

    Hi Folks,
    if the job(Z or Standard prog)is completed successfully then it sends mail to user. i want to know what is the field to capture this information.
    Could you tell me what is the field in the table TBTCO.
    Thanks,
    Lakshmi

    Please check table SOST. MSGV1 field might hold this info.

  • BDT add fields to standard SAP tabel on BP screen

    With this email I would like to report a problem I have with the BDT to show extra fields on a table control in the businesspartner masterdata. I hope you can help me and tell me what I am doing wrong or why I cannot show these new fields.
    The SAP Module is FS-CS (Commissions). On the businesspartner there is a tab screen with contractdetails. We want to add two new Z-fields to the table control and we have added these fields to an append structure in the CACS_CTRTBU table. I have put the extra fields to a new fieldgroup and put the fieldgroups on a new view added the view on a new section, defined a new screen and finally added the screen to a new screen sequence. The original screen has now been replaced with the new screen with the extra fields.
    In the screenpainter I defined a new screen for the new view by copying the original function group of the original screen together with all functionmodules. I added the new fields of the newly defined fieldgroup to this screen.
    I registered the new functionmodules for the events ISSTA, ISDAT and ISDST in customizing for the new defined application.
    Within the programme there is a structure used called CACS_S_BUPA1. I have added the 2 new field also to this structure.
    If I look in my sourcecode in the PBO then I see that the internal table has stored the values of the new fields together with the values of the original fields.
    Still if the screen comes up, the values for the new field are not shown and the old(orignal fields) are shown. The new headers and colomns in the table control for the new fields are visible.
    Do you have any idea what the problem might be ?
    Kind regards,
    Peter Jonker

    Thanks for your reply, the tip of the fieldgroup has helped me and my colleague who also had a BDT problem, his problem was that changes on fieldgroup level were not saved. Once he changed to the range 6xx with his fieldgroup the problem was solved.
    My problem has been solved too, although I am not sure if it had anything to do with changing the range of the fieldgroups, it probably did.
    I had done the whole designing from scratch again, but this time using fieldgroups in the range 6xx. Now it works fine.
    Strange thing is that in the SAP Help it says to use fieldgroups in the range 600- 799, while the 7xx range will give you problems. The 900 range, as you suggested, also gave problems. In our case the 6xx range was the right one to use

  • No key field found for creation of DataSource - Classification Datasource

    Hello,
    While trying to create a clasiffication datasource based on 0PLANT_ATTR, when i assign a characteristic and push the DataSource button, i get the following message:
    No key field found for creation of DataSource
    Diagnosis
    During generation of a classification or configuration DataSource, only those key fields for the object table (field "Obj.Tabelle") that are already present in the basis DataSource transferred to the extract structure.  This is the case when none of the key fields of the object table were found in the structure of the basis DataSource.
    System response
    A DataSource cannot be created without key fields. The action was cancelled.
    Procedure
    Check whether you have selected the correct basis DataSource and object table. For more information, please see SAP Note 569849.
    Do you know what can be the problem?
    Thank you and regards

    Hi Alberto,
    plants are a special case. The key which is used for the classification 
    of plants (object type BETR) is not the same as the key which is used in
    datasource 0PLANT_ATTR.
    BETR has key LOCNR (Site). That's a customer related to a plant. The    
    customer number will be extracted in field LOCNR.
    0PLANT_ATTR extracts the plant in its key field WERKS.
    Transaction CTBW and the generic extraction program for classifications 
    don't know the relationship between LOCNR and WERKS. So they cannot map     
    them.
    I do recommend a solution which would add the mapping between
    LOCNR and WERKS:
    1. Create please the classification datasource as intended, but use     
    datasource 0RT_LOC_MGR_ATTR as basis datasource. It's the only          
    datasource of the content where LOCNR is a key field. So                
    0RT_LOC_MGR_ATTR is used as a dummy here, to allow transaction CTBW to  
    create the classification datasource. It's not necessary to extract     
    data with datasource 0RT_LOC_MGR_ATTR.
    2. Extend please the extract structure of the created classification    
    datasource. Add please field WERKS using component type WERKS_D. Make   
    this field visible.
    3. Fill field WERKS in the extractor user exit EXIT_SAPLRSAP_002. WERKS 
    can be read from table KNA1 by using the customer number extracted to   
    LOCNR to select on field KNA1-KUNNR.
    4. Transaction CTBW_META on the BW system isn't able to append the      
    characteristics from the classification datasource to infosource        
    0PLANT, because the keys are different. So create please a new info     
    source with CTBW_META. This allows CTBW_META to create the info objects 
    for the characteristics used in the classification datasource.
    5. Add please the characteristics used in the classification datasource 
    to infosource 0PLANT manually. You will find the info object names of   
    the characteristics by looking up the characteristic datasources which  
    are assigned to the classification datasource in transaction CTBW. From 
    these names you can derive the info object names:                       
    1CL_A... -> C_A...
    6. Disconnect the infosource which has been created with CTBW_META from 
    the classification datasource.
    7. Connect please the classification datasource to infosource 0PLANT    
    Use following info object:
    info object   field
    0PLANT       WERKS
    The info object names for the characteristics are explained in step 5.
    8. Add an infopackage to infosource 0PLANT for the classification       
    datasource.
    Now the extraction of classifications of sites should work.
    Best regards,
    Rolf
    P.S. I saw the system messed it up and doesn't display any new and empty lines. Sorry, I hope you still can read it.
    Edited by: Rolf Doersam on Mar 26, 2010 6:56 PM

Maybe you are looking for

  • Bar code3 in alv

    hi, i need to display barcode in alv report  how to do this, pls provide sample code. regards, jai

  • Regarding types statement in ECC 6.0...plz reply..urgent

    Hi, I am copying a program which is in<b> 4.7 to ECC 6.0,</b>i am facing error regarding <b>structures with types<b>... The following code in<b> 4.7</b> <b>DATA:BEGIN OF W_BMM00.         INCLUDE STRUCTURE BMM00. DATA:END OF W_BMM00. DATA:BEGIN OF W_B

  • Cannot get Flash Player 15 debug to install properly in Safari 7.1

    After upgrading Safari, with FlashPlaer debug plugin installed, to 7.1  on my MacBook Pro running OSX 10.9.5, I found that I could not type into text fields of a flash based website created by me with FlashBuilder 4.6. I found that the FlashPlayer pl

  • Using variables for column headings in REUSE_ALV_GRID_DISPLAY

    Hi Everyone,            Is it possible for me to display the column heading in REUSE_ALV_GRID_DISPLAY using a variable?   CLEAR ls_fieldcat.   ls_fieldcat-col_pos         =   13.   ls_fieldcat-reptext_ddic      =  LWOP1.  " <===Here is my variable fo

  • I don't want my iPhone photos in the iCloud

    Good evening Gang, I do not want every picture I take with my iPhone in the "iCloud" and automatically sent to my other devices. Is there a way to stop this madness? Thanks, James