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

How to Compare DateTime Fields to Date Value Fields

0 Likes
1,415

Hi Colleagues,

I have a Local table with Period as one the structure in it and it holds StartDate, EndDate with GDT APC_S_UP_LOCALNORM_DAT_TIM_PER

Now I need to compare the rows in the table based on a date field that I have of type APC_V_DATE. however it looks like it is not able to compare these two fields.

I am using the following expression:

period-start_date_time-content le low_date or period-start_date_time-content ge high_date

Can you please help.

Regards,

Rohit

7 REPLIES 7
Read only

Former Member
0 Likes
1,316

Hi Rohit,

Can you explain a bit more about your scenario? You want to compare records or fields means columns?

Regards,

Aabha

Read only

0 Likes
1,316

GoodMorning Aabha,

I have an internal table (of 10 Columns) in which I have a Column Period. Period is of structure and Has Start Date and Endate.

Now I want to get records from this table comparing the date fields with another variable of type APC_V_DATE

Now I am facing problem in comparing it because of Different Data Types.

Read only

Former Member
0 Likes
1,316

Very Good morning Rohit,

Before comparing these fields convert them in same date formart. Then you can retreive the values by comparing both the dates.

Regards,

Aabha

Read only

0 Likes
1,316

Correct, Now in order to convert my Date value to a Datetime Value I need to get some method from ISDT class...Which I can't see

Read only

Former Member
0 Likes
1,316

Hi,

There are many function Modules available which can convert Date Formats, Ex: CONVERSION_EXIT_SDATE_INPUT.

You can also search with convertdate* in tcode SE37, you will many FM, find the one suitable to you.

Regards,

Shweta Soragavi

Read only

Shahid
Product and Topic Expert
Product and Topic Expert
0 Likes
1,316

data: lv_date type "of your start date type".

write APC_V_DATE to lv_date.

Read only

0 Likes
1,316

Thanks a lot colleagues for your help, I used the above suggestions from all and was able to achieve it.

Thanks.