How to display total in ALV Header
How to display total in ALV Header?
Hi Venkey,
As far as your issue is concerned I would like to quote my perception.
Create a header internal table with title and number of records.
At the later part of your program you should have found the total number of records ,now assign it to the header internal table and print it.
For further clarification you can go check this link:
http://wiki.sdn.sap.com/wiki/display/ABAP/AddHeadertoALVreport
Thanks
P.Srikanth
Similar Messages
-
How to Display Logo in ALV Header?
Hi
I want to display/ print my company logo image in ALV Header. Please help me how can I do this?
Thanks
Iftikhar Ali
Islamabad.Hi,
If you are already having a logo say ZLOGO .
You can use it this way .
Give TOP-OF-PAGE
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
And in top of page do this .
FORM top-of-page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRIT
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHE
i_logo = 'ZLOGO'
I_END_OF_LIST_GRID =
endform.
Hope this will work .
Reward if found useful.
Regards
SureshP. -
How to display total in alv only for single row
Hello,
I wish to replace VAT field in my ALV OUTPUT from another ITAB using READ TABLE. But in ALV output I have multiple rows for one document number.
So the value is assigning to all the rows in output, is it possible to assign that VAT value to only one row ( to any one record from output with corresponding document number) .
Thanks in advance.
Regards,
Ritesh InamdarHi Sudeesh,
I am fetching data for PO details, GR details along with condition types of PO.
All data is collected in ALV OUTPUT itab, after this I am trying to assign the values of VAT from another itab in ALV OUTPUT LOOP using READ TABLE with reference to PO-PO_ITEM-CONDITION_TYPE.
Now, when the alv loop is getting executed and in that I am fetching data for VAT using READ statement, the program is assigning VAT to all records of output alv with comparison of PO-PO_ITEM-CONDITION_TYPE.
see:
LOOP AT it_alv ASSIGNING <fs-alv>.
READ TABLE it_vat ASSIGNING <fs-vat>
WITH KEY ebeln = <fs-alv>-ebeln
posnr = <fs-alv>-posnr
kschl = 'JVCS'.
IF sy-subrc = 0.
<fs-alv>-vat = <fs-vat>-kbetr / 10.
<fs-alv>-vat_val = <<fs-alv>-vat * it_alv-menge.
END IF.
END LOOP.
Please refer above.
Thanks.
Ritesh -
How to display total "items" and "amount " in header.jsp in CRM ISA B2B
Hi,
I am modifying header.jsp in standard CRM ISA B2B application. Here we have summary of total number of items and total amount but it is coming in to button and for that below code is there in header.jsp and it display it as button text.
if (!ui.homActivated) { %>
!!" alt="" border="0" height="16" width="20">
</td>
<td class="vertical-align-middle" name="miniBasket" value="<isa:translate key="b2b.header.minibasket.default"/>" >
<form name="basketForm" action="javascript:show_basket();">
<input class="green" name="miniBasket" type="button" value="<isa:translate key="b2b.header.minibasket.default"/>"/>
</form>
</td>
<% } else { %>
<!-- HOM scenario - minibasket displays collective order -->
<td class="vertical-align-middle" align="right">
!!" alt="" border="0" height="16" width="20">
</td>
<td class="vertical-align-middle" name="miniBasket" value="<isa:translate key="b2b.header.collorder.default"/>">
<form name="basketForm" action="javascript:show_collective_order();">
<input class="green" name="miniBasket" type="button" value="<isa:translate key="b2b.header.collorder.default"/>"/>
</form>
</td>
<% } %>
Now I want to display total number of items and total amount separately in two different <td> element.
How I can get total number of items and total amount in header.jsp I tried below code but did not get any success.
Insert below line in header.jsp with respective page import statement for class or let me know which class I have to import.
<%
HeaderSalesDocument hdr =
(HeaderSalesDocument) request.getAttribute(MaintainBasketBaseAction.RK_HEADER);
ItemList items =
(ItemList) request.getAttribute(MaintainBasketBaseAction.RK_ITEMS);
%>
And then I use
<td><%= hdr.getNetValue() %></td>
<td><%= items.size() %></td>
But it is not printing any thing and header page not display at all.
Pl. tell me how to get total amount and number of items in header area. Which class or object I have to use here.
I really appreciated any help from any one.
Thanks and regards.
Ashish Patel.Hi, I tried another logic. I took value from Standard button, in which B2B application display total items and amount and I hide this field, to another text element.
Now I Am breaking that value in words and stored them in array and then trying to display that array with particular number which contains total item and amount through Java Script on Focus.
But problem here is, It is not getting updated automatically I have to click on new text files to trigger Onfocus event. How I can achieve effect like as soon as Standard button changes it's value which is now hidden filed my new text box should update automatically.
Thanks.
Ashish -
Display Total in ALV-List-urgent
Hi,
I have an ALV-List with an amount column...I have to show the total at the end of the list..Calculation of total can be done in the internal table but how to display it neatly just below the itab-amount with a tag Total : 29000000 .Kindly help.
Thanks..see this below example
REPORT yktest.
*& TABLES DECLARATION *
TABLES : ekko, ekpo, t001w, t161t, lfa1.
*& INTERNAL TABLE DECLARATION *
TYPES : BEGIN OF tp_itab1,
bukrs TYPE ekko-bukrs,
lifnr TYPE ekko-lifnr,
ebeln TYPE ekko-ebeln,
waers TYPE ekko-waers,
bsart TYPE ekko-bsart,
ekorg TYPE ekko-ekorg,
ekgrp TYPE ekko-ekgrp,
ebelp TYPE ekpo-ebelp,
txz01 TYPE ekpo-txz01,
matnr TYPE ekpo-matnr,
werks TYPE ekpo-werks,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
netwr TYPE ekpo-netwr,
name1 TYPE t001w-name1,
header_text(132),
chk TYPE c,
END OF tp_itab1.
DATA : t_itab1 TYPE STANDARD TABLE OF tp_itab1,
wa_itab1 TYPE tp_itab1,
ws_name1 TYPE t001w-name1.
DATA : f_itab1 TYPE STANDARD TABLE OF tp_itab1,
wa_fitab1 TYPE tp_itab1.
DATA : f_itab2 TYPE STANDARD TABLE OF tp_itab1,
wa_fitab2 TYPE tp_itab1.
TYPES : BEGIN OF tp_name1,
werks TYPE t001w-werks,
name1 TYPE t001w-name1,
END OF tp_name1.
DATA : t_name1 TYPE STANDARD TABLE OF tp_name1,
wa_name1 TYPE tp_name1.
DATA : t_lfa1 TYPE STANDARD TABLE OF lfa1,
wa_lfa1 TYPE lfa1.
DATA: hold_tabix TYPE sy-tabix.
DATA : t_tlinetab TYPE STANDARD TABLE OF tline,
wa_tlinetab TYPE tline.
DATA: ws_name TYPE thead-tdname,
ws_repid TYPE sy-repid VALUE 'YKTEST'.
DATA : repid TYPE sy-repid.
DATA : total TYPE p DECIMALS 2,
quantity TYPE p DECIMALS 3.
CONSTANTS : ws_id TYPE thead-tdid VALUE 'F01',
ws_object TYPE thead-tdobject VALUE 'EKKO',
lc_view(1) TYPE c VALUE 'F',
lc_form(10) TYPE c VALUE 'YK_FORM'.
*& ALV DECLARATION *
TYPE-POOLS : slis.
DATA: lt_fieldcat TYPE slis_t_fieldcat_alv,
lf_fieldcat TYPE slis_fieldcat_alv.
DATA: lh_index LIKE lf_fieldcat-col_pos.
DATA: l_layout TYPE slis_layout_alv.
DATA : l_sort TYPE slis_t_sortinfo_alv,
w_sort TYPE slis_sortinfo_alv.
*& SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 2.
SELECT-OPTIONS: s_bukrs FOR ekko-bukrs OBLIGATORY.
SELECT-OPTIONS: s_lifnr FOR ekko-lifnr OBLIGATORY.
SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.
PARAMETERS: p_bsart TYPE ekko-bsart.
SELECT-OPTIONS: s_matnr FOR ekpo-matnr.
SELECT-OPTIONS: s_ekorg FOR ekko-ekorg.
SELECT-OPTIONS: s_ekgrp FOR ekko-ekgrp.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN END OF BLOCK a1.
*& START-OF-SELECTION *
START-OF-SELECTION.
FETCHING DATA
PERFORM fetch_data.
BUILD FIELD CATALOG
PERFORM build_fieldcatalog.
BUILD LAYOUT
PERFORM build_layout.
SORT LAYOUT
PERFORM sort_layout.
*& END-OF-SELECTION. *
END-OF-SELECTION.
*DISPLAY GRID
PERFORM display_grid.
*& Form fetch_data *
FORM fetch_data.
IF p_bsart IS INITIAL.
SELECT ekko~bukrs
ekko~lifnr
ekko~ebeln
ekko~waers
ekko~bsart
ekko~ekorg
ekko~ekgrp
ekpo~ebelp
ekpo~txz01
ekpo~matnr
ekpo~werks
ekpo~menge
ekpo~meins
ekpo~netpr
ekpo~netwr
INTO TABLE t_itab1 FROM
ekko INNER JOIN ekpo ON ekkoebeln = ekpoebeln
WHERE ekko~ebeln IN s_ebeln AND
ekko~bukrs IN s_bukrs AND
ekko~lifnr IN s_lifnr AND
ekko~ekorg IN s_ekorg AND
ekko~ekgrp IN s_ekgrp AND
ekpo~matnr IN s_matnr.
ELSE.
SELECT ekko~bukrs
ekko~lifnr
ekko~ebeln
ekko~waers
ekko~bsart
ekko~ekorg
ekko~ekgrp
ekpo~ebelp
ekpo~txz01
ekpo~matnr
ekpo~werks
ekpo~menge
ekpo~meins
ekpo~netpr
ekpo~netwr
INTO TABLE t_itab1 FROM
ekko INNER JOIN ekpo ON ekkoebeln = ekpoebeln
WHERE ekko~ebeln IN s_ebeln AND
ekko~bukrs IN s_bukrs AND
ekko~lifnr IN s_lifnr AND
ekko~ekorg IN s_ekorg AND
ekko~ekgrp IN s_ekgrp AND
ekpo~matnr IN s_matnr AND
ekko~bsart = p_bsart.
ENDIF.
IF NOT t_itab1[] IS INITIAL.
FETCHING NAME1
SELECT werks
name1
FROM t001w
INTO TABLE t_name1
FOR ALL ENTRIES IN t_itab1
WHERE werks = t_itab1-werks.
SORT t_itab1 BY werks.
SORT t_name1 BY werks.
IF sy-subrc = 0.
LOOP AT t_itab1 INTO wa_itab1.
hold_tabix = sy-tabix.
READ TABLE t_name1 INTO wa_name1 WITH KEY werks = wa_itab1-werks
BINARY SEARCH.
IF sy-subrc = 0.
wa_itab1-name1 = wa_name1-name1.
MODIFY t_itab1 INDEX hold_tabix FROM wa_itab1.
ENDIF.
FETCHING HEADER TEXT
MOVE wa_itab1-ebeln TO ws_name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = ws_id
language = sy-langu
name = ws_name
object = ws_object
TABLES
lines = t_tlinetab
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc = 0.
LOOP AT t_tlinetab INTO wa_tlinetab.
wa_itab1-header_text = wa_tlinetab-tdline.
MODIFY t_itab1 FROM wa_itab1.
ENDLOOP.
ENDIF. " IF sy-subrc = 0.
CLEAR : wa_itab1,
hold_tabix,
wa_name1.
ENDLOOP.
ENDIF.
ENDIF. " IF NOT t_itab1[] IS INITIAL.
IF t_itab1[] IS INITIAL.
MESSAGE i000(zg) WITH text-008.
ENDIF.
SORT : t_itab1 BY bukrs lifnr ebeln ebelp.
ENDFORM. " fetch_data
*& Form build_fieldcatalog *
FORM build_fieldcatalog .
COMPANY CODE
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'BUKRS'.
lf_fieldcat-ref_tabname = 'EKKO'.
lf_fieldcat-ref_fieldname = 'BUKRS'.
lf_fieldcat-fix_column = 'X'.
APPEND lf_fieldcat TO lt_fieldcat.
VENDOR
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'LIFNR'.
lf_fieldcat-ref_tabname = 'EKKO'.
lf_fieldcat-ref_fieldname = 'LIFNR'.
lf_fieldcat-fix_column = 'X'.
APPEND lf_fieldcat TO lt_fieldcat.
PURCHASING DOCUMENT NUMBER
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'EBELN'.
lf_fieldcat-ref_tabname = 'EKKO'.
lf_fieldcat-ref_fieldname = 'EBELN'.
lf_fieldcat-key = 'X'.
lf_fieldcat-do_sum = 'X'.
lf_fieldcat-fix_column = 'X'.
APPEND lf_fieldcat TO lt_fieldcat.
ITEM NUMBER OF PURCHASING DOCUMENT
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'EBELP'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'EBELP'.
APPEND lf_fieldcat TO lt_fieldcat.
SHORT TEXT
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'TXZ01'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'TXZ01'.
APPEND lf_fieldcat TO lt_fieldcat.
MATERIAL NUMBER
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'MATNR'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'MATNR'.
APPEND lf_fieldcat TO lt_fieldcat.
PLANT
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'WERKS'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'WERKS'.
APPEND lf_fieldcat TO lt_fieldcat.
NAME
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'NAME1'.
lf_fieldcat-ref_tabname = 'T001W'.
lf_fieldcat-ref_fieldname = 'NAME1'.
APPEND lf_fieldcat TO lt_fieldcat.
PURCHASE ORDER QUANTITY
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'MENGE'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'MENGE'.
lf_fieldcat-do_sum = 'X'.
lf_fieldcat-qfieldname = 'MEINS'.
APPEND lf_fieldcat TO lt_fieldcat.
UNIT
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'MEINS'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'MEINS'.
APPEND lf_fieldcat TO lt_fieldcat.
NET PRICE IN PURCHASING DOCUMENT
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'NETPR'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'NETPR'.
lf_fieldcat-cfieldname = 'WAERS'.
lf_fieldcat-do_sum = 'X'.
APPEND lf_fieldcat TO lt_fieldcat.
NET ORDER VALUE IN PO CURRENCY
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'NETWR'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'NETWR'.
lf_fieldcat-cfieldname = 'WAERS'.
lf_fieldcat-do_sum = 'X'.
APPEND lf_fieldcat TO lt_fieldcat.
CURRENCY
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'WAERS'.
lf_fieldcat-ref_tabname = 'EKKO'.
lf_fieldcat-ref_fieldname = 'WAERS'.
APPEND lf_fieldcat TO lt_fieldcat.
HEADER TEXT
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'HEADER_TEXT'.
lf_fieldcat-seltext_m = 'Header Text'.
APPEND lf_fieldcat TO lt_fieldcat.
ENDFORM. " build_fieldcatalog
*& Form display_grid *
FORM display_grid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = ws_repid
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout = l_layout
it_fieldcat = lt_fieldcat
it_sort = l_sort
i_save = 'X'
IMPORTING
TABLES
t_outtab = t_itab1
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_grid
*& Form build_layout *
FORM build_layout .
l_layout-colwidth_optimize = 'X'.
l_layout-zebra = 'X'.
l_layout-box_fieldname = 'CHK'.
l_layout-box_tabname = 'T_ITAB1' .
ENDFORM. " build_layout
*& Form sort_layout *
FORM sort_layout .
CLEAR w_sort.
w_sort-fieldname = 'BUKRS'.
w_sort-tabname = 'T_ITAB1'.
w_sort-spos = 1.
w_sort-up = 'X'.
w_sort-subtot = 'X'.
APPEND w_sort TO l_sort.
CLEAR w_sort.
w_sort-fieldname = 'EBELN'.
w_sort-tabname = 'T_ITAB1'.
w_sort-spos = 1.
w_sort-up = 'X'.
w_sort-subtot = 'X'.
APPEND w_sort TO l_sort.
ENDFORM. " sort_layout
*& Form PF_STATUS
FORM pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD1' EXCLUDING rt_extab.
ENDFORM. " PF_STATUS
*& Form user_command
FORM user_command USING s_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CLEAR wa_itab1.
READ TABLE t_itab1 INTO wa_itab1 INDEX rs_selfield-tabindex.
CASE s_ucomm.
WHEN 'POD'.
SET PARAMETER ID 'BES' FIELD wa_itab1-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
CLEAR wa_itab1.
WHEN 'MAT'.
SET PARAMETER ID 'MAT' FIELD wa_itab1-matnr.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'MATNR'.
SET PARAMETER ID 'MAT' FIELD wa_itab1-matnr.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ELSEIF rs_selfield-fieldname = 'EBELN'.
SET PARAMETER ID 'BES' FIELD wa_itab1-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
WHEN 'PRINT'.
PERFORM multiple_sel.
PERFORM call_form.
CLEAR : f_itab1, f_itab2.
WHEN 'SMART'.
PERFORM multiple_sel.
PERFORM call_smartform.
ENDCASE.
ENDFORM. "user_command -
How to get total in ALV report in same Internal table?
Data : Begin of it_data,
kunnr type kunnr,
name1 type name1,
amt1 type btrt01, " CURR 15,2
end of it_data.
loop at it_data into wa_data
endloop.
Hello friends,
I am developing one ALV report with 20 rows.
I have filled one internal table with some fileds like amount.
I want to get total of all amount1 in AMT1 field.
So, How to get total of amount in same internal table in ALV report ?
It is ok if i get duplicate rows in internal table.
Points 'll be awarded soon.
Regards,
NVMHi Ronny,
the alv output will display the sum at the last row.
for this functionality u have do this logic.
data: lw_fcat type slis_fieldcat_alv.
data: lt_fcat type slis_t_fieldcat_alv/
wa_fcat-fieldname = 'AMT1'.
wa_fcat-tabname = 'ITAB'.
wa_fcat-do_sum = 'X'.
append wa_fcat to lt_fcat.
and then pass it to reuse_alv_grid_display function,
regards,
Santosh Thorat -
How to display logo in alv grid display
Hi, i am using 'REUSE_ALV_COMMENTARY_WRITE' to display logo. but i couldn't get in the output.
plain explain how use this functoin module.
DATA : it_listheader TYPE slis_t_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader
i_logo = 'LOGO'.hi
i am doing month wise customer sale report.
the output should like that
month customer1 customer2 customer3 customer 4 total
jan 100 200 200 - 500
feb 300 300
mar
apr
total 100 200 500 800
i want to do this dynamicaly.
let me know how can i display customer as a header. -
How to display LOGO in ALV grid when using class CL_GUI_ALV_GRID
Hello everyone,
please let me know how to display Company logo as the header part in the report program with the class cl_gui_alv_grid.
Thanks and regards,
Padma.Hi,
Got this info from a site.
http://sap.ittoolbox.com/documents/document.asp?i=3213
In the transaction OAOR, you should be able to insert your company Logo.
GOTO - OAOR (Business Document Navigator)
Give Class Name - PICTURES Class Type - OT..... then Execute
It will show you the list, then select ENJOYSAP_LOGO.
On that list, you will find one control with a "create" tab.
Click std. doc types.
Select SCREEN and double-click.
It will push FILE selection screen.
Select your company logo (.gif) and press OK.
It will ask for a description- for instance: "company logo".
It will let you know your doc has been stored successfully.
You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
Try this one.
Also have a look at this link
http://www.sap-img.com/fu002.htm
Message was edited by: Judith Jessie Selvi -
How to display total in a block without total showing up in relevant detail block
Hi there,
I create a worksheet, including two block, one of which have detail information with multiple characts and one key figure, another block only have sumerization information takes one cell, which is summarized key figure for that detail information block.
I implement this summary cell with formula 'GETDATA', but it is only effective after I show total for detail block.
such as for detail block:
employee_no, wage type, earning_amount.
overall result total for earning_amount
for summary block:
summary of earning_amount for all employees in the detail block.
please tell me how to display summary block without pulling in overall result for detail block.
Many Thanks,Hi bo zhang,
This can be a work around
As Michael Tocik suggested
goto components tab, right click on data source and select copy
do not insert cross tab
then use the formula for DS_2 like
=SAPGetData("DS_2","earning_amount","employee_no=TOTAL")
this should work.
and if you do any drill down for DS_1, the above total will not chnage because that is dependent on DS_2
Hope it helps
Best Regards,
Subhash -
How to display total for a column in updateble report
How can I display total on a report column?
the query is
select htmldb_item.checkbox(1,invoice_id) invoice_id,
htmldb_item.DISPLAY_AND_SAVE(2,invoice_no,15)invoice_no,
htmldb_item.DISPLAY_AND_SAVE(3,to_char(invoice_date, 'DD-MON-YYYY'),20) invoice_date,
htmldb_item.DISPLAY_AND_SAVE(4,net_amount,15) NET_AMOUNT,
htmldb_item.text(5,net_amount,null,10) amount_adj,
htmldb_item.text(6,net_amount,null,10) actual_amt
from INVOICE
where OWNER_TYPE = 'CUSTOMER'
and OWNER_ID = :P57_CUSTOMER_NAME
group by invoice_id,invoice_no, invoice_date,net_amount
In the report column attributes the sum column is checked for the sal field
When I run the report, I get a Sub-total of 0 and a Report Total of 0. What am I doing wrong?
thanksSunil,
Which column is the sal column? I canât see any numeric columns in your query. If you use htmldb_item calls in your query column, then this makes them strings and you canât build sums on string columns. If you want to build sums in an updateable report / tabular form, then donât use the htmldb_item API. Instead use the built-in display types on the report column attributes page. Using the built-in display types is the better options in most cases anyway and they do allow you to calculate sums even if the column is a text field or display and save type field.
Regards,
Marc -
How to display field value in header text?
Hi Experts,
In va03, the client wants some number in the header text which is stored in vbak. Please tell me:
1. Which method should I use in BADI?
2. How to display in header text?
Regards
ManiHi Kiran,
Thanks for the prompt reply. How can I display some hard code like 'Test' in the header text in va03.
Text name = 0000001252
Language = EN
Text ID = Z001
Text object = VBBK
READ_TEXT is used to get the values from the header text, but how to set the values?
Regards
Mani -
How to display an OO ALV in a Popup?
The ALV will be non-editable but it has to be able to have the hotspot functionality, so it has to be done in OO. Is there any function module that will display my OO alv as a popup?
* Show as popup
CALL METHOD gr_grid->set_screen_popup( EXPORTING start_column = 10
end_column = 130
start_line = 5
end_line = 15 ).
* Define a column as hotspot
DATA:
lr_columns TYPE REF TO cl_salv_columns_table,
lr_column TYPE REF TO cl_salv_column,
lr_cols TYPE REF TO cl_salv_columns,
lr_column_list TYPE REF TO cl_salv_column_list.
lr_cols = lr_columns.
lr_columns = gr_grid->get_columns( ).
lr_column_list ?= lr_cols->get_column( 'MYCOLUMN' ).
lr_column_list->set_cell_type( if_salv_c_cell_type=>hotspot ). -
How to set alignment of ALV heading.
Hi Experts,
In a ALV report I have created a Heading I want this heading to be displayed in the centre How to do this.
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader.
/// I want this heading to be in centered/////
Heading 'Relicance Energy Limited
wa_header-typ = 'H'.
wa_header-info = text-001.
APPEND wa_header TO t_header.
CLEAR wa_header.
IF p_bp_ty = 1.
Premium value customer
wa_header-typ = 'S'.
wa_header-info = text-002.
APPEND wa_header TO t_header.
CLEAR wa_header.
ENDIF.
IF p_bp_ty = 2.
High value customer
wa_header-typ = 'S'.
wa_header-info = text-003.
APPEND wa_header TO t_header.
CLEAR wa_header.
ENDIF.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header
i_logo = 'RELMR'.
Fast response will be highly rewarded
Regards
BikasCheck this Blog,
This is using the LVC Function module.
/people/community.user/blog/2007/01/10/displaychange-mode-of-editable-fields-in-alv-using-function-modules-but-not-custom-containers -
How to display subtotal in ALV, where the field is not a numeric.
Hi
We are having a requirement to display the sub total for a field using ALV grid display, where the field is not numeric.
The field is characte, Status field(consists of values Submit, Approve ,Reject), where the subtotal should be value of count of group by status .
say status with submit are 10 records, so after all records with submit status are, displyed, we need to display its subtotal as 10.
Thanks & AdvanceHi Satya,
REPORT z_alv_subtotal.*&---------------------------------------------------------------------*
*& Table declaration
*&---------------------------------------------------------------------*TABLES: ekko.*&---------------------------------------------------------------------*
*& Type pool declaration
TYPE-POOLS: slis. " Type pool for ALV*&---------------------------------------------------------------------*
*& Selection screen
SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.*&---------------------------------------------------------------------*
*& Type declaration
*&---------------------------------------------------------------------** Type declaration for internal table to store EKPO data
TYPES: BEGIN OF x_data,
ebeln TYPE char30, " Document no.
ebelp TYPE ebelp, " Item no
matnr TYPE matnr, " Material no
matnr1 TYPE matnr, " Material no
werks TYPE werks_d, " Plant
werks1 TYPE werks_d, " Plant
ntgew TYPE entge, " Net weight
gewe TYPE egewe, " Unit of weight
END OF x_data.*&---------------------------------------------------------------------*
*& Internal table declaration
DATA:* Internal table to store EKPO data
i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
* Internal table for storing field catalog information
i_fieldcat TYPE slis_t_fieldcat_alv,
* Internal table for Top of Page info. in ALV Display
i_alv_top_of_page TYPE slis_t_listheader,
* Internal table for ALV Display events
i_events TYPE slis_t_event,
* Internal table for storing ALV sort information
i_sort TYPE slis_t_sortinfo_alv,
i_event TYPE slis_t_event.*&---------------------------------------------------------------------*
*& Work area declaration
*&---------------------------------------------------------------------*DATA:
wa_ekko TYPE x_data,
wa_layout TYPE slis_layout_alv,
wa_events TYPE slis_alv_event,
wa_sort TYPE slis_sortinfo_alv.*&---------------------------------------------------------------------*
*& Constant declaration
*&---------------------------------------------------------------------*CONSTANTS:
c_header TYPE char1
VALUE 'H', "Header in ALV
c_item TYPE char1
VALUE 'S'.*&---------------------------------------------------------------------*
*& Start-of-selection event
*&---------------------------------------------------------------------*START-OF-SELECTION.* Select data from ekpo
SELECT ebeln " Doc no
ebelp " Item
matnr " Material
matnr " Material
werks " Plant
werks " Plant
ntgew " Quantity
gewei " Unit
FROM ekpo
INTO TABLE i_ekpo
WHERE ebeln IN s_ebeln
AND ntgew NE '0.00'. IF sy-subrc = 0.
SORT i_ekpo BY ebeln ebelp matnr .
ENDIF.* To build the Page header
PERFORM sub_build_header.* To prepare field catalog
PERFORM sub_field_catalog.* Perform to populate the layout structure
PERFORM sub_populate_layout.* Perform to populate the sort table.
PERFORM sub_populate_sort.* Perform to populate ALV event
PERFORM sub_get_event.END-OF-SELECTION.* Perform to display ALV report
PERFORM sub_alv_report_display.
*& Form sub_build_header
* To build the header
* No Parameter
FORM sub_build_header .* Local data declaration
DATA: l_system TYPE char10 , "System id
l_r_line TYPE slis_listheader, "Hold list header
l_date TYPE char10, "Date
l_time TYPE char10, "Time
l_success_records TYPE i, "No of success records
l_title(300) TYPE c. " Title
* Title Display
l_r_line-typ = c_header. " header
l_title = 'Test report'(001).
l_r_line-info = l_title.
APPEND l_r_line TO i_alv_top_of_page.
CLEAR l_r_line.* Run date Display
CLEAR l_date.
l_r_line-typ = c_item. " Item
WRITE: sy-datum TO l_date MM/DD/YYYY.
l_r_line-key = 'Run Date :'(002).
l_r_line-info = l_date.
APPEND l_r_line TO i_alv_top_of_page.
CLEAR: l_r_line,
l_date.ENDFORM. " sub_build_header
*& Form sub_field_catalog
* Build Field Catalog
* No Parameter
FORM sub_field_catalog .* Build Field Catalog
PERFORM sub_fill_alv_field_catalog USING: '01' '01' 'EBELN' 'I_EKPO' 'L'
'Doc No'(003) ' ' ' ' ' ' ' ', '01' '02' 'EBELP' 'I_EKPO' 'L'
'Item No'(004) 'X' 'X' ' ' ' ', '01' '03' 'MATNR' 'I_EKPO' 'L'
'Material No'(005) 'X' 'X' ' ' ' ', '01' '03' 'MATNR1' 'I_EKPO' 'L'
'Material No'(005) ' ' ' ' ' ' ' ',
'01' '04' 'WERKS' 'I_EKPO' 'L'
'Plant'(006) 'X' 'X' ' ' ' ', '01' '04' 'WERKS1' 'I_EKPO' 'L'
'Plant'(006) ' ' ' ' ' ' ' ', '01' '05' 'NTGEW' 'I_EKPO' 'R'
'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.ENDFORM. " sub_field_catalog*&---------------------------------------------------------------------*
*& Form sub_fill_alv_field_catalog
*& For building Field Catalog
*& p_rowpos Row position
*& p_colpos Col position
*& p_fldnam Fldname
*& p_tabnam Tabname
*& p_justif Justification
*& p_seltext Seltext
*& p_out no out
*& p_tech Technical field
*& p_qfield Quantity field
*& p_qtab Quantity table
FORM sub_fill_alv_field_catalog USING p_rowpos TYPE sycurow
p_colpos TYPE sycucol
p_fldnam TYPE fieldname
p_tabnam TYPE tabname
p_justif TYPE char1
p_seltext TYPE dd03p-scrtext_l
p_out TYPE char1
p_tech TYPE char1
p_qfield TYPE slis_fieldname
p_qtab TYPE slis_tabname.* Local declaration for field catalog
DATA: wa_lfl_fcat TYPE slis_fieldcat_alv. wa_lfl_fcat-row_pos = p_rowpos. "Row
wa_lfl_fcat-col_pos = p_colpos. "Column
wa_lfl_fcat-fieldname = p_fldnam. "Field Name
wa_lfl_fcat-tabname = p_tabnam. "Internal Table Name
wa_lfl_fcat-just = p_justif. "Screen Justified
wa_lfl_fcat-seltext_l = p_seltext. "Field Text
wa_lfl_fcat-no_out = p_out. "No output
wa_lfl_fcat-tech = p_tech. "Technical field
wa_lfl_fcat-qfieldname = p_qfield. "Quantity unit
wa_lfl_fcat-qtabname = p_qtab . "Quantity table IF p_fldnam = 'NTGEW'.
wa_lfl_fcat-do_sum = 'X'.
ENDIF.
APPEND wa_lfl_fcat TO i_fieldcat.
CLEAR wa_lfl_fcat.
ENDFORM. " sub_fill_alv_field_catalog*&---------------------------------------------------------------------*
*& Form sub_populate_layout
* Populate ALV layout
* No Parameter
FORM sub_populate_layout . CLEAR wa_layout.
wa_layout-colwidth_optimize = 'X'." Optimization of Col widthENDFORM. " sub_populate_layout*&---------------------------------------------------------------------*
*& Form sub_populate_sort
* Populate ALV sort table
* No Parameter
FORM sub_populate_sort .* Sort on material
wa_sort-spos = '01' .
wa_sort-fieldname = 'MATNR'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.* Sort on plant
wa_sort-spos = '02'.
wa_sort-fieldname = 'WERKS'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.
ENDFORM. " sub_populate_sort*&---------------------------------------------------------------------*
*& Form sub_get_event
* Get ALV grid event and pass the form name to subtotal_text
* event
* No Parameter
FORM sub_get_event .
CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
'SUBTOTAL_TEXT'. DATA: l_s_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 4
IMPORTING
et_events = i_event
EXCEPTIONS
list_type_wrong = 0
OTHERS = 0.* Subtotal
READ TABLE i_event INTO l_s_event
WITH KEY name = slis_ev_subtotal_text.
IF sy-subrc = 0.
MOVE c_formname_subtotal_text TO l_s_event-form.
MODIFY i_event FROM l_s_event INDEX sy-tabix.
ENDIF.ENDFORM. " sub_get_event*&---------------------------------------------------------------------*
*& Form sub_alv_report_display
* For ALV Report Display
* No Parameter
FORM sub_alv_report_display .
DATA: l_repid TYPE syrepid .
l_repid = sy-repid .* This function module for displaying the ALV report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_top_of_page = 'SUB_ALV_TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = i_fieldcat
it_sort = i_sort
it_events = i_event
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = i_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE i000 WITH 'Error in ALV report display'(055).
ENDIF.ENDFORM. " sub_alv_report_display*&---------------------------------------------------------------------*
* FORM sub_alv_top_of_page
* Call ALV top of page
* No parameter
*---------------------------------------------------------------------*FORM sub_alv_top_of_page. "#EC CALLED* To write header for the ALV
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_alv_top_of_page.
ENDFORM. "alv_top_of_page*&---------------------------------------------------------------------*
*& Form subtotal_text
* Build subtotal text
* P_total Total
* p_subtot_text Subtotal text info
FORM subtotal_text CHANGING
p_total TYPE any
p_subtot_text TYPE slis_subtot_text.
* Material level sub total
IF p_subtot_text-criteria = 'MATNR'.
p_subtot_text-display_text_for_subtotal
= 'Material level total'(009).
ENDIF.* Plant level sub total
IF p_subtot_text-criteria = 'WERKS'.
p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
ENDIF.
ENDFORM. "subtotal_text
Regards,
Pravin -
How to sub-total in alv?
Hi,
I have an alv layout like following:
ZZZ 300100089 1050
ZZZ 300100089 1050
subtoal 2100
90256243 300100000 193410
90256242 300100000 173250
90256241 300100000 173250
90256240 300100000 173250
90256239 300100000 173250
90256238 300100000 173250
90256237 300100000 173250
subtotal 1232910
when the second numbers are the same,
I need to sum up as
300100089 2100
300100000 1232910
I write the coding as the following, but it did not work, Please
help and correct it!!
the coding:
data: it_sortcat type slis_sortinfo_alv occurs 1,
wa_sort like line of it_sortcat.
sort gt_outalv.
wa_sort-fieldname = 'wrbtr'.
wa_sort-SUBTOT = 'X'.
APPEND wa_sort TO it_sortcat.
In FM
it_sort = it_sortcat
I got dump and it did not work .
Please correct my coding !!
Thank you in advance,Check the Below Example program
the code below produces alv display with 2 columns: field1 & field2.
field1 is character based & the int. table passed to the alv is sorted on this field.
field2 is numeric, whose subtotals are desired.
so while populating the gt_sort table the option gs_sort-subtot is set for field1 bcoz the subtotals are to be based on the groups existing in this column.whereas the same option is NOT set for field2, even though the subtotal appears in that column.i have marked these 2 statements in the code for your convenience.
execute the code below & you will surely understand what i said above.
bye!!
report zalv10.
type-pools: slis.
data: g_repid like sy-repid,
gs_print type slis_print_alv,
gt_list_top_of_page type slis_t_listheader,
gt_events type slis_t_event,
gt_sort type slis_t_sortinfo_alv,
gs_layout type slis_layout_alv,
gt_fieldcat type slis_t_fieldcat_alv,
fieldcat_ln like line of gt_fieldcat,
col_pos type i.
data: begin of itab,
field1(5) type c,
field2(5) type c,
field3(5) type p decimals 2,
end of itab.
data: begin of itab1 occurs 0.
include structure itab.
data: end of itab1.
data: begin of itab_fieldcat occurs 0.
include structure itab.
data: end of itab_fieldcat.
Print Parameters
parameters:
p_print as checkbox default ' ', "PRINT IMMEDIATE
p_nosinf as checkbox default 'X', "NO SELECTION INFO
p_nocove as checkbox default ' ', "NO COVER PAGE
p_nonewp as checkbox default ' ', "NO NEW PAGE
p_nolinf as checkbox default 'X', "NO PRINT LIST INFO
p_reserv type i. "NO OF FOOTER LINE
initialization.
g_repid = sy-repid.
perform print_build using gs_print. "Print PARAMETERS
start-of-selection.
TEST DATA
move 'TEST1' to itab1-field1.
move 'TEST1' to itab1-field2.
move '10.00' to itab1-field3.
append itab1.
move 'TEST2' to itab1-field1.
move 'TEST2' to itab1-field2.
move '20.00' to itab1-field3.
append itab1.
do 50 times.
append itab1.
enddo.
end-of-selection.
perform build.
perform eventtab_build changing gt_events.
perform comment_build changing gt_list_top_of_page.
perform call_alv.
form build.
DATA FIELD CATALOG
Explain Field Description to ALV
data: fieldcat_in type slis_fieldcat_alv.
clear fieldcat_in.
fieldcat_ln-fieldname = 'FIELD1'.
fieldcat_ln-tabname = 'ITAB1'.
*FIELDCAT_LN-NO_OUT = 'X'. "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
fieldcat_ln-key = ' '. "SUBTOTAL KEY
fieldcat_ln-no_out = ' '.
fieldcat_ln-seltext_l = 'HEAD1'.
append fieldcat_ln to gt_fieldcat.
clear fieldcat_in.
fieldcat_ln-fieldname = 'FIELD2'.
fieldcat_ln-tabname = 'ITAB1'.
fieldcat_ln-no_out = 'X'.
fieldcat_ln-seltext_l = 'HEAD2'.
append fieldcat_ln to gt_fieldcat.
clear fieldcat_in.
fieldcat_ln-fieldname = 'FIELD3'.
fieldcat_ln-tabname = 'ITAB1'.
fieldcat_ln-ref_fieldname = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
fieldcat_ln-ref_tabname = 'MSEG'. "<- REF TABLE IN THE DICTIONNARY
fieldcat_ln-no_out = ' '.
fieldcat_ln-do_sum = 'X'. "SUM UPON DISPLAY
append fieldcat_ln to gt_fieldcat.
DATA SORTING AND SUBTOTAL*
data: gs_sort type slis_sortinfo_alv.
*clear gs_sort.*
*gs_sort-fieldname = 'FIELD1'.*
*gs_sort-spos = 1.*
*gs_sort-up = 'X'.*
**gs_sort-subtot = 'X'. ***CRUCIAL STATEMENT******
*append gs_sort to gt_sort.*
clear gs_sort.
gs_sort-fieldname = 'FIELD2'.
gs_sort-spos = 2.
gs_sort-up = 'X'.
**GS_SORT-SUBTOT = 'X'. **THIS SHOULD NOT BE UNCOMENTED**
append gs_sort to gt_sort. endform.
form call_alv.
ABAP List Viewer
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = g_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
i_structure_name = 'ITAB1'
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = gt_sort[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = gt_events[]
IT_EVENT_EXIT =
is_print = gs_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 = itab1
exceptions
program_error = 1
others = 2.
endform.
HEADER FORM
form eventtab_build changing lt_events type slis_t_event.
constants:
gc_formname_top_of_page type slis_formname value 'TOP_OF_PAGE'.
*GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = lt_events.
read table lt_events with key name = slis_ev_top_of_page
into ls_event.
if sy-subrc = 0.
move gc_formname_top_of_page to ls_event-form.
append ls_event to lt_events.
endif.
define END_OF_PAGE event
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
endform.
form comment_build changing gt_top_of_page type slis_t_listheader.
data: gs_line type slis_listheader.
clear gs_line.
gs_line-typ = 'H'.
gs_line-info = 'HEADER 1'.
append gs_line to gt_top_of_page.
clear gs_line.
gs_line-typ = 'S'.
gs_line-key = 'STATUS 1'.
gs_line-info = 'INFO 1'.
append gs_line to gt_top_of_page.
gs_line-key = 'STATUS 2'.
gs_line-info = 'INFO 2'.
append gs_line to gt_top_of_page.
CLEAR GS_LINE.
GS_LINE-TYP = 'A'.
GS_LINE-INFO = 'ACTION'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
endform.
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = gt_list_top_of_page.
write: sy-datum, 'Page No', sy-pagno left-justified.
endform.
form end_of_page.
write at (sy-linsz) sy-pagno centered.
endform.
PRINT SETTINGS
form print_build using ls_print type slis_print_alv.
ls_print-print = p_print. "PRINT IMMEDIATE
ls_print-no_print_selinfos = p_nosinf. "NO SELECTION INFO
ls_print-no_coverpage = p_nocove. "NO COVER PAGE
ls_print-no_new_page = p_nonewp.
ls_print-no_print_listinfos = p_nolinf. "NO PRINT LIST INFO
ls_print-reserve_lines = p_reserv.
endform.
Kanagaraja L
Maybe you are looking for
-
Function Module Interface for Agent Determination Rule without Tables Param
Hi, I'm currently trying to create an agent determination rule using a custom function module. I know that the function module must have a certain interface consisting of two table parameters to be accepted by the system. But since table parameters a
-
How do I get iPhone to sync with iPhoto immediately without plugging in?
I'm running latest versions of IOS and OSX on iPhone 5 and Macbook. I plug both phone and mac into power supply, open iPhoto and wait. Sometimes it will sync. More often not. I really want this to work over WiFi and not have to plug in.
-
Change the User ID running the SunOne Directory Server 6.3 on Windows 2003
Hi Experts, I have an install of SunOne Directory Server Enterprise edition 6.3 running on Windows 2003 server. It was installed using the Zip distribution and is running as a user ID in the Active Directory the server is part of. We are trying to ch
-
I have an iPod touch 3rd gen. with 32gb. Can I update it to iOS 6??
-
Has anyone had problems with their macbook deleting/removing groups of files at random? I have a 2006 macbook and I know that at least two different folders containing important files are gone from my hard drive.