How to display list of fields using ALV reports.



REPORT  ZSPRO_ALV_FCT.

tables vbak.

typesBEGIN OF ty_vbak,
       vbeln 
type vbak-vbeln,
      erdat 
type vbak-erdat,
       ernam 
type vbak-ernam,
       vbtyp 
TYPE vbak-vbtyp,
       auart 
TYPE vbak-auart,
      
END OF ty_vbak.

data it_fcat type  SLIS_T_FIELDCAT_ALV.
data wa_fcat type SLIS_FIELDCAT_ALV.

data it_vbak type TABLE OF TY_vbak.

select-OPTIONS s_vbeln for vbak-vbeln.

select vbeln erdat ernam vbtyp auart from vbak into table it_vbak where vbeln                          in s_vbeln.

  wa_fcat
-fieldname  'VBELN'.
  wa_fcat
-seltext_l  'SALES ORD NO'.

  
APPEND WA_FCAT TO IT_FCAT.
  
CLEAR WA_FCAT.

wa_fcat
-fieldname 'ERDAT'.
  wa_fcat
-seltext_l 'DATE'.

  
APPEND WA_FCAT TO IT_FCAT.
  
CLEAR WA_FCAT.

  wa_fcat
-fieldname 'ERNAM'.
  wa_fcat
-seltext_l 'NAME'.

  
APPEND WA_FCAT TO IT_FCAT.
  
CLEAR WA_FCAT.

   wa_fcat
-fieldname 'VBTYP'.
  wa_fcat
-seltext_l 'DOC'.

  
APPEND WA_FCAT TO IT_FCAT.
  
CLEAR WA_FCAT.


   wa_fcat
-fieldname 'AUART'.
  wa_fcat
-seltext_l 'DOCTY'.

  
APPEND WA_FCAT TO IT_FCAT.
  
CLEAR WA_FCAT.

 
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
  
EXPORTING
*    I_INTERFACE_CHECK              = ' '
*    I_BYPASSING_BUFFER             =
*    I_BUFFER_ACTIVE                = ' '
    I_CALLBACK_PROGRAM             
sy-repid
*    I_CALLBACK_PF_STATUS_SET       = ' '
*    I_CALLBACK_USER_COMMAND        = ' '
*    I_STRUCTURE_NAME               =
*    IS_LAYOUT                      =
    IT_FIELDCAT                    
IT_FCAT
*    IT_EXCLUDING                   =
*    IT_SPECIAL_GROUPS              =
*    IT_SORT                        =
*    IT_FILTER                      =
*    IS_SEL_HIDE                    =
*    I_DEFAULT                      = 'X'
*    I_SAVE                         = ' '
*    IS_VARIANT                     =
*    IT_EVENTS                      =
*    IT_EVENT_EXIT                  =
*    IS_PRINT                       =
*    IS_REPREP_ID                   =
*    I_SCREEN_START_COLUMN          = 0
*    I_SCREEN_START_LINE            = 0
*    I_SCREEN_END_COLUMN            = 0
*    I_SCREEN_END_LINE              = 0
*    IR_SALV_LIST_ADAPTER           =
*    IT_EXCEPT_QINFO                =
*    I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
*  IMPORTING
*    E_EXIT_CAUSED_BY_CALLER        =
*    ES_EXIT_CAUSED_BY_USER         =
   
TABLES
     T_OUTTAB                       
IT_VBAK
*  EXCEPTIONS
*    PROGRAM_ERROR                  = 1
*    OTHERS                         = 2
           
.
 
IF SY-SUBRC <> 0.
* Implement suitable error handling here
 
ENDIF.


 



 





 

SHARE

Unknown

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment

0 comments:

Post a Comment