Table Field Reading in an ABAP program

Dear All Gurus,
This is my requirement..
I need to read the field name (not the value of the field) in an Internal Table loop.
Ex : If internal table is currently reading 'LIFNR' ,need to read this field name into a variable, because I need to cross check this with a mapping table created for this development (BADI for ME52N).
How to I do this ?
Need your help..
Thanks
Jam123

Hi,
Check below code. It will useful.
TYPE-POOLS: sydes.
TABLES: dd01t, dd03l.
DATA: BEGIN OF t_marc OCCURS 0,
matnr TYPE marc-matnr,
werks TYPE marc-werks,
pstat TYPE marc-pstat,
END OF t_marc.
DATA: it_dd03l TYPE STANDARD TABLE OF dd03l,
      it_dd01t TYPE STANDARD TABLE OF dd01t.
DATA: td TYPE sydes_desc.
DATA: lv_domain TYPE dd03l-domname,
      lv_field_desc TYPE string,
      lv_tabname TYPE string,
      lv_field_name TYPE string.
FIELD-SYMBOLS :<fs> TYPE ANY.
DESCRIBE FIELD t_marc INTO td.
*APPEND td TO tt.
*CLEAR td.
SELECT * FROM dd03l INTO TABLE it_dd03l WHERE tabname = 'MARC'.
*IF it_dd03l IS NOT INITIAL.
SELECT * FROM dd01t INTO TABLE it_dd01t
   FOR ALL ENTRIES IN it_dd03l WHERE domname = it_dd03l-domname.
*ENDIF.
lv_tabname = 'MARC'.
WRITE:/ 'Field Description:'.
SHIFT lv_tabname LEFT DELETING LEADING space.
LOOP AT td-names ASSIGNING <fs>.
  SHIFT <fs> LEFT DELETING LEADING space.
  lv_field_name = <fs>.
     SELECT SINGLE * FROM dd03l WHERE tabname = lv_tabname AND fieldname = lv_field_name AND languflag = sy-langu.
  READ TABLE it_dd03l INTO dd03l WITH KEY tabname = lv_tabname fieldname = lv_field_name.
  IF dd03l-domname IS NOT INITIAL.
    SELECT SINGLE ddtext INTO lv_field_desc FROM dd01t WHERE domname = dd03l-domname AND ddlanguage = sy-langu.
   READ TABLE it_dd01t INTO dd01t WITH KEY domname = dd03l-domname.
    WRITE:/ lv_field_desc.
  ENDIF.
  CLEAR: <fs>, dd03l, dd01t, lv_field_desc, lv_field_name.
ENDLOOP.
Ram.

Similar Messages

  • Updating Q and P table of master data using ABAP program

    Hi All
    I have a requirement to update Q and P table(non key and non date fields) of master data using an ABAP program.
    Is this something recommended?
    Will there be any issues if I do that?
    Thanks
    Deepak

    Thanks Vikram. Ok. My look up is on some other master data Q table and that is the reason why I asked about ABAP custom program.
    Look like I will have to do the following approach.
    Load the required supporting master data to BW.
    Execute Attribute change run process for those master data objects.
    Load the actual master data and look up on supporting master data.
    Execute attribute change run process.
    This process takes me long time and I am trying to reduce the overall execution time. let me know if you have some good suggestions.
    Thanks
    Deepak

  • Reading email using abap program

    Hi All,
    I have a requirement to read inbox mails through abap program.
    Also from address, to address, subject.
    Could someone help me  !!
    Thanks in advance,
    Venkat
    Moderator message : Requirements dumping not allowed, show the work you have already done.  Thread locked.
    Edited by: Vinod Kumar on Jan 30, 2012 11:37 AM

    Hi,
       Please find below the tables if you are usinG BI 7.0
    For 3.5 also they are almost similar...
    Getting Details regarding DSO
    1) RSDODSO
    2) RSDODSOT
    3) RSDODSOIOBJ
    4) RSDODSOATRNAV
    Getting Details regarding InfoObjects
    5)  RSDIOBJ
    6)  RSDIOBJT
    Getting Details regarding DataSource
    7)   RSDSSEG
    8)   RSDS
    9)   RSDST
    10) RSDSSEGFD
    Getting Details regarding Transformation
    11)   RSTRAN
    12)   RSTRANFIELD
    13)   RSTRANRULE
    Getting Details regarding InfoCube
    14) RSDDIME
    15) RSDCUBE
    16) RSDCUBEIOBJ
    17) RSDDIMEIOBJ
    18) RSDCUBET
    19) RSDDIMET
    Getting Details regarding MultiProvider
    20) RSDCUBEMULTI
    21) RSDICMULTIIOBJ
    Getting Details regarding Queries
    22) RSREPDIR
    23) RSZELTTXT
    Based on the above tables ,we can write our own generic program based on your needs.....
    These tables help you a lot in order to achieve that.
    Regards
    vamsi

  • Setting value of input/output field of screen in abap program

    I have a screen.I have added a input/output field in my screen.The purpose is i just want to display a text in that field upon PBO through my abap program.I m a newbie.PLS help me
    Also can i use textfield instead of input/output field for this purpose.if so then wats the difference between both of them

    Hi
    To display a text in I/O element, go to the PBO of this screen and
    assign the text to your I/O element.
    Lets say if TEXT_IO is the name of ur UI element, and you want to display "Hello" into it, do it as follows:
    TEXT_IO = 'Hello'.
    Must ensure that the type of this UI element is CHAR type and you define its lenght properly.
    to display "Hello", length would be 5.
    Hope it will solve ur query.

  • Standard program to display which tables are used by Webdynpro ABAP program

    Hi Gurus,
    I am working on a couple of enhancements in SAP Promotion Management for Retail (SAP PMR) which works on the principle of Floor Plan Management.
    I was wondering if anyone would know of a standard program to display the tables used by Webdynpro ABAP?
    (or)
    Where can I get info of SAP Tables associated to SAP PMR?

    Hi,
    I am not aware of any standard reports that displays the tables.
    If I have to view the tables, I would go to se80, give the package and view all the tables in the package.
    Regards,
    Daz.

  • Accessinng Table using Native SQL in ABAP Program

    Hi Experts,
    I need to access a table that is created in Oracle.
    But while writing a select query as below:
      EXEC sql.
       SELECT MAX(ID_EVENTO)
         INTO :LV_ID_EVENTO
         FROM ZTAB.
      ENDEXEC.
    I am getting a dump saying "ZTAB doesnot exist" or IF I use ZTAB@ifsap then it dumps saying "Database name is missing a component".
    Do I need to add some suffix to the table name like @ifsap to ZTAB?
    Also, can I use SY-SUBRC to check to the success and failure for SELECTION OR INSERTION Operation?
    Thanks
    Depesh

    Hello,
    Try using SAP<SID>.ZTAB in your query.
    For example SAPC05.ZTAB
    Regards,
    Yoganand.V

  • Assign loading / handling resource to location through ABAP program

    Hello Experts,
    I have a requirement where by I have to assign loading / unloading resource to a location through ABAP program. Need to assign the resource in Resources Tab in TP/VS section. Is there any function module or any method available to this?
    Responses highly appreciated. Thanks in advance
    Regards
    Sandeep Patil

    Hi all
       I have the same requirement for the end user.
      Is it a good idea update active Table of ODS behind an ABAP Program Z?, I understood that you can't have log history... and you can't delete request.. because you will not generate this..
      We actually have one ODS that contain invoices... all the fields that contain the invoice..like material, vendor, etc.. was updated according to ABAp programa that we specify on start routine, each time that we need to update these fields we need to unload fros ODS to PSA and load again with dtp...
      Let me copy more details:
    Actually, we have an DSO that is updated each week, we load the information into different PSA, all of this PSA pass to ODS for one info source and transformation rule, in this transformation rule we have an ABAP rotine that have some validation and assign some values for different fields.
    In this procees everthing look fine, actually If we need to update this information from DSO (that was loaded and the user need to update some fields) we need to download information from DSO to PSA and load again with DTP process, this was fine.
    Actually the user want that this kind of changes will be apply on line, this mean that for example all the invoices that I have actually loaded into DSO need to be analyzed and update according new parameters that they specify in other tables.
    The DSO is standard, and contain three basis tables, active, delta, modified.
    My question is: Is it possible update directly table of active records of DSO with one Z program?? is it a good idea?, We want to discard the option of unload and load information each time that they need to update certain field that are calculated or updated whit the transformation rule or load.
    Than you for your help.

  • Where does ABAP programs , BAPI's etc., get saved?

    Hi friends
    We have an ERP server (ECC) and have created lots of database tables, functions, Abap programs etc.,
    For some reason our ERP software is corrupted. However, the SQL database looks ok.
    So here is what we want to do.
    Since the SQL database is good, So we would like to backup the SQL database first.
    We have a ghost image of the server that was done some 2 months back. So we would like to install the ghost image of the server from 2 months back. This will bring the server back to working condition but without data.
    Then recover the SQL database which we backed up before installing the ghost.
    By doing this, will we be able to get back all the tables, data elements, BAPIs, functions, ABAP programs etc.,
    Please let us know.
    I will really appreciate it.
    Thanks
    Ram

    (subfolders COFILE and DATA of DIR_TRANS contain the transport requests once they are released, and they must exist in your system, check via AL11 to get the actual name on server, e.g. /usr/sap/trans/cofiles.)
    Program sources are stored in a cluster like (comrpessed) table (tables REPOSRC and REPOTEXT and for older versions tables D010S, D010SINF, D010T, D010TINF) and so not easily downloadable.
    You can create a report that read thru the abap program header table (TRDIR or via TADIR ) and execute the [READ REPORT|http://help.sap.com/abapdocu_70/en/ABAPREAD_REPORT.htm] statement to load source into an internal table, then you can download it
    Check sample at wiki like [Download given set of programs into a folder on presentation server|http://wiki.sdn.sap.com/wiki/display/Snippets/Downloadgivensetofprogramsintoafolderonpresentationserver]
    Regards,
    Raymond

  • Where does Abap Dataflow create the Abap program

    Within Abap dataflow properties i have to give program name: which i gave as : Z_MaraXtract
    The abap dataflow extracted data perfectly fine. it created a dat file in working folder and also populated data to template table.
    Where does this Abap program "Z_MaraXtract: gets created?
    Thanks a lot for the helpful info.

    Hi Raj,
    You are probably looking for Z_MaraXtract on your DS box. This is the same thing I was looking for, for a long time.
    This is the Abap program name. The file that DataServices uses is in the folder you defined in the data store, advanced,  Generated ABAP directory.
    To the the OS filename on your DS server , rightclick on the ABAP Dataflow, properties, select the tab options and you will see a "Generated Abap filename" field. The name you put there is the physical filename on, say Windows. If you open that file (with notepad) you will see the ABAP program name  Z_MaraXtract.
    Norbert

  • Call ABAP program from Unix script passing dynamic filename

    Hi,
    Does anyone know if it is possible to call an ABAP program from a Unix script passing a dynamic filename to the ABAP program?
    We are receiving a file from an external company and on receipt of the file want to call an ABAP program passing the filename.  The filename is made up of File ID, Date and Time which we need to read in the ABAP program.  We usually use Events to trigger a program which is fine when the filename if static however since this filename will be dynamic we cannot do this.  In addition we cannot just rename the file to a static name in the Unix script as we need to know the value of the date and time from the file ID in the ABAP program.  I can change the ABAP program to check our /in directory for a Filename that starts with the fixed File ID however I thought there must be a better way of doing this.  We want the external company to put this information in a file header record but they don't want to change the file contents.  Any ideas would be appreciated.
    Thanks,
    Sinead.

    You could follow the following method
    1.Let the external file reside in the SAP application layer in a defined path e.g. /usr/sap/tmp/interface/working/
    2.Write an ABAP program which will include the following steps:-
       i) read all files in the file path using function module EPS_GET_DIRECTORY_LISTING
      ii) Read the data from files existing in the directory using OPEN_DATASET statement
    iii) After the files have been read move the files to another directory e.g. /usr/sap/tmp/interface/backup/ or you can delete the file.
    3.Schedule this program to be executed depending on the frequency of the external file being generated.

  • GDS with an ABAP program

    Hi All,
    I have a GDS which is created using table and data (daily delta)  in table is coming through an abap program.
    But I am not getting how this program will execute automatically until and unless we dont execute it.
    Is there any procedure to call the abap program to fill data in GDS ???
    Regards
    Shweta

    Hi,
    One Program is running and filling Table and then you are taking data from that table using GDS. So you ask ABAPer who written that program?. and daily at what time it will execute in ECC and what time the job will completes, then after that you run your daily extraction, then you will get Deltas or Full loads based on Date.
    Thanks
    Reddy

  • Read DB2 tables from ABAP program

    Hi All,
    I have a requirement to read a DB2 table(in our landscape) from the ABAP program.  I appreciate any pointers.
    Thanks,
    Kiran.

    Connecting to an External database from SAP
    Step 1: Create an entry for the External database in DBCON table using Trxn: DBCA.
    Table: DBCON (Description of Database Connections)
    Field Name Description Value (For: E.g.:)
    CON_NAME Logical name for a database RAJ
    DBMS Database system MSS
    USER_NAME Database user <username>
    PASSWORD Password for setting up the connection to the database <pwd>/<pwd>
    CON_ENV Database-specific information for a database connection MSSQL_SERVER=depotserver MSSQL_DBNAME=HOF_INDORE
    DB_RECO Availability type for an open database connect
    Step 2: Now you can write code to connect to the external database…
    Your Sample code can be something like this……
    FUNCTION-POOL z_houston. "MESSAGE-ID ..
    DATA: BEGIN OF wa,
    c_locid(3),
    c_locname(50),
    c_locstate(5),
    END OF wa.
    FUNCTION z_houston_connect.
    ""Local interface:
    EXEC SQL.
    CONNECT TO 'RAJ' AS 'V'
    ENDEXEC.
    EXEC SQL.
    SET CONNECTION 'V'
    ENDEXEC.
    *- Get the data from MS-SQL Server
    EXEC SQL.
    open C1 for
    select
    loc_id,
    loc_name,
    loc_state
    from ho_loc_mast
    ENDEXEC.
    DO.
    EXEC SQL.
    FETCH NEXT C1 into :wa-c_locid, :wa-c_locname, :wa-c_locstate
    ENDEXEC.
    IF sy-subrc = 0.
    PERFORM loop_output.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    EXEC SQL.
    CLOSE C1
    ENDEXEC.
    ENDFUNCTION.
    *& Form LOOP_OUTPUT
    Output
    FORM loop_output .
    WRITE: /5 wa-c_locid, 10 wa-c_locname, 65 wa-c_locstate.
    CLEAR wa.
    ENDFORM. " LOOP_OUTPUT

  • Synchronizing Two Custom Z Tables Using Abap Program

    Hi,
        My requirement is Synchronizing two custom z tables using abap program me.
    I have vendors in two tables, i have to select the common vendors from first which are existing in second  table also.
    In first table each vendor can have more than one supplier types in one field only. In second table these supplier types are divided into
    different fields.
         My requirement is I have to check supplier types in first table and i have to pass X to corresponding supplier types in second table vendor.
    I have to pass X value for each depending in Second table depending upon supplier type in first table.
    . How to do it can any one suggest with code.
    Thanks in Advance,
    Vivek
    <subject edited by moderator>
    Message was edited by: Manish Kumar

    Hi,
    Imho, you need to get (meaning, extract into separate fields) the different supplier types from Table1 first. Your key for Table1 is the vendor no, which is also the key in Table2 (or the key for Table2 is Vendor no & Type).
    For better performance, better select multiple/all required entries from Table1 instead of doing a select endselect.
    Depending on the format of the vendortypes in Table1, put them in a new itab (for our purpose named Table1New where vendor no & type are the only 2 fields. For example, if the type length is fixed to 2 chars, or divided by space,... use your coding accordingly.
    Next step is to select all vendor no's in Table2 which you have selected in Table1. If in Table2, the vendor no is the only key (and the all vendor types are filled in a single record), then loop check the vendor types from Table1New against the types in Table2.
    If the key of Table2 is vendor no & vendor type, then do a read table for the key.
    The logic in pseudo-code:
    Select from Table1 into table. If you'd like to limit the selection size, add package size statement.
         extract the vendor types in to itab Table1New.
         Select the vendor & types from Table2 by using the for all entries option (better performance).
         loop at Table1New
              check in Table2:
                   if the unique key is vendor no: check all fields for the vendor type from Table1New
                   if the unique key combo is vendor no & type: check by using a read table.
              If not found => add entry to Table2
         endloop.
    endselect Table1 (when using package size)
    I guess the most difficult step is to extract the types from Table1 into separate fields, all the rest seems straight forward. Please keep in mind the itab type definitions for a better performance.
    Good luck!
    Best regards,
    Zhou

  • Error messages in ABAP program are stored in which table

    hi all,
    Can anyone tell
    error messages in ABAP program are stored in which table??

    Hi Sir ,
    Please have a look below .Hope it is suitable and simpler solution for your question.
    Please do reward if useful.
    Thankx.
    Fuction module for storing error messages  ->'format_message'
    for example...
    data : v_message(100) type c.
    call transaction NNNN mode A update S messages into it_messages.
    loop at it_messages where msgty = 'E'.
    call function 'format_message'
    exporting
    *it_messages details
    importing
    v_message.
    write :/ v_message.
    clear v_message.
    endloop.
    Anothe method - ->
    Here is a sample of the program code for that:
    LOOP AT it_messtab.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    id = it_messtab-msgid
    lang = it_messtab-msgspra
    no = it_messtab-msgnr
    v1 = it_messtab-msgv1
    v2 = it_messtab-msgv2
    IMPORTING
    msg = g_msg
    EXCEPTIONS
    OTHERS = 0.
    IF it_messtab-msgtyp = 'S'.
    it_sucess-sucess_rec = g_msg.
    it_sucess-lifnr = it_header-lifnr." Based on your field
    it_sucess-tabix = v_lines.
    APPEND it_sucess.
    ELSEIF it_messtab-msgtyp = 'E'.
    it_error-error_rec = g_msg.
    it_error-lifnr = it_header-lifnr.
    it_error-tabix = v_lines.
    APPEND it_error.
    ELSE.
    it_info-info_rec = g_msg.
    it_info-lifnr = it_header-lifnr.
    it_info-tabix = v_lines.
    APPEND it_info.
    ENDIF.
    ENDLOOP.

  • How to pass table data to brf plus application through abap program

    Dear All,
    i have a question related to BRF Plus management through abap program.
    In brf plus application end, Field1,field2,field3 these 3 are importing parameters.
                                           Table1->structure1->field4,field5 this is the table,with in one structure is there and 2 fields.
    in my abap program, i am getting values of fields let us take field1,field2,field3,field4,field5.
    And my question is
    1) How to pass fields to BRF Plus application from abap program.
    2)How to pass Table data to BRF Plus application from abap program.
    3)How to pass Structure data to BRF Plus application from abap program.
    4)How to get the result data from BRF Plus application to my abap program.
    And finally , how to run FDT_TEMPLATE_FUNCTION_PROCESS.
    How do i get the code automatically when calling the function in brf plus application.
    Regards
    venkata.

    Hi Prabhu,
    Since it is a Custom Fm i cant see it in my system.
    Look if u want to bring data in internal table then there could be two ways::
    1) your FM should contain itab in CHANGING option , so that u can have internal table of same type and pass through FM,
    2) read values one by one and append to internal table.
    Thanks
    Rohit G

Maybe you are looking for

  • Status of the Sale order

    Hi Experts     In which tabe we will get the status of the sale order.But in the screen it shows VBSTT-GBSTA_BEZ.      VBSTT is astructure Regards Mano

  • Splitting of fields using BPM

    hi   my scenerio is about file to JDBC .  my flat file contains some 20 rows,just i want to split into 4 rows and then transfer into sql server.   how i want to split the fields using BPM. thx in advance. Message was edited by:         tamilarasan ka

  • Does N97 support TV out

    I go the n95 TV out and I was curious if I can use it on the n97 as I can see there is settings for the TV out on the nokia n97 but when I use it don't work, so what's the problem?

  • Formbuilder where does it work for sure?

    I am finding that it is not true that formbuilder (11.1.1.4) is not compatible with 2008 r2 64 bits.... yet. I fear I will find out why it's not certified... sooner or later... But it is working with everything that should not work. 2008 r2 64 bits a

  • How to open PDF files on HP 32 tp

    Please help. I'm trying to open PDF or mime files on my HP 32 bit tp Thanks.