‎2008 Feb 28 4:28 AM
hi all,
can any one help me out how to use reuse_alv_block_list_append function module, what parameters shall i pass to it, so that i get top of page and end of page events and report data in two blocks, can any one tell how can i didvide the data into block, at a particular line
‎2008 Feb 28 4:33 AM
Hi,
following ALV report is the sample report for that function module.
Kindly go through it .
REPORT YMS_BLOCKALV.
TYPE-POOLS : SLIS.
TABLES : MARA,MAKT.
SELECT-OPTIONS : MAT FOR MARA-MATNR.
DATA : BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR,
MAKTX LIKE MAKT-MAKTX,
MATKL LIKE MARA-MATKL,
MTART LIKE MARA-MTART,
END OF ITAB.
DATA : BEGIN OF ITAB1 OCCURS 0,
MTART LIKE MARA-MTART,
COUNT TYPE I,
END OF ITAB1.
DATA : BEGIN OF ITAB1_COL OCCURS 0,
MTART LIKE MARA-MTART,
COUNT TYPE I,
END OF ITAB1_COL.
DATA : T_FCAT1 TYPE SLIS_T_FIELDCAT_ALV,
T_FCAT2 TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT TYPE SLIS_FIELDCAT_ALV,
T_EVE TYPE SLIS_T_EVENT,
WA_EVE TYPE SLIS_ALV_EVENT,
T_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA : V_REPID LIKE SY-REPID,
T_MAT LIKE MARA-MATNR.
DEFINE CREATE_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = &1.
WA_FCAT-SELTEXT_L = &2.
WA_FCAT-OUTPUTLEN = &3.
APPEND WA_FCAT TO T_FCAT1.
END-OF-DEFINITION.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM DIS_DATA.
&----
*& Form get_data
&----
text
----
FORM GET_DATA.
SELECT AMATNR BMAKTX AMTART AMATKL INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM MARA AS A INNER JOIN MAKT AS B ON
AMATNR = BMATNR
WHERE A~MATNR IN MAT.
LOOP AT ITAB.
ITAB1-MTART = ITAB-MTART.
ITAB1-COUNT = 1.
APPEND ITAB1.
ENDLOOP.
SORT ITAB1 BY MTART.
LOOP AT ITAB1.
MOVE-CORRESPONDING ITAB1 TO ITAB1_COL.
COLLECT ITAB1_COL.
ENDLOOP.
ENDFORM. "get_data
&----
*& Form dis_data
&----
text
----
FORM DIS_DATA.
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID.
REFRESH T_FCAT1.
CLEAR T_FCAT1.
REFRESH T_EVE.
WA_EVE-NAME = 'TOP_OF_PAGE'.
WA_EVE-FORM = 'TOP_OF_PAGE1'.
APPEND WA_EVE TO T_EVE.
CREATE_FCAT:
'MATNR' 'Material' '10',
'MAKTX' 'Material Description' '40',
'MTART' 'Type' '10',
'MATKL' 'Group' '10'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = T_LAYOUT
IT_FIELDCAT = T_FCAT1
I_TABNAME = 'ITAB'
IT_EVENTS = T_EVE
TABLES
T_OUTTAB = ITAB.
REFRESH T_FCAT1.
CLEAR T_FCAT1.
REFRESH T_EVE.
WA_EVE-NAME = 'TOP_OF_PAGE'.
WA_EVE-FORM = 'TOP_OF_PAGE2'.
APPEND WA_EVE TO T_EVE.
CREATE_FCAT:
'MTART' 'Type' '10',
'COUNT' 'Total' '5'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = T_LAYOUT
IT_FIELDCAT = T_FCAT1
I_TABNAME = 'ITAB1_COL'
IT_EVENTS = T_EVE
TABLES
T_OUTTAB = ITAB1_COL.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
ENDFORM. "dis_data
&----
*& Form top_of_page1
&----
text
----
FORM TOP_OF_PAGE1.
FORMAT COLOR COL_POSITIVE.
WRITE:/ 'First Block'.
FORMAT COLOR OFF.
ENDFORM. "top_of_page
&----
*& Form top_of_page2
&----
text
----
FORM TOP_OF_PAGE2.
FORMAT COLOR COL_NEGATIVE.
WRITE /5 'Second Block'.
FORMAT COLOR OFF.
ENDFORM. "top_of_page
Thanks,
Sankar M
‎2008 Feb 28 4:34 AM
Hi,
go for block list display(with block list display only lists in same screen is possible.if u want grids in same screen u have to go for OOALV).
TABLES:LFA1,EKKO.
SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR.
DATA:BEGIN OF ITAB OCCURS 0,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
LAND1 LIKE LFA1-LAND1,
ORT01 LIKE LFA1-ORT01,
REGIO LIKE LFA1-REGIO,
END OF ITAB.
DATA:BEGIN OF JTAB OCCURS 0,
LIFNR LIKE EKKO-LIFNR,
EBELN LIKE EKKO-EBELN,
BUKRS LIKE EKKO-BUKRS,
BSTYP LIKE EKKO-BSTYP,
EKORG LIKE EKKO-EKORG,
BSART LIKE EKKO-BSART,
END OF JTAB.
SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE LIFNR
IN LIFNR.
SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE JTAB WHERE LIFNR
IN LIFNR.
TYPE-POOLS:SLIS.
DATA:LAYOUT TYPE slis_layout_alv.
DATA:EVE TYPE slis_t_event WITH HEADER LINE.
DATA:EVE1 TYPE slis_t_event WITH HEADER LINE.
DATA:HEAD TYPE slis_t_listheader WITH HEADER LINE.
DATA:FCAT TYPE slis_t_fieldcat_alv.
DATA:FCAT1 TYPE slis_t_fieldcat_alv.
LAYOUT-ZEBRA = 'X'.
LAYOUT-colwidth_optimize = 'X'.
LAYOUT-WINDOW_TITLEBAR = 'VENDOR DETAILS SCREEN'.
EVE1-NAME = 'TOP_OF_PAGE'.
EVE1-FORM = 'TOP_OF_PAGE1'.
APPEND EVE1.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = EVE[]
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE EVE WITH KEY NAME = 'TOP_OF_PAGE'.
EVE-FORM = 'TOP_OF_PAGE'.
MODIFY EVE TRANSPORTING FORM WHERE NAME = 'TOP_OF_PAGE'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* IT_EXCLUDING =
.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'ITAB'
* I_STRUCTURE_NAME =
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = FCAT
* 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.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FCAT
I_TABNAME = 'ITAB'
IT_EVENTS = EVE[]
* IT_SORT =
* I_TEXT = ' '
TABLES
T_OUTTAB = ITAB
* EXCEPTIONS
* PROGRAM_ERROR = 1
* MAXIMUM_OF_APPENDS_REACHED = 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.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'JTAB'
* I_STRUCTURE_NAME =
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = FCAT1
* 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.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FCAT1
I_TABNAME = 'JTAB'
IT_EVENTS = EVE1[]
* IT_SORT =
* I_TEXT = ' '
TABLES
T_OUTTAB = JTAB
* EXCEPTIONS
* PROGRAM_ERROR = 1
* MAXIMUM_OF_APPENDS_REACHED = 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.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
* EXPORTING
* I_INTERFACE_CHECK = ' '
* IS_PRINT =
* 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 =
* 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.
FORM TOP_OF_PAGE.
REFRESH HEAD.
HEAD-TYP = 'H'.
HEAD-INFO = 'VENDORS DETAILS'.
APPEND HEAD.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEAD[]
* I_LOGO =
* I_END_OF_LIST_GRID =
.
ENDFORM.
FORM TOP_OF_PAGE1.
REFRESH HEAD.
HEAD-TYP = 'H'.
HEAD-INFO = 'PURCHASE DOCCUMENTS DETAILS'.
APPEND HEAD.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEAD[]
* I_LOGO =
* I_END_OF_LIST_GRID =
.
ENDFORM.
Also look this sample reports:
Thanks & Regards,
Dhruv Shah
‎2008 Feb 28 4:39 AM
hi,
this is my simple alv blockedlist programme.go through it.it will definrtley help u.
REPORT z50870alv_blocked.
TYPE-POOLS : slis.
&----
*& structure declaration
&----
TYPES : BEGIN OF st_ekko,
ebeln TYPE ekko-ebeln, "Purchasing Document Number
bstyp TYPE ekko-bstyp, "Purchasing Document Category
bsart TYPE ekko-bsart, "Purchasing Document Type
aedat TYPE ekko-aedat, "record created on
ernam TYPE ekko-ernam, "Person who Created the Object
END OF st_ekko.
TYPES : BEGIN OF st_ekpo,
ebeln TYPE ekko-ebeln,
ebelp TYPE ekpo-ebelp, "Item Number of Purchasing Document
ematn TYPE ekpo-ematn, "Material number
matkl TYPE ekpo-matkl, "Material group
netpr TYPE ekpo-netpr, "Net price in purchasing document
END OF st_ekpo.
&----
*& internal table and work area declaration
&----
DATA : it_ekpo TYPE STANDARD TABLE OF st_ekpo,
it_ekko TYPE STANDARD TABLE OF st_ekko,
it_fieldcat1 TYPE slis_t_fieldcat_alv,
wa_fieldcat1 TYPE slis_fieldcat_alv,
it_fieldcat2 TYPE slis_t_fieldcat_alv,
wa_fieldcat2 TYPE slis_fieldcat_alv,
it_events Type slis_t_event,
wa_layout TYPE slis_layout_alv.
&----
*& data declaration
&----
DATA : v_ebeln TYPE ekko-ebeln.
&----
*& selection-screen
&----
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-000.
SELECT-OPTIONS : so_ebeln FOR v_ebeln.
SELECTION-SCREEN END OF BLOCK a.
&----
*& At-selection-screen
&----
at selection-screen on so_ebeln.
perform validate_ebeln.
&----
*& start-of-selection
&----
START-OF-SELECTION.
PERFORM data_retrieval.
&----
*& end-of-selection
&----
END-OF-SELECTION.
PERFORM initialize_alv_block.
PERFORM build_fieldcatalog1.
PERFORM build_fieldcatalog2.
PERFORM build_layout.
PERFORM get_events .
PERFORM append_ekkodata_to_alv_block.
PERFORM append_ekpodata_to_alv_block.
PERFORM display_blocked_alv.
&----
*& FORM initialize_alv_block
&----
FORM initialize_alv_block.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid.
endform.
&----
*& FORM validate_ebeln
&----
form validate_ebeln.
select ebeln
from ekko
into table it_ekko
where ebeln in so_ebeln.
if sy-subrc ne 0.
message text-003 type 'W'.
endif.
endform.
&----
*& FORM data_retrieval
&----
FORM data_retrieval.
SELECT ebeln bstyp bsart aedat ernam
FROM ekko
INTO TABLE it_ekko
WHERE ebeln IN so_ebeln.
if sy-subrc ne 0.
message text-001 type 'I'.
endif.
SELECT ebeln ebelp ematn matkl netpr
FROM ekpo
INTO TABLE it_ekpo
WHERE ebeln IN so_ebeln.
if sy-subrc ne 0.
message text-002 type 'I'.
endif.
endform.
&----
*& Form build_fieldcatalog1
&----
FORM build_fieldcatalog1.
wa_fieldcat1-fieldname = 'EBELN'.
wa_fieldcat1-seltext_l = 'PURCHASE ORDER'.
wa_fieldcat1-col_pos = 0.
APPEND wa_fieldcat1 TO it_fieldcat1.
wa_fieldcat1-fieldname = 'BSTYP'.
wa_fieldcat1-seltext_l = 'DOCUMENT CATEGORY'.
wa_fieldcat1-col_pos = 1.
APPEND wa_fieldcat1 TO it_fieldcat1.
wa_fieldcat1-fieldname = 'BSART'.
wa_fieldcat1-seltext_l = 'DOCUMENT TYPE'.
wa_fieldcat1-col_pos = 2.
APPEND wa_fieldcat1 TO it_fieldcat1.
wa_fieldcat1-fieldname = 'AEDAT'.
wa_fieldcat1-seltext_l = 'DATE'.
wa_fieldcat1-col_pos = 3.
APPEND wa_fieldcat1 TO it_fieldcat1.
wa_fieldcat1-fieldname = 'ERNAM'.
wa_fieldcat1-seltext_l = 'NAME'.
wa_fieldcat1-col_pos = 4.
APPEND wa_fieldcat1 TO it_fieldcat1.
ENDFORM. "build_fieldcatalog
&----
*& Form build_fieldcatalog2
&----
FORM build_fieldcatalog2.
wa_fieldcat2-fieldname = 'EBELN'.
wa_fieldcat2-seltext_l = 'PURCHASE ORDER'.
wa_fieldcat2-col_pos = 0.
APPEND wa_fieldcat2 TO it_fieldcat2.
wa_fieldcat2-fieldname = 'EBELP'.
wa_fieldcat2-seltext_l = 'ITEM NUMBER'.
wa_fieldcat2-col_pos = 1.
APPEND wa_fieldcat2 TO it_fieldcat2.
wa_fieldcat2-fieldname = 'EMATN'.
wa_fieldcat2-seltext_l = 'MATERIAL TYPE'.
wa_fieldcat2-col_pos = 2.
APPEND wa_fieldcat2 TO it_fieldcat2.
wa_fieldcat2-fieldname = 'MATKL'.
wa_fieldcat2-seltext_l = 'MATERIAL GROUP'.
wa_fieldcat2-col_pos = 3.
APPEND wa_fieldcat2 TO it_fieldcat2.
wa_fieldcat2-fieldname = 'NETPR'.
wa_fieldcat2-seltext_l = 'NET PRICE'.
wa_fieldcat2-col_pos = 4.
wa_fieldcat2-do_sum = 'X'.
APPEND wa_fieldcat2 TO it_fieldcat2.
ENDFORM. "build_fieldcatalog
&----
*& form build_layout.
&----
FORM build_layout.
wa_layout-zebra ='X'.
wa_layout-no_vline = 'X'.
wa_layout-no_hline = 'X'.
wa_layout-colwidth_optimize = 'X'.
wa_layout-window_titlebar = 'PURCHASE ORDER HEADER AND ITEM DETAILS'.
ENDFORM. "build_layout
&----
*& form append_ekkodata_to_alv_block
&----
FORM append_ekkodata_to_alv_block.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout
it_fieldcat = it_fieldcat1
i_tabname ='it_ekko'
it_events = it_events[]
IT_SORT = IT_SORT
I_TEXT = ' '
TABLES
t_outtab = it_ekko
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 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.
&----
*& form append_ekpodata_to_alv_block
&----
FORM append_ekpodata_to_alv_block.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = wa_layout
it_fieldcat = it_fieldcat2
i_tabname ='it_ekpo'
it_events = it_events[]
IT_SORT = IT_SORT
I_TEXT = ' '
TABLES
t_outtab = it_ekpo
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 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.
&----
*& FORM display_blocked_alv.
&----
FORM display_blocked_alv.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
endform.
&----
*& Form GET_EVENTS
&----
FORM get_events .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 2
IMPORTING
et_events = it_events[]
EXCEPTIONS
list_type_wrong = 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. " GET_EVENTS\
regards,
pavan t.
‎2008 Feb 28 4:39 AM
Hi,
U can use the 'REUSE_ALV_BLOCK_LIST_DISPLAY' for displaying more than one ALV block in a page.
For 'REUSE_ALV_BLOCK_LIST_APPEND', u need to pass FIELDCATALOG, and the INTERNAL TABLE name as mandatory.
Here is the sample program using this....
report zalv_block.
type-pools: slis.
types: begin of g_ty_s_test,
layo_no_vert_lines type char1,
end of g_ty_s_test.
data: int_tab type table of zprod,
fs type zprod,
int_tab1 type table of zprod,
fs1 type zprod.
data : alvfc type slis_t_fieldcat_alv,
alvwc type slis_fieldcat_alv.
data : alvly type slis_layout_alv.
data : alvev type slis_t_event.
data: gs_test type g_ty_s_test.
select * from zprod into table int_tab.
select * from zprod into table int_tab1 up to 5 rows.
gs_test-layo_no_vert_lines = 'X'.
alvly-no_vline = gs_test-layo_no_vert_lines.
call function 'REUSE_ALV_BLOCK_LIST_INIT'
exporting
i_callback_program = sy-repid.
clear alvwc.
alvwc-fieldname = 'PNO'.
append alvwc to alvfc.
clear alvwc.
alvwc-fieldname = 'PNAME'.
append alvwc to alvfc.
clear alvwc.
alvwc-fieldname = 'QTY'.
append alvwc to alvfc.
clear alvwc.
alvwc-fieldname = 'RATE1'.
append alvwc to alvfc.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
is_layout = alvly
it_fieldcat = alvfc
i_tabname = 'INT_TAB'
it_events = alvev
tables
t_outtab = int_tab
exceptions
program_error = 1
maximum_of_appends_reached = 2
others = 3.
clear alvfc.
clear alvfc[].
clear alvwc.
alvwc-fieldname = 'PNO'.
append alvwc to alvfc.
clear alvwc.
alvwc-fieldname = 'PNAME'.
append alvwc to alvfc.
clear alvwc.
alvwc-fieldname = 'QTY'.
append alvwc to alvfc.
clear alvwc.
alvwc-fieldname = 'RATE1'.
append alvwc to alvfc.
call function 'REUSE_ALV_BLOCK_LIST_APPEND'
exporting
is_layout = alvly
it_fieldcat = alvfc
i_tabname = 'INT_TAB1'
it_events = alvev
tables
t_outtab = int_tab1
exceptions
program_error = 1
maximum_of_appends_reached = 2
others = 3.
DISPLAY
call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'
exceptions
program_error = 1
others = 2.
Hope it helps u..
Reward points if useful
Regards,
Shanthi
‎2008 Feb 28 5:09 AM
What is ALV programming in ABAP? When is this grid used in ABAP?
ALV is Application List viewer.
Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.
In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.
The report output can contain up to 90 columns in the display with the wide array of display options.
The commonly used ALV functions used for this purpose are;
1. REUSE_ALV_VARIANT_DEFAULT_GET
2. REUSE_ALV_VARIANT_F4
3. REUSE_ALV_VARIANT_EXISTENCE
4. REUSE_ALV_EVENTS_GET
5. REUSE_ALV_COMMENTARY_WRITE
6. REUSE_ALV_FIELDCATALOG_MERGE
7. REUSE_ALV_LIST_DISPLAY
8. REUSE_ALV_GRID_DISPLAY
9. REUSE_ALV_POPUP_TO_SELECT
Purpose of the above Functions are differ not all the functions are required in all the ALV Report.
But either no.7 or No.8 is there in the Program.
How you call this function in your report?
After completion of all the data fetching from the database and append this data into an Internal Table. say I_ITAB.
Then use follwing function module.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'Prog.name'
I_STRUCTURE_NAME = 'I_ITAB'
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = I_ITAB.
IF SY-SUBRC 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC .
ENDIF.
ENDFORM. " GET_FINAL_DATA
‎2008 Mar 01 9:01 AM
hi everyone,
When i use the 'REUSE_ALV_BLOCK_LIST_APPEND', FUNCTION MODULE,i could not get trigerred top of page event , so that i could populate heading in it, how should i achieve it
‎2008 Mar 01 9:15 AM
Check the below thread to find answer for ur question
https://www.sdn.sap.com/irj/sdn/forums
Regards,
Chandru
‎2008 Mar 01 2:04 PM
thanxs for ur replies,
but what exactly i mean is that, i have generated alv report in blocks, but i need a hesding to be displayed for each block, above it so that we can know what in formation it contains.when i use events too, i could not get that trigerred, and i cannot understand how to give the heading for the two blocks i generated.can any one tell which parameters have to be used to acheieve it