cancel
Showing results for 
Search instead for 
Did you mean: 

Validate no. of lines item against a data field in Header

Former Member
0 Kudos

Hi Experts,

I have this requirement that a source file will contain 1 header and multiple of line items.

There is a field in Header that specify the total no. of line items.

I need to count the number of lines items and validate against this field. If equals, then pass this record, else raise an exception.

Appreciate your guidance on this requirement.

Regards

FNG

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi ALL,

Thanks for your suggestion, I will try it out and get back to you.

Regards

FNG

rajasekhar_reddy14
Active Contributor
0 Kudos

If you want raise exception what type of exception? you want throw message mapping exception??

if yes then

apply logic suggested by babu, but dont use if then else logic pass result of equals function to usd, in udf throw exception,

you have to write logic in UDF , equals s function result true mean pass value to target else thow exception.

Regards,

Raj

former_member207622
Contributor
0 Kudos

if you have this structure as

header -- 1-1

Details -- 0-unbounded

then try this

use this mapping as

details -- count -


1st input ---equals -


createif -


( root node of the target structure)

header --- 2nd input to equals -


regards

Ninad

Former Member
0 Kudos

Hi,

Use the COUNT function to count total number Line items, by changing the context.

Then using equals function check for equality with the header field.

If true map to target else dont, ifWithoutElse

Babu