cancel
Showing results for 
Search instead for 
Did you mean: 

Infopackage routine !

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Eduardo,

Why you want to delete the records, you want data on <b>OR</b> condition and you are getting by executing 3 infopackages.

Hope it Helps

Srini

Message was edited by: Srini

Former Member
0 Kudos

Srini,

These 3 packs could select registers that occurs in part or all of them.

I can have dates that are in the same range of them.

Regards

Eduardo

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi, Nagesh.

Your suggestion seems to be excellent but i have doubts.

Where should i write this code ?

I can not view other fields when I open a routine in a particular one (infopackage level).

How to implement this code ?

Regards

Eduardo

Former Member
0 Kudos

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.

Former Member
0 Kudos

Nagesh,

The code do the same work as giving direct selection... I didnt understand how it works as OR condition...?? The result will be AND only. Correct me if i am wrong. Or plz explain.

Srini

Former Member
0 Kudos

i missed one point that is OR condition. my won't work for this. and one more thing to my knowledge any routine in IP will satisfy your requirement. you need to do it in the UR.

All the best.

Regards,

Nagesh Ganisetti.

Former Member
0 Kudos

Nagesh,

Thanks for your help.

I will try to change these 3 dates in only one in the source system.

Eduardo

Former Member
0 Kudos

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.