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

multiple tables in ALV

Hi,

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.

simi

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

    Klaus

    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

      EXPORTING

      is_variant = w_variant

      i_save = c_a

      is_layout = w_layout

      CHANGING

      it_outtab = p_output[]

      it_fieldcatalog = p_fieldcat[]

      EXCEPTIONS

      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.

      LEAVE LIST-PROCESSING.

      ENDIF.

      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

      USING 'ZZ_OUTPUT'.

      FORM f9001_build_field_cat TABLES p_fieldcat STRUCTURE lvc_s_fcat

      USING value(p_structure).

      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

      EXPORTING

      i_structure_name = p_structure

      CHANGING

      ct_fieldcat = p_fieldcat[]

      EXCEPTIONS

      inconsistent_interface = 1

      program_error = 2

      OTHERS = 3.

      IF sy-subrc <> 0.

      MESSAGE i000 WITH Error in ALV field catalogue creation.

      LEAVE LIST-PROCESSING.

      ENDIF.

      ENDFORM. " f9001_build_field_cat

      Try this out.

      Thanks & Regards,

      Judith.

  • 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">www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference for ALV Grid Control".

    Regards

    *--Serdar https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ 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.