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

comparing dates

Former Member
0 Likes
637

Hi,

I am working with promotion transaction WAK1.

My requirement is to select the condition record number from the table A017 by comparing the all the primary key fields.

in that i have date fields valid to date and valid end date .

i want to select the condition record number which will fall between the valid to date and from date of header promotion.

I am using DATBI GE lv_vkdbi

AND DATAB LE lv_vkdab.

lv_vkdbi and lv_vkdab are dates that i converted using CONVERSION_EXIT_PDATE_OUTPUT' of the header wakhd.

i am getting the condition record number if i remove the dates comparison.

Please help me in getting with dates comparison

regdards

pavee.

1 ACCEPTED SOLUTION
Read only

anand_goenka
Explorer
0 Likes
602

hi praveen_g,

try adding a condition in WHERE in ur SQL "and U_date between St_Date

and End_Date" where U_date is the date u want to compare and St_Date is starting date and End_Date is the ending date or last date....

regards,

Anand

4 REPLIES 4
Read only

Former Member
0 Likes
602

Hi,

check out the following link it might help you

http://help.sap.com/saphelp_webas620/helpdata/en/fc/eb3509358411d1829f0000e829fbfe/frameset.htm

****please reward points if the infromation is helpful to you***********

Read only

Former Member
0 Likes
602

Hi Praveen,

Comparing Dates is similar to the comparison of remaining data types.

An example code can be as below:

Parameters: a type D, b type D.

if a EQ b.

Write 'EQUAL'.

elseif a GT b.

Write 'a is GREATER THAN b'.

else.

Write 'a is LESSER THAN b'.

endif.

The format of the Date field may vary from system to system. For ex. YYYYMMDD or DDMMYYYY.

Reward points for useful answers.

Regards,

Sumanth

Read only

Former Member
0 Likes
602

Hi Praveen,

You can see the date format in the entries of A017. The Function Module CONVERSION_EXIT_PDATE_OUTPUT would not help in this case.

You would have to convert the dates to match with the format of A017.

For further help, do not hesitate to mail me.

Reward points if helpful.

Regards,

Atin

Read only

anand_goenka
Explorer
0 Likes
603

hi praveen_g,

try adding a condition in WHERE in ur SQL "and U_date between St_Date

and End_Date" where U_date is the date u want to compare and St_Date is starting date and End_Date is the ending date or last date....

regards,

Anand