Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

first code is executing correctly but second code is not executing... alv report

former_member622718
Participant
0 Likes
899
                          first code which is executing





TYPE-POOLS: slis.  " SLIS contains all the ALV data types

*&---------------------------------------------------------------------*
*& Data Declaration
*&---------------------------------------------------------------------*
DATA: it_sbook     TYPE TABLE OF sbook.
DATA: it_fieldcat  TYPE slis_t_fieldcat_alv,
      wa_fieldcat  TYPE slis_fieldcat_alv.
*&---------------------------------------------------------------------*
*& START-OF-SELECTION
*&---------------------------------------------------------------------*
START-OF-SELECTION.

*Fetch data from the database
  SELECT * FROM sbook INTO TABLE it_sbook.

*Build field catalog
  wa_fieldcat-fieldname  = 'CARRID'.    " Fieldname in the data table
  wa_fieldcat-seltext_m  = 'Airline'.   " Column description in the output
  APPEND wa_fieldcat TO it_fieldcat.

  wa_fieldcat-fieldname  = 'CONNID'.
  wa_fieldcat-seltext_m  = 'Con. No.'.
  APPEND wa_fieldcat TO it_fieldcat.

  wa_fieldcat-fieldname  = 'FLDATE'.
  wa_fieldcat-seltext_m  = 'Date'.
  APPEND wa_fieldcat TO it_fieldcat.

  wa_fieldcat-fieldname  = 'BOOKID'.
  wa_fieldcat-seltext_m  = 'Book. ID'.
  APPEND wa_fieldcat TO it_fieldcat.

  wa_fieldcat-fieldname  = 'PASSNAME'.
  wa_fieldcat-seltext_m  = 'Passenger Name'.
  APPEND wa_fieldcat TO it_fieldcat.

*Pass data and field catalog to ALV function module to display ALV list
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      it_fieldcat   = it_fieldcat
    TABLES
      t_outtab      = it_sbook
    EXCEPTIONS
      program_error = 1
      OTHERS        = 2.



                       second code which is not executing



REPORT zmanoj4.



TYPE-POOLS : slis.

TABLES zmanojtable.

DATA : manoj TYPE TABLE OF zmanojtable.

DATA: it_manoj TYPE  slis_t_fieldcat_alv,

      wa_manoj TYPE slis_fieldcat_alv.


SELECT

  mandt

  studentid

  studentname

  studentage

  studentdegree

  FROM zmanojtable INTO TABLE it_manoj.



wa_manoj-fieldname  = 'mandt'.

wa_manoj-seltext_m  = 'client'.

APPEND wa_manoj TO it_manoj.



wa_manoj-fieldname  = 'studentid'.

wa_manoj-seltext_m  = 'student id'.

APPEND wa_manoj TO it_manoj.



wa_manoj-fieldname  = 'studentname'.

wa_manoj-seltext_m  = 'student name'.

APPEND wa_manoj TO it_manoj.



wa_manoj-fieldname  = 'studentage'.

wa_manoj-seltext_m  = 'student age'.

APPEND wa_manoj TO it_manoj.



wa_manoj-fieldname  = 'studentdegree'.

wa_manoj-seltext_m  = 'student degree'.

APPEND wa_manoj TO it_manoj.





CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

  EXPORTING

    it_manoj   = it_manoj

  TABLES

    t_outtab      = manoj

  EXCEPTIONS

    program_error = 1

    OTHERS        = 2.
4 REPLIES 4
Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
764

Function REUSE_ALV_GRID_DISPLAY does not have it_manoj parameter.

-- Tomas --
Read only

former_member259807
Active Participant
764

and:

FROM zmanojtable INTOTABLE it_manoj.

is filling the wrong table (should be manoj, not it_manoj)

Read only

0 Likes
764

hi b.wallagh i did manoj from it_manoj but still run time error is occuring.

Read only

ThomasZloch
Active Contributor
0 Likes
764

try replacing "manoj" by "kumar"