cancel
Showing results for 
Search instead for 
Did you mean: 

if records > 999 then error

Former Member
0 Kudos

hi friends,

my task was one file to one idoc the file has large no of records Condition is that if the number of items in the idoc after conversion crosses 999 it should report as error.

i did some work for usual file to idoc procdure,ie. normal mapping and stuff,now what changes do i make.

does the idoc field document item number help in this regard.

for a trial i mapped one of the item number as index.

can any one help me please.

thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

thank you friends i will try all your advises, many many thanks

Former Member
0 Kudos

Hi kutumba,

Why do you want to check if your files as more 999 lines?

Is is due to a business rule ? or because you have a technical dump if file has 1000 lines?

I ask you that, coz if this the 2nd case, there are some OSS notes to correct a such error. Personnaly, I send regurlaly files with 10.000 lines without problem.

For the count, another way is to manage the count directly in your Message Mapping:

1. add a field called "nbr_lines" in the target Message Type

2. use function "Count" between the root of your source Message Type and this field "nbr_lines".

3. In your BPM (or directly in the Interface determination) add your check condition.

Mickael

Former Member
0 Kudos

I think you should use BPM. You have to Receive the file and then find the count of records in the file and if the count is greater than 999 throw an exception.

Former Member
0 Kudos

yes venkat i am using BPM ,

and also put recieve step,

now how to do count of record

Former Member
0 Kudos

You should have the Receive step in a loop. Also define a container variable say counter and increment the counter inside the loop.

Think of each record in the file as a message.

After the loop is over check the count and if the count > 999 throw an exception.

Former Member
0 Kudos

Another way is to have another structure just like the source but with an extra field count. In the mapping calculate the count using a java function.

In BPM Receive the file do Transformation using the above mapping. Then check the count.

Former Member
0 Kudos

Also another way is to do a count on a node in an XPATH expression. This you can do in Receiver Determination Condition or in BPM you can assign the count to a Container Variable.

Good luck

Venkat Dittakavi