Make your own free website on Tripod.com
 

SAP ABAP Programming, Functional and Basis Components Books


Question : Subject: ALV Sample Code

Hi friends,

I would like to set up list through ALV grid control.

Can any body send me simple sample program.

Thanks in advance.
 

Reply : Subject: ALV Sample Code

Hello,

here I am sending you sample program for alv

========================================

Report ZHELLO.

Tables:
        MAKT,
        MARA.

data: begin of itab_alv1 occurs 10,
          MAKTX like MAKT-MAKTX ,
          MATFI like MARA-MATFI ,
          MATNR like MARA-MATNR ,
          MFRPN like MARA-MFRPN ,
      END OF ITAB_ALV1.

type-pools: slis.

data: afield type slis_fieldcat_alv.

DATA: fieldcat type slis_t_fieldcat_alv.

clear afield.

afield-col_pos = 1 .
afield-fieldname = 'MAKTX'.
afield-seltext = ''.
append afield to fieldcat.
afield-col_pos = 2 .
afield-fieldname = 'MATFI'.
afield-seltext = ''.
append afield to fieldcat.

select * from mara.
   select * from makt where
         matnr = mara-matnr.
       itab_alv1-matnr = mara-matnr.
       itab_alv1-maktx = makt-maktx.
       append itab_alv1.
   endselect.
endselect.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       IT_FIELDCAT = fieldcat
    Tables
       t_outtab = itab_alv1.
 

Reply : Subject: ALV Sample Code

thanks.........

Return to :-
SAP Hints and Tips on Configuration and ABAP/4 Programming