01-21-2016 12:48 AM
Is it possible to add a field to input date and have the query select from the date that has been input in the new field created? The current InfoSet is set to have the report to calculate from the day of when the report is ran and I have been struggling with this for the past two weeks to figure it out and I need help.
01-26-2016 2:26 AM
Hello Shawn,
This does not look very complex to me the way I understood the requirement. The following solution is in the same lines as Raymond suggested. I have tested this in one of my Infoset Queries and found working well.
Step1
Create a Selection Parameter say USERDATE in the Infoset Extras > Selections
This adds a Parameter field User Date in the Selections Screen.
Step2
Now in the Extras > Code > Record Processing give the following line.
check resb-bdter >= userdate.
Note that resb-bdter is to be replaced by your Date field which needs to be overridden by the Userdate of the Selection screen.
I saw this working. ( Please do not forget to run SQ01 afresh everytime you make changes to and Regenerate SQ02 )
Hope this helps you.
Regards
KJogeswaraRao
01-21-2016 5:26 AM
Hi,
Try creating a variant to read the Date from the TVARVC and update the table TVARVC when infoset is executed.
Regards,
Naveen Kumar.
01-21-2016 5:32 AM
01-25-2016 6:22 PM
Thanks Naveen. I am unaware of TVARVC and I'm researching how this works. I am also very new to SAP.
01-21-2016 7:03 AM
Hello Shawn,
You can try coding in the below suitable event codes available in SQ02.
Regards,
TP
01-21-2016 7:52 AM
There are two steps in SQ02, navigate to Extras
Regards,
Raymond
01-21-2016 3:48 PM
The program/query is in place but it is calculating from the day of the report is being executed. I want to be able to have the users manually enter a date and to run the report on the date specified by the user and the date needs to calculate from the input date instead of the day of when the report is ran.
01-21-2016 5:54 PM
What exactly are you calculating and for what purpose? You are just repeating "I am trying" without stating what exactly the problem or question is. So what replies are you expecting from the community here? I'm confused.
01-21-2016 7:41 PM
The report is currently calculating the active projects that are past due on days and the days left to the due date from the day when the report is completed. What the users want is to be able to input any date and have that date calculate.
This is what is being exported after the user runs the report.
This is the input screen and I need to add a date field
I hope I'm a little more clear on what I need help with. Thanks.
01-22-2016 5:10 AM
Hello Shawn,
Modify the query in SQ01.
Go to Basic List --> Data fields --> Check on the field Report date in the Selection column to be available on the selection screen.
Regards,
Thanga
01-22-2016 2:46 PM
Raymond already replied above how to add a parameter in the Infoset. Is that solution not working for you for some reason?
01-25-2016 6:18 PM
I am researching "TVARVC" and I apologize for not mentioning that I am new to SAP. Thanks for the suggestions and assistance
01-25-2016 6:20 PM
Thanks Thanga. I am now trying to figure out the logic and programming part of it now. I need to make changes to the program but I am uncertain as how
01-25-2016 11:09 PM
Best practice is even better -> create your program using SQ01 in DEV and copy it to a normal report. Create a tcode for the report.
Transport then to QAS and run SAT on it....
Then adjust the code for performance, selection screen logic, defaults, authority-checks if not in LDB, etc....
Then you have control over it and SQ01 just built the selects for you.
ps: the alternative of BW / BI / BO and standard report variants are highly likely to replace 99% of your SQ01 code anyway...
Cheers,
Julius
01-25-2016 11:28 PM
01-26-2016 2:26 AM
Hello Shawn,
This does not look very complex to me the way I understood the requirement. The following solution is in the same lines as Raymond suggested. I have tested this in one of my Infoset Queries and found working well.
Step1
Create a Selection Parameter say USERDATE in the Infoset Extras > Selections
This adds a Parameter field User Date in the Selections Screen.
Step2
Now in the Extras > Code > Record Processing give the following line.
check resb-bdter >= userdate.
Note that resb-bdter is to be replaced by your Date field which needs to be overridden by the Userdate of the Selection screen.
I saw this working. ( Please do not forget to run SQ01 afresh everytime you make changes to and Regenerate SQ02 )
Hope this helps you.
Regards
KJogeswaraRao
01-26-2016 3:16 PM
01-26-2016 5:22 PM
I'm not too sure why it is not giving me the option to be able to select a date. I had to manually input the date. I also replaced "WA_DATE" to "USERDATE" in the calculation and the option for the date calculation. I'm not too sure what else I can do.
01-26-2016 5:33 PM
F4 help
When F4 help is not there for DATE field, you need to enter in this format: 010115. However to get the F4 help in the userdate field, do the little correction in the USERDATE selection parameter in SQ02 as under.
Then you will get the F4 help you are looking for.
Secondly and more Importantly
I have seen you have copied same code given by me as example in the Record Processing and did not replace the RESB-BDTER as suggested. You should replace this field with yours.i.e., the Date field which you told system is calculating the report From. Means the code you should use is
SystemDate >= userdate.
So you need not declare the table. I repeat, the SystemDate above is the same date you mentioned that System is generating the report from..
Knowing the value of the SystemDate is at the center of your issue, without which this can not be achieved.
Note:
In the F4 help section you are free to use any Date field RESB-BDTER or any other suitable Date field. (It can be VIQMEL-QMDAT also)
01-26-2016 6:13 PM
Thanks. I got it to work but now it is only selecting the projects that were created on the date selection. The users want to be able to have the selection select all of the projects and perform the date calculation on the input date. I appreciate your assistance in this matter. I am almost done. I just need to select the correct table and data field.
01-26-2016 6:23 PM
Shawn
Here you only can help yourself. Because you are the person who knows basis of calculation. My assistance is limited to the use of SQO2 only.
01-26-2016 6:37 PM
The only problem I am having now is having the report calculate from the USERDATE field. Trying to decide which data field to use.
CHECK sy-datum >= USERDATE. This is only calculating from today's date. Same as it was when it was created. Not needed.
CHECK PROJ-ZDATE7 >= USERDATE. This has no results.
CHECK PROJ-ERDAT >= USERDATE. This is only selecting the date of the created project.
01-26-2016 11:09 PM
Does the selection need to come from an existing field and it can't be calculated by the input date not coming from an existing field?
CHECK SY-DATUM >= WA_DATE.
or
CHECK "Custom Field" >= WA_DATE.
01-26-2016 11:28 PM
Copy to own program and transport...
Or write your own program....
Or use SAP report which already does this...
Zzzzzz....
Cheers,
Julius
01-28-2016 1:17 AM