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

multiple tables in ALV


I want to print the report in ALV format. Here i am fetching the data from 4 database tables, and passing in one internal table. I want to print the report using that one internal table. But the problem is every time it is giving me an error as the internal table is not in the outtab format.

I tried using the same program to print with one DB table and one ITab, it works.

The report is printing data in normal report form also.

How to call the same report using ALV grid.

pls help.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 15, 2005 at 04:30 PM

    Hello Simi,

    it seems your data table has a differnt structure like the alv field catalogue. This should be not to tricky if you already have an DDIC type of your joined table. The name of this structure must somehow passed to the ALV functionality.

    Of course that depends on the concrete ALV function module or ALV class. In case you need more help please provide some information on this.

    Best Regards


    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      In the call method, pass p_output = ITQALS1

      and p_fieldcat as i_fieldcat TYPE lvc_t_fcat.

      w_layout TYPE lvc_s_layo ,

      w_variant TYPE disvariant.

      c_a = 'A'

      <b>I_STRUCTURE_NAME type DD02L-TABNAME optional</b>

      CALL METHOD o_alvgrid->set_table_for_first_display


      is_variant = w_variant

      i_save = c_a

      is_layout = w_layout


      it_outtab = p_output[]

      it_fieldcatalog = p_fieldcat[]


      invalid_parameter_combination = 1

      program_error = 2

      too_many_lines = 3

      OTHERS = 4.

      IF sy-subrc <> 0.

      MESSAGE i001 WITH Error in ALV report display.



      Recheck with the structure name in the exporting part.

      While defining an output structure, GOTO SE11 select option Data type "ZZ_OUTPUT" > create, then define all the fields u want in the output table as a structure.

      Then u can define the <b>i_output TYPE STANDARD TABLE OF ZZ_OUTPUT.</b>

      w_output TYPE ZZ_OUTPUT.

      Also u can pass the structure for creating a field catalog.

      <b>* Building the field catalog</b>

      PERFORM f9001_build_field_cat TABLES i_fieldcat


      FORM f9001_build_field_cat TABLES p_fieldcat STRUCTURE lvc_s_fcat

      USING value(p_structure).



      i_structure_name = p_structure


      ct_fieldcat = p_fieldcat[]


      inconsistent_interface = 1

      program_error = 2

      OTHERS = 3.

      IF sy-subrc <> 0.

      MESSAGE i000 WITH Error in ALV field catalogue creation.



      ENDFORM. " f9001_build_field_cat

      Try this out.

      Thanks & Regards,


  • Posted on May 15, 2005 at 04:39 PM

    Hi Simi

    If you want to use the class version of the ALV Grid control, you can make use of the tutorial "An" target="_blank">">"An Easy Reference for ALV Grid Control".


    *--Serdar">[ BC ]

    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.