‎2007 Jun 25 10:59 AM
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.
‎2007 Jul 16 4:40 PM
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
‎2007 Jun 25 1:12 PM
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***********
‎2007 Jun 26 6:19 AM
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
‎2007 Jun 26 11:24 AM
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
‎2007 Jul 16 4:40 PM
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