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

how to provide top of page when using alv list disply

hi friends,

how to provide top of page when using alv list disply,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 04:49 AM

    While displaying top-of-page event not triggered.

    it will trigger only while printing u can check in spools

    Madhavi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 04:50 AM

    hi,

    use top_of_page event fm 'reuse_list_disply'

    just see this how to pass that into FM,

    IT_EVENTS-NAME

    Name of the Callback event.

    Possible Callback events:

    - Action

    USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

    RS_SELFIELD TYPE SLIS_SELFIELD

    Process actions on the list

    As this is a frequently-used Callback event, the form routine

    can also be passed directly in the interface in the IMPORTING

    parameter I_CALLBACK_USER_COMMAND.

    PF_STATUS_SET USING RT_EXTAB TYPE SLIS_T_EXTAB

    If a user list status is to be set, it must be done in the form

    routine assigned to this event. The ALV function codes, which

    must not be active, are in the Parameter RT_EXTAB. This table

    must be passed with the SET PF-STATUS command (with inactive

    user function codes as well, if necessary).

    The STANDARD status of the function group SALV should be used as

    a template for a user-specific status.

    As this is a frequently-used Callback event, its form routine

    can also be passed directly in the interface in the IMPORTING

    parameter I_CALLBACK_PF_STATUS_SET.

    ITEM_DATA_EXPAND USING RS_SELFIELD TYPE SLIS_SELFIELD

    RFLG_ALL TYPE C

    Only relevant for hierarchical-sequential lists using the layout

    parameter IS_LAYOUT-EXPAND_FIELDNAME of the structure IS_LAYOUT.

    Exit for passing item entries (ITEM table) for a header record

    which was expanded interactively by the user.

    RS_SELFIELD-TABINDEX contains the header table index for which

    the item entries are to be put in the global item output table

    (T_OUTTAB_SLAVE). The Callback is only called if ALV has no

    items for a header which is to be expanded.

    RFLG_ALL is passed with 'X' if the user shows all items. The

    application must ensure that entries are not repeated in the

    item table.

    RS_SELFIELD is initial in this case.

    CALLER_EXIT USING RS_DATA

    Is called at the beginning of the function module to make

    special settings. It is not usually used.

    List processing events

    IMPORTANT: The application Callback routine must not manipul

    the internal output table and/or its header record. This

    restriction applies to all Callbacks which are called in the

    list output and run under the 'List processing events'.

    TOP_OF_PAGE no USING parameter

    Equivalent to the list processing TOP-OF-PAGE event

    reward points if useful,

    seshu.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 04:54 AM

    Hi Check this program i have used top of page in the program for heading. please reward points if useful.

    Try copy this progam in ur system and execute . .

    • GLOBAL DATA

    TABLES: EKKO.

    TYPE-POOLS:SLIS.

    • LOCAL DATA

    DATA: ITAB TYPE TABLE OF EKKO,

    WA TYPE EKKO.

    • FOR CREATING ALV CREATE A FIELD CATALOG

    DATA: LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

    WA_CAT TYPE SLIS_FIELDCAT_ALV.

    DATA: EVENTS TYPE SLIS_T_EVENT,

    MY_FNAME TYPE slis_formname VALUE 'TOP_OF_PAGE',

    lt_header TYPE slis_t_listheader, "HEADER TABLE,

    wa_header TYPE slis_listheader, "WORK AREA FOR HEADER,

    WA_EVT TYPE SLIS_ALV_EVENT.

    START-OF-SELECTION.

    SELECT BUKRS

    BSTYP

    BSART

    BSAKZ

    FROM EKKO INTO CORRESPONDING FIELDS OF TABLE ITAB UP TO 30 ROWS.

    PERFORM EVENTS.

    perform POP_EVENTS.

    PERFORM BUILD_FIELD_CATLOG.

    PERFORM LIST_CREATION.

    &----


    *& Form BUILD_FIELD_CATLOG

    &----


    FORM BUILD_FIELD_CATLOG .

    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

    EXPORTING

    I_PROGRAM_NAME = SY-REPID

    I_INTERNAL_TABNAME = 'ITAB'

    I_STRUCTURE_NAME = 'EKKO'

    • I_CLIENT_NEVER_DISPLAY = 'X'

    • I_INCLNAME =

    • I_BYPASSING_BUFFER =

    • I_BUFFER_ACTIVE =

    CHANGING

    CT_FIELDCAT = LT_FIELDCAT.

    • EXCEPTIONS

    • INCONSISTENT_INTERFACE = 1

    • PROGRAM_ERROR = 2

    • OTHERS = 3

    .

    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. " BUILD_FIELD_CATLOG

    &----


    *& Form LIST_CREATION

    &----


    FORM LIST_CREATION .

    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 = LT_FIELDCAT[]

    • IT_EXCLUDING =

    • IT_SPECIAL_GROUPS =

    • IT_SORT =

    • IT_FILTER =

    • IS_SEL_HIDE =

    • I_DEFAULT = 'X'

    • I_SAVE = ' '

    • IS_VARIANT =

    IT_EVENTS = 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

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

    TABLES

    T_OUTTAB = ITAB[].

    • 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. " LIST_CREATION

    FORM EVENTS .

    *

    • WA_EVT-NAME = 'TOP_OF_PAGE'.

    • WA_EVT-FORM = 'HEADER'.

    • APPEND WA_EVT to events.

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    EXPORTING

    I_LIST_TYPE = 0

    IMPORTING

    ET_EVENTS = EVENTS

    EXCEPTIONS

    LIST_TYPE_WRONG = 1

    OTHERS = 2.

    ENDFORM. " EVENTS

    &----


    *& Form POP_EVENTS

    &----


    • text

    ----


    FORM POP_EVENTS.

    DATA COUNT LIKE SY-TABIX.

    READ TABLE EVENTS WITH KEY = slis_ev_top_of_page INTO WA_EVT.

    IF sy-subrc = 0.

    MOVE MY_FNAME TO WA_EVT-FORM.

    MODIFY EVENTS FROM WA_EVT INDEX sy-tabix.

    CLEAR WA_EVT.

    ENDIF.

    READ TABLE EVENTS WITH KEY = slis_ev_end_of_list INTO WA_EVT.

    IF sy-subrc = 0.

    WA_EVT-FORM = 'ENDLIST'.

    MODIFY EVENTS FROM WA_EVT INDEX sy-tabix.

    CLEAR WA_EVT.

    ENDIF.

    ENDFORM. "POP_EVENTS

    FORM top_of_page.

    REFRESH lt_header.

    wa_header-typ = 'H'.

    wa_header-info = 'This is your ALV LIST HEADER'.

    APPEND wa_header TO lt_header.

    *CALLING FUNCTION MODULE FOR WRITING THE HEADING

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = lt_header. "INTERNAL TAB FOR HEADER

    ENDFORM. "TOP_OF_PAGE

    FORM ENDLIST.

    REFRESH lt_header.

    wa_header-typ = 'H'.

    wa_header-info = 'AGARWAL'.

    APPEND wa_header TO lt_header.

    *CALLING FUNCTION MODULE FOR WRITING THE HEADING

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = lt_header. "INTERNAL TAB FOR HEADER

    ENDFORM. "TOP_OF_PAGE

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 04:58 AM

    Hi Chandru,

    just use logic as shown below.

    wa_line-typ = 'H'.

    wa_line-info = 'Duplicates Ignored by Requestor Report'.

    APPEND wa_line TO tb_list_header.

    CLEAR wa_line.

    wa_line-typ = 'S'.

    WRITE p_frmdat TO g_date1 DD/MM/YY.

    WRITE p_to_dat TO g_date2 DD/MM/YY.

    CONCATENATE 'From Date : ' g_date1 ' To Date : ' g_date2

    INTO g_date3 SEPARATED BY space .

    wa_line-info = g_date3.

    APPEND wa_line TO tb_list_header.

    CLEAR wa_line.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    it_list_commentary = tb_list_header.

    • i_logo =

    • I_END_OF_LIST_GRID =

    regards,

    DVNS.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 04:58 AM

    In Reuse_ALV_list_display function module

    1. Pass value for this parameter

    IT_EVENTS TYPE SLIS_T_EVENT OPTIONAL

    2. before passing value to IT_EVENTS parameter

    first get possible events for this ALV type Ex: Blocked ALV,

    or hierarchical ALV. For that use Function module:

    REUSE_ALV_EVENTS_GET

    3. Use REUSE_ALV_COMMENTARY_WRITE to trigger

    top-of-page or end-of page.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 05:04 AM

    hi Chandra,

    Try using this code snippet.

    and change it wih respect to ur requirement.

    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 = 'EKKO 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.

    • Total No. of Records Selected

    describe table it_ekko lines ld_lines.

    ld_linesc = ld_lines.

    concatenate 'Total No. of Records Selected: ' ld_linesc

    into t_line separated by space.

    wa_header-typ = 'A'.

    wa_header-info = t_line.

    append wa_header to t_header.

    clear: wa_header, t_line.

    call function 'REUSE_ALV_COMMENTARY_WRITE'

    exporting

    it_list_commentary = t_header.

    • i_logo = 'Z_LOGO'.

    endform.

    Reawrd points if useful

    Chandra

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 22, 2008 at 07:26 AM

    Dear Chandrashekar,

    Take this simple example..it covers your question.Dont forget to change program name to your program name,else top of page event will not be hit..

    do reward points it helps

    &----


    *& Report ZTESTER

    *&

    &----


    *&

    *&

    &----


    REPORT ZTESTER.

    &----


    *& Report ZSOD2

    *& This is a report of Sales Document with ALV Display.

    *& Also No of records selected along with Date and Time is displayed.

    *& Code for display of LOGO and sorting of a particular field also.

    &----


    *&Created by Rahul Bhat on 31-07-2007.

    *&

    &----


    *REPORT ZSOD2.

    --


    FOR ALV REPORT--

    TYPE-POOLS : SLIS .

    ----


    --


    CONSTANTS FOR PROCESSING--

    • c_x VALUE 'X' .

    ----


    .

    --


    TABLES DECLARATION--

    TABLES : VBAK,VBAP.

    ----


    --


    ALV data declarations--

    DATA : fieldcat TYPE slis_fieldcat_alv OCCURS 0 WITH HEADER LINE.

    --


    FOR SORTING TO DISPLAY VBELN FIELD (SALES ORDER)ONLY ONCE----

    DATA: IT_sortcat type slis_sortinfo_alv occurs 1,

    wa_sort like line of IT_sortcat.

    --


    END OF ALV DECLARATIONS--

    DATA : COL_POS TYPE I .

    *DATA : v_cntr TYPE i VALUE IS INITIAL ,

    • v_pcnt TYPE i VALUE 1 ,

    • v_totl TYPE p DECIMALS 6 VALUE IS INITIAL,

    • a LIKE sy-ucomm .

    *

    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    SELECT-OPTIONS :VBELN FOR VBAK-VBELN ,

    S_ERDAT FOR VBAK-ERDAT ,

    S_SPART FOR VBAK-SPART .

    SELECTION-SCREEN END OF BLOCK B1 .

    DATA :BEGIN OF IVBAK OCCURS 0 ,

    VBELN LIKE VBAK-VBELN ,

    ERDAT LIKE VBAK-ERDAT ,

    ERNAM TYPE VBAK-ERNAM ,

    ERZET TYPE VBAK-ERZET ,

    SPART TYPE VBAK-SPART ,

    TRVOG TYPE VBAK-TRVOG ,

    END OF IVBAK .

    DATA :BEGIN OF IVBAP OCCURS 0 ,

    VBELN LIKE VBAP-VBELN ,

    ERDAT LIKE VBAP-ERDAT ,

    POSNR LIKE VBAP-POSNR ,

    MATNR LIKE VBAP-MATNR ,

    MATWA LIKE VBAP-MATWA ,

    CHARG LIKE VBAP-CHARG ,

    KWMENG LIKE VBAP-KWMENG ,

    NETWR LIKE VBAP-NETWR ,

    END OF IVBAP .

    *----


    &----There is no need to define structures of 2 tables as above.Instead we can use INNER JOIN.This coding has been done in ZTRIALS&----

    *&--


    All the SELECT statments will be commented in that case_--


    *----


    START-OF-SELECTION .

    ----


    *From here we can use inner join and comment the below SELECT statments.

    *The inner join statment will be as follows.

    • SELECT VKVBTYP VPVBELN VPPOSNR VPMATNR VPMATWA VPCHARG VPKWMENG VPNETWR ""vp-initial for VBAP

    • INTO CORRESPONDING FIELDS OF TABLE ITAB FROM VBAP AS VP ""vk-initial for VBAK

    • INNER JOIN VBAK AS VK ON VKVBELN = VPVBELN

    • WHERE VK~VBELN IN VBELN.

    ----


    .

    ----


    SELECT * FROM VBAK INTO CORRESPONDING FIELDS OF TABLE IVBAK WHERE VBELN IN VBELN AND ERDAT IN S_ERDAT.

    IF SY-SUBRC <> 0 . """"Always use a SY_SUBRC check after select statment.

    MESSAGE i000(zmm) . """"Message for DATA NOT FOUND.

    ELSE .

    SELECT VBELN ERDAT POSNR MATNR MATWA CHARG KWMENG NETWR INTO CORRESPONDING FIELDS OF

    TABLE IVBAP FROM VBAP FOR ALL ENTRIES IN IVBAK

    WHERE VBELN EQ IVBAK-VBELN AND

    SPART IN S_SPART .

    ENDIF .

    ----


    *CALL FUNCTION 'POPUP_TO_DECIDE_INFO'

    • EXPORTING

    • DEFAULTOPTION = 'Y'

    • TEXTLINE1 = 'ARE YOU SURE?'

    • TEXTLINE2 = 'GO BACK '

    • TITEL = 'POPUP'

    • START_COLUMN = 25

    • START_ROW = 6

    • IMPORTING

    • ANSWER =

  • .

  • &--


    For Displaying the required fields--
    &

    ADD 1 TO COL_POS . """"If we add 1 more column of VBTYP it will result in a dump as we are passing IVBAP.

    FIELDCAT-COL_POS = COL_POS . """"So to avoid this we can use INNER JOIN statment.

    FIELDCAT-FIELDNAME = 'VBELN' .

    FIELDCAT-TABNAME = 'FIELDCAT' .

    FIELDCAT-SELTEXT_L = 'SALES ORDER' .

    FIELDCAT-FIX_COLUMN = 'X' .

    FIELDCAT-OUTPUTLEN = 15 .

    FIELDCAT-DO_SUM = 'X' .

    APPEND FIELDCAT .

    CLEAR FIELDCAT .

    ADD 1 TO COL_POS .

    FIELDCAT-COL_POS = COL_POS .

    FIELDCAT-FIELDNAME = 'MATNR' .

    FIELDCAT-TABNAME = 'FIELDCAT' .

    FIELDCAT-SELTEXT_L = 'MATERIAL NO.' .

    FIELDCAT-FIX_COLUMN = 'X' .

    FIELDCAT-OUTPUTLEN = 16 .

    FIELDCAT-KEY(1) = 'MATNR' .

    APPEND FIELDCAT .

    CLEAR FIELDCAT .

    ADD 1 TO COL_POS .

    FIELDCAT-COL_POS = COL_POS .

    FIELDCAT-FIELDNAME = 'ERDAT' .

    FIELDCAT-TABNAME = 'FIELDCAT' .

    FIELDCAT-SELTEXT_L = 'RECORD DATE' .

    FIELDCAT-FIX_COLUMN = 'X' .

    FIELDCAT-OUTPUTLEN = 16 .

    APPEND FIELDCAT .

    CLEAR FIELDCAT .

    ADD 1 TO COL_POS .

    FIELDCAT-COL_POS = COL_POS .

    FIELDCAT-FIELDNAME = 'POSNR' .

    FIELDCAT-TABNAME = 'FIELDCAT' .

    FIELDCAT-SELTEXT_L = 'ITEM' .

    FIELDCAT-FIX_COLUMN = 'X' .

    FIELDCAT-OUTPUTLEN = 5 .

    APPEND FIELDCAT .

    CLEAR FIELDCAT .

    ADD 1 TO COL_POS .

    FIELDCAT-COL_POS = COL_POS .

    FIELDCAT-FIELDNAME = 'MATWA' .

    FIELDCAT-TABNAME = 'FIELDCAT' .

    FIELDCAT-SELTEXT_L = 'MATERIAL ENT' .

    FIELDCAT-FIX_COLUMN = 'X' .

    FIELDCAT-OUTPUTLEN = 15 .

    APPEND FIELDCAT .

    CLEAR FIELDCAT .

    ADD 1 TO COL_POS .

    FIELDCAT-COL_POS = COL_POS .

    FIELDCAT-FIELDNAME = 'CHARG' .

    FIELDCAT-TABNAME = 'FIELDCAT' .

    FIELDCAT-SELTEXT_L = 'BATCH.NO' .

    FIELDCAT-FIX_COLUMN = 'X' .

    FIELDCAT-OUTPUTLEN = 10 .

    APPEND FIELDCAT .

    CLEAR FIELDCAT .

    ADD 1 TO COL_POS .

    • LOOP AT IVBAP.

    • AT END OF VBELN.

    FIELDCAT-COL_POS = COL_POS .

    FIELDCAT-FIELDNAME = 'KWMENG' .

    FIELDCAT-TABNAME = 'FIELDCAT' .

    FIELDCAT-SELTEXT_L = 'CUMULATIVE ORDER QUANTITY IN SALES UNITS'.

    FIELDCAT-FIX_COLUMN = 'X' .

    FIELDCAT-OUTPUTLEN = 42 .

    • FIELDCAT-SUBTOT = 'X' .

    FIELDCAT-DO_SUM = 'X' . """"FOR CALCULATING THE SUM DIRECTLY

    APPEND FIELDCAT .

    CLEAR FIELDCAT .

    • ENDAT.

    • ENDLOOP.

    ADD 1 TO COL_POS .

    FIELDCAT-COL_POS = COL_POS .

    FIELDCAT-FIELDNAME = 'NETWR' .

    FIELDCAT-TABNAME = 'FIELDCAT' .

    FIELDCAT-SELTEXT_L = 'NET VALUE IN DOCUMENT CURRENCY' . """"OF THE ORDER ITEM IN DOCUMENT CURRENCY.

    FIELDCAT-FIX_COLUMN = 'X' .

    FIELDCAT-OUTPUTLEN = 35 .

    FIELDCAT-DO_SUM = 'X' . """"FOR CALCULATING THE SUM DIRECTLY

    APPEND FIELDCAT .

    CLEAR FIELDCAT .

    &--


    End of Display--
    &

    &--


    Perform for showing the Progress Bar--
    &

    *PERFORM SHOW_PROGRESS.

    &----


    &

    &--


    PERFORM FOR SORTING SALES ORDER--
    &

    --


    For Sorting required Fields in the Display--

    PERFORM BUILD_SORTCAT.

    &----


    &

    &--


    FUNCTION CALL FOR ALV DISPLAY--
    &

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    • I_INTERFACE_CHECK = ' '

    • I_BYPASSING_BUFFER = ' '

    • I_BUFFER_ACTIVE = ' '

    I_CALLBACK_PROGRAM = 'ZSOD2'

    • I_CALLBACK_PF_STATUS_SET = ' '

    • I_CALLBACK_USER_COMMAND = ' '

    I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'

    • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

    • I_CALLBACK_HTML_END_OF_LIST = ' '

    • I_STRUCTURE_NAME =

    • I_BACKGROUND_ID = ' '

    I_GRID_TITLE = 'AVAILABLE DATA FOR SELECTED SALES DOCUMENT'

    • I_GRID_SETTINGS =

    • IS_LAYOUT =

    IT_FIELDCAT = FIELDCAT[]

    • IT_EXCLUDING =

    • IT_SPECIAL_GROUPS =

    IT_SORT = IT_SORTCAT "INTERNAL TABLE PASSED FOR SORTING

    • IT_FILTER =

    • IS_SEL_HIDE =

    • I_DEFAULT = 'X'

    • I_SAVE = 'X'

    • 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

    • I_HTML_HEIGHT_TOP = 0

    • I_HTML_HEIGHT_END = 0

    • IT_ALV_GRAPHICS =

    • IT_HYPERLINK =

    • IT_ADD_FIELDCAT =

    • IT_EXCEPT_QINFO =

    • IR_SALV_FULLSCREEN_ADAPTER =

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

    TABLES

    T_OUTTAB = IVBAP[]

    • 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 .

    --


    END OF FUNCTION CALL--

    --


    FORM TOP-OF-PAGE--

    --


    TO DISPLAY THE REQUIRED HEADING AT TOP OF PAGE--

    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 = 'Sales Document' .

    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 .

    • TOTAL NO.OF RECORDS SELECTED :

    DESCRIBE TABLE IVBAP LINES LD_LINES .

    LD_LINESC = LD_LINES .

    CONCATENATE 'Total Number of Records Selected: ' LD_LINESC

    INTO T_LINE SEPARATED BY SPACE .

    WA_HEADER-TYP = 'A' .

    WA_HEADER-INFO = t_line .

    APPEND WA_HEADER to T_HEADER .

    clear: WA_HEADER, T_LINE .

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE' """"TO DISPLAY STATMENTS WRITTEN ABOVE.

    EXPORTING

    IT_LIST_COMMENTARY = T_HEADER

    I_LOGO = 'SAP LOGO' .""""SAP LOGO ON SCREEN.

    ENDFORM .

    --


    ENDFORM--
    .

    &--


    Form BUILD_SORTCAT--

    &----


    &--


    Build Sort catalog--

    --


    FORM FOR SORTING SALES ORDER FIELD--

    FORM BUILD_SORTCAT .

    WA_SORT-SPOS = 1.

    WA_SORT-FIELDNAME = 'VBELN' . """"FIELD NAME FOR WHICH ALL ITS CORRESPONDING RECORDS SHOULD BE DISPLAYED

    • wa_sort-SUBTOT = 'X' . """"subtotals any totals column by this field

    • gd_sortcat-tabname

    APPEND WA_SORT TO IT_SORTCAT .

    • wa_sort-spos = 2 .

    • wa_sort-fieldname = 'EBELP' .

    • gd_sortcat-tabname

  • APPEND wa_sort TO it_sortcat .

  • ENDFORM .

    --


    ENDFORM--

    • &------------------------------------------------------------------

    **& Form show_progress (PROGRESS BAR)

    *&----


    • text

    *----


    • --> p1 text

    • <-- p2 text

    *----


    *FORM show_progress .

    • (a) Testing

  • DATA: c(3) TYPE c VALUE IS INITIAL.

  • *

    • v_pcnt = v_cntr * v_totl.

    • c = v_pcnt.

    • CONCATENATE 'Processing.... ' c '%' INTO a.

    *

    • CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

    • EXPORTING

    • percentage = v_pcnt

    • text = a.

    *

    • v_cntr = v_cntr + 1.

    *ENDFORM. " show_progress.

    • .

    *--


    ENDFORM--

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.