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

use of READ REPORT and INSERT REPORT

Hi Guys,

i need a small help from u guys.......

i want to know the use of READ REPORT and INSERT REPORT with Example

the requirement is...

i want to declare an internal table with fields from custom table.

if any field is aded in the custum table then that field also should get populated in the program.

Ex: custom table fields are

MANDT

BUKRS

MATNR

LIFNR

field1

field2

field3

now suppose if a new field field4 is added in the Table

then the Program should automatically pick-up the fields from FIELD1...FIELD4.

i heard by using READ and INSERT report we can do it

plz help me ...

Thanks

Sunil.:-)

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Nov 23, 2007 at 10:13 AM

    Hi,

    Just declre the internla table like the data base table

    data : itab type table of ztable.

    Now the structure of ztable if changed the itab also will change...

    Regards,

    Nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

    • If you're on 46C or above, you can use the following to generate tables dynamically.

      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE

      EXPORTING

      IT_FIELDCATALOG = GT_FIELDCAT

      IMPORTING

      EP_TABLE = GS_DATA_HEAD

      EXCEPTIONS

      GENERATE_SUBPOOL_DIR_FULL = 1

      OTHERS = 2.

      But you are restricted to 32 calls, if I remember correctly. If you are in a later release, you can use the RTTS classes to create internal tables dynamically, without the restriction on subroutine pools.

      These classes are CL_ABAP_TYPEDESCR and subclasses.

      There are a few blogs on SDN that give examples of their use.

      Matt

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2007 at 10:22 AM

    yes it is possiable.

    refer table structure. itab and wa .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2007 at 10:24 AM

    Hi..

    Declare ur internal table structure in the table structure itself..

    For Eg.

    data : begin of itab occurs 0.

    include strucuture zxxx.

    data end of itab.

    Regards

    Bala..

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

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

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