cancel
Showing results for 
Search instead for 
Did you mean: 

Having 1000 records need only 100

former_member650013
Participant
0 Kudos

Hi gurus,

I am new to sap pi i have one doubt that in one file having 1000 records but i need only 100 records out of 1000 how can we send 100 records from that.

is there and paremeter option adapters to send like this.Please give me the response for this

Thanks&Regards

N.Madhu

Accepted Solutions (0)

Answers (1)

Answers (1)

Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi N Madhu

Recomnend you specify the release and support pack of PI you are using as that will make it easier for people to answer you

former_member650013
Participant
0 Kudos

Thanks joclyn Dart,

Thanks for providing valuble information im using basic version of pi i.e pi 7.0 only and i dont know the Which service pack is this.

Thanks & Regards

N.Madhu

former_member201264
Active Contributor
0 Kudos

Hi Madhu,

If  you want always 100 records then you can do it at Data type occurence level as 0-100.

If want dynamically then you can use UDF OR Use node Functions in Mapping.

Regards,

Sreeni.

former_member650013
Participant
0 Kudos

Hi kancham sreenivasulu,

Thanks for ur reply.

No i dont want all the 1000 records to target i need only  100 records to reach to target not all 1000 records.

Thanks&regards

N.Madhu

anupam_ghosh2
Active Contributor
0 Kudos

Hi N.Madhu,

                  How will you choose which 100 records to send to target? Are there some conditions or you want to send first 100 records? In case you have some conditions then you need to put those conditions in a UDF and the records which satisfy those conditions are forwarded to the target.

Regards

Anupam 

former_member650013
Participant
0 Kudos

Thanks for your reply,

I just need first 100 records only.

Thanks&regards

N.Madhu

anupam_ghosh2
Active Contributor
0 Kudos

Hi N Madhu,

                  Please try using this UDF of type "context"

public void firstNValues(String[] a,ResultList result,Container container) throws StreamTransformationException {

      int i,n=100;

     for(i=0;i<a.length && i<n;++i)

     {

          result.addValue(a[i]);

     }

}

a------->FirstNvalues UDF------>target

a is the input field to the UDF.

Regards

Anupam

former_member650013
Participant
0 Kudos

Thanks for providing me valuable information Anupam ghosh.

anupam_ghosh2
Active Contributor
0 Kudos

Welcome.