Change of count on the header on filtering the ALV
Hi Gurus!
I have this ALV report which gives the sales order report, in the output right on the top the report shows the count of all the distinct sales order displayed when the report is run based ona selection criteria. Is it possible to show the total count of teh sales order in the report to change and show teh number of distinct sales doc when we use filter on teh report. Suppose if we run the report based on a particular selection criteria and it gives a count of 30 . In the output if we put filter on a particular column and the report shows fewer lines , which will reduce the number of sales doc, is it possible to show this number which for eg will be say 20 , is it possible to show the number 20 after filetr on ALV instead of that 30 remainiung constant. I am wanting the report to show the change in count of distinct sales doc when I put filter on any columnh.
report zsales_orders message-id zsd no standard page heading.
* For ALV usage
type-pools: slis.
data: gs_layout type slis_layout_alv,
ta_events type slis_t_event_exit,
tp_event type slis_event_exit,
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.
tp_event-ucomm = '&ILT'. " Filter event.
tp_event-after = 'X'.
append tp_event to ta_events.
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.
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[]
it_event_exit = ta_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.
when '&ILT'.
data:
lta_filt type slis_t_filtered_entries.
break rdrury.
call function 'REUSE_ALV_LIST_LAYOUT_INFO_GET'
importing
* es_layout = gs_layout
* et_fieldcat = t_fieldcat[]
* et_sort = gt_sort[]
* ES_LAYOUT =
* ET_FIELDCAT =
* ET_SORT =
* ET_FILTER =
* ES_LIST_SCROLL =
* ES_VARIANT =
* E_WIDTH =
* ET_MARKED_COLUMNS =
et_filtered_entries = lta_filt
* ET_FILTERED_ENTRIES_HEADER =
* ET_FILTERED_ENTRIES_ITEM = lta_filt
* TABLES
* et_outtab =
* ET_OUTTAB_HEADER =
* et_outtab_item =
* ET_COLLECT00 =
* ET_COLLECT01 =
* ET_COLLECT02 =
* ET_COLLECT03 =
* ET_COLLECT04 =
* ET_COLLECT05 =
* ET_COLLECT06 =
* ET_COLLECT07 =
* ET_COLLECT08 =
* ET_COLLECT09 =
exceptions
no_infos = 1
program_error = 2
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
I have used all the FM modules mentioned but I am not able to get the total of the sales doc on the top of the page to chnage when filtering of data is done . I just want to see this count of sales document (distict ) and to see it change as filtering is done , be it at any place in teh ALV , its not necessary that it has to be on the top of the ALV output. Could I get some inputs please. As you can see I used the below mentioned FM but on debugging I find the gt_stack is empty still.
*& 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.
Data:lt_FILTERED_ENTRIES type SLIS_T_FILTERED_ENTRIES,
wa_filter like line of lt_FILTERED_ENTRIES.
data: count2 type i.
data: it_fieldcat type slis_t_fieldcat_alv with header line.
CALL FUNCTION 'REUSE_ALV_LIST_LAYOUT_INFO_GET'
IMPORTING
ET_FILTERED_ENTRIES = lt_FILTERED_ENTRIES
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.
MESSAGE i000 WITH count1 .
ENDIF.
loop at lt_FILTERED_ENTRIES into wa_filter.
* if sy-tabix <> 0.
if sy-subrc = 0 .
count2 = count2 + 1.
*count3 = count1 - count2 .
* write:/ 'Total number of Sales Documents =', count3 .
endif.
endloop.
ENDFORM. " TOP_OF_PAGE
I tried using it at user-command level too but it dosent help.
Thanks
Similar Messages
-
Show Subreport Name in the header part of the main Report subreport wise
Hi,
I want to create a Report which contains a collection of Subreport.
In header part of the main report I have one expression which shows specific text for specific subreport.
In Detail
I have three subreport named as
Sureport1
Subreport2
Subreport3
I have given page name for all the three subreport as subreport name.
Now I create one Main report. Where I drag one table and delete the group.
I created three rows in this tablix.
And in each textbox I have inserted one rectangle.
and place all the three subreport.
and here my expression is mentioned below.
=IIf(Globals!PageName Like "Subreport1","Subreport1",
IIf(Globals!PageName Like "Subreport2","Subreport2",
IIf(Globals!PageName Like "Subreport3","Subreport3","")))
This expression is working when I am placing all the subreports inside separate rectangle but not working when I am placing all three subreports in one tablix.
For both case it is showing in report designer window but in second case it is not showing in the pdf.
Thanks,
Aswini RoutHi,
As the description, I understand that you want to display the subreports’ name on the page header of the main report. When the page display a subreport, display the corresponding subreport name in the header part of the main report.
Base on my understanding, you should have page break on each subreport(suppose you add the subreports without Rectangle) since there is no group in the main report and there should not be a page break in the main report. If I have misunderstood, please correct
me.
I was not able to reproduce the issue currently. How did you define the page name of your main report. If it is possible, please upload your rdl file to your OneDrive and share the link here. You can also capture the screenshot so that I can understand the
problem in more details.
Thanks.
Tracy Cai
TechNet Community Support -
How to add texts to the Header Text in the PO header
Hi
In our system, some already added remarks are appearing in the PO header text field when i open a PO. I wanted to edit the remarks appearing in the PO header as a default. I wanted to know where these predefined texts are filled in. Appriciate if you can help me findout the same.
Thanks
Venkat.Hi
In the above said configuraiton path, they have mentioned "Purchase order" in the source object and the "Header Text" in the source text.
But i wanted to konw where the below mentioned genereic Notes/Remarks will be entered. For all the purchase orders, this text is autmatically get copied into the header text. i wanted to know from where it is originating and where we are maintaining.
"Notes / Remarks :
Vendor's signature on the attached PO terms and conditions is an integral part of this PO
All documents should have a PO number
Invoices should be submitted to the attention of the Finance department
Please attach a PO copy with all claims to avoid delay in receiving payment.?" -
Pre-Populating the header data in the survey attached to an activity in CRM
Hello Gurus,
I have a question regarding Pre-Populating the header data in the survey attached to an activity in CRM Mobile 4.0. That in can we define a Functional module for a PBO (Process Before Output) for a survey u201CZ_SVY_Templateu201D in CRM 4.0.
So that when a Sales rep opens the Survey in CRM Mobile 4.0 the Organizationu2019s Header data should automatically be displayed in the u201CZ_SVY_Templateu201D, so that he just needs to fill out only the remaining additional blank fields in the survey.
<< Moderator message - Please do not offer points >>
Thanks,
Siddhu
Edited by: Rob Burbank on Oct 8, 2010 2:16 PMModerator message - Cross post locked
Rob -
I need to make a copy of an entire email, including the header w/the sender's info and time, etc. to insert into a letter, etc. How can I do this w/out cutting and pasting the header separately from the text. I know there is a way besides a screen shot but I've spend hours trying to find it.
Smurfslayer wrote:
For the particularly persnickety types you might want to expose the full headers in the email message as well. It's easy enough to do, from mail's 'menu' select "view"; then "message"; then all headers.
Another option you could use is a screen capture using Grab.
Activate Grab, then shift + command + w (for a window screen shot). Then confirm the window selection and click the mail message.
Dave
Why are you addressing this to me...?
I am not the OP... -
Has anyone tried creating a plugin that you can type in a specific word, and if it comes up in the very top of the page (i think its refered to as the header) it closes the page or tab automatically? there is a program called POW! by AnalogX that does this, but its only good for IE. And Im a Firefox man. Can anyone look into this or maybe create a plugin that does what POW! does for IE? I will donate to the creater of a plugin that does that. Im so sick of pop ups that most pop up blockers miss.
The Firefox pop-up blocker is very effective. If you are getting a lot of pop-ups in Firefox, you may have picked up some Malware that is causing those pop-ups.
Install, update, and run these programs in this order. '''''(Not all programs detect the same Malware.)''''' They are all free for personal use, but some have limited functionality in the "free mode" - but those are features you really don't need to find and remove the problem that you have.<br />
''Note: If your Malware infection is bad enough and you are mis-directed to URL's other than what is posted, you may have to use a different PC to download these programs and use a USB stick to transfer them to the afflicted PC.''
Malwarebytes' Anti-Malware - [http://www.malwarebytes.org/mbam.php] <br />
SuperAntispyware - [http://www.superantispyware.com/] <br />
AdAware - [http://www.lavasoftusa.com/software/adaware/] <br />
Spybot Search & Destroy - [http://www.safer-networking.org/en/index.html] <br />
Windows Defender: Home Page - [http://www.microsoft.com/windows/products/winfamily/defender/default.mspx]
If these don't find it or can't clear it, post in one of these forums for specialized malware removal help: <br />
[http://www.spywarewarrior.com/index.php] <br />
[http://forum.aumha.org/] <br />
[http://www.spywareinfoforum.com/] <br />
[http://bleepingcomputer.com] -
ITunes New Release - Printing a playlist to my printer the header prints, but the song list all print in the same place. I am able to print from any other source. Does anyone else have this problem? Not sure if I should completely uninstall my ITunes and reload from scratch. Sure would appreciate any help you could provide as I really need to get some playlists printed now. Thanks - Scott
There is another discussion of this problem under "can't print cd jewel case inserts"--about 20 people on that page have the same problem.--I have a "band-aid" fix for anyone is in a hurry. When you go to print, choose the option "large playlist" (I think it is the last option). You can then print at least the songs that are on the playlist. Then, you can print a mosaic copy to get the album art work. Then you get out the scotch tape & tape them together! This is UNACCEPTABLE but it will do in a pinch. Someone on the other page suggests we all write in "itunes" feedback & complain.
-
Exposing the header info on the second page
Hello, I need help exposing the header information on the second page when the child IO component has more records on the succeeding second page. I have tried looked up the bookshelf and didn't find info on how to get this done. Can anyone please help?
I have the XML data file and the RTF template when needed.
Thank youcan you send me your template and xml . i can try at my side . email: [email protected]
-
I need a Functional module to get the header material from the component .
Dear Guru's
Please help me .
I need a name of the Functional module to get the header material from the component .
As in if I put the Component in the Input I should get ALL the Main header materials using this Component.
Regards,
Roshan Lilaram Wadhwani.This was not answered
-
i am not able to hear any sounds of games on the speaker. Though the sounds function on the head fones. The speaker works perfect in other applications except games.Have checked all the settings but not able to fix it.
Have you got notifications muted ? Only notifications (including games) get muted, so the iPod and Videos apps, and headphones, still get sound. Depending on what you've got Settings > General > Use Side Switch To set to (mute or rotation lock), then you can mute notifications by the switch on the right hand side of the iPad, or via the taskbar : double-click the home button; slide from the left; and its the icon; press home again to exit the taskbar. The function that isn't on the side switch is set via the taskbar instead : http://support.apple.com/kb/HT4085
If that doesn't solve it then try a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot. -
Google tell me to insert their codes for a site map in the <head> section before the first <body> section.. but where in exact terms is the head & body section on my 09 iwebsite?
It's been a while since I had to verify my sitemap with Google, but if I remember, there were two options for verification. The one I chose was an HTML file verification. That's a file that would be put in your Site Folder in GoDaddy. Google would then crawl your site to verify that way. I found that much easier than putting a file in the website itself.
It would be a file that looks like this: googlebe235d8cb7e91037.html
And would live in your Site Folder on Godaddy like this: -
Got a new HP1050A prints ok except when printing an email only the header prints not the message.Help!
It's the same from two different email addresses.If you're using Windows 7 Ultimate (I think) and your processor supports virtualization, you could try installing XP Mode. Some older apps that were wonky in Win7 are usually much happier in XP Mode.
If you're not operating as per above, have you turned off UAC and set Indy to run in Compatibility mode?
Lastly, I'm suggesting these as possible bits of duct-tape to try, not as reliable fixes. Bob is right. If you're not willing to upgrade InDesign, think hard about downgrading your OS. -
Why is the head jumping around the body?
I wrote the following code for Head which should follow the body like a spring. I added friction so the head will stop bouncing sometime but no success. The head keeps jumping near the beggining of the spring (which is the beggining of the body) and not stopping. What should I do to make the head stop at some time?
final static int MASS = 10;
final static int FRICTION = 100;
private final double hardness = 3;
public void followBody(Body body) {
double[] coards = getCoardinatesBy(getRadius(), body.getXCoardStart(), body.getYCoardStart(), 180+body.getAngel()); // get the coordinates of the beginning of the spring (where should the head be in the end
coards[0] -= getRadius();
coards[1] -= getRadius();
if (getYSpeed() < 0) {
this.setYAcceleration((getYForce(coards[1]) + FRICTION)/MASS);
} else if (getYSpeed() > 0) {
this.setYAcceleration((getYForce(coards[1]) - FRICTION)/MASS);
} else if (Math.abs(getYForce(coards[1])) < FRICTION ) { //static friction, equal to the power or less
this.setYAcceleration(0);
} else {
this.setYAcceleration(getYForce(coards[1]) / MASS); // speed is zero. new the head is far away from the spring
if (getXSpeed() < 0) {
this.setXAcceleration((getXForce(coards[0]) + FRICTION)/MASS);
} else if (getXSpeed() > 0) {
this.setXAcceleration((getXForce(coards[0]) - FRICTION)/MASS);
} else if (Math.abs(getXForce(coards[0])) < FRICTION) { // static friction, equal to the power or less
this.setXAcceleration(0);
} else {
this.setXAcceleration(getXForce(coards[0]) / MASS); // speed is zero. new the head is far away from the spring
double getYForce(double y){
return hardness*(y-yCoardStart);
double getXForce(double x){
return hardness*(x-xCoardStart);
static double[] getCoardinatesBy(double height, double startX, double startY, double angel) {
double[] coardinates = new double[2];
coardinates[1] = startY - (height * Math.sin((Math.toRadians(angel))));
coardinates[0] = startX + (height * Math.cos(Math.toRadians(angel)));
return coardinates;
public void update() {
xSpeed += xAcc;
ySpeed += yAcc;
xCoardStart += xSpeed;
xCoardEnd += xSpeed;
yCoardEnd += ySpeed;
yCoardStart += ySpeed;
angularVelocity+=angularAcc;
this.angel += angularVelocity;
autoSetEndXY();
private void autoSetEndXY() {
double[] coards = getCoardinatesBy(height, xCoardStart, yCoardStart, angel);
yCoardEnd = coards[1];
xCoardEnd = coards[0];
}Edited by: Vitali.pom on May 20, 2012 6:01 AM
Edited by: Vitali.pom on May 29, 2012 12:19 AM
Edited by: Vitali.pom on Jun 26, 2012 12:05 PMThanks for the try. That's what I tried:
public void followBodyPart(BodyPart body) {
double[] coards = getCoardinatesBy(getRadius(), body.getXCoardStart(), body.getYCoardStart(), 180+body.getAngel());
coards[0] -= getRadius();
coards[1] -= getRadius();
if (getYSpeed() < 0) {
this.setYAcceleration((getYForce(coards[1]) + FRICTION)/MASS);
} else if (getYSpeed() > 0) {
this.setYAcceleration((getYForce(coards[1]) - FRICTION)/MASS);
System.out.println("Player moved.");
} else if (Math.abs(getYForce(coards[1])) < FRICTION) {
this.setYAcceleration(0);
System.out.println("y force is 0.");
} else {
this.setYAcceleration((getYForce(coards[1]))/ MASS);
if (getXSpeed() < 0) {
this.setXAcceleration((getXForce(coards[0]) + FRICTION)/MASS);
} else if (getXSpeed() > 0) {
this.setXAcceleration((getXForce(coards[0]) - FRICTION)/MASS);
System.out.println("Player moved.");
} else if (Math.abs(getXForce(coards[0])) < FRICTION) {
this.setXAcceleration(0);
System.out.println("x force is 0.");
} else {
this.setXAcceleration((getXForce(coards[0]))/ MASS);
}And that's what I got (repeating in the end):
Player moved.
y force is 0.
y force is 0.
Player moved.
y force is 0.
y force is 0.
Player moved.
y force is 0.
Player moved.
Player moved.
Player moved.
Player moved.
Player moved.
Edited by: Vitali.pom on Jun 16, 2012 3:54 AM -
Add default value to the Header Text of the Quotation
Hi All,
I want to add the default value to the header text of the Quotation.
I've created the Text Type and Access Sequence usign the VOTXN,
but I want some default text shown on the header text when user click on the Text type.
for e.g.
"The reason", "Qty"....
I've check the routine of data transfer and also the User Exit MV45AFZB Userexit_MOVE_FIELD_TO_TVCOM_H...still no solution.
Please help.
TerryPlease check below link.
http://www.sapfans.com/forums/viewtopic.php?f=5&t=324385 -
How to bring the Header value to the row ?
Dear All,
I am a starter in learning SDK. have developed a form having 2 tables a header and a row detailed one.
Now i need to update a field in all the row with a header value when the header value is added. it should be like the SE name getting updated when the SE name is selected in header level in std doc.
how to arrive it?
kindly help me to achieve this.
Thanks,
Sam.Dear Gordon,
May the customer enters a value to the header which they want it to be unique value for all the row detail.
If there exists more than 50 rows they cant enter it for each and every row, for in case if the value needed to be changed for a particular row or for particular few rows they will change it manually to that row alone.
I just want to achieve this scenario in my form.
Do you know how to bring in ?
As this is being a normal functionality in Std forms.
Thank you...
Maybe you are looking for
-
Error in bapi_po_getdetail
Hi all, I am using BAPI_PO_GETDETAIL to get required data. cODE IS data: po_items type table of bapiekpo with header line. data: po_item_schedules type table of BAPIEKET with header line. data: PO_ITEM_TEXTS type table of BAPIEKPOTX with header lin
-
Hey everyone please answer me as soon as possible;
I want to ask does the Apple Mini DisplayPort to DVI adapter works with Macbook Pro 13 inc. Late 2011 and to be specific; does it fit in the Thundebolt?
-
BO 4.0 LCM - Override settings option not working consistently.
Does anyone here have experience using LCM for BOBJ 4.0? I'm promoting all of the Best Practice reports that I implemented on our Dev. server to our Prod. server and would like LCM to map the dev connection settings to the prod connection settings. I
-
Need a download for Illustrator CS4
I need a download for Illustrator CS4. I have a valid serial number but the disc seems to be damaged.
-
How to tell if your screen is dying
I have been noticing on my iMac that any sort of bright colors show these dark swirls coming out the sides of my screen. Its really hard to explain. Say when I boot up my machine and its showing the Apple Logo with the white background I see on the s