on 06-15-2006 4:10 PM
Hi, guys.
I´m working with "Ud Connect" and trying to build a routine logic in infopackage level to read 3 dates and make a selection :
Date 1 (range = 06/09/2006 to 06/14/2006)
Date 2 (range = 06/09/2006 to 06/12/2006)
Date 3 (range = 06/05/2006 to 06/13/2006)
What i need is to validate each line of the pack with each field (OR clause and not AND).
For example :
If I have one line of the pack with the contents
Date1 = 06/13/2006, Date2 = 06/01/2006 and Date3 = 06/02/2006 the line should be selected (one of these selection are right).
The problem is that the selection only occurs if all the fields are ok.
Any ideas ?
Thanks for the help
Eduardo Silberberg
Hi Eduardo,
As i know, you can not give Or Condition in infopackage. If you want to fetch the data on OR condition, For your case, create 3 infopackages and pull the data to ODS in overwrite mode.
Or Pull the data using one infopackage(by specifing from and to date) and write a small code in start routine to keep the records according to your condition and delete the remaining records.
Hope it Helps
Srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Srini and OscarRomero.
If I create the 3 infopackages to filter these 3 fields I will have first to select all the registers and then delete the remaining or let the ODS do that.
The ideal is to restrict that in infopackage level but I think is not possible.
Thanks for your suggestions.
Eduardo
Eduardo,
try this and let me know.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = <date1>.
l_idx = sy-tabix.
L_t_range-low = '20060609'.
l_t_range-high = '20060614'.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
modify l_t_range index l_idx.
p_subrc = 0.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = <date2>.
l_idx = sy-tabix.
L_t_range-low = '20060609'.
l_t_range-high = '20060612'.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
modify l_t_range index l_idx.
p_subrc = 0.
date3:
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = <date1>.
l_idx = sy-tabix.
L_t_range-low = '20060605'.
l_t_range-high = '20060613'.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
modify l_t_range index l_idx.
p_subrc = 0.
system will check whether these 3 fields checks success then only that record will pick for BW.
Regards,
Nagesh Ganisetti.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Eduardo,
your intention is to get the records which satisfies
Date 1 (range = 06/09/2006 to 06/14/2006)
Date 2 (range = 06/09/2006 to 06/12/2006)
Date 3 (range = 06/05/2006 to 06/13/2006) this condition.
if that is the case.
create one IP. these fields should be enable for selection.
create 3 Routines one for each field.
sure this code will work.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = <date1>.
l_idx = sy-tabix.
L_t_range-low = '20060609'.
l_t_range-high = '20060614'.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
modify l_t_range index l_idx.
p_subrc = 0.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = <date2>.
l_idx = sy-tabix.
L_t_range-low = '20060609'.
l_t_range-high = '20060612'.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
modify l_t_range index l_idx.
p_subrc = 0.
date3:
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = <date1>.
l_idx = sy-tabix.
L_t_range-low = '20060605'.
l_t_range-high = '20060613'.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
modify l_t_range index l_idx.
p_subrc = 0.
above code will work you need to create 3 routines for corresponding fields.
you can try this code also and let me know this one you need to create only one routine for any of the date field.
check this and let me know.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = <date1>.
l_idx = sy-tabix.
L_t_range-low = '20060609'.
l_t_range-high = '20060614'.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
modify l_t_range index l_idx.
read table l_t_range with key
fieldname = <date2>.
l_idx = sy-tabix.
L_t_range-low = '20060905'.
l_t_range-high = '20060612'.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
modify l_t_range index l_idx.
read table l_t_range with key
fieldname = <date3>.
l_idx = sy-tabix.
L_t_range-low = '20060605'.
l_t_range-high = '20060613'.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
modify l_t_range index l_idx.
p_subrc = 0.
An idea can be made three infopackge, each one filtering by one date, there you have the OR condition. Then the problem is than one record can be selected twice, but if you load into ODS it shouldn't be a problem, i think. It depends of the number of records to load too, obvious.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.