2012 Mar 08 5:12 AM
Hi ABAP Champs,
I have the requirement of showing Multiple ALV lists each with a Push button in its last column. Please note that I want a ALV List and not ALV Grid.
Also, I do not want to use the Class implementation.Meaning that it has to be based on an fm (like REUSE_ALV_BLOCK_LIST_DISPLAY, or something).
Is this possible in first place? If yes, could you show me how?
Thanks,
Shashi
Edited by: Shashidhar N Garimella on Mar 8, 2012 6:16 AM
Hi ABAP Champs,
I have the requirement of showing Multiple ALV lists each with a Push button in its last column. Please note that I want a ALV List and not ALV Grid.
Also, I do not want to use the Class implementation.Meaning that it has to be based on an fm (like REUSE_ALV_BLOCK_LIST_DISPLAY, or something).
Is this possible in first place? If yes, could you show me how?
Thanks,
Shashi
Edited by: Shashidhar N Garimella on Mar 8, 2012 6:16 AM
2012 Mar 08 11:27 AM
Hi
you can reuse function module REUSE_ALV_LIST_DISPLAY
Regards
prady
2012 Mar 10 5:16 AM
Hi Prady,
I can use 'REUSE_ALV_LIST_DISPLAY' if i want to display just one ALV.
But, my requirement is to display multipe ALVs.And to display multiple ALVs, I should use only 'REUSE_ALV_BLOCK_LIST_DISPLAY'
Is my understanding correct?
Now, only problem is I do not have call back program param in 'REUSE_ALV_BLOCK_LIST_DISPLAY'.So how to display the button.
Thanks & Regards,
Shashi
Edited by: Shashidhar N Garimella on Mar 10, 2012 6:16 AM
2012 Mar 10 5:57 AM
dude First of all Please tell me how u can display ur list using FM 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
Where you are passing internal table(to be displayed in the list) in the function module .
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.
Secondly if u want Pshbutton to be displayed on ALV Grid the u have to use ABAPoops concept.
Using class CL_GUI_ALV_GRID.
here is the code for that:
**internal table declaratios*
DATA I_TAB TYPE TABLE OF MAKT WITH HEADER LINE. " data internal table
DATA IT_FCAT TYPE LVC_T_FCAT. " field catalog internal table
DATA WA_FCAT LIKE LINE OF IT_FCAT . " work area of field catalogue
**container declarations*
DATA GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
**create a screen in SE51 and place a custom control on the screen and
** name it (say container)
start-of-selection.
SELECT * FROM MAKT INTO TABLE I_TAB. "select records in internal table
SET SCREEN 1.
**PBO Module*
MODULE STATUS_0001 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
* SET TITLEBAR 'xxx'.
BREAK-POINT.
IF CONTAINER IS INITIAL.
CREATE OBJECT CONTAINER
EXPORTING
CONTAINER_NAME = 'CONTAINER'.
CREATE OBJECT GRID
EXPORTING
I_PARENT = CONTAINER.
ENDIF.
ENDMODULE.
**PAI Module
PERFORM BUILD_CATALOGUE. "first build the field catalogue (Display attributes )
BREAK-POINT.
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_STRUCTURE_NAME = 'MAKT'
* IS_LAYOUT = I_LAYOUT
CHANGING
IT_OUTTAB = I_TAB[]
IT_FIELDCATALOG = IT_FCAT.
FORM BUILD_CATALOGUE .
WA-COL_POS = '1'.
WA-FIELDNAME = 'MATNR'.
WA-TABNAME = 'I_TAB'.
WA-COLTEXT = 'Material'.
WA-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_BUTTON. "<-- this arribute will set the entire column as pushbuttons
APPEND WA TO IT_FCAT.
clear wa_fcat.
WA-COL_POS = '2'.
WA-FIELDNAME = 'SPRAS'.
WA-TABNAME = 'I_TAB'.
WA-COLTEXT = 'language'.
APPEND WA TO IT_FCAT.
clear wa_fcat.
ENDFORM.
Similarly If u place 5 Custom controls on single screen then u can display 5 ALV on the same screen.
With pushbuttons on the desired field (set attribute in the field catalog). ANd hence MULTIPLE ALV
Revert Back if problem still not solved with Your code.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |