cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Field Routine

virupasan_balanathan
Active Participant
0 Kudos

Dear Experts

i have written a field route but values are not Transferring to The ODS. please check below code and let me know where the mistake is.

if SOURCE_FIELDS-KNART eq 'ZVAO' and SOURCE_FIELDS-KNVAL ne 0.

RESULT = SOURCE_FIELDS-KNVAL.

endif.

regards

B.Virupasan

Edited by: Lankem-IT on Jul 20, 2011 8:22 AM

Accepted Solutions (1)

Accepted Solutions (1)

virupasan_balanathan
Active Participant
0 Kudos

hi Gandewar,rookie,Ashish

thanks

i changed the Code as you Suggested and did the "Rules test" also but still values are not updating.

Rules Details Aggregation is "Overwrite" is it correct? b'cos i have loading two datasource (2LIS_13_VDITM and 2LIS_13_VDKON) into one DSO.

regards

viru

Former Member
0 Kudos

Hi Viru,

The aggregation type "Overwrite is fine" but did you check your data confirmed that whether there exists some data which will satisfy your condition.

If data is available then debug your code and check.

Regards,

Durgesh.

Former Member
0 Kudos

There is nothing wrong in selecting "overwrite" but as per your routine, your field will contain value only for those records where KNART is 'ZVAO' and KNVAL ne 0. for other records it would be zero, so there is a possibility that the value record is being overwritten by zero records....

I guess biling doc no and item no is the key in your DSO.

say for ex if you have two records coming from source


BILL_DOCNO ITEMNO KNART KNVAL 
1001       10     ZVAO   5
1001       10     ZZZZ   0

After transformation you will have values populated for the zfield in New table...


BILL_DOCNO ITEMNO KNART KNVAL ZFIELD
1001       10     ZVAO   5    5
1001       10     ZZZZ   0    0

And when you activate the request, the second record will overwrite the first record and you will get only zero....

Just check in the New table before activating the request in DSO and see if you have values populated for this routine field...

And if you dont want this to be overwritten, then set the Aggregation type to "summation".

--- Thanks...

Answers (6)

Answers (6)

virupasan_balanathan
Active Participant
0 Kudos

Hi Guys

Thanks for your

As you all suggested I have cleared the DSO and tried to load only the Condition Data source to the DSO first still VAT field is blank in DSO so problem is not due to Overwriting.

And also I checked the DSO tableu2019s before activation there also VAT in Blank.

Is there any other things I need to check?

Regards

B.Virupasan

virupasan_balanathan
Active Participant
0 Kudos

Dear Durgesh.

as you Suggested i debug the Transformation but in that Result fild is getting populated with the correct value but it is not Updating the DSO.

is there any other setting i need to check.

Regards

B.virupasan

Former Member
0 Kudos

Hi,

This looks to be very strange that result field is getting populated correctly but data is not appearing in DSO. Just check that you are activating the request after loading.

Once the loading is completed check your data in New as well as in Active table.

Regards,

Durgesh.

Former Member
0 Kudos

Hi Virupasan,

Code looks fine except for the change suggested in above posts.

Do the following and you shall easily solve it.

1. Check the source for KNART eq 'ZVAO' and KNVAL ne 0.

Take sample data.

2. Try loading only the sample data thru' DTP restrictions. Debug and see how the code performs.

Hope this helps.

Regards,

Guru

Former Member
0 Kudos

Hi,

It looks like there is no error in the code, I guess there is no proper data which will fulfill your condition, just debug your code and make sure.

And just one modification in code suggested by Ashish,

you can write,

if SOURCE_FIELDS-KNART eq 'ZVAO' and SOURCE_FIELDS-KNVAL is not initial.

Just to increase the readability.

Regards,

Durgesh.

Former Member
0 Kudos

The code looks fine... check the values coming from the source.... check if you have 'ZVAO' value for KNART field and non zero values for KNVAL field....

To test the code, goto the transformation and then rule details of the particular infoobject and then at the bottom of the screen you can see Test Rule button.

Select it and you will be prompted to enter values for KNART and KNVAL, give ZVAO and 5.... if the result is 5, then there is nothing wrong with the code.... may be you dont have these combination of records coming from source...

--- Thanks...

Former Member
0 Kudos

Hi,

Routine looks almost fine,

but can you please modify it to

if SOURCE_FIELDS-KNART eq 'ZVAO' and not SOURCE_FIELDS-KNVAL is initial.

RESULT = SOURCE_FIELDS-KNVAL.

endif.

and then pls let me know.

regards,

Ashish