How to pass relative dates (Yesterday, Last week) via Command Parameters in a linked subreport
I have been struggling with this one and would sure appreciate your help
I have a report that runs fine but takes to long when running, to optimise it have setup it up as a subreport , created a main report which I linked to it via a relative field ({?ServiceID}) field, this has reduced the report time but I would like to go even further by user selecting date e.g startdate, enddate or relative field eg ‘yesterday’, ‘Last Week’
I can do the selectable start and end date fine but I’m failing to make use of the ‘Yesterday’,’ last week’ within the command parameters, below is an example of the code I have on the reports select expert but I want a semiliar filtering on the command parameter to avoid the filtering taking place on crystal but straight from the DB.
IF {?Relative Date}= "Yesterday" THEN currentdate-1
ELSE IF {?Relative Date}="Last Week" THEN LastFullWeek
Good Day Guys,
Apologies for the late response, I have been looking and trying the different suggestion you pointed out, unfortunately without any success
Stored Proc
Nrupal, I tried setting one up but I’m getting a error I cannot seem to get past, below is my condition, any help would be appreciated
where cd1.Service_ID = @Service_ID
and cd1.CallStartDt in (
Case @RelativeDate
When 'Today' then CONVERT (date, getdate())
When 'Yesterday' Then DATEADD(DAY,-1,CONVERT (date, getdate()))
When ‘Last Week’ then between @LastWeekStart and @LastWeekEnd //sytntax before between, also tried using ‘IN’, same result
When ‘Last Month’ then between @LastMonthStart and @LastMonthEnd
else between @CallStart and @CallEnd
END )
End
Crystal command parameter code
where cd1.Service_ID in ({?Service_ID}) and
convert(datetime,cd1.CallStartdt) in (
Case {?RelativeDate}
When 'Yesterday' Then GetDate()-1
else {?CallStart}
END)
Abhilash,
I have tried both your proposed command parameters but still fail
I’m getting an invalid column name ‘Yesterday’ error , I’m not sure if Crytsal takes this type of command formatting using the command parameters, would appreciate your help as I would like to stay clear of the SP, unless it’s the only altanative
Dell
I will start working in your re
Thanks Again
Similar Messages
-
How to pass the data from wa_itab to fieldcatlog?
how to pass the data from wa_itab to fieldcatlog?
Your question doesn't appear to be Web Dynpro ABAP related. Please only post questions in this forum if they are directly Web Dynpro ABAP related. There are several other more general ABAP related forums.
-
How to pass table data to brf plus application through abap program
Dear All,
i have a question related to BRF Plus management through abap program.
In brf plus application end, Field1,field2,field3 these 3 are importing parameters.
Table1->structure1->field4,field5 this is the table,with in one structure is there and 2 fields.
in my abap program, i am getting values of fields let us take field1,field2,field3,field4,field5.
And my question is
1) How to pass fields to BRF Plus application from abap program.
2)How to pass Table data to BRF Plus application from abap program.
3)How to pass Structure data to BRF Plus application from abap program.
4)How to get the result data from BRF Plus application to my abap program.
And finally , how to run FDT_TEMPLATE_FUNCTION_PROCESS.
How do i get the code automatically when calling the function in brf plus application.
Regards
venkata.Hi Prabhu,
Since it is a Custom Fm i cant see it in my system.
Look if u want to bring data in internal table then there could be two ways::
1) your FM should contain itab in CHANGING option , so that u can have internal table of same type and pass through FM,
2) read values one by one and append to internal table.
Thanks
Rohit G -
Hi All,
I have a simple query which is below:-
Declare @reportdate date
set @reportdate= (DATEADD(dd,-5,getdate()))
select * from dbo.Table
where date IN (@reportdate)
I need this query to pull the data for the last 3rd business day .So lets say today is monday then i need the data for last week wednesday which is 3 business days back from monday, if today is a tuesday it would be for last thursday ( as 3 business days for
tuesday would be thursday). But if today is wednesday then i need to be last 3rd business day which is last friday and i also need to get the data for saturday and sunday.
Can someone please help me how cani change my filter to do this?
Please let me know if i am still unclear.
ThanksHi SqlDev12,
Based on my understanding on your requirement, you can reference the below sample.
CREATE TABLE BusinessTable
Bdate DATE,
Wd VARCHAR(10)
;WITH Cte(DT,WD) AS
SELECT CAST('20150401' AS DATE),DATENAME(WEEKDAY,CAST('20150401' AS DATE))
UNION ALL
SELECT DATEADD(DAY,1,DT),DATENAME(WEEKDAY,DATEADD(DAY,1,DT)) FROM Cte
WHERE DT<GETDATE()
INSERT INTO BusinessTable SELECT * FROM Cte
SELECT * FROM BusinessTable
SET DATEFIRST 7 -- Set Sunday as the first day of a week
DECLARE @givenDay DATE ='20150415' --Wednesday
SELECT * FROM BusinessTable
WHERE Bdate BETWEEN
--For Monday and Sunday, select last wednesday
(CASE WHEN DATEPART(WEEKDAY,@givenDay) IN(1,2) THEN DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay)-1,0))
--For Tuesday and Wednesday, last week's Thursday and Friday
WHEN DATEPART(WEEKDAY,@givenDay) IN(3,4) THEN DATEADD(DAY,-5,@givenDay)
--For Thursday and Friday, current week's Monday and Tuesday
WHEN DATEPART(WEEKDAY,@givenDay) IN(5,6) THEN DATEADD(DAY,-3,@givenDay)
--For Saturday, current week's Wednesday
ELSE DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay),0)) END)
AND
(CASE WHEN DATEPART(WEEKDAY,@givenDay) IN(1,2) THEN DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay)-1,0))
WHEN DATEPART(WEEKDAY,@givenDay) IN(3) THEN DATEADD(DAY,-5,@givenDay)
WHEN DATEPART(WEEKDAY,@givenDay) IN(4) THEN DATEADD(DAY,-3,@givenDay)
WHEN DATEPART(WEEKDAY,@givenDay) IN(5,6) THEN DATEADD(DAY,-3,@givenDay)
ELSE DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay),0)) END)
DROP TABLE BusinessTable
If you have any feedback on our support, you can click
here.
Eric Zhang
TechNet Community Support -
Calculate Dates for Last week and next three weeks
Hi,
I have a report where I need to calculate dates between last week and the next three weeks (not counting current week). I'm familar with the first part, it could be done by using the LastFullweek function but not sure how I can avoid the current week and calculate the next three weeks.
Any help is greatly appreciated.
Thanks!... and here are a few more...
Last Week...
IF {TableName.Date} IN
DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate), #1/7/1900#)
To
DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -1, #1/7/1900#)
THEN TRUE ELSE FALSE
The week before...
IF {TableName.Date} IN
DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -1, #1/7/1900#)
To
DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -2, #1/7/1900#)
THEN TRUE ELSE FALSE
And the week before that...
IF {TableName.Date} IN
DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -2, #1/7/1900#)
To
DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -3, #1/7/1900#)
THEN TRUE ELSE FALSE
and of course all 3 weeks together...
IF {TableName.Date} IN
DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate), #1/7/1900#)
To
DateAdd("ww", DateDiff("ww", #1/7/1900#, CurrentDate) -3, #1/7/1900#)
THEN TRUE ELSE FALSE
If you want the 1st day of the week to be Monday instead of Sunday just change the date of #1/7/190# to #1/1/1900#
HTH,
Jason -
How to pass the data from a input table to RFC data service?
Hi,
I am doing a prototype with VC, I'm wondering how VC pass the data from a table view to a backend data service? For example, I have one RFC in the backend system with a tabel type importing parameter, now I want to pass all the data from an input table view to the RFC, I guess it's possible but I don't know how to do it.
I try to create some events between the input table and data service, but seems there is no a system event can export the whole table to the backend data service.
Thanks for your answer.Thanks for your answer, I tried the solution 2, I create "Submit" button, and ser the mapping scope to be "All data rows", it only works when I select at least one row, otherwise the data would not be passed.
Another question is I have serveral imported table parameter, for each table I have one "submit" event, I want these tables to be submitted at the same time, but if I click the submit button in one table toolbar, I can only submit the table data which has a submit button clicked, for other tables, the data is not passed, how can I achieve it?
Thanks. -
Regarding how to pass the data from web dynpro to workflow
hi gurus,
how to pass the data from web dynpro to workflow.
Regards
vijayCheck this [thread|SAP_WAPI_START_WORKFLOW;
-
How to pass the data from web dynpro to workflow.
hi gurus,
how to pass the data from web dynpro to workflow.
Regards
vijayHi
you can use function module
data ls_input_container TYPE swr_cont.
data lt_input_container TYPE TABLE OF swr_cont.
CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
EXPORTING
task = ptask
IMPORTING
return_code = lv_return_code
new_status = lv_new_status
TABLES
input_container = pinput_container
message_lines = lt_message_lines
message_struct = lt_message_struct.
where you pass the data in imnternal table "pinput_container" as
ls_input_container-element = 'KUNNR'.
ls_input_container-value = ls_skna1-kunnr ."wd_this->lv_kunnr.
APPEND ls_input_container TO lt_input_container .
ls_input_container-element = 'CLUSER'.
ls_input_container-value = lv_cluser.
APPEND ls_input_container TO lt_input_container .
ls_input_container-element = 'BUKRS'.
ls_input_container-value = lv_bukrs. " youe value as per requirement.
APPEND ls_input_container TO lt_input_container .
ls_input_container-element = 'VKORG'.
ls_input_container-value = ls_sknvv-vkorg. " youe value as per requirement
APPEND ls_input_container TO lt_input_container .
ls_input_container-element = 'VTWEG'.
ls_input_container-value = ls_sknvv-vtweg. "youe value as per requirement.
APPEND ls_input_container TO lt_input_container .
ls_input_container-element = 'SPART'.
ls_input_container-value = ls_sknvv-spart. "youe value as per requirement.
APPEND ls_input_container TO lt_input_container .
*Also Forgot to mention where ptask is your workflow ID *
Regards,
Arvind
Edited by: Arvind Patel on May 14, 2010 7:38 AM -
HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?
HI,
HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?
thanks,
samba.By selection screen, what do you mean? There is no selection screen in WDA as there was in classic dynpro. Do you mean you are using the Select-Options reusable component? Are you wanting to call a standard transaction via ITS - SAPGUI for HTML? Please provide more details to your question.
-
How to pass a data set as a filter?
Hello everybody!
Are asking me to do the following:
Select from a Combo Box classifications suppliers and all suppliers to pass on the whole as a result of a query filter.
At this time I was only able to pass the values of the first, someone will have some idea on how to pass a data set as a filter?
The result of my selection, as a way to "Store" and assign it as my input filter query.
thanks for your help.Hi Jan,
thanks for your help, but...
My problem is passing the result of a query directly to another query, to me that this generates a result.
For Example: zquery_1, is the entry qualification of suppliers and I returned a set of suppliers.
The zquery 2, receives as input suppliers that set me back and the materials associated with the suppliers.
To achieve this, I am passing the result of a zquery_1 store and east asginandolo as variable input to zquery_2, my problem is that this just me reading the first of the records.
If the 3 providers zquery_1 me back, how can I pass these 3 andalusia zquery_2 providers without the user having to select them?
greetings
Manuel Sandoval -
How the HR related data of BP is stored in SAPCRM Sys??
Hi Guru's,
I' m very new to the CRM.
I want to know <b>How the HR related data of BP is stored in SAPCRM System?? for the project requirement.</b>
Please, can anybody help in this regard ??
Regards,
Arjunhi,
I don;t entirely understand your question.
But just as in R/3 HR data is stored in infotypes, accesible as always with PPOM, but for CRM, there's also PPOMA_CRM.
If you check the evaluation paths in OOAW, you also see some specific ones for BP. this is also an entity in HR, just as P, O CP etc.
In short, data is stored as relations eventually in table HRP1001
Kind regards, Rob Dielemans -
How to pass XML data between applications
Hi,
can any one tell me how to pass XML data between applications
Thanks in advance
SudheerSteve,
I tried the code in the http package in the Appendix A section of your book. Each time i try a POST I get a HTTP/1.1 400 Bad Request error from the server. I can successfully do a GET from URLs. I have pretty much copied your code verbatim. Any ideas?
Thanks,
Sunder
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
See the "Working with XML Messages" section starting on page 242 of my Building Oracle XML Applications. It covers how to Send and Receive XML messages over the web through HTTP GET and HTTP POST as well as specifically Example 6-30 that illustrates how to receive a posted XML message in a servlet and process it.
Hope this helps.<HR></BLOCKQUOTE>
null -
How to pass table data into below code for alv
hi
i want to pass table data into alvgrid
i dont know how to pass table data.
here instead of passing ABC into internal table
i want to pass table data .
please help me
ialv-test1 = 'ABC'.
form get_data.
ialv-test1 = 'ABC'.
ialv-test2 = 'DEF'.
append ialv.
ialv-test1 = 'GHI'.
ialv-test2 = 'JKL'.
append ialv.
ialv-test1 = '123'.
ialv-test2 = '456'.
append ialv.
endform
thanks in advanced.Have a look at below links. It gives you sample code of alv grid.
http://sap.niraj.tripod.com/id64.html
http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
Have a look at below links for SAP Help.
http://help.sap.com/saphelp_nw04/helpdata/en/8d/e994374c9cd355e10000009b38f8cf/content.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/12/904f42d5f811d2b469006094192fe3/content.htm
Best Regards,
Vibha
*Please mark all the helpful answers -
I have a requirement to display popular search key words with in specific date range. Like search key words searched in last week/ in last 30days/in 90 days.
how to get date range searched keywords from Search Trends?? is there any other way to get these??Issue was due to a syntax error. Case closed.
Thanks!
-OS -
Yesterday & Last week on repots
Hi,
1. How to calculate yesterday date from todays date?, need to view yesterday report on 2days login.
monday i shoud view saturdays.not sundays.
2. Mondays login i need to view last week reports, but on tuesday need to view mondays & tuesday only,
on saturday this weeks only.
How to set the filter on date.
Hope the genies out there can guide me on.
Thanks in Advance.
RegardsI am trying to run a report that always shows the "last full week" Sun-Sat no matter what day of the week you run it. I have tried to apply the CASE statement to my currently "rolling past week" but still get an error message when running.
Can you please review
CASE
When DayofWeek(Current_Date) = 1 Then Date.Date BETWEEN TIMESTAMPADD(SQL_TSI_DAY,-8,(CURRENT_DATE)) AND TIMESTAMPADD(SQL_TSI_DAY,-1,(CURRENT_DATE))
When DayofWeek(Current_Date) = 2 Then Date.Date BETWEEN TIMESTAMPADD(SQL_TSI_DAY,-9,(CURRENT_DATE)) AND TIMESTAMPADD(SQL_TSI_DAY,-2,(CURRENT_DATE))
When DayofWeek(Current_Date) = 3 Then Date.Date BETWEEN TIMESTAMPADD(SQL_TSI_DAY,-10,(CURRENT_DATE)) AND TIMESTAMPADD(SQL_TSI_DAY,-3,(CURRENT_DATE))
When DayofWeek(Current_Date) = 4 Then Date.Date BETWEEN TIMESTAMPADD(SQL_TSI_DAY,-11,(CURRENT_DATE)) AND TIMESTAMPADD(SQL_TSI_DAY,-4,(CURRENT_DATE))
When DayofWeek(Current_Date) = 5 Then Date.Date BETWEEN TIMESTAMPADD(SQL_TSI_DAY,-12,(CURRENT_DATE)) AND TIMESTAMPADD(SQL_TSI_DAY,-5,(CURRENT_DATE))
When DayofWeek(Current_Date) = 6 Then Date.Date BETWEEN TIMESTAMPADD(SQL_TSI_DAY,-13,(CURRENT_DATE)) AND TIMESTAMPADD(SQL_TSI_DAY,-6,(CURRENT_DATE))
When DayofWeek(Current_Date) = 7 Then Date.Date BETWEEN TIMESTAMPADD(SQL_TSI_DAY,-14,(CURRENT_DATE)) AND TIMESTAMPADD(SQL_TSI_DAY,-7,(CURRENT_DATE))
END
and Advise...your prompt assistance is most appreciated.
Thanks Debbie
Maybe you are looking for
-
How do I add mailbox folder in ipad?
Whenever get new mail and want to save it folder. When I go to mailbox and saw "add mailbox" so I clicked it and have no way for me type new mailbox
-
How do I replace a single instance of a string?
I'm trying to replace a certain string in a text file. The problem is, there is other data in the text file that is being affected by the replace() function, since replace() replaces each substring that fits the pattern it's looking for. I want my re
-
SQLs erver migration performance issue
We are performing migration from oracle to MSSQL server 2005 (Windows 2003/SAP 4.6D).Our target system configuration is like below: ->OS - Windows 2003 x64 ->DB - MSSQL server 2005 SP4 ->SAP - 4.6 D kernel ->CPU - 4 processors (2.67ghz each) ->RAM -
-
OS-10.6 server - out-of-the-box
Does the normal OS-10.6 server installation include Apache, PHP4+ and a mySQL 4.2.1+ environment right out of the box?
-
Charging port on MacBook died, what to do?
so my laptop was at 3% and I went to go charge it; wouldn't charge. I kept trying and trying but eventually my laptop just died. I'm really hoping it's my charger and I'll just buy a new one and it'll be fine. But of course I'm over here, thinking ab