TABLES statement in report program

Hi,
Is there any performance issue in using TABLES statement in report program? Because I have got an review point from QA insisting me to avoid TABLES statement. Is it recommended by SAP to avoid TABLES statement in report program?
Thanks in advance.
Regards,
Balaji Viswanath.

Balaji,
If you use TABLE statement it will provide the work area of the given table.
EX: Decalre  any fields of table in slection scereen
without declarin g the tabel name in TAble statement.It will give error.
This will give error.
SELECT-OPTIONS : s_matnr LIKE MARA-matnr.
This will work.
TABLES: mara.
SELECT-OPTIONS : s_matnr LIKE MARA-matnr.
It means it will occupy some area.
Don't forget to reward if useful.

Similar Messages

  • Table control in report program

    Hi all...
    Please help me to create a table control in my report program. my requirement is to enable the user to enter two fields (company code and cost center) on the selection screen. I wish to do this using table control..
    example codes will be extremely helpful..
    Thanks in advance..
    -Pranati.

    Hi,
    We can not do the Table control on the selection screen, but we can do the Tab strip control.
    To define a tabstrip area with tab pages, use the following statements in your selection screen definition:
    SELECTION-SCREEN: BEGIN OF TABBED BLOCK <tab_area> FOR <n> LINES,
                      TAB (<len>) <tab1> USER-COMMAND <ucom1>
                                  [DEFAULT [PROGRAM <prog>] SCREEN <scrn>],
                      TAB (<len>) <tab2> USER-COMMAND <ucom2>
                                  [DEFAULT [PROGRAM <prog>] SCREEN <scrn>],
                      END OF BLOCK <tab_area>.
    See the below SAP link for the sample programs
    http://help.sap.com/saphelp_46c/helpdata/EN/00/deb23789e95378e10000009b38f8cf/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e7/deb237b9a9a968e10000009b38f8cf/content.htm
    See the example code
    REPORT   znr1 NO STANDARD PAGE HEADING
                LINE-SIZE 80 LINE-COUNT 60.
    TABLES : sscrfields.
    DATA  activetab(6) TYPE c .
    DATA  mat_des TYPE makt-maktx.
    DATA  pl_des  TYPE t001w-name1 .
    SELECTION-SCREEN BEGIN OF SCREEN 001 AS SUBSCREEN NO INTERVALS.
    SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-002 NO
    INTERVALS.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 14(18) text-002 FOR FIELD matnr.
    PARAMETERS matnr TYPE mara-matnr.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK block1.
    SELECTION-SCREEN END OF SCREEN 001.
    SELECTION-SCREEN BEGIN OF SCREEN 002 AS SUBSCREEN NO INTERVALS.
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-003 NO
    INTERVALS.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 14(18) text-003 FOR FIELD matnr.
    PARAMETERS werks TYPE t001w-werks.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK block2.
    SELECTION-SCREEN END OF SCREEN 002.
    SELECTION-SCREEN BEGIN OF TABBED BLOCK tabb1 FOR 5 LINES NO INTERVALS.
    SELECTION-SCREEN TAB (15) tabs1 USER-COMMAND ucomm1
                         DEFAULT SCREEN 001.
    SELECTION-SCREEN TAB (15) tabs2 USER-COMMAND ucomm2.
    *                     DEFAULT SCREEN 002   .
    SELECTION-SCREEN END OF BLOCK tabb1.
    INITIALIZATION.
      tabs1 = text-002.
      tabs2 = text-003.
      activetab = 'TABS1'.
    AT SELECTION-SCREEN .
      CASE sscrfields-ucomm.
        WHEN 'UCOMM1'.
          tabb1-prog = sy-repid.
          tabb1-dynnr   = 001.
          tabb1-activetab = 'TABS1'.
          activetab = 'TABS1' .
        WHEN 'UCOMM2'.
          tabb1-prog = sy-repid.
          tabb1-dynnr   = 002.
          tabb1-activetab = 'TABS2'.
          activetab = 'TABS2'.
      ENDCASE.
    START-OF-SELECTION.
      CASE activetab.
        WHEN 'TABS1'.
          SELECT SINGLE maktx  FROM makt INTO pl_des WHERE matnr = matnr.
          WRITE: 'Material ' , matnr , mat_des .
        WHEN 'TABS2'.
          SELECT SINGLE name1  FROM t001w INTO pl_des WHERE werks = werks.
          WRITE: 'Plant ' , werks ,pl_des.
    Regards
    Sudheer

  • How to lock a table in a report program

    Hi all,
         I have a requirement inwhich if i have selected one radio button  the table should locked .
       and the i need to check wether the table is locked or not by checking the condition.if locked continue else i need to stop.
    can any one help me doing this.

    Hi,
    Hope this information will be useful for you.....
    The description of an SAP lock to a table is made via the lock condition and the lock mode.
    The lock condition is a logical condition for the lines of the table to be locked. It describes the area of the table which the lock is to protect from competitive access. To avoid the administration of the lock becoming complicated, the lock condition can not be formulated as freely as the WHERE clauses:  only fully qualified key fields related by AND may appear in the condition.
    Via the lock mode you define which operations on the table are to be protected by the lock. The lock modes available are:
    Read lock (shared lock)
    protects read access to an object. The read lock allows other transactions read access but not write access to the locked area of the table.
    Write lock (exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to the locked area of the table.
    Enhanced write lock (exclusive lock without cumulation)
    works like a write lock except that the enhanced write lock also protects from further accesses from the same transaction.
    In order to be able to define SAP locks for a table, you must first create a lock object for the table via Development->Dictionary.
    If the data for an application object is distributed among several database tables, it is often necessary to be able to lock these tables simultaneously. It is therefore possible to include several tables in a lock object, althought they must be related via appropriate foreign key relationships. The tables involved in a lock object are also known as its base tables.
    Thanks
    NITESH

  • Getting data from table control to the report program.

    Hi,
    I created a table control using report program and i am trying to enter data in the table control which i want to update in the DB table. How can i get the data entered in table control to the report program, so that i can update the DB table.
    Please help me finding out which variable will hold the data entered in table control(dynamically).

    hi,
    in your table control you give some name to that table control say it_cntrl.
    this only serves as the internal table to process the table control data.
    like u can write like this.
    loop at it_cntrl into wa_cntrl.   "wa_cntrl is work area of type it_cntrl table type
    .........        "do your functining
    end loop.
    any clarification get in touch
    thnks

  • Trigger report program if Z table field is modified/created

    Hi,
    I have a requirement where i want to run the report program ONLY if a particular field ( Dispatch date ) is modified or updated of a 'Z' Table ( Custom Table ).
    The report program would fetch data from the same 'Z' table only for those records which are modified/updated. This data is then transferred to an application server.
    1. How should i trigger the report program for the above requirement.
    2. If a background program is to be created, then what should be the trigerring criteria & where it should be defined.
    3. Do i need to set any change pointers etc.
    Pointers to the above requirement would be very helpful.
    Thanks in advance,
    Best regards,
    Prashant

    hi prashant,
       i'm working on a similar query as that of ur's.
      see the logic is as we proceed in ur case is DISPATCH DATE say are to be modified in the process of inserting 0r changing the contents of a ZTABLE.
    so here the logic would be
    loop at itab.
    MODIFY ZTABLE FROM TABLE ITAB.
    endloop.
    This is the key reference in our logic .
    now it is known that u have a ZTABLE with dispatch date
    here the data element will be DATUM .
    now in the ZTABLE go to DISPATCH DATE filed i.e its DATA ELEMET double click on data element  DATUM .
    now if u see here there will be a tick called as Checkbox on change document which is enabling the CDHDR and CDPOS.
    *if its not checked get it checked in .
    This is the source to the logic.
    now what u need to do in ur logic part is
    1. collect all the entries of the table.
    (im not sure how many entries are there but try to get all the primary keys + one or two more fields so that the time is saved . this we do to check.
    2. before the modify comes into affect see if u can store all the content of the table i.e step 1.
    3.lets say we have modified the ZTABLE.
    4.now collect all the entries i.e newly modified into new inttab with same logic as the basic primary key configurations + two fields .
    5. let the two internal tables be compared and based on the comparision derive a new internal table as follows .
    REPORT ztemp .
    TYPES: BEGIN OF line,
              brand(10) TYPE c,
              rate(3)   TYPE p DECIMALS 2,
              gender(1) TYPE c,
              sno       TYPE i,
              desc(30)  TYPE c,
            END OF line.
    DATA: it_lines_1 TYPE TABLE OF line
                      WITH KEY brand
                               rate
                               gender,
           wa_lines_1 LIKE LINE OF it_lines_1.
    DATA: it_lines_2 TYPE TABLE OF line
                      WITH KEY brand
                               rate
                               gender,
           wa_lines_2 LIKE LINE OF it_lines_2.
    DATA: gi_counter TYPE i.
    START-OF-SELECTION.
       PERFORM fill_it_line_1. " not included; tested with your 4 records
       SORT it_lines_1.
       CLEAR gi_counter.
       LOOP AT it_lines_1 INTO wa_lines_1.
         wa_lines_2 = wa_lines_1.
         ADD 1 TO gi_counter.
         AT END OF gender.
           IF gi_counter > 1.
             APPEND wa_lines_2 TO it_lines_2.
           ENDIF.
           CLEAR gi_counter.
         ENDAT.
       ENDLOOP.
    This only works if you are able to define the fields of the internal table in this order, so with the key fields first in the right order. Otherwise the AT END OF will not work.
    6. now if u can reach upto here then we need not create a background program .
    7. u are exactly right change pointers will have to come into picture .
    8 .then comes the picture of moving this content to application server using datasets etc.
    hope this helps u in building the logic .
    i would like to hear from other developers too in this regard.
    Thanks and regards,
    vijay.

  • How to create an internal table in a Report from File of FTP Server.

    Hi All,
    I want to create an internal table in a Report program. But the problem is I have to download two latest files from FTP server.
    Now, based in those file I have to design internal tables in current program. The problem is the program from which these files are being generated has options to display some fields in the output. Hence, the columns of these files becomes dynamic due to which I am not able to design the internal table in my current program...Please Help.
    Regards & Thanks.
    Prashant.

    Hi,
    Or you can use the RTTS classes...
    Plenty of examples over here.
    one external link: http://help-abap.zevolving.com/2008/09/dynamic-internal-table-creation/
    Kr,
    Manu.

  • How to Populate Internal table data to Table Control in a Report Program

    Dear All,
           How to Populate Internal table data to Table Control in a Report Program? It is a pure report program with out any Module pool coding involved, which is just used to display data. Till now it is being displayed in a report. Now the user wants the data to be displayed in a table control. Could someone tell me how to go about with this.
    Thanks in Advance,
    Joseph Reddy

    If you want to use a table control, you will need to create a screen.
    In your report....
    start-of-selection.
    perform get_data.  " Get all your data here
    call screen 100. " Now present to the user.
    Double click on the "100" in your call screen statement.  This will forward navigate you to the screen.  If you have not created it yet, it will ask you if you want to create it, say yes.  Go into screen painter or layout of the screen.  Use the table control wizard to help you along the process.  It will write the code for you.  Since it is an output only table control, it will be really easy with not a lot of code. 
    A better way to present the data to the user would be to give it in a ALV grid.  If you want to go that way, it is a lot easier.  Here is a sample of the ALV function module.  You don't even have to create a screen.
    report zrich_0004
           no standard page heading.
    type-pools slis.
    data: fieldcat type slis_t_fieldcat_alv.
    data: begin of imara occurs 0,
          matnr type mara-matnr,
          maktx type makt-maktx,
          end of imara.
    * Selection Screen
    selection-screen begin of block b1 with frame title text-001 .
    select-options: s_matnr for imara-matnr .
    selection-screen end of block b1.
    start-of-selection.
      perform get_data.
      perform write_report.
    *  Get_Data
    form get_data.
      select  mara~matnr makt~maktx
                into corresponding fields of table imara
                  from mara
                   inner join makt
                     on mara~matnr = makt~matnr
                        where mara~matnr in s_matnr
                          and makt~spras = sy-langu.
    endform.
    *  WRITE_REPORT
    form write_report.
      perform build_field_catalog.
    * CALL ABAP LIST VIEWER (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_fieldcat = fieldcat
           tables
                t_outtab    = imara.
    endform.
    * BUILD_FIELD_CATALOG
    form build_field_catalog.
      data: fc_tmp type slis_t_fieldcat_alv with header line.
      clear: fieldcat. refresh: fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material Number'.
      fc_tmp-fieldname  = 'MATNR'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '18'.
      fc_tmp-col_pos    = 2.
      append fc_tmp to fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material'.
      fc_tmp-fieldname  = 'MAKTX'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '40'.
      fc_tmp-col_pos    = 3.
      append fc_tmp to fieldcat.
    endform.
    Regards,
    Rich Heilman

  • REPORT/PROGRAM statement missing, or program type is INCLUDE error upgrade.

    Hi Experts,
    I have done the recording for FK05 and created functionmodule for the same. But when I use that function module in my custom program or if I try directly execute the FM, I am getting dump like syntax error. So I did syntax check and tried to activate, I am getting "REPORT/PROGRAM statement missing, or program type is INCLUDE error upgrade" error.
    Please help me soon to resolve this issue.
    Thanks in advance.
    Shreyansh

    Hi
    Goto main function group include name attributes tab and double click.
    once the include is opened, try to activate it. if shows errors then fix.
    regards
    Shiva

  • Error: REPORT/PROGRAM statement missing , program type is I (include).

    Hi,
    I have created a REPORT Program (Z Program) and also created a TOP INCLUDE. I am NOT using Function module. When I tried to syntex check the INCLUDE, system is giving
    following error:
    REPORT/PROGRAM statement missing, program type I (Include).
    Can you help me in resolving this error.
    Currently TOP include has only one statement to declare a Constant.
    Thanks,

    hi,
    take your program in se80.
    double click on the program name. Right click on it and press Activate. All the include will get activated and the problem will get solved.
    Regards,
    Renjith Michael.
    http://www.sourceveda.com/

  • Insert records from report program into R3 table

    Hi
    I wanted to insert records from report program into R3 table.
    here is my code
    data : itab type standard table of zemp initial size 10 with header line.
    itab-EMPNO = '012'.
    itab-ENAME = 'XXXX'.
    itab-JOB = 'XXXX'.
    APPEND itab.
    insert ztable from table itab.
    but i am getting the following error
    the type of the data base table and work area/internal table "ITAB" are no unicode-converible.
    how can I insert records from report program into R3 table
    should I have to write move corresponding
    pls guide
    thanks
    manian

    Hi,
    itab-EMPNO = '012'.
    itab-ENAME = 'XXXX'.
    itab-JOB = 'XXXX'.
    APPEND itab.
    insert ztable from table itab.
    Do one thing
    Data : itab type table of ztable with header line.
    itab-EMPNO = '012'.
    itab-ENAME = 'XXXX'.
    itab-JOB = 'XXXX'.
    APPEND itab.
    insert ztable from table itab.
    error will resolve, then try to make structure similar to ZTABLE

  • REPORT/PROGRAM statement missing.

    Hi,
    I have a report with two includes. In both the Include Programs,i am getting a error message 'REPORT/PROGRAM statement missing, or program type is I (INCLUDE).'
    Eg.
    Report reportname.  " program type Report
    include program1.    " program type Inlude
    include program2.    " program type Inlude
    start-of-selection.
    Please Help.
    Thanks & Regards,
    Jayapal.

    Hi ,
    This will not be any problem Jay. Since it is a Non executable program it will always show that error. You can activate the program.
    Do one thing create a test report program and call this include program in that report and execute. It will show you the result.
    I've created an example program for this, please have a look
      My Report Program :
    REPORT ZTEST.
    INCLUDE ZTESTINCLUDE.
    My Include Program :
    *&  Include           ZTESTINCLUDE
    data : a type i,
           b type i,
           c type i.
    a = 3.
    b = 2.
    c = a + b.
    write : / 'Result is :' , c.
    Try executing the Report it will show you the result 5. Tell the client this is not a problem. Check in the attributes of your Include program ( program1 ) if it is of type Include.
    Regards,
    Sai

  • Report  all  z  tables  with  all  z  program containing these z tables

    Hi  Everyone,
    I  want  to  write a report  to  extract  all   z table   with  all   z  program  contained in these z tables 
    ex: The z table zxxxx  exist in program zxx1 , zxx2 and zxx3.
    Table                                    Program
    zxxxxx                                 zxx1
                                                 zxx2
                                                 zxx2
    If  you  have  any  idea  ,  wich table we can find information
    Thanks in advance for your time
    Soufiene

    Thank you very much , but where i can find the descritption for the table .
    EX :
    TABLE                        DESCRIPTION                                                 PROGRAM
    ZCHANGEMPL           SAP  TO Kronos interface tables                   ZXXXXXXX
    Thanks a lot
    Soufiene

  • How to lock a database Z table before updating it through a report program

    Hi,
    How to lock a database Z table before updating it through a report program and also how to unlock it after my updation.
    The whole process is done through report program.

    Hi,
    Go to SE11, in the option 'Lock object' enter the name of your lock,
    begin with 'E', suppose 'EXXXX' And create. In tab 'Tables' fill the
    table name where the record you want to lock exist and select the
    lock mode. Lock mode can be shared and exclusive. If 'shared',
    when you lock the record, other can also read data, but can not
    modify. If 'exclusive', when you lock the record, other can neither
    read nor modify the record. After save and activate, you will get two
    function module.'ENQUEUE_EXXXX' to lock record,
    'DEQUEUE_EXXXX' to release lock on one record.
    When use this function module it only lock one record at a time. It
    does not lock the table.
    Regards,
    Omkaram.

  • Message class defined as part of report/program statement

    Hi,
    This is a very general question but I am not sure to what this refers to.
    "Message class defined as part of report/program statement"
    What does this mean or what is this referenced to?
    Thanks
    Edited by: David Rivera on Feb 3, 2010 10:36 PM

    Hello,
    it means when you are creating a report / program you can assign one message class to that...
    like:
    report Ztest message-id <message class>
    then you can access all the messages defined in that message class...
    Thanks
    K.

  • Few questions on Report programming

    Hi guys,
    I have few questions on report programming.
    1. What is the purpose of the statement REPORT zxxx. Even if i gave a name other than my report name i don't find any difference in syntax check/Functionality.
    2. What is the purpose of list headings in report program? This option will come along with the text elements and selection texts.
    3. What is the purpose of logical data base. Even if it is efficient why don't we use it frequently in our reports? Is there any limitations?
    All usefull answers will be rewarded as usuall:-)
    Thanks,
    Vinod.

    1. As u told that you dint get any syntax errors even after changing the Report Name,there are chances of getting Runtime errors.
    2. The usage of List Headings is when you create a list in a program, you can also create your own list and column headings.
    Refer this link for further info.
    http://help.sap.com/saphelp_nw70/helpdata/en/e3/960a05eb0711d194d100a0c94260a5/content.htm
    3. The Limitation of LDB  is the usage of GET statements which act similar to SELECT - ENDSELECT And also if you dont choose the proper LDB,a  single LDB may contain data retrieval from so many tables ,that it would make the entire process very slow and it is very hard to find LDBs for other modules than HR.
    Only in HR module the data is organized in such a way thatusing LDBs would be much simpler.
    Reward points if useful.

Maybe you are looking for

  • How to get the tablename of current price

    Hi experts, In sales tab page in MM43, I can see the current price in the bottom right corner of the screen. When I click "Sales Prc. Calc." button, I can find a list. Now I want to get the curr. finalprc of the list. Who will tell me the table name

  • Can i swap out the SIM in an iPad 16G?

    way past the end of my 2 year contract with awful carrier 3, so i want to get a SIM only contract elsewhere and just flush the old one down the toilet.  can i do this?

  • Macbook pro won't detect VGA display

    My MacBook Pro (15-inch i7 Early 2011) won't detect an external display using an apple mini displayport -> VGA connector using 10.7.3. All cables and the monitor are fine because my white macbook detects the LG monitor without any problem. I have rea

  • Updating ipad 2 to io6 using wifi

    Im selling my iPad 2 (getting the new generation  iPad 4) to a friend who doesn't have a computer or notebook , although he has internet service at home which he use basically for phone service. I was wondering if he can update the iPad 2 to io6 usin

  • Cover art for Pdf in Itunes 11

    Please, does anybody solved the problem with cover art in pdf in itunes 11?? You can add an image to use as cover art to a pdf in itunes 11.4 but it won´t stick, any apple forum geniuses out there that could solved this? anybody know how can i send t