Chnaging the count of doucments on filtering
Hi I have this report which I have created which also gives the count of distinct documnets at the top-of page, on filtering that number dosent and wont change as that comes from the internal table , I need to show the count of actual number of documents in teh output after the filetring is done alos which will change as per the filtering is done . Is it possible to show a column or somewhere in teh out like the actual document number on top somewhere which will refrlet the actual number of documents in teh output after filter is done based on any of teh selection.
REPORT zztest MESSAGE-ID zsd NO STANDARD PAGE HEADING.
* For ALV usage
TYPE-POOLS: slis.
DATA: gs_layout TYPE slis_layout_alv,
tp_print TYPE slis_print_alv,
gt_sort TYPE slis_t_sortinfo_alv,
gt_events TYPE slis_t_event,
t_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
repid TYPE syrepid, " ABAP Program.
gt_list_top_of_page TYPE slis_t_listheader, " Top of page text.
gs_list_top_of_page type slis_listheader,
alv_variant TYPE disvariant. " Customize Disp. Variant
DATA: w_field TYPE slis_fieldcat_alv.
DATA: count type i.
DATA: count1 type i.
TABLES: vbak, vbap, vbpa, knvv.
* Definition of selection screen *
* By plant, storage location, sold-to customers, material and *
* posting date of the sales orders *
SELECTION-SCREEN BEGIN OF BLOCK one WITH FRAME TITLE text-001.
PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY MEMORY ID VKO,"DEVK906677
p_vtweg TYPE vtweg OBLIGATORY DEFAULT '01',
p_spart TYPE spart OBLIGATORY DEFAULT '01'.
SELECT-OPTIONS: s_vkbur for vbak-vkbur, " Sales Office "DEVK906677
s_kunnr FOR vbak-kunnr. " Sold-to customer number.
SELECT-OPTIONS: s_shipto FOR vbap-oid_ship, " Ship-to customer number.
s_billto FOR vbpa-kunnr, " bill-to from S.O. header.
s_load FOR vbpa-kunnr, " Load confirmation contact.
s_truck FOR vbap-oid_extbol. " Trucking ticket number.
SELECT-OPTIONS: s_werks FOR vbap-werks OBLIGATORY NO INTERVALS. " Plant.
SELECT-OPTIONS: s_lgort FOR vbap-lgort. " Storage location.
SELECT-OPTIONS: s_matnr FOR vbap-matnr. " Material number.
SELECT-OPTIONS: s_konda FOR knvv-konda. " price group
SELECTION-SCREEN SKIP 1.
SELECT-OPTIONS: s_vdatu FOR vbak-vdatu DEFAULT sy-datum.
SELECTION-SCREEN END OF BLOCK one.
* ALV display layout
SELECTION-SCREEN BEGIN OF BLOCK layout WITH FRAME TITLE text-003.
PARAMETERS: pa_vari TYPE slis_vari DEFAULT ' '. " Display variant.
SELECTION-SCREEN END OF BLOCK layout.
SELECTION-SCREEN BEGIN OF BLOCK two WITH FRAME TITLE text-028.
selection-screen comment: /1(79) text-029.
selection-screen comment: /1(79) text-030.
selection-screen comment: /1(79) text-031.
selection-screen comment: /1(79) text-032.
selection-screen comment: /1(79) text-033.
selection-screen comment: /1(79) text-034.
selection-screen comment: /1(79) text-035.
selection-screen comment: /1(79) text-036.
SELECTION-SCREEN END OF BLOCK two.
* Data Definitions *
* Storing Extracted Info.
TYPES: BEGIN OF t_extract,
vbeln TYPE vbeln_va, " Sales order number.
augru TYPE augru, " order reason
vdatu TYPE edatu_vbak, " Requested delivery date.
kunnr TYPE kunag, " Sold-to customer number.
soldto_name TYPE name1_gp, " Sold-to name.
posnr TYPE posnr_va, " Item number.
matnr TYPE matnr, " Material number.
vrkme TYPE vrkme, " Sales UoM.
mseh3 TYPE mseh3, " UoM text.
netwr TYPE netwr_ap, " Net value of the order item.
kwmeng TYPE p LENGTH 13 DECIMALS 1, " Quantity.
werks TYPE werks_d, " Plant.
lgort TYPE lgort_d, " Storage location.
oid_extbol TYPE oid_extbol, " External BOL or truck ticker header.
maktx TYPE maktx, " Material description.
oid_ship TYPE kunwe, " Ship-to customer number.
shipto_name TYPE name1_gp, " Ship-to name.
billto TYPE kunre, " Bill-to customer number.
billto_name TYPE name1_gp, " Bill-to name.
load_contact TYPE kunnr, " Load confirmation contact.
load_name TYPE name1_gp, " Load confirmation contact name.
truck TYPE kunnr, " Truck company number.
truck_name TYPE name1_gp, " Truck company name.
bstkd TYPE bstkd, " PO number.
ihrez TYPE ihrez, " AFE number per the contract/sales order.
delivery TYPE vbeln_vl, " Delivery number.
posnr_vl TYPE posnr_vl, " Delivery item number.
bill_vbeln TYPE vbeln_vf, " Invoice number.
bill_posnr TYPE posnr_vf, " Invoice item number.
bill_netwr TYPE netwr_fp, " Invoice net value.
statu TYPE stats, " Document status.
auart TYPE auart, " order type
vkorg TYPE vkorg, " sales org.
vtweg TYPE vtweg, " distrbtn channel
spart TYPE spart, " division
vkbur like vbak-vkbur, " Sales Office DEVK906677
konda TYPE konda, " price group
tdline TYPE tdline, " text for customer account reference
count TYPE I,
END OF t_extract.
DATA : it_extract TYPE TABLE OF t_extract WITH HEADER LINE,
it_extract2 TYPE TABLE OF t_extract WITH HEADER LINE.
DATA: it_text TYPE TABLE OF tline WITH HEADER LINE.
DATA: w_index type sy-index,
w_tdname type TDOBNAME.
CONSTANTS: c_minus1 type netwr_ap value '1.00-'.
*RANGES: r_auart FOR vbak-auart.
Data: r_auart TYPE range of t_extract-auart,
r_auart_line like line of r_auart.
* initialization
INITIALIZATION.
gs_layout-colwidth_optimize = 'X'.
tp_print-no_print_listinfos = 'X'.
tp_print-no_coverpage = 'X'.
PERFORM set_fieldcat.
PERFORM alv_eventtab_build USING:
** Event name Form to execute Event internal table
'TOP_OF_PAGE' 'TOP_OF_PAGE' gt_events[].
* changed to exclude following order types
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZEQ'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* credit memo
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZPRC'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* debit memo
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZPRD'.
clear r_auart_line-high.
append r_auart_line to r_auart.
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZDR'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* Industry sales order correction
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZSOC'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* oilfield FF correction
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZOCF'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* oilfield WP correction
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZOCW'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* Dropdown list for all created ALV layouts, global or user-specific
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_vari.
PERFORM alv_variant_f4 CHANGING pa_vari.
* Main BODY of processing logic
START-OF-SELECTION.
PERFORM extract_data.
END-OF-SELECTION.
IF NOT it_extract[] IS INITIAL.
* Build headings for report.
PERFORM build_top_of_page USING gt_list_top_of_page[].
PERFORM call_alv.
ENDIF.
*& Form EXTRACT_KEY_DATA
* Retreive the data for the report.
FORM extract_data.
CLEAR: it_extract. REFRESH: it_extract.
* orders
SELECT vbak~vbeln vbak~auart vbak~augru vbak~vkorg vbak~vtweg
vbak~spart vbak~vdatu vbak~kunnr vbak~vkbur
vbap~posnr vbap~matnr vbap~vrkme vbap~netwr vbap~kwmeng
vbap~werks vbap~lgort vbap~oid_extbol vbap~oid_ship
INTO CORRESPONDING FIELDS OF TABLE it_extract
FROM vbak INNER JOIN vbap
ON vbak~mandt = vbap~mandt
AND vbak~vbeln = vbap~vbeln WHERE
vbak~auart NOT IN r_auart AND
vbak~vkorg EQ p_vkorg AND
vbak~vtweg EQ p_vtweg AND
vbak~spart EQ p_spart AND
vbak~vkbur in s_vkbur and "DEVK906677
vbak~vdatu IN s_vdatu AND
vbak~kunnr IN s_kunnr AND
vbap~matnr IN s_matnr AND
vbap~werks IN s_werks AND
vbap~lgort IN s_lgort AND
vbap~oid_extbol IN s_truck AND
vbap~oid_ship IN s_shipto.
IF sy-subrc <> 0.
MESSAGE i000 WITH text-002 ' ' ' ' ' '.
ENDIF.
SORT it_extract BY vbeln.
CHECK sy-subrc = 0.
LOOP AT it_extract.
* Retrieve and select by load confirmation contacts from header
SELECT SINGLE kunnr FROM vbpa INTO it_extract-load_contact
WHERE vbeln = it_extract-vbeln
AND posnr = '000000'
AND parvw = 'ZB'.
IF it_extract-load_contact IN s_load.
it_extract-load_name = zcl_kna1=>get_name1( it_extract-load_contact ).
ELSE.
DELETE it_extract.
CONTINUE.
ENDIF.
* Retrieve and select by sales order bill-to on header level
* as well as lookup bill-to customer name/description
SELECT SINGLE kunnr FROM vbpa INTO it_extract-billto
WHERE vbeln = it_extract-vbeln
AND posnr = '000000'
AND parvw = 'RE'.
IF sy-subrc = 0.
if s_billto is initial.
it_extract-billto_name = zcl_kna1=>get_name1( it_extract-billto ).
else.
if it_extract-billto in s_billto.
it_extract-billto_name = zcl_kna1=>get_name1( it_extract-billto ).
else.
DELETE it_extract.
CONTINUE.
endif.
endif.
ELSE.
* Newalta - always has bill-to, following will not occur but included
* as good programming practice.
it_extract-billto_name = it_extract-billto.
ENDIF.
* Retrieve and select by price group of sold-to
SELECT SINGLE konda FROM knvv INTO it_extract-konda
WHERE kunnr = it_extract-kunnr
AND vkorg = it_extract-vkorg
AND vtweg = it_extract-vtweg
AND spart = it_extract-spart.
IF sy-subrc = 0.
IF NOT ( it_extract-konda IN s_konda ).
DELETE it_extract.
CONTINUE.
ENDIF.
ENDIF.
* Retrieve trucking company customer
SELECT SINGLE kunnr FROM vbpa INTO it_extract-truck WHERE
vbeln = it_extract-vbeln AND
posnr = '000000' AND
parvw = 'ZT'.
IF sy-subrc = 0.
it_extract-truck_name = zcl_kna1=>get_name1( it_extract-truck ).
ENDIF.
* Retrieve sold-to name
it_extract-soldto_name = zcl_kna1=>get_name1( it_extract-kunnr ).
* Retrieve ship-to name
it_extract-shipto_name = zcl_kna1=>get_name1( it_extract-oid_ship ).
* lookup P.O.
SELECT SINGLE bstkd ihrez FROM vbkd INTO (it_extract-bstkd, it_extract-ihrez)
WHERE vbeln = it_extract-vbeln
AND posnr = '000000'.
* Retreive the material description.
it_extract-maktx = zcl_material=>get_maktx( it_extract-matnr ).
* cosmetic change of material number, donot display leading zeros.
SHIFT it_extract-matnr LEFT DELETING LEADING '0'.
* translate unit of measure
it_extract-mseh3 = it_extract-vrkme.
SELECT SINGLE mseh3 FROM t006a INTO it_extract-mseh3
WHERE spras = sy-langu
AND msehi = it_extract-vrkme.
w_tdname = it_extract-vbeln.
* read customer account reference which is under 'text'
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'Z010'
LANGUAGE = sy-langu
NAME = w_tdname
OBJECT = 'VBBK'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
TABLES
LINES = it_text
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.
read table it_text index 1.
if sy-subrc = 0.
it_extract-tdline = it_text-tdline.
else.
clear it_extract-tdline.
endif.
ELSE.
clear it_extract-tdline.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Get the delivery item.
CALL METHOD zcl_vbap=>get_delivery
EXPORTING
itp_vbeln = it_extract-vbeln
itp_posnr = it_extract-posnr
IMPORTING
etp_vbeln = it_extract-delivery
etp_posnr = it_extract-posnr_vl.
IF it_extract-delivery IS NOT INITIAL.
PERFORM process_deliveries.
ELSE.
PERFORM invoice_process.
ENDIF.
it_extract-count = 1 .
MOVE-CORRESPONDING it_extract TO it_extract2.
APPEND it_extract2.
AT NEW vbeln.
count1 = count1 + 1.
ENDAT.
CALL FUNCTION 'REUSE_ALV_EVENT_NAMES_GET'
* EXPORTING
* I_LIST_TYPE = 0
TABLES
T_EVENT_NAMES = it_extract2
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.
ENDLOOP.
ENDFORM. " EXTRACT_DATA
*& Form SET_FIELDCAT
* Create the field catalogue.
FORM set_fieldcat .
CLEAR w_field.
CLEAR t_fieldcat. REFRESH t_fieldcat.
w_field-col_pos = 1 .
w_field-fieldname = 'VBELN'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Document.Nbr'.
w_field-emphasize = 'X'.
w_field-hotspot = 'X'.
APPEND w_field TO t_fieldcat.
CLEAR w_field.
w_field-col_pos = 2 .
w_field-fieldname = 'POSNR'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Item'(023).
APPEND w_field TO t_fieldcat.
CLEAR w_field.
w_field-col_pos = 3 .
w_field-fieldname = 'VDATU'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Req. Del. Date'(005).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 4. "DEVK909658
w_field-fieldname = 'KUNNR'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Sold-to.'(038).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 5 .
w_field-fieldname = 'SOLDTO_NAME'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Sold-to'(006).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 6 .
w_field-fieldname = 'MATNR'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Material'(007).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 7 .
w_field-fieldname = 'KWMENG'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Quantity'(008).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 8.
w_field-fieldname = 'MSEH3'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'UOM'(009).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 9 .
w_field-fieldname = 'BILL_VBELN'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Invoice #'(010).
w_field-emphasize = 'X'.
w_field-hotspot = 'X'.
APPEND w_field TO t_fieldcat.
CLEAR w_field.
w_field-col_pos = 10 .
w_field-fieldname = 'BILL_NETWR'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Values'(011).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 11.
w_field-fieldname = 'WERKS'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Plant'(012).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 12.
w_field-fieldname = 'LGORT'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Storage Loc'(013).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 13 .
w_field-fieldname = 'MAKTX'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Description'(014).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 14. "DEVK909658
w_field-fieldname = 'OID_SHIP'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Ship-to.'(039).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 15 .
w_field-fieldname = 'SHIPTO_NAME'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Ship-to'(015).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 16. "DEVK909658
w_field-fieldname = 'BILLTO'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Bill-to .'(040).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 17 .
w_field-fieldname = 'BILLTO_NAME'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Bill-to'(016).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 18 .
w_field-fieldname = 'LOAD_NAME'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Load Contact'(017).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 19 .
w_field-fieldname = 'TRUCK_NAME'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Truck Comp.'(018).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 20 .
w_field-fieldname = 'BSTKD'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'P.O.'(019).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 21 .
w_field-fieldname = 'IHREZ'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'AFE Nbr'(020).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 22 .
w_field-fieldname = 'OID_EXTBOL'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Truck Ticket'(021).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 23.
w_field-fieldname = 'STATU'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Status'(022).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 24.
w_field-fieldname = 'AUGRU'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Ord.Reason'(024).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 25.
w_field-fieldname = 'TDLINE'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'cstmr.acct.ref.'(027).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 26 . "DEVK906678
w_field-fieldname = 'VKBUR'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Sales Office'(037).
APPEND w_field TO t_fieldcat.
w_field-col_pos = 27. "DEVK909658
w_field-fieldname = 'COUNT'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Count'(041).
w_field-do_sum = 'X'.
APPEND w_field TO t_fieldcat.
ENDFORM. " SET_FIELDCAT
*& Form CALL_ALV
* Call the ALV Grid function.
FORM call_alv .
SORT it_extract BY lgort vbeln.
* repid is necessary since the ALV F.M. does not work properly with
* sy-repid.
repid = sy-repid.
alv_variant-variant = pa_vari.
alv_variant-report = sy-repid.
alv_variant-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repid
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = t_fieldcat[]
it_sort = gt_sort[]
i_default = 'X'
i_save = 'A'
is_variant = alv_variant
it_events = gt_events[]
is_print = tp_print
TABLES
t_outtab = it_extract2
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE w000 WITH text-004 ' ' ' ' ' '.
ENDIF.
ENDFORM. " CALL_ALV
*& Form build_top_of_page
* Build heading for report. *
* -->P_GT_LIST_TOP_OF_PAGE[] Header stuff for report
FORM build_top_of_page USING e04_lt_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader. "Header table for top of page
* construct 'top of page' info. to display. In this case, one line.
DATA: w_selections(40) TYPE c,
w_date_from(10) TYPE c,
w_date_to(10) TYPE c.
WRITE: s_vdatu-low TO w_date_from DD/MM/YYYY.
IF s_vdatu-high IS NOT INITIAL.
WRITE: s_vdatu-high TO w_date_to DD/MM/YYYY.
CLEAR w_selections.
CONCATENATE 'Del.Req.Date: ' w_date_from 'To' w_date_to
INTO w_selections SEPARATED BY space.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = w_selections.
APPEND ls_line TO e04_lt_top_of_page.
gs_list_top_of_page-typ = 'S'.
gs_list_top_of_page-info = ' Total Number of Sales Documents'.
append gs_list_top_of_page to gt_list_top_of_page.
gs_list_top_of_page-typ = 'S'.
gs_list_top_of_page-info = count1.
append gs_list_top_of_page to gt_list_top_of_page.
ELSE.
CLEAR w_date_to.
CONCATENATE 'Del.Req.Date: ' w_date_from
INTO w_selections SEPARATED BY space.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = w_selections.
APPEND ls_line TO e04_lt_top_of_page.
ENDIF.
ENDFORM. " build_top_of_page
*& Form alv_eventtab_build
* Pass list of events to be triggered by the ALV function module
FORM alv_eventtab_build USING u_name TYPE slis_alv_event-name
u_form TYPE slis_alv_event-form
alv_lt_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event. " structure for event handling
ls_event-name = u_name.
ls_event-form = u_form.
APPEND ls_event TO alv_lt_events.
ENDFORM. " alv_eventtab_build
* FORM TOP_OF_PAGE *
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'NEWALTA_LOGO'
it_list_commentary = gt_list_top_of_page.
ENDFORM. " TOP_OF_PAGE
*& Form process_deliveries
* Process the delivery related records.
FORM process_deliveries .
DATA:
ltp_date TYPE wadat_ist, " Goods movement date.
ltp_vbtyp TYPE vbtyp_n,
ltp_mtart TYPE mtart, " Material type.
w_lfimg TYPE lfimg, " Actual quantity delivered (in sales units).
w_vrkme TYPE vrkme. " Sales unit of measure.
* Read delivery quantity and uom.
SELECT SINGLE lfimg vrkme INTO (w_lfimg, w_vrkme)
FROM lips WHERE
vbeln = it_extract-delivery AND
posnr = it_extract-posnr_vl.
* these fields have values from vbap. override with lips values
IF sy-subrc = 0.
it_extract-kwmeng = w_lfimg.
it_extract-vrkme = w_vrkme.
* translate unit of measure
it_extract-mseh3 = it_extract-vrkme.
SELECT SINGLE mseh3 FROM t006a INTO it_extract-mseh3
WHERE spras = sy-langu
AND msehi = it_extract-vrkme.
ENDIF.
* Determine STATUS by reading 'service confirmation', R (goods movemt)
* it is possible to have multiple 'service confirmation' records for
* one item. ie. delivery 80010390 in PRD.
* As long as there is at least one 'service confirmation' record,
* status is considered 'complete'.
* Validate the created on date of the goods movement or service confirmation.
ltp_mtart = zcl_material=>get_mtart( it_extract-matnr ).
* ltp_date = zcl_lips=>get_goods_movement_date( itp_vbeln = it_extract-delivery
* itp_posnr = it_extract-posnr_vl itp_mtart = ltp_mtart ).
CALL METHOD zcl_lips=>get_goods_mvt_info
EXPORTING
itp_vbeln = it_extract-delivery
itp_posnr = it_extract-posnr_vl
itp_mtart = ltp_mtart
IMPORTING
rtp_date = ltp_date
rtp_vbtyp = ltp_vbtyp.
* 'h' is cancel goods issue
IF ltp_vbtyp = 'h'.
it_extract-statu = 'Incomplete'(025).
ELSE.
IF ltp_date IS NOT INITIAL.
it_extract-statu = 'COMPLETE'(026).
ENDIF.
ENDIF.
* Retrieve the invoice/billing document item.
CALL METHOD zcl_lips=>get_invoice
EXPORTING
itp_vbeln = it_extract-delivery
itp_posnr = it_extract-posnr_vl
IMPORTING
rtp_vbeln = it_extract-bill_vbeln
rtp_posnr = it_extract-bill_posnr.
IF it_extract-bill_vbeln IS NOT INITIAL.
* retrieve net value from the invoice.
CLEAR it_extract-bill_netwr.
SELECT SINGLE netwr INTO it_extract-bill_netwr FROM vbrp
WHERE vbeln = it_extract-bill_vbeln
AND posnr = it_extract-bill_posnr.
ELSE.
it_extract-bill_netwr = it_extract-netwr. " Use order net value.
ENDIF.
ENDFORM. " process_deliveries
*& Form user_command
* Process the user command.
* -->R_UCOMM User command
* -->RS_SELFIELD Field selected
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: ltp_vbeln TYPE vbeln. " Sales document number.
CASE r_ucomm.
WHEN '&IC1'.
IF ( rs_selfield-fieldname = 'VBELN'
OR rs_selfield-fieldname = 'BILL_VBELN' )
AND rs_selfield-value IS NOT INITIAL. " Display sales document.
ltp_vbeln = rs_selfield-value.
zcl_sales_doc=>display( ltp_vbeln ).
ENDIF.
ENDCASE.
ENDFORM. "user_command
*& Form invoice_process
* Process for orders without deliveries. *
FORM invoice_process .
* Translate unit of measure.
SELECT SINGLE mseh3 FROM t006a INTO it_extract-mseh3
WHERE spras = sy-langu
AND msehi = it_extract-vrkme.
* Retrieve the invoice/billing document item.
CALL METHOD zcl_vbap=>get_invoice
EXPORTING
itp_vbeln = it_extract-vbeln
itp_posnr = it_extract-posnr
IMPORTING
rtp_vbeln = it_extract-bill_vbeln
rtp_posnr = it_extract-bill_posnr.
IF it_extract-bill_vbeln IS NOT INITIAL.
* retrieve net value from the invoice.
CLEAR it_extract-bill_netwr.
SELECT SINGLE netwr INTO it_extract-bill_netwr FROM vbrp
WHERE vbeln = it_extract-bill_vbeln
AND posnr = it_extract-bill_posnr.
ELSE. " If no Invoice, then status becomes 'incomplete'.
it_extract-bill_netwr = it_extract-netwr. " Use order net value.
it_extract-statu = 'Incomplete'(025).
ENDIF.
ENDFORM. " invoice_process
*& Form alv_variant_f4
* Get the display variant.
* <--CTP_VARI Variant name
FORM alv_variant_f4 CHANGING ctp_vari TYPE slis_vari.
alv_variant-report = sy-repid. " Report ID
alv_variant-username = sy-uname. " User ID
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = alv_variant
i_save = 'A'
IMPORTING
es_variant = alv_variant
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
ctp_vari = alv_variant-variant.
ENDIF.
ENDFORM. " alv_variant_f4
Kind help will be greatly appreciated.
Thanks
Aarav
Aarav,
when you call the ALV you need to set the event exit details for filter:
*Set callback after filter
REFRESH T_EVENT_EXIT.
CLEAR WA_EVENT_EXIT.
WA_EVENT_EXIT-UCOMM = '&ILT'.
WA_EVENT_EXIT-AFTER = 'X'.
APPEND WA_EVENT_EXIT TO T_EVENT_EXIT.
Then call the ALV as per usual with the event exit details:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'Z_OWDR_MONTH_END_01'
I_CALLBACK_PF_STATUS_SET = Z_PF_STATUS_SET
I_CALLBACK_USER_COMMAND = 'CALLBACK_USER_COMMAND'
I_BACKGROUND_ID = 'ALV_BACKGROUND'
IS_LAYOUT = Z_IS_LAYOUT
IT_FIELDCAT = T_FIELDCAT2
IT_FILTER = T_FILTER
I_SAVE = 'A'
IS_VARIANT = Z_VARIANT
IT_EVENT_EXIT = T_EVENT_EXIT
TABLES
T_OUTTAB = T_OUT
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
Then in the 'callback_user_command' insert some code to read the filter settings when the filter function is selected using function 'REUSE_ALV_GRID_LAYOUT_INFO_GET':
FORM CALLBACK_USER_COMMAND USING UCOMM LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
CASE UCOMM.
WHEN '&ILT'.
PERFORM 99_STORE_FILTERS.
ENDCASE.
FORM 99_STORE_FILTERS.
CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
IMPORTING
ET_FILTER = T_FILTER
ET_FILTERED_ENTRIES = T_FILTERED
EXCEPTIONS
NO_INFOS = 1
PROGRAM_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " 99_STORE_FILTERS
Hope that makes it clear - worked for me.
Claire
Similar Messages
-
SSRS matrix click on the count like a pivot table to get details
Hi,
I am trying to create a matrix report to work similar to a pivot table, where when a user clicks on the count, the details are displayed. When I add the action to open a sub-report, how do I pass in the parameter values for the group that was selected? meaning
if in row group- I have company name, and column group I have job title, when the count gets clicked, i need to pass in the company name for the row that was clicked along with the column group. How can I proceed?
Thanks in advance!Hi NewCSharpUser,
According to your description, you have created a main report which contains company name as row group and job title as column group. And a drill through report which contains company name as a parameter to filter the data. When you click the data region
in the main report, you want to display corresponding details in the drill through report filtered by the company name, right?
In your scenario, you could add a “Go to report” action, then specify a parameter to filter the drill through report. Please refer to steps below:
1. Design the main report like below:
2. Preview the report.
Reference:
Drillthrough Reports (Report Builder and SSRS)
If the method couldn't meet your requirement, please share you report design and expected results for our analysis.
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
How to get the Count of a logic?
Hi,
Very new to CRM. I am trying to get the count of "activity start time" that are greater than current time stamp. Count(activity start time) work. I don't know how to add the time stamp condition to this. I can't add this condition as filter.
Appreciate any responses.
ThanksRaghu,
Thanks for the help. It works to get the count.
The problem is, i have some other filters set and can't combine this filter. Here is my scenario:
get all activities on a contact that have greater than x $ amount as assets. I need to find the number of future appointments for that contact and start time of first pending future appointment. All has to be in one report.
My columns are for example : contact name, activity start time, end time, subject, next pending appointment start time, total future appointments, some other related fields from contact
So when I add the filter that you had given, it will not give me all activities. I am able to achieve all this in seperate reports and unnable to get it in single one.
Thanks,
GiGi -
PXI 6220 - problems with the counter
Hello all,
I try to make a buffered counting with counter0 of my PXI card 6220, to count the speed of a motor through a photocell and a sticker over the pulley of the motor.
I have wired my photocell at PFI8 (source) and I generate a pulse train that I have wired in PFI9.
The input to the counter is a pulse train 5V high level - 0V low level.
The problem is that the counter counts sometimes more than 1 pulse for every turn of the motor. However, apparently the pulse train looks ok.
I don´t know what´s the problem.
The rising slope of the pulses looks very nice so, I think I could discard it.
I can suppose that in between pulses there are some glitches at a very high frequency that I cannot see (I have sampled this signal only at 800kHz and at this frequency there are no glitches), but maybe the counter yes, because it works at 20MHz.
Somebody has experienced this problem. Sometimes ago, using a PCI6221, I solved a similar problem by activating the digital filtering, but it seems it is not possible to activate for this cards. Could somebody confirm it?
Any ideas will be appreciated.
Thank you very much in advance!!Pete;
I agree that is a little strange.We don't have such problem reported on our Data Bases.
A workaround you can try is to make a sinle pulse goes to the source, before start the buffered acquisition, and see if that makes the counter keeps reporting a 1 value.
You can also try the same thing on another counter of the board to see if that problem is related to the counter you are using.
Regards
Filipe A.
Applications Engineer
National Instruments -
Displaying the count of search result?
Hi,
We have built new search pages for our client to search for candidates registering in their iRecruitment site. The client prefers to see the no of records of each search result. Typically some searches may fetch around 50000 records.
How to achieve this. Currently we have set the VO_MAX_FETCH_SIZE for one responsibility as 50000. I think this will have a performance impact and it cannot display the exact count if it is > 50000. Is there any other way just to show the count of search records?
thanks,
HemHenry,
As Ram insisted before that if no. of records in your VO is more than max fetch size set in profile option, then it won't return excat number of records.You can very well use this method in normal flow, if you expect that your VO query will not return more than max fetch size records.
Otherwise run a separate query to get total, as discussed.
--Mukul -
How can i get the count vaule from GPIB?
I want to get the count waule from GPIB ,but I find that the vaule I get from GPIB now is the trace vaule ,
so I ask How can i get it.The count of what? What kind of instrument are you using?
-
Showing Duplicate records in a report with the count of their occurrence
Hi Members,
I am novice to BI. i need your suggestion to achiever one of the functionality. A report is required to be built with columns Incident ID, Task ID, Task Name. The Original report is below:-
In the above report I have to display only duplicated records once. Distincat records are not required to be shown. That is, if the same no. of Task Name is associated with the same Incident ID then it should be displayed once with the count of their occurrences in a separate column say , Count. For example, the Task 'TASK_MANUAL_KCI' got 4 times associated with the same Incident ID INC000000001434. Then the report should display this task one time in a report with count 4. Similarly, for INC000000000943 where task 'IPCG Diagnostic Template' got associated 2 times. The Count is 2 for this task.
Other records should not be displayed in a report.
Would highly appreciate quick response. Please suggest.
Thanks,
Neha PateriaI tried this Gill, but result is bit different :-
Seems some little modifications are needed. Report should be displayed like the below one where it says how many times the same Task is associated with the same incident. Eg. Task 'TASK_CIRCUIT_RESOLVER' is associated with the incident 'INC000000001434' 4 times. 'IPCG Diagnostic Template' is associated with 'INC000000000943' 2 times. Similarly for other records.
But I really thankful to you for giving me the logic proceed further. I tried '=RunningCount([Task Name]; Row; ([Task Name]; [Incident ID]))'. It gave me desired results. :-
But the only thing that needs to be done is to bring the single Task associated with the Incident..
Thanks,
Neha Pateria -
When user clicks on "Like Button," the counter increases but nothing shows up showing the user recommends my site to their friends. What did I do wrong?
I used the iframe code from Facebook's "Like Button" site; and inserted the code in the html widget popup box, then positioned it where I wanted it on my page and published. It looks fine (though I had to add "http" before my url to get it to show up).
So, when a user clicks on button, a pop-up opens asking for Facebook password. When I (the user) enter a password, nothing happens after that. I thought the idea was that a user would be able to show their friends that they like my website. After I entered my password in pop-up after clicking on "Like" I went to my facebook page (a company page) to see if it showed that I (the user that clicked on "Like" on iweb) recommended the website. But nothing showed up. I thought maybe it was because Facebook associated my password as the admin for the Facebook page so didn't count it. But a friend tried it and same thing happened. I went back and on one page I put in another facebook code for a combo Like/Send button. It shows up but acted the same as the regular Like button.
Questions:
1. Is this the way the Like Button is suppose to work? Only benefit of Like button being that it just counts the clicks on the Like button and does NOT let users share their recommendation with their friends?
2. If it's suppose to let users share their "Likes" with their friends, what did I do wrong? There were three types of code but in reading discussions, they all say to use iframe. (I used the first choice which I think was html for Javascript SDK and put that in my HTML Snippit box and the Like/Share button showed up on my iweb page next to the facebook icon and the words "likes this" but when I click it, I don't see instructions that it's sending my recommendation to my friends.)
I must have done something wrong, but can't figure out what. Does anyone know? If the only benefit of the Like Button is the counter, it doesn't seem worthwhile.
Thanks to anyone who can figure this out! My website is couponsforfun.comYou want something like this?
http://home.wyodor.net/demoos/facebook/
The send button sends the link to their friends in the address field with a message.
They recieve a message in the inbox.
There's no post on a page.
If they want that, then they should share the link themselves.
Perhaps it's best to study what facebook has to offer and how it works instead of guessing what it is supposed to do and be disappointed. -
How can I disarm the counter in a specified time?
I am using 6602 counter. I use 2 counters to perform "Buffered Period Measurement ". I use internal time base (20MHz) as the SOURCE, and wire the signal to the Gate. The counters are triggered by a trigger signal.
Now I just want to stop counting the signal in a specified time after the counters triggered. After that time, even the input signal is still running,the counting must be stopped. How can I implement this purpose? I don't know how to disarm the counter when the counter are still running, and how to exactly determinate the stop time.
Thanks for any advise. I have attach my present routine here.
Attachments:
counters.vi 192 KBJust to expand a bit on Justin's answer to outline a few particulars.
You mentioned using 2 counters to capture buffered periods so I'm assuming that you'll enable triggering to guarantee that they both have the same start time. Note that in this scheme, element #0 of your array of buffered periods will represent the time from the Trigger edge until the first Gate edge.
Since your description made it sound acceptable to ignore pulse periods occurring later than the interval of interest, perhaps you can collect data for a little longer than necessary, then reset the counters and trim off the periods that came in "too late" using 'Array Subset.' A quick-and-dirty way is to loop over each array of periods, performing a cumulative sum until it exceeds the specified data collection time interval. That'll tell you the length of the subset you need to keep.
The hard part is that after starting the measurement, you'll need to poll task attributes/properties to determine when the trigger has been received. Only after that's been determined would you start keeping track of approximate time in software.
There are ways to do the timing in hardware if you get more of the 6602's counters involved. Here's one way:
1. First configure your 2 counters for buffered period measurement. However, instead of using the internal timebase for a Source, use another counter's output as a Source. Under DAQmx, the internal routing details are handled for you; under traditional NI-DAQ, you'll need to make explicit routing via RTSI.
Note that in this scheme, these 2 counters don't need to be triggered.
2. Next, generate a finite-duration pulse train at 20 MHz (examples can be readily found under LabVIEW help or this website). This pulse train should last for your data collection time interval, and will act as the Source signal for your period measurements. It is important that the period-measuring counters are started before the finite pulse train.
The finite pulse train uses 2 counters -- one to generate the output pulse train at 20 MHz and a "helper" that produces a single pulse whose duration equals your data collection interval time.
If you need to synchronize to some external trigger signal, you can set the "helper" counter to be triggered, but there'll be one subtle catch. The first period measurement in your buffers will not include the time from the external trigger signal until the beginning of the single "helper" pulse, i.e., the "delay" time spec for the pulse. You can either make this very very short and ignore it, or make it any convenient duration and then add it to the first period measurements. Be careful though: the timebase for this "delay" time isn't necessarily the same as the timebase used to measure periods.
There's quite a bit of complication there, so let me suggest an easier way that assumes no need to synchronize to an external trigger. (I'll use DAQmx terminology, since the traditional NI-DAQ would get complicated again with explicit RTSI signal routing.)
A. As describe in #1 above, configure your period-measuring counters to use a 3rd counter's output as the timing source terminal.
B. After starting your 2 period-measuring counters, start up the 3rd counter to generate a continuous 20 MHz pulse train.
C. After the 3rd counter starts, call the 'Wait (ms)' function from the Time & Dialog palette. Wait for slightly longer than your desired collection time.
D. Read all buffered periods from the counters. You may need to first query each to find out how many are waiting to be read.
E. Reset all 3 counters.
F. Do the cumulative sum work on the two buffered period arrays to determine where each should be truncated.
Note that step "C" above will leave you stuck while data is being collected. A small variation would be to read a reference time ("Tick Count (ms)") right after starting your 20 MHz counter, then set up a loop that allows you to terminate early (logical OR of, say, "abort" button, data acq error cluster error, and time comparison). In that loop, you put a delay of maybe 50-200 msec using "Wait (ms)."
"Wait (ms)" will output a tick count from which you subtract the reference time. When the difference exceeds your data collection time, you can exit the loop and continue with step D above.
-Kevin P. -
I am contemplating using a PCI 6071E with SCXI. We have the boards (6071E), we would need the cable (I suppose SH1006868) and the SCXI system. I would like to know how would you access the counter and digital line capabilities of the board. I will be using a SCXI-1314 with a SCXI-1520 Module for strain measurements but will need to use the counter and digital lines of the board as well. Can this be done? If so, how and/or what else do I need?
I think this KnowledgeBase will answer the question for you.
Accessing DAQ Board Counter Pins with an SCXI System
Otis
Training and Certification
Product Support Engineer
National Instruments -
Can DAQmxRegisterEveryNSamplesEvent function be used for the Counter Input Channels
Hi, All,
I have an application to count the digitial pulse number. I want to know the time of the coming pulses which start from 1 and increased 4 later, like 1, 5, 9, 13..... The time interval between each pulse is not a fixed value. So I tried to use DAQmxRegisterEveryNSamplesEvent and DAQmxCreateCICountEdgesChan functions. But afterI called the DAQmxStartTask function, it always failed. The board I used is the NI-PCIe-6320. Here is part of my code.
DAQmxErrChk (DAQmxCreateTask("",&m_taskhandle));
DAQmxErrChk (DAQmxCreateCICountEdgesChan(m_taskhandle,"Dev1/ctr0","",DAQmx_Val_Rising, 0, DAQmx_Val_CountUp));
DAQmxErrChk(DAQmxRegisterEveryNSamplesEvent(m_taskhandle, DAQmx_Val_Acquired_Into_Buffer, 4, 0, EveryNSamplesCallback, this) );
DAQmxErrChk (DAQmxStartTask(m_taskhandle));
I don't know the reason. Can Anyone give me some help. Thanks.
Yang
Solved!
Go to Solution.Hi, John,
What's I what to do is that I have an external digital signal, when the signal goes from low to high, I need do some operations. So I just want to know the time when the digital signal goes from low to high. The frequency of the digital signal is from 0 - 20000Hz. My first plan is to use a counter to count the pulse rising edges. When the number of edge increases one, I do the designed operations. In this method, I can't guarantee I can catch each pulse rising point. Because sometimes the counter will increase more than one in the on-demand mode. For example, the previous content of the counter is xxxx4, but the next reading the content may become xxxx6.
After I learned some ANSI C codes, I found that the ChangeDetectionEvent can help me found time when the signal goes from low to high. So I wrote the following code: (I set the digital signal to P0.0)
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateDIChan(taskHandle,"Dev1/port0/line0","",DAQmx_Val_ChanPerLine));
DAQmxErrChk (DAQmxCfgChangeDetectionTiming(taskHandle,"Dev1/port0/line0","",DAQmx_Val_ContSamps, 1));
DAQmxErrChk (DAQmxRegisterSignalEvent (taskHandle, DAQmx_Val_ChangeDetectionEvent, 0, Callback , dialog));
DAQmxErrChk (DAQmxStartTask(taskHandle));
int32 CVICALLBACK Callback (TaskHandle taskHandle, int32 signalID, void *callbackData){
CNIPCIE6320Dlg* dialog = static_cast<CNIPCIE6320Dlg*>(callbackData);
dialog->m_event_num++; // Here is to calculate how many events has been triggered
return 0;
Yesterday I used this method to get the pulse rising time. I found the m_event_num is close to the ground truth (In the simulation, I know how may rising pulse I generated). In one two hours test, the offset is almost 400 pulses. But today I did the same tests again. I found the m_event_num got a big difference from the ground truth. The voltage of the whole system today maybe smaller than yesterday, because today the power is from an invertor while yesterday the power is from the electricity supply. So will the lower voltage supply will causing some event missing. Or if PC system became busy will ignore some callings of the event callback function? That's two possible reason will affact the final result. I am not sure. Do you have any experience about this problem. Or do you have some better suggestion to get the pulse rising time. Thanks again.
Regards,
Yang -
does anyone know how the cutout filter works and is there a way of achieving the same effect without using filters to get more control over final look?
Several ways to get similar results. Image > Adjustments > Posturize with low values similar to what you'd use n Cutout. This is the most flexible way I can think of as you keep the image in RGB mode with layers intact. A more radical approach would be to reduce bit depth using Indexed Colour. You'll need to experiment with settings, try changing Forced to Primaries, and Matte to Foreground Color. There's no going back from this route, although you can change the mode back to RGB to re-enable layers, adjustment layers etc.
A nice thing about the Filter gallery filters is that you can change the layer to a Smart object with all the control that gives you.
Now if only this forum could filter out bizarre content. -
To get the count of records and able to access the column value in a single
Hi
Is there any way to get the number of records in the query and access the column values
e.g
select count(*)
from
(SELECT department, COUNT(*) as "Number of employees"
FROM employees
WHERE salary > 25000
GROUP BY department ) a
This wil only get the Count, if i want to access each row from the inline view how can i do that.Your question is not clear.
Are you looking for total record count as well as count by department ?
Something like this?
SQL>
SQL> with temp as
2 (
3 select 1 dept ,10000 sal from dual union
4 select 1 dept ,25100 sal from dual union
5 select 1 dept ,30000 sal from dual union
6 select 1 dept ,40000 sal from dual union
7 select 2 dept ,10000 sal from dual union
8 select 2 dept ,25100 sal from dual union
9 select 2 dept ,30000 sal from dual union
10 select 2 dept ,40000 sal from dual )
11 select count(*) over( partition by 1 ) total_count,dept,
12 count(*) over(partition by dept) dept_cnt from temp
13 where sal>25000;
TOTAL_COUNT DEPT DEPT_CNT
6 1 3
6 1 3
6 1 3
6 2 3
6 2 3
6 2 3
6 rows selected
SQL> -
How do i hide the counter?
Hi everybody, i just published my first iWeb site yesterday (great app) and this morning i decided after all to insert a hit counter on some pages. The thing is i would like this counter to be visible ONLY to me, or differently worded, i'd like to make it invisible to visitors. i was able to select this option in the old homepage edit, but how do i do that in iWeb? Thanks for your help.
You can also visit the site at http://web.mac.com/buquet/ -any feedback is welcome (Bob Dylan fans should click the top link 'BobStories'!).
Oh, yes, are there any rulers in iWeb?
iMac 800 G4 flat panel, 160Gb external FireWire Mac OS X (10.4.7)To hide the counter, just put it behind another object, like an image for instance. Just drag the counter graphic on top of an image, then click on the "Back" button on the bottom of the iWeb window to force it back behind the image layer.
As far as rulers go, the closest thing that iWeb has built in is the Inspector Metrics tab where you can specify exact sizes of objects and the like. There are no on screen rulers like guides and such. I think Michael Wong has devised a method of using various sized shapes of predetermined size to gauge onscreen distances and alignment...
Michael Wong's Graphics Tips
Good luck! -
I'm trying to get the count for each row to total count for each month
Something like this
Hardware | Jan
Monitors | 5
Processors | 137
Printers | 57
etc........
How can I write a query for this. I can get the Hardware column but don't know how to get the next column.If you can provide more data like sample input DML statements it would have been wonderful..
Assuming is , you need a pivot. Here is an article on basic Pivot..
http://sqlsaga.com/sql-server/how-to-use-pivot-to-transform-rows-into-columns-in-sql-server/
something like this may be..
DECLARE @Input TABLE
Hardware VARCHAR(20),
[Date] VARCHAR(20)
INSERT INTO @Input VALUES('Monitor', '01/01/2014'), ('CPU', '01/01/2014'), ('Monitor', '01/03/2014')
, ('ABC', '01/01/2014'),('Monitor', '02/01/2014')
;WITH CTE AS
SELECT Hardware, LEFT(DATENAME(M, [Date]),3) AS [MonthName] FROM @Input
SELECT *
FROM
SELECT Hardware, [MonthName], COUNT(Hardware) AS Count FROM CTE GROUP BY Hardware, [MonthName]) a
PIVOT (MAX([Count]) FOR [MonthName] IN ([Jan], [Feb])) pvt
Please mark as answer, if this has helped you solve the issue.
Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.
Maybe you are looking for
-
Error while updating Curve 9300 OS to Os6 Pls help!
While I was updating my Blackberry Curve 9300 this notice popped up "An error has occurred while downloading software for your device. Please verify your Internet connection or try again later, if the problem persists." My internet connection is fin
-
CVP 7.0(2) web service element, is it compatible with WCF
I'm looking for documentation on the Web Service element in CVP 7.0(2). The element specs guide for 7.0 doesn't have any thing on it only the 8.0 guide, what does this mean. Should I just build something Java? I will be using it with microsoft WCF to
-
Hi there, Basically I've been trying to hook my Imac up to my TV to use as a secondary monitor. The TV is a samsung series 5 I am using a minidvi > hdmi adapter then a hdmi lead from there. Will the version of OS i am using affect it The problem is b
-
Since updating to iOS 5.0, my iphone 4 has a persistent voicemail password prompt although I have never set a password. How to shut it off?
-
How do I remove the spotlight effect on the bottom of my screen? I have already tried the Shift+Control+Eject.