Blank Line in an ALV Grid on screen
Hello,
I have added one ALV grid on a custom screen and appended it to the Opportunity Management transaction in CRM. The issue is that as soon as i toggle from display to change mode in the transaction, a blank line is itself appended to the ALV grid. I dont want this blank line. How do i suppress it? Can anyone help me with this.
Rgds
Priyanka
Yes you are correct But then how do i take care of the toggle and the blank line that is appended on the ALV screen table at the time of toggle ... coz toggle is called as a standard method in the standard code and i dont wanna change that.
Rgds
Priyanka
Similar Messages
-
How to insert blank lines in the ALV output.
Hi Friends,
Could any body help me out How to insert blank lines in the ALV output.?? Any Code pls...
Thank you,
Vikram.Chi vikram
do like this
In the fieldcatalog table all the fields should be in editable mode
ie lw_fcat-edit = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout = lv_layout
it_fieldcat = lt_fcat[]
i_save = 'A'
is_variant = lv_variant
TABLES
t_outtab = lt_license[]
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_data
*& Form user_command
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'ADD'. "
data: lv_ind type i.
data: lv_line type i.
describe table lt_license lines lv_line.
loop at lt_license into lw_license.
lv_ind = sy-tabix.
if lv_ind = lv_line.
append initial line to lt_license.
endif.
endloop.
ENDCASE.
ENDFORM. "user_command
reward points if useful
Rohan -
Problem with ALV Grid Display screen Back Button
Dear Friends ,
I have an ALV Grid Display,Here am facing a problem for my 'Back' button,i haven't defined any PF Status and is using the standard one.But after the Display when i press Back Button a blank Screen is appearing n then again i have to press back button to go to my Selection Screen.
Please Suggest if i have to take care of something else.
I want my Selection Screen when i press Back on my Display Screen.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
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
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
Thanks and Regards,
AshwiniHi Vijay ,
No i dont have any write statement in my proggram.
Here it is
REPORT ZRMMPD01A NO STANDARD PAGE HEADING.
TABLES : EQUI,SER03,MKPF,OBJK.
TYPE-POOLS : SLIS.
DATA IT_EQUI LIKE EQUI OCCURS 0 WITH HEADER LINE.
DATA IT_OBJK LIKE OBJK OCCURS 0 WITH HEADER LINE..
DATA IT_SER03 LIKE SER03 OCCURS 0 WITH HEADER LINE.
DATA IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE .
DATA : BEGIN OF IT_DISPLAY OCCURS 0,
MATNR LIKE EQUI-MATNR,
SERNR LIKE EQUI-SERNR,
BWART LIKE SER03-BWART,
WERK LIKE SER03-WERK,
CHARGE LIKE SER03-CHARGE,
LAGERORT LIKE SER03-LAGERORT,
MBLNR LIKE SER03-MBLNR,
MJAHR LIKE SER03-MJAHR,
ZEILE LIKE SER03-ZEILE,
BUDAT LIKE MKPF-BUDAT,
BKTXT LIKE MKPF-BKTXT,
USNAM LIKE MKPF-USNAM,
XBLNR LIKE MKPF-XBLNR,
END OF IT_DISPLAY.
DATA : WA_DISPLAY LIKE IT_DISPLAY.
DATA IT_FINAL LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
DATA IT_TEMP LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA :I_LAYOUT TYPE SLIS_LAYOUT_ALV,
I_EVENTS TYPE SLIS_T_EVENT.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_MATNR FOR EQUI-MATNR MATCHCODE OBJECT MCD,"OBLIGATORY
S_SERNR FOR EQUI-SERNR, "MATCHCODE OBJECT MCD OBLIGATORY
S_MBLNR FOR SER03-MBLNR MATCHCODE OBJECT MCD,
S_BWART FOR SER03-BWART MATCHCODE OBJECT MCD,
S_WERK FOR SER03-WERK MATCHCODE OBJECT MCD,
S_LAGET FOR SER03-LAGERORT MATCHCODE OBJECT MCD,
S_BUDAT FOR MKPF-BUDAT MATCHCODE OBJECT MCD,
S_XBLNR FOR MKPF-XBLNR MATCHCODE OBJECT MCD.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X',
R2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK B2.
START-OF-SELECTION.
*Fetch Data.
PERFORM GET_DATA.
*Fill Display Fields.
PERFORM FILL_TABLE.
*Segregate data according to radio button selection.
PERFORM SELECT_CONDITION.
*Fill The Feild catalog.
PERFORM FIELD_CATALOG.
*Display Output.
PERFORM OUTPUT_DISPLAY..
*& Form GET_DATA
text
--> p1 text
<-- p2 text
FORM GET_DATA.
SELECT * FROM EQUI INTO TABLE IT_EQUI
WHERE MATNR IN S_MATNR
AND SERNR IN S_SERNR.
SELECT * FROM OBJK INTO TABLE IT_OBJK
FOR ALL ENTRIES IN IT_EQUI
WHERE EQUNR = IT_EQUI-EQUNR.
SELECT * FROM SER03 INTO TABLE IT_SER03
FOR ALL ENTRIES IN IT_OBJK
WHERE OBKNR = IT_OBJK-OBKNR
AND MBLNR IN S_MBLNR
AND BWART IN S_BWART
AND WERK IN S_WERK
AND LAGERORT IN S_LAGET.
SELECT * FROM MKPF INTO TABLE IT_MKPF
FOR ALL ENTRIES IN IT_SER03
WHERE MBLNR = IT_SER03-MBLNR
AND BUDAT IN S_BUDAT
AND XBLNR IN S_XBLNR.
ENDFORM. " GET_DATA
*& Form FILL_TABLE
text
--> p1 text
<-- p2 text
FORM FILL_TABLE.
LOOP AT IT_EQUI.
LOOP AT IT_OBJK.
IF IT_OBJK-EQUNR <> IT_EQUI-EQUNR.
SKIP.
ELSE.
READ TABLE IT_SER03 WITH KEY OBKNR = IT_OBJK-OBKNR.
IF SY-SUBRC = 0.
WA_DISPLAY-MATNR = IT_EQUI-MATNR.
WA_DISPLAY-SERNR = IT_EQUI-SERNR.
WA_DISPLAY-BWART = IT_SER03-BWART.
WA_DISPLAY-WERK = IT_SER03-WERK.
WA_DISPLAY-CHARGE = IT_SER03-CHARGE.
WA_DISPLAY-LAGERORT = IT_SER03-LAGERORT.
WA_DISPLAY-MBLNR = IT_SER03-MBLNR.
WA_DISPLAY-MJAHR = IT_SER03-MJAHR.
WA_DISPLAY-ZEILE = IT_SER03-ZEILE.
READ TABLE IT_MKPF WITH KEY MBLNR = IT_SER03-MBLNR.
IF SY-SUBRC = 0.
WA_DISPLAY-BUDAT = IT_MKPF-BUDAT.
WA_DISPLAY-BKTXT = IT_MKPF-BKTXT.
WA_DISPLAY-USNAM = IT_MKPF-USNAM.
WA_DISPLAY-XBLNR = IT_MKPF-XBLNR.
ENDIF.
ENDIF.
ENDIF.
IF NOT WA_DISPLAY IS INITIAL.
APPEND WA_DISPLAY TO IT_DISPLAY.
CLEAR WA_DISPLAY.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDFORM. " FILL_TABLE
*& Form FIELD_CATALOG
text
--> p1 text
<-- p2 text
FORM FIELD_CATALOG.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MATNR'.
FIELDCAT-SELTEXT_M = 'Material Number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'SERNR'.
FIELDCAT-SELTEXT_M = 'Serial number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MBLNR'.
FIELDCAT-SELTEXT_L = 'Number of material document'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BWART'.
FIELDCAT-SELTEXT_M = 'Movement type'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'WERK'.
FIELDCAT-SELTEXT_M = 'Plant'.
FIELDCAT-OUTPUTLEN = 5.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'CHARGE'.
FIELDCAT-SELTEXT_M = 'Batch number'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'LAGERORT'.
FIELDCAT-SELTEXT_M = 'Storage Location'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'MJAHR'.
FIELDCAT-SELTEXT_M = 'Material doc. year'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'ZEILE'.
FIELDCAT-SELTEXT_L = 'Item in material document'.
FIELDCAT-OUTPUTLEN = 18.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BUDAT'.
FIELDCAT-SELTEXT_L = 'Posting date in the document'.
FIELDCAT-OUTPUTLEN = 10.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'BKTXT'.
FIELDCAT-SELTEXT_L = 'Document header text'.
FIELDCAT-OUTPUTLEN = 25.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'USNAM'.
FIELDCAT-SELTEXT_M = 'User name'.
FIELDCAT-OUTPUTLEN = 15.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-TABNAME = 'IT_DISPLAY'.
FIELDCAT-FIELDNAME = 'XBLNR'.
FIELDCAT-SELTEXT_L = 'Reference document number'.
FIELDCAT-OUTPUTLEN = 25.
APPEND FIELDCAT TO IT_FIELDCAT.
CLEAR FIELDCAT.
ENDFORM. " FIELD_CATALOG
*& Form DISPLAY_OUTPUT
text
--> p1 text
<-- p2 text
FORM OUTPUT_DISPLAY.
IF R1 = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = IT_DISPLAY
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.
REFRESH IT_DISPLAY.
CLEAR IT_DISPLAY.
ELSEIF R2 = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'ZRMMPD01A'
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = IT_FINAL
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.
REFRESH IT_DISPLAY.
CLEAR IT_DISPLAY.
ENDIF.
ENDFORM. " DISPLAY_OUTPUT
*& Form SELECT_CONDITION
text
--> p1 text
<-- p2 text
FORM SELECT_CONDITION.
IF R2 = 'X'.
CLEAR WA_DISPLAY.
SORT IT_DISPLAY BY MATNR SERNR MBLNR ZEILE.
DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
LOOP AT IT_DISPLAY WHERE ZEILE = '0002'.
READ TABLE IT_DISPLAY WITH KEY MATNR = IT_DISPLAY-MATNR
SERNR = IT_DISPLAY-SERNR ZEILE = '0001'.
IF SY-SUBRC = 0.
DELETE IT_DISPLAY.
ENDIF.
ENDLOOP.
SORT IT_DISPLAY BY MATNR SERNR BWART MBLNR.
DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
LOOP AT IT_DISPLAY.
IF WA_DISPLAY IS INITIAL.
WA_DISPLAY = IT_DISPLAY.
ENDIF.
LOOP AT IT_DISPLAY WHERE MATNR = WA_DISPLAY-MATNR
AND SERNR = WA_DISPLAY-SERNR.
IF IT_DISPLAY-BUDAT > WA_DISPLAY-BUDAT.
WA_DISPLAY = IT_DISPLAY.
ELSE.
DELETE IT_DISPLAY.
ENDIF.
ENDLOOP.
APPEND WA_DISPLAY TO IT_TEMP.
CLEAR WA_DISPLAY.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM IT_TEMP.
IF NOT IT_TEMP[] IS INITIAL.
IT_FINAL[] = IT_TEMP[].
ENDIF.
ENDIF.
ENDFORM. " SELECT_CONDITION
Regards,
Ashwini -
Hello experts,
is it possible to implement ALV grid display (OO) without statements such as "call screen 100"?
I have an example, logically everything should work but, unfortunatelly, nothing displays. Code:
ZPROGRAM CODING ***
REPORT ZTESTPROG.
DATA: save_ok LIKE sy-ucomm,
ok_code LIKE sy-ucomm,
it_spfli TYPE TABLE OF spfli WITH HEADER LINE.
DATA: G_CUSTOM_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
GRID1 TYPE REF TO CL_GUI_ALV_GRID,
it_cat TYPE LVC_T_FCAT,
wa_cat TYPE LVC_S_FCAT.
START-OF-SELECTION.
SELECT * FROM spfli
INTO TABLE it_spfli.
perform INITIAL_GRID.
form INITIAL_GRID.
PERFORM create_field_catalog.
PERFORM create_grid_control.
endform. " INITIAL_GRID OUTPUT
FORM create_field_catalog .
IF it_cat[] is initial.
clear wa_cat.
wa_cat-col_pos = 1.
wa_cat-fieldname = 'CARRID'.
wa_cat-datatype = 'CHAR'.
wa_cat-inttype = 'C'.
wa_cat-intlen = 3.
wa_cat-reptext = 'Airline Code'.
wa_cat-coltext = 'Airline Code'.
append wa_cat to it_cat.
clear wa_cat.
wa_cat-col_pos = 2.
wa_cat-fieldname = 'CONNID'.
wa_cat-datatype = 'NUMC'.
wa_cat-inttype = 'N'.
wa_cat-intlen = 4.
wa_cat-reptext = 'Flight Conn. No'.
wa_cat-coltext = 'Flight Conn. No'.
append wa_cat to it_cat.
clear wa_cat.
wa_cat-col_pos = 3.
wa_cat-fieldname = 'CITYFROM'.
wa_cat-datatype = 'CHAR'.
wa_cat-inttype = 'C'.
wa_cat-intlen = 20.
wa_cat-reptext = 'Dep. city'.
wa_cat-coltext = 'Dep. city'.
append wa_cat to it_cat.
clear wa_cat.
wa_cat-col_pos = 4.
wa_cat-fieldname = 'AIRPFROM'.
wa_cat-datatype = 'CHAR'.
wa_cat-inttype = 'C'.
wa_cat-intlen = 3.
wa_cat-reptext = 'Dep. airport'.
wa_cat-coltext = 'Dep. airport'.
append wa_cat to it_cat.
clear wa_cat.
wa_cat-col_pos = 5.
wa_cat-fieldname = 'CITYTO'.
wa_cat-datatype = 'CHAR'.
wa_cat-inttype = 'C'.
wa_cat-intlen = 20.
wa_cat-reptext = 'Arrival city'.
wa_cat-coltext = 'Arrival city'.
append wa_cat to it_cat.
clear wa_cat.
wa_cat-col_pos = 6.
wa_cat-fieldname = 'AIRPTO'.
wa_cat-datatype = 'CHAR'.
wa_cat-inttype = 'C'.
wa_cat-intlen = 3.
wa_cat-reptext = 'Dest. airport'.
wa_cat-coltext = 'Dest. airport'.
append wa_cat to it_cat.
ENDIF.
ENDFORM. " create_field_catalog
*& Form create_grid_control
text
--> p1 text
<-- p2 text
FORM create_grid_control .
IF G_CUSTOM_CONTAINER1 is initial .
CREATE OBJECT G_CUSTOM_CONTAINER1
EXPORTING CONTAINER_NAME = 'CUSTOM1'.
CREATE OBJECT GRID1
EXPORTING I_PARENT = G_CUSTOM_CONTAINER1.
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = it_spfli[]
IT_FIELDCATALOG = it_cat[]
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " create_grid_control
In contrast, if you use function "Reuse_Alv_List_Display" it works without any screens.Hi
If you wish to go with OO approach to ALV Grid you can use the CL_SALV class.
Here you do not need to create the screen.
TYPES: BEGIN OF ty_kna1,
kunnr TYPE kunnr,
name1 TYPE name1_gp,
land1 TYPE land1_gp,
END OF ty_kna1,
ty_t_kna1 TYPE TABLE OF ty_kna1.
DATA: t_kna1 TYPE TABLE OF ty_kna1,
r_salv_table TYPE REF TO cl_salv_table,
r_display TYPE REF TO cl_salv_display_settings,
r_columns TYPE REF TO cl_salv_columns_table.
START-OF-SELECTION.
** Fetch Data
SELECT kunnr
name1
land1
FROM kna1
INTO TABLE t_kna1
UP TO 25 ROWS.
CALL METHOD cl_salv_table=>factory
* EXPORTING
* list_display = if_salv_c_bool_sap=>true
* r_container =
* container_name =
IMPORTING
r_salv_table = r_salv_table
CHANGING
t_table = t_kna1.
r_columns = r_salv_table->get_columns( ).
r_columns->set_optimize( ).
r_display = r_salv_table->get_display_settings( ).
r_display->set_striped_pattern( value = 'X' ).
r_salv_table->display( ).
Edited by: SAP LEARNER on Apr 6, 2011 4:56 PM -
Multi Line Selection with ALV Grid
Dear all
what do I have to do to make multiple line selection available in an ALV Grid (Version 4.7)?
HerbertHi Herbert again,
Once you displayed your alv output display, then select rows in the alv display.
then when you click for interactive buttion (ie. like Refresh functionality), In debug mode you can see internal table with Sell field active (i.e. marked "X") which you have selected.
e.g.
FORM user_command USING lv_ucomm TYPE sy-ucomm ls_selfield TYPE slis_selfield.
DATA:
lv_ref_grid TYPE REF TO cl_gui_alv_grid.
CLEAR : gv_tcode.
*-- to ensure that only new processed data is displayed
IF lv_ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lv_ref_grid.
ENDIF.
IF NOT lv_ref_grid IS INITIAL.
CALL METHOD lv_ref_grid->check_changed_data.
ENDIF.
CASE lv_ucomm.
WHEN '&IC1'.
IF ls_selfield-fieldname = 'MATNR'.
READ TABLE gt_gi INTO gs_gi INDEX ls_selfield-tabindex.
IF sy-subrc = 0.
gv_tcode = 'MMBE'.
SET PARAMETER ID 'MAT' FIELD gs_gi-matnr.
CALL TRANSACTION gv_tcode AND SKIP FIRST SCREEN. "#EC CI_CALLTA "MMBE
ENDIF.
ENDIF.
WHEN 'COPY'.
LOOP AT gt_gi INTO gs_gi WHERE sel = 'X'.
gs_gi-sel = ' '.
APPEND gs_gi TO gt_gi.
CLEAR gs_gi.
ENDLOOP.
WHEN 'POST'.
REFRESH : gt_error[].
WHEN OTHERS.
ENDCASE.
ENDFORM. " USER_COMMAND
I hope you clear now.
Feel free to ask any doubts.
Thanks and regards,
Vijay -
ALV Grid Details Screen Editable
Hi All,
I have requirement to Edit the ALV grid.
ie I have ALV grid , after selecting (highlighting a line ), the user will go to the details screen, i need to be the details screen
should be editable. Please give info about this.
Thanks
aRsMy problem is if you put details screen also displayed in horizontal way. I need to display the fields in vertical order.and it should editable
If you press details icon the grid, you see the selected records displays like the following , but i need to editable
eg.
Number : XXXXXX
Desc : XXXXXXXXXXXXXXXXX
Name : XXXXXXXXXXXXXXXXX
Thanks
aRs -
How do I find an event which is triggered on line selection for ALV grid?
Hi,
I'm trying to find an event which is triggered when a user selects a row in the ALV grid. I want to add my own code in to add up the total values of selected lines, but can't find any event which will trigger my method.
I found CLICK_ROW_COL but it's protected so when I try and add a method for it:
PROTECTED SECTION.
METHODS:
select_row
FOR EVENT click_row_col OF cl_gui_alv_grid.
I get the syntax error:
Access to protected event "CLICK_ROW_COL" is not allowed.
Am I using the right event? Am I implementing it correctly?
Any help appreciated. Thanks in advance.
GillI chose to solve this by removing the line select buttons from the ALV and replacing them with a checkbox defined as a hotspot. I then used EVENT hotspot_click FROM cl_gui_alv_grid to highlight the line and change my totals on a single click.
-
ALV Grid and screen title using OO
I've been searching thru documentation and this forum without any luck. I want to display a screen title in the location where the report name displays on a standard report, i.e., between the Menu Toolbar and the Application Toolbar. I am using OO ALV Grid. I found how to do it using function modules, there they set the layout field "gs_test-layo_title" but this field does not exist in OO layout. The field "grid_title" displays the title inside the grid display (not what I want) and the field "detailtitl" does not work either.
Any help will be greatly appreciated.
ThanksHi Nicolas, understand that the OO ALV Grid which you are referring to is implemented into a screen container. This container does not really have anything to do with the screen title. Only when using the full-screen grid(using the FM) do you have direct control of this title via the ALV tool. If you simply want to set this title in the title bar, you can simply do this using the SET TITLE-BAR statement in the PBO of the screen. Or you may even able to simply set the system variable(haven't tested this) again in the PBO of the screen.
sy-title = 'This is my title'.
Regards,
Rich Heilman -
Hi guys: I need to double click on a field in the ALV report that should bring up another structure (which I have created) called s_det
s_det has only document number & company code.
Please provide the code for doing this in ALV. I know I cant use At Line Selection. Please give me simple code.
thanks so much
BrianHi
take this as an example for ur solution.
In this if we double click on first level display then it opens second level display.Just have a look on the following code.
This is Interactive ALV report of displaying each row with colours and Headers.
TYPE-POOLS SLIS.
TYPES: BEGIN OF I_EKKO,
EBELN LIKE EKKO-EBELN,
AEDAT LIKE EKKO-AEDAT,
BUKRS LIKE EKKO-BUKRS,
BSART LIKE EKKO-BSART,
LIFNR LIKE EKKO-LIFNR,
L_COLOR(4) TYPE C,
END OF I_EKKO.
DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
WA_EKKO TYPE I_EKKO.
TYPES: BEGIN OF I_EKPO,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
MENGE LIKE EKPO-MENGE,
MEINS LIKE EKPO-MEINS,
NETPR LIKE EKPO-NETPR,
L_COLOR1(4) TYPE C,
END OF I_EKPO.
DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
WA_EKPO TYPE I_EKPO.
DATA: V_REPID TYPE SY-REPID,
I_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FLDCAT TYPE SLIS_FIELDCAT_ALV,
I_EVENTS TYPE SLIS_T_EVENT,
WA_EVENT TYPE SLIS_ALV_EVENT,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
GD_LAYOUT1 TYPE SLIS_LAYOUT_ALV.
DATA: I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST ALV REPORT',
I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDARY ALV REPORT'.
INITIALIZATION.
V_REPID = SY-REPID.
PERFORM FLDCATALOG.
PERFORM CALL_EVENTS.
PERFORM POPULATE_EVENT.
PERFORM BLD_LAYOUT.
PERFORM BLD_LAYOUT1.
START-OF-SELECTION.
PERFORM DATA_RETRIEVAL.
PERFORM DISPLAY_ALV_REPORT.
FORM FLDCATALOG.
WA_FLDCAT-TABNAME = 'IT_EKKO'.
WA_FLDCAT-FIELDNAME = 'EBELN'.
WA_FLDCAT-SELTEXT_M = 'PO NUMBER'.
APPEND WA_FLDCAT TO I_FLDCAT.
CLEAR WA_FLDCAT.
WA_FLDCAT-TABNAME = 'IT_EKKO'.
WA_FLDCAT-FIELDNAME = 'AEDAT'.
WA_FLDCAT-SELTEXT_M = 'DATE'.
APPEND WA_FLDCAT TO I_FLDCAT.
CLEAR WA_FLDCAT.
WA_FLDCAT-TABNAME = 'IT_EKKO'.
WA_FLDCAT-FIELDNAME = 'BUKRS'.
WA_FLDCAT-SELTEXT_M = 'DOCUMENT TYPE'.
APPEND WA_FLDCAT TO I_FLDCAT.
CLEAR WA_FLDCAT.
WA_FLDCAT-TABNAME = 'IT_EKKO'.
WA_FLDCAT-FIELDNAME = 'LIFNR'.
WA_FLDCAT-SELTEXT_M = 'VENDOR CODE'.
APPEND WA_FLDCAT TO I_FLDCAT.
CLEAR WA_FLDCAT.
ENDFORM.
FORM CALL_EVENTS.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = I_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.
FORM POPULATE_EVENT.
*READ TABLE I_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
*IF SY-SUBRC = 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY I_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME = WA_EVENT-FORM.
*ENDIF.
READ TABLE I_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
IF SY-SUBRC = 0.
WA_EVENT-FORM = 'USER_COMMAND'.
MODIFY I_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME = WA_EVENT-NAME.
ENDIF.
ENDFORM.
FORM BLD_LAYOUT.
GD_LAYOUT-INFO_FIELDNAME = 'L_COLOR'.
ENDFORM.
FORM DATA_RETRIEVAL.
DATA LN_COLOR(1) TYPE C.
SELECT EBELN AEDAT BUKRS BSART LIFNR
FROM EKKO INTO TABLE IT_EKKO.
LOOP AT IT_EKKO INTO WA_EKKO.
LN_COLOR = LN_COLOR + 1.
IF LN_COLOR = 8.
LN_COLOR = 1.
ENDIF.
CONCATENATE 'C' LN_COLOR '11' INTO WA_EKKO-L_COLOR.
MODIFY IT_EKKO FROM WA_EKKO.
ENDLOOP.
ENDFORM.
FORM DISPLAY_ALV_REPORT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = '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 = I_TITLE_EKKO
I_GRID_SETTINGS =
IS_LAYOUT = GD_LAYOUT
IT_FIELDCAT = I_FLDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = I_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 = IT_EKKO
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.
FORM TOP_OF_PAGE.
DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER TYPE SLIS_LISTHEADER.
WA_HEADER-TYP = 'H'.
WA_HEADER-INFO = 'THIS IS MY FIRST ALV'.
APPEND WA_HEADER TO T_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_HEADER
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM.
FORM USER_COMMAND USING R_COMM TYPE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_COMM.
WHEN '&IC1'.
READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
PERFORM FLDCAT_EKPO.
PERFORM CALL_EVENT_EKPO.
PERFORM POPULATE_EVENT_EKPO.
PERFORM DATA_RETRIEVAL_EKPO.
PERFORM DISPLAY_ALV_REPORT_EKPO.
ENDCASE.
ENDFORM.
FORM FLDCAT_EKPO.
WA_FLDCAT-TABNAME = 'IT_EKPO'.
WA_FLDCAT-FIELDNAME = 'EBELN'.
WA_FLDCAT-SELTEXT_M = 'PO NUMBER'.
APPEND WA_FLDCAT TO I_FLDCAT.
CLEAR WA_EKPO.
WA_FLDCAT-TABNAME = 'IT_EKPO'.
WA_FLDCAT-FIELDNAME = 'EBELP'.
WA_FLDCAT-SELTEXT_M = 'LINE NO'.
APPEND WA_FLDCAT TO I_FLDCAT.
CLEAR WA_EKPO.
WA_FLDCAT-TABNAME = 'IT_EKPO'.
WA_FLDCAT-FIELDNAME = 'MATNR'.
WA_FLDCAT-SELTEXT_M = 'MATERIAL NUMBER'.
APPEND WA_FLDCAT TO I_FLDCAT.
CLEAR WA_FLDCAT.
WA_FLDCAT-TABNAME = 'IT_EKPO'.
WA_FLDCAT-FIELDNAME = 'MENGE'.
WA_FLDCAT-SELTEXT_M = 'QUANTITY'.
APPEND WA_FLDCAT TO I_FLDCAT.
CLEAR WA_FLDCAT.
WA_FLDCAT-TABNAME = 'IT_EKPO'.
WA_FLDCAT-FIELDNAME = 'MEINS'.
WA_FLDCAT-SELTEXT_M = 'BASE UNIT OF MEASURE'.
APPEND WA_FLDCAT TO I_FLDCAT.
CLEAR WA_FLDCAT.
WA_FLDCAT-TABNAME = 'IT_EKPO'.
WA_FLDCAT-FIELDNAME = 'NETPR'.
WA_FLDCAT-SELTEXT_M = 'PRICE'.
APPEND WA_FLDCAT TO I_FLDCAT.
CLEAR WA_FLDCAT.
ENDFORM.
FORM CALL_EVENT_EKPO.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = I_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.
*FORM POPULATE_EVENT_EKPO.
*READ TABLE I_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
*IF SY-SUBRC = 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY I_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME = WA_EVENT-FORM.
*ENDIF.
*ENDFORM.
FORM BLD_LAYOUT1.
GD_LAYOUT1-INFO_FIELDNAME = 'L_COLOR1'.
ENDFORM.
FORM DATA_RETRIEVAL_EKPO.
DATA LN_COLOR1(1) TYPE C.
SELECT EBELN EBELP MATNR MENGE MEINS NETPR
INTO TABLE IT_EKPO
FROM EKPO.
LOOP AT IT_EKPO INTO WA_EKPO.
LN_COLOR1 = LN_COLOR1 + 1.
IF LN_COLOR1 = 8.
LN_COLOR1 = 1.
ENDIF.
CONCATENATE 'C' LN_COLOR1 '11' INTO WA_EKPO-L_COLOR1.
MODIFY IT_EKPO FROM WA_EKPO.
ENDLOOP.
ENDFORM.
FORM DISPLAY_ALV_REPORT_EKPO.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE1'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_TITLE_EKPO
I_GRID_SETTINGS =
IS_LAYOUT = GD_LAYOUT1
IT_FIELDCAT = I_FLDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = I_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 = IT_EKPO
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.
FORM TOP_OF_PAGE1.
DATA: T_HEADER1 TYPE SLIS_T_LISTHEADER,
WA_HEADER1 TYPE SLIS_LISTHEADER.
WA_HEADER1-TYP = 'H'.
WA_HEADER1-INFO = 'SECONDARY ALV LEVEL'.
APPEND WA_HEADER1 TO T_HEADER1.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = T_HEADER1
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM = .
ENDFORM.
reward points,if it is useful.
Thanks,
chandu. -
Regarding user interface in subtotal line of ALV grid, ensure points
Hi,
I have 3 fields,
A= vendor , B = freight , C = Cost PMT
When the vendor get changed, My Grid is showing subtotal of B i.e freight.
Now my requirement is, in the same subtotal line, I want average of C (Cost PMT) field.
So how we can interact with the subtotal line of the ALV grid.
Pleas reply!!!! & have ur points.
cheersRead the documentation of FM ICON_CREATE, the purpose of the Function module is entirely different from what you are using it for.
To print Icons in ALV (Using FMs ) all you need to do is to send the Icon name in the field.
Also parameters TEXT and INFO of FM ICON_CREATE seem to be flags, that are appended to the icon name so that when you set it on the screen the appropriate info or Text is shown. -
Alv grid : is it possible to create 2 header lines ?
alv grid : is it possible to create 2 header lines ?
for example :
open year close year
from 2006 until 2008
data
data
data
data
i know that i can do so in alv list , but is it possible in alv
grid ( with screen ) ?No, this is not supported by the ALV Grid control.
Regards,
Rich Heilman -
Displaying items in a single line in ALV grid using ALV_TOP_OF_PAGE.
Hello Guys,
I am having a problem in displaying items in a single line in the ALV Grid using event ALV_TOP_OF_PAGE.
My requirement is to group items on a single line i.e. in the example below, Vendor code and posting date are on the same line. The next line the prints Vendor Name and Document no.
Vendor Code: 123123 Posting Date : 01.01.2011
Vendor Name: ABCD Document No: 152246598.
Here is my code in subroutine 'ALV_TOP_OF_PAGE',
wa_list_comments-typ = 'S'.
wa_list_comments-key = ''.
wa_list_comments-info = 'Vendor Code'.
APPEND wa_list_comments TO it_list_comments.
wa_list_comments-typ = 'S'.
wa_list_comments-key = ''.
wa_list_comments-info = 'Posting Date'.
APPEND wa_list_comments TO it_list_comments.
The above code prints in the following format i.e one below the other,
Vendor Code: 123123
Posting Date : 01.01.2011.
I also tried using HTML_TOP_OF_PAGE, but it didn't work.
Can anybody please help me out with this.
Regards,
Danish.Hi Danish,
Your problem is with the alignment and you need some fix positions .
The solution i feel is u can use as below :
In CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
use
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'.
Now on calling routine call use cl_dd_document class :
FORM html_top_of_page USING document TYPE REF TO cl_dd_document .
data : doctable TYPE REF TO cl_dd_table_element,
col1_t1 TYPE REF TO cl_dd_area,
col2_t1 TYPE REF TO cl_dd_area,
col1_t2 TYPE REF TO cl_dd_area,
col2_t2 TYPE REF TO cl_dd_area.
add quick table with five columns
CALL METHOD lw_document->add_table
EXPORTING
no_of_columns = 2
border = '0'
cell_background_transparent = ' '
width = '100%'
IMPORTING
table = doctable.
Filling columns in row
CALL METHOD doctable->add_column
EXPORTING
width = '40%'
IMPORTING
column = col1_t1.
Filling columns in row
CALL METHOD doctable->add_column
EXPORTING
width = '60%'
IMPORTING
column = col2_t1.* Filling columns in row
Call method doctable->new_row.
CALL METHOD doctable->add_column
EXPORTING
width = '40%'
IMPORTING
column = col1_t2.
Filling columns in row
CALL METHOD doctable->add_column
EXPORTING
width = '60%'
IMPORTING
column = col2_t2.
*Now adding the texts
lw_text1 = 'your first text'
CALL METHOD col1_t1->add_text
EXPORTING
text = lw_text.
*Similarly add text for other columns
*Adujust % in width to adjust the column as required
Endform.
Hope this will solve your problem . -
Total and non-total lines in ALV grid
Hi all,
Does anyone know if there is any standard SAP functionality for retrieving the non-total/raw item lines that lies beneath a total line in an ALV grid (after the user has selected the total line)?
All helpful answers will be rewarded!
Best regards,
MVTry the ALV event AFTER-LINE-OUTPUT may be it can help u to achieve ur requirement.
Append AFTER-LINE-OUTPUT event to the internal table T_EVENT.
CLEAR W_EVENT.
W_EVENT-FORM = SLIS_EV_AFTER_LINE_OUTPUT.
W_EVENT-NAME = SLIS_EV_AFTER_LINE_OUTPUT.u201CAFTER_LINE_OUTPUT event
APPEND W_EVENT TO T_EVENT.
FORM AFTER_LINE_OUTPUT
USING P_RS_LINEINFO TYPE SLIS_LINEINFO.
Here you have to write the logic to retrieve the 'total' line
ENDFROM.
Now call the alv FM
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = L_REPID "Program Name
IS_LAYOUT = W_LAYOUT "Layout of the Report
IT_FIELDCAT = T_FIELDCAT "Field Catalog for Report
IT_EVENTS = T_EVENT "For setting the events
TABLES
T_OUTTAB = T_OUTPUT "Report data Internal Table
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2. -
Hi,
Can I use a total line in an ALV grid and hide part of the columns, so that only the total line will be presented for some of the columns ?Hi,
Yes u can use a total column in the ALV Grid.
Check the code below:
AT LAST.
WA_ALV_CAT1-FIELDNAME = 'TOTAL'(004).
WA_ALV_CAT1-COL_POS = L_I.
WA_ALV_CAT1-COLTEXT = 'TOTAL'(004).
WA_ALV_CAT1-JUST = C_CENTER. " 'C'.
APPEND WA_ALV_CAT1 TO L_ALV_CAT1_TAB.
CLEAR WA_ALV_CAT1.
ENDAT.
Regards
Kannaiah -
How to sense which lines are selected in ALV grid with Reuse FM.
Hi!;
with the help of the forum I have developed a ALV grid whose first column is a editable checkbox.
The user click some of the lines on the ALV grid and I added an additional button on the tooolbar named "ACCEPT".
When the button ACCEPT is clicked I want to get the lines whose checkbox is checked.
How can I do that ?
Making the first column (Checkbox column ) hotspot of no help.
Would you please help me ?
Erkan
Moderator message: please search for available information/documentation.
Edited by: Thomas Zloch on Sep 14, 2011 3:05 PMhi,
you can refer the below link:
/thread/492162 [original link is broken]
Maybe you are looking for
-
Front row & shared libraries on same computer
Hey My girlfriend and I dont have the same music taste, which is why we like to keep our music on different accounts. However recently I've bought a Mac Mini intended to work as a mediacenter. I've planned to use Front Row along with the remote contr
-
PO item text not displaying in ME23n
Hello, There is a PO which was created manually in which the Item text does not display from ME23n. In the display, the item text has a tick next to it but the display window shows nothing. However, the output message is having the item text in it. H
-
Adding a new conditon on head via function modul?
Hi, is there a way to add a condition to an order via function module? I mean in customizing we have maintained the calc scheme (and everything else) and assign it to the order. What we want is to add the new condition type to the head of the order v
-
New E65 phone, loaded latest PC suite - computer s...
Hi everyone, Just acquired splendid new E65 phone. Running Windows XP Professional 64 bit software and successfully loaded PC Suite software - 6.83.14.1 from Nokia website. Connected phone via USB cable; selected PC Suite mode on the phone; PC accept
-
Potential Fix to the WiFi connection dropping on MacBook Pro
I, along with a number of other people who have posted here, was experiencing WiFi connection drops after a few minutes on my brand new MacBook Pro, which is running OS X 10.7.5. Rather than going the route of plugging in a static IP address, I decid