Application Development and Automation 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: 
Read only

Database view

Former Member
0 Likes
1,427

Hello folks,

I really am having a serious issue here.

I am building a database view based on a z table and pa0002 infotype using employee number as join condition. The pa0002 infotype is having 2 records for each employee number (due to some reason).

In the view I am seeing 2 records for each employee (which is expected) but I am trying to filter those records with a selection condition in the database view.

I am trying to put the following logic in the seelction condition of the database view.

Begin date LE sy-datum and

End date GE sy-datum.

But the 'comparison value' in selection condition of a database view is not taking sy-datum. It is looking for a constant or a string in quotations. I need to compare begin and end dates with todays date.

Can any1 help how to address this issue.

Thanks,

Message was edited by: Naren Somen

9 REPLIES 9
Read only

Former Member
0 Likes
1,157

You should be able to use SY-DATUM or SYST-DATUM in Help and Maintenance views. I don't think you use quotes for the system fields.

Is it a MAINTENANCE or HELP View? Not sure it works with a DB view. I've only used it with MAINTENANCE and HELP views.

Read only

0 Likes
1,157

Hello Norman,

Yes I know that sy-datum can be declared in maintenance and help views. But I want to download the contents the view in to a file. Can I do that using maintenance view?? I dont think so. Please suggest.

Read only

0 Likes
1,157

Hi Naren,

You can down load the contents in the view (Using SE11/Se16)but not in maintenance view.

Lanka

Read only

0 Likes
1,157

Hello Murthy,

Yes...that is the reason behind creating a database view so that I can download the contents. But it has a restriction..I can not specify sy-datum in the selection method.

Where as with Maintenance view I can specify sy-datum in the selection method for filtering but can not download.

I am looking for a solution which satisfies both scenarios.

Thanks,

Naren

Read only

0 Likes
1,157

Can you define a HELP VIEW against the database view (or the same tables in the view) and then put the SY-DATUM selection in the HELP VIEW?

Read only

0 Likes
1,157

Hello Norman,

How can I attach a help view to a database view??

Can help view be used for my requirement. If I create a help view can I display the contents of those two tables used in help view like I do in database view??

Thanks,

Naren

Read only

0 Likes
1,157

I thought you could point one view to another, but I just tried and it doesn't look like it. Sorry. I'm still looking around.

Read only

0 Likes
1,157

Hopefully someone will think of a solution. All I can think of is changing the DATABASE view to a MAINTENANCE view, adding the SY-DATUM restriction, and setting the ACCESS to READ ONLY. Don't think you could use SE16, so you would have to do something like an ALV to display and download the data.

Read only

0 Likes
1,157

Hello Norman,

Thanks for your replies. Ypur replies are rewarding.

Here is the solution I came across and implemented.

Instead of using sy-datum, I am just comparing end date to '12/31/9999' to get a unique/latest record.

Thanks,