‎2006 Jun 15 6:36 PM
Hi folks,
I want to pick the data from payr table where pridt(creation date) IN sel_cpud ( selection screen field)and
voidd > sel_cpud.
I mean , i need to get checks from payer for the period of creation date and need to include voided checks whose void date is greater than creation date which we enter in selection screen.
How to write a query.
thanks in advance.
regards
Vishal
‎2006 Jun 15 6:45 PM
Hi vishal,
select f1 f2 ... from payr into table itab where
pridt in se_cpud.
loop at itab.
delete itab where voidd < sel_cpud.
endloop.
hope this helps.
reward if helpful.
regards,
keerthi.
‎2006 Jun 15 6:39 PM
If i say
select * from payr where pridt IN sel_cpud
AND voidd > sel_cpud , its not picking any data even data is avilable between this pridt period which we enter in selection screen.
‎2006 Jun 15 6:47 PM
‎2006 Jun 15 6:47 PM
You have to use OR not AND. Also, 'voidd > selcpud' will not work because selcpud is a select option. So if the user enters a range of dates, are you saying your voided date should be greater than every one of them? Think again if it makes sense. If it is a single date(parameter) entered in the selection screen, then it is ok no if it is a range.
‎2006 Jun 15 6:45 PM
Hi vishal,
select f1 f2 ... from payr into table itab where
pridt in se_cpud.
loop at itab.
delete itab where voidd < sel_cpud.
endloop.
hope this helps.
reward if helpful.
regards,
keerthi.
‎2006 Jun 15 6:47 PM
hi you cannot use > if your selection screen field is a defined using SELECT-OPTIONS.
if it is defined using PARAMETERS then your code should look like
select * from payr into table int_payr where pridt eq sel_cpud and voidd gt sel_cpud.
if you have defined the SELECT-OPTIONS then your code should look like.
RANGES r_voidd FOR payr-voidd.
START-OF-SELECTION.
LOOP AT SEL_CPUD.
MOVE: SEL_CPUD-LOW TO R_VOIDD-LOW,
SEL_CPUD-HIGH TO R_VOIDD-HIGH,
'EQ' TO R_VOIDD-OPTION,
'I' TO R_VOIDD-SIGN.
APPEND R_VOIDD.
ENDLOOP.
select * from payr into table int_payr where pridt in sel_cpud and voidd in R_VOIDD.
Cheers,
Abdul Hakim