Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SQ01 & SQ02 Infoset

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

jogeswararao_kavala
Active Contributor

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

24 REPLIES 24

Former Member
0 Kudos

Hi,

Try creating a variant to read the Date from the TVARVC and update the table TVARVC when infoset is executed.

Regards,

Naveen Kumar.

0 Kudos

This message was moderated.

0 Kudos

Thanks Naveen. I am unaware of TVARVC and I'm researching how this works. I am also very new to SAP.

thanga_prakash
Active Contributor
0 Kudos

Hello Shawn,

You can try coding in the below suitable event codes available in SQ02.

Regards,

TP

raymond_giuseppi
Active Contributor
0 Kudos

There are two steps in SQ02, navigate to Extras

  • In tab "selection", use create icon
  • In tab "code", select record processing and add a check between record field and the added parameter/select-option

Regards,

Raymond

Former Member
0 Kudos

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.

Jelena
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

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

Jelena
Active Contributor
0 Kudos

Raymond already replied above how to add a parameter in the Infoset. Is that solution not working for you for some reason?

Former Member
0 Kudos

I am researching "TVARVC" and I apologize for not mentioning that I am new to SAP. Thanks for the suggestions and assistance

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Thank you Julius. I will try that

jogeswararao_kavala
Active Contributor

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

0 Kudos

Thank you

0 Kudos

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.

0 Kudos

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)

0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

Copy to own program and transport...

Or write your own program....

Or use SAP report which already does this...

Zzzzzz....

Cheers,

Julius

0 Kudos

I figured it out. Thanks.