2009 Jan 29 8:44 PM
Hi Gurus!
I have given an option in my report o show the total number of distinct sales documents in my report in my top-of-page. It works well and fine and shows me the total number of sales doc when athe report is run based on a particular selection criteria, also I have a column to show the number of line items in the report.
The problem arises and which si , when I run the report and in the selection screen when I give a date range i.e 01/07/2008 to 01/31/2008 in between such and such date it gives the total number sales document output in the top-of-page in the top but when I give just one date i. e 01/07/2008 , it gives the output without the top of the page having the number of sales documents. Can I get some help as to why its not showing when only one date is given and shows up when a range of date is given.
Regards
Aarav
2009 Jan 29 8:51 PM
Lets see how you are calculating the number of records and how you are passing it to top-of-page...
paste Code..
2009 Jan 29 9:49 PM
Here is teh code that I ahve used to create :-
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.
Thanks
2009 Jan 29 10:13 PM
Ok I was able to get it , I ahd to add the contents of code in the else statement to at teh end .
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.
Thanks
2009 Jan 29 8:54 PM
Hi Aarav,
I think that when you enter your dates as in between it treats them as such. It means in range table it will give option = 'BT', so it will look for documents between these dates. Conversely when you only provide one date it is consideres as option = 'EQ' which simply means look for documents where date is equal this one. As they might not be any for this date, it doesn't give you any output.
Try debugging and see how data are extracted and if there are any documents counted.
Hope this will answer your doubt.
Marcin
2009 Jan 29 10:14 PM