SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

alv top of page not export to excel sheet



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
pranaypanchbhai
Участник
Участник



Joined: 26 Mar 2010
Posts: 9

PostPosted: Mon Jun 21, 2010 4:42 pm    Post subject: alv top of page not export to excel sheet Reply with quote

hiiiiiiii friend,


i have this following code i have problem that when i export alv output to excel/spreedsheet then no top of page data in excel .

i want top page information to be exported in excel plz help me

***********
Code:
*=======================================================================
* Report : ZPSP_NEW
* Company : SOLAR INDUSTRIES INDIA LTD.
* Author : PRANAY
* Function : Development:ABAP
* Date : 15.06.2010
*———————————————————————–
* Title :
*=======================================================================

report  ZPSP_NEW.
TABLES : SFLIGHT.
TYPE-POOLS : SLIS.

**INTERNAL TABLE DECLARTION
DATA : WA_SFLIGHT TYPE SFLIGHT,
       IT_SFLIGHT TYPE TABLE OF SFLIGHT.

**DATA DECLARTION
DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
      GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
      GD_REPID     LIKE SY-REPID,
      G_SAVE TYPE C VALUE 'X',
      G_VARIANT TYPE DISVARIANT,
      GX_VARIANT TYPE DISVARIANT,
      G_EXIT TYPE C,
      ISPFLI TYPE TABLE OF SPFLI.

* To understand the importance of the following parameter, click here.
**SELECTION SCREEN DETAILS
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002 .
PARAMETERS: VARIANT LIKE DISVARIANT-VARIANT.
SELECTION-SCREEN END OF BLOCK B1.
**GETTING DEFAULT VARIANT
INITIALIZATION.
  GX_VARIANT-REPORT = SY-REPID.
  CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
      I_SAVE     = G_SAVE
    CHANGING
      CS_VARIANT = GX_VARIANT
    EXCEPTIONS
      NOT_FOUND  = 2.
  IF SY-SUBRC = 0.
    VARIANT = GX_VARIANT-VARIANT.
  ENDIF.

**PERFORM DECLARATIONS
START-OF-SELECTION.
  PERFORM DATA_RETRIVEL.
  PERFORM BUILD_FIELDCATALOG.
  PERFORM DISPLAY_ALV_REPORT.

*&---------------------------------------------------------------------*
*&      Form  BUILD_FIELDCATALOG
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM BUILD_FIELDCATALOG .

  FIELDCATALOG-FIELDNAME   = 'CARRID'.
  FIELDCATALOG-SELTEXT_M   = 'Airline Code'.
  FIELDCATALOG-COL_POS     = 0.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.

  FIELDCATALOG-FIELDNAME   = 'CONNID'.
  FIELDCATALOG-SELTEXT_M   = 'Flight Connection Number'.
  FIELDCATALOG-COL_POS     = 1.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.

  FIELDCATALOG-FIELDNAME   = 'FLDATE'.
  FIELDCATALOG-SELTEXT_M   = 'Flight date'.
  FIELDCATALOG-COL_POS     = 2.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.

  FIELDCATALOG-FIELDNAME   = 'PRICE'.
  FIELDCATALOG-SELTEXT_M   = 'Airfare'.
  FIELDCATALOG-COL_POS     = 3.
  FIELDCATALOG-OUTPUTLEN   = 20.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.
ENDFORM.                    " BUILD_FIELDCATALOG


*&---------------------------------------------------------------------*
*&      Form  DISPLAY_ALV_REPORT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM DISPLAY_ALV_REPORT .
  GD_REPID = SY-REPID.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM      = GD_REPID
      I_CALLBACK_TOP_OF_PAGE  = 'TOP-OF-PAGE'  "see FORM
      I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
      IT_FIELDCAT             = FIELDCATALOG[]
      I_SAVE                  = 'X'
      IS_VARIANT              = G_VARIANT
    TABLES
      T_OUTTAB                = IT_SFLIGHT
    EXCEPTIONS
      PROGRAM_ERROR           = 1
      OTHERS                  = 2.
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    "DISPLAY_ALV_REPORT

" DISPLAY_ALV_REPORT
*&---------------------------------------------------------------------*
*&      Form  DATA_RETRIVEL
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM DATA_RETRIVEL .
  SELECT * FROM SFLIGHT INTO TABLE IT_SFLIGHT.
ENDFORM.                    " DATA_RETRIVEL

*-------------------------------------------------------------------*
* Form  TOP-OF-PAGE                                                 *
*-------------------------------------------------------------------*
* ALV Report Header                                                 *
*-------------------------------------------------------------------*
FORM TOP-OF-PAGE.
*ALV Header declarations
  DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
        WA_HEADER TYPE SLIS_LISTHEADER,
        T_LINE LIKE WA_HEADER-INFO,
        LD_LINES TYPE I,
        LD_LINESC(10) TYPE C.

* Title
  WA_HEADER-TYP  = 'H'.
  WA_HEADER-INFO = 'SFLIGHT Table Report'.
  APPEND WA_HEADER TO T_HEADER.
  CLEAR WA_HEADER.

* Date
  WA_HEADER-TYP  = 'S'.
  WA_HEADER-KEY = 'Date: '.
  CONCATENATE  SY-DATUM+6(2) '.'
               SY-DATUM+4(2) '.'
               SY-DATUM(4) INTO WA_HEADER-INFO.   "todays date
  APPEND WA_HEADER TO T_HEADER.
  CLEAR: WA_HEADER.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY = T_HEADER.
ENDFORM.                    "top-of-page
Back to top
View user's profile Send private message
namorr
Участник
Участник



Joined: 21 Jan 2010
Posts: 2

PostPosted: Wed Jan 26, 2011 2:29 pm    Post subject: The same problem Reply with quote

Hi man,
Have already solved the problem? Thank you for help...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.