2009 Feb 16 3:48 PM
Hi All,
Can anyone please guide how do i get the PO's(EKKO-EBELN ) within + - 7 days from a particular date.(Input), Your help is highly appreciated
Cheers,
Smith
2009 Feb 16 4:00 PM
Check this:
TABLES: ekko.
PARAMETER: p_date TYPE d.
SELECT-OPTIONS: s_date FOR ekko-aedat NO INTERVALS NO-EXTENSION.
INITIALIZATION.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = p_date
days = '7'
signum = '-'
IMPORTING
calc_date = p_date.
w_date-sign = 'I'.
w_date-option = 'EQ'.
w_date-low = p_date .
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = p_date
days = '7'
signum = '+'
IMPORTING
calc_date = p_date.
w_date-high = p_date .
APPEND w_date TO s_date.
SELECT * FROM ekko
WHERE aedat IN s_date.
2009 Feb 16 3:57 PM
Hi,
Try these codes:
Parameters: P_date type sy-datum.
RANGES:
S_DATE FOR <DATE>.
AT SELECTION-SCREEN.
S_date-low = p_date - 7.
S_date-high = p_date + 7.
If S_date-high > sy-datum.
S_date-high = sy-datum.
endif.
S_date-option = 'EQ'.
S_date-sign = 'I'.
Append S_DATE.
USE the S_DATE in SELECT QUERY.
EX: SELECT PO FROM <DB> into itab where date in s_date
Regards,
Gurpreet
2009 Feb 16 4:00 PM
Check this:
TABLES: ekko.
PARAMETER: p_date TYPE d.
SELECT-OPTIONS: s_date FOR ekko-aedat NO INTERVALS NO-EXTENSION.
INITIALIZATION.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = p_date
days = '7'
signum = '-'
IMPORTING
calc_date = p_date.
w_date-sign = 'I'.
w_date-option = 'EQ'.
w_date-low = p_date .
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = p_date
days = '7'
signum = '+'
IMPORTING
calc_date = p_date.
w_date-high = p_date .
APPEND w_date TO s_date.
SELECT * FROM ekko
WHERE aedat IN s_date.
2009 Feb 16 4:08 PM
2009 Feb 16 4:26 PM
Hi GP & J@Y,
Apologies for opening this again,
I'm creating a BAPI with the input feild as date,i_date(to be checked in EKKO) and the output the list of PO numbers , which has to be checked against EKPO-WERKS = 1234. and only send the final output the list of po numbers(from EKPO-EBELN), Can you please help me to write code for this.
Your help is highly appreciated.
Cheers,
Smith
2009 Feb 17 10:14 PM
creating a BAPI to list all the PO's that too much to imagine....
select a~ebeln
from ekko
join ekpo
on ekko~ebeln = ekpo~ebeln
into table itab_ek
where ekko~AEDAT in s_date "the way we told before...
and ekpo~werks = '1234'.