cancel
Showing results for 
Search instead for 
Did you mean: 

Excluding of records from extraction

Former Member
0 Kudos

Hi Experts

1. I am in need of code to exclude the records for a particular value of the fields AUART and VBUND

For records with the following criteria should be EXCLUDED

Sales Order Type (AUART): ZCP

Trading partner (VBUND): 1261

I know that we can write the code at start routine of the transformations but what to write in

the start routine of transformations

2. I have an extractor bringing data from ECC to info cube with alternative unit of measure

Now I need to undo these conversions in the current extractor and bring in these values from a

Custom Z table from ECC using generic extractor

And I am doubted in how to undo these conversions from the current extractor to the cube

Please help me

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

For your first query, please write the below code in the start routine of the transformation :

DELETE SOURCE_PACKAGE WHERE AUART = ZCP OR VBUND = 1261.

Can you please brief about your second query?

Hope it helps.

Regards

Sadeesh

Former Member
0 Kudos

Hi All/Sadeesh

Thank you for your quick response

I need to write routine at info package level to exclude the records where

Sales order type (AUART) = u2018ZCPu2019 AND Trading partner (VBUND) = u20181261u2019

My requirement is to write at info package level only

How can I achieve this? Please provide the sample code

Thank you

mansi_dandavate
Active Contributor
0 Kudos

Hi,

Use the following code.

data: l_idx like sy-tabix.

read table l_t_range with key

fieldname = 'AUART'.

l_idx = sy-tabix.

l_t_range-low = 'ZCP'.

l_t_range-high = 'ZCP'.

l_t_range-sign = 'E'.

l_t_range-option = 'EQ'.

modify l_t_range index l_idx.

p_subrc = 0.

And same code will be for the other field.

Just change AUART with VBUND and ZCP with 1261.

Regards,

Mansi

Former Member
0 Kudos

Hi Mansi

Thanks for code given

small clarificatication as i dont know ABAP

will this code for the two fields deletes the records with the criteria

AUART = 'ZCP' AND VBUND = '1261'

and in the data selection tab at which fields selection (AUART or VBUND) I need to include this code or

AUART code at AUART field and

VBUND code at VBUND field

Thank you

shanthi_bhaskar
Active Contributor
0 Kudos

it wont delete the records but it these are excluded from the selection..

these are filtered out from loading in to the cube/dso

Edited by: shanthi bhaskar on Apr 29, 2009 5:39 PM

Former Member
0 Kudos

Hi Shanti Bhaskar

Thank you for clarification

So this code exclude the records which meets the following criteria

AUART = ZCP AND VBUND = 1261

as my requirement is to exclude the records which meets above criteria

and please give me clarification on at which fields selection to insert this code for both the fields

thank you

shanthi_bhaskar
Active Contributor
0 Kudos

yes you need to place filter code for two fields separately

i.e for AUART where you will exclude ZCP as per Mansi's code

for VBUND where you will exclude 1261 as per code....

Former Member
0 Kudos

Hi Shanti Bhaskar

Thank you so much for clarification

Answers (2)

Answers (2)

Former Member
0 Kudos

Plese help me

This code in infopackage excluding all the records where auart = ZCP

and also the records Vbund = 1261

but not according to the specific selection as auart = ZCP and Vbund = 1261

please help me on this

awaiting response

thank you

Edited by: MSS:-) on May 5, 2009 8:16 AM

Former Member
0 Kudos

Hi

I believe you cannot implement your scenario in infopackage. if you want to exclude records based on the selection as auart = ZCP and Vbund = 1261 then you have to do it at the transformation level.

1. Plz extract all the data to the PSA from source.

2. In the transformation write start routine to delete records where auart = ZCP and Vbund = 1261.

3. Code : DELETE SOURCE_PACKAGE WHERE AUART = ZCP AND VBUND = 1261.

Hope it helps.

Regards

Sadeesh

Former Member
0 Kudos

Hi Sadeesh

Can you please explain where to place this code in the transformations start routine

and give me the exact code to be placed as i dont know ABAP

I have 632 records in source and full load to PSA gave 725 records in to PSA how is it possible

and the no of records that meets Auart = ZCP and vbund = 1261 are 96 in the source

what is happening in the back ground whilw loding

can you plase clarify this to me

thank you

Former Member
0 Kudos

Hi

1. Open the transformation and click on start routine

2. The ABAP editor screen appears and you can find this part in the abap editor of start routine "$$ begin of routine - insert your code only below this line -

... "insert your code here"

3. Please delete the line "insert your code here" completely and paste the code which i gave you.

4. Check for syntax errors and activate the transformation.

5. Also activate the DTP.

Also please dont not put the code below "begin of global or 2nd part of global".

Plz lemme how many records you have in rsa3 without any selection. The infopackage will just fetch the records from the source and it will not do any transformation.

Hope it helps.

Former Member
0 Kudos

Hi Sadeesh

Thank you

sorry for the values mentioned in the previous post

In RSA3 with out any selection i have 725 records in the ztable

through infopackage i got 725 records to the PSA

and 96 records are matching the criteria auart= zcp and vbund= 1261

I placed the code in the start routine of the transformations and activated the transformations

now after the DTP executed i have only 186 records in the cube instead of 629 (725-96)

why it is happening

thank you

Former Member
0 Kudos

Hi

I feel the code is fine. Plz put a break point in the start routine of the code and execute the dtp in debugging mode and find out the how it is deleting the records.

If you dont know abap then you have to take the help of an abaper to debug it.

Regards

Sadeesh

Former Member
0 Kudos

Hi Sadeesh

thank you fo your code

i solved the problem i placed '001261' instead of '1261'

now it is giving 629 records in the cube

and more over i have one doubt

why we cannot do the coding for this sort of crieteria at infopackage level

can som one explain the reason for this

thank you

Former Member
0 Kudos

Hi

The reason why we are not able to achieve the same in the infopackage is that there is no provision to write the routine for the combination of fields.(In your case Auart and vband)

You can only write routine to exclude records for fields separately not for the combination. But you can achieve it in start routine because the source_package internal table contains the all the records.

Hope it

Former Member
0 Kudos

Hi,

Try the below code

DATA : wa TYPE data_package_structure.

if /bic/AUART = ZCP.

Delete Data package from wa.

endif.

if /bic/VBUND = 1261.

Delete Data package from wa.

endif.