cancel
Showing results for 
Search instead for 
Did you mean: 

X Path condition

Former Member
0 Kudos

Hi,

My requirement is as follows.

If am getting file 1234.csv, i need to send to receiver A and if i get file with 1234.pdf, i need to send to receiver B.

how can i write X Path condition in receiver determination ( i cant go for enhanced receiver determination due to some functionality limiations).

Please suggest.

Thanks

Kishore

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

You can select filename option in Receiver determination conditions. You need to enable ASMA in sender file channel. That's all.

Former Member
0 Kudos

Hi,

Thanks for your reply.

Sender is Proxy and from proxy data i will be having filename field.

and this field name will be date_debtors_XXXX.csv or date_debtors_XXXX.pdf. How can i differentiate whether it is .CSV or .PDF and based on this i have to route to different receiver.

Thanks

Kishore

rajasekhar_reddy14
Active Contributor
0 Kudos

Sender strcuture only holding the field so no need of ASMA.

Option1:

if you are using multi mapping concept then in mapping itself you can write logic by uisng create if node function by checking file name.

Option2:

If you want to write in recveiver determination then it is very much easy check fieldname="date_debtors_XXXX.csv" ,you have option to compare in condition editor.

search in sdn .

Regards,

Raj

former_member181985
Active Contributor
jagdishwar_b
Active Participant
0 Kudos

>>Sender is Proxy and from proxy data i will be having filename field.

if the filename field is part of the payload, then you can use the Condition based Receiver determnation.

those conditions are simple ones e.g. you can check if the filename field equals or notEquals certain string.

but i am not sure, if those conditions are rich enough to handle things like endsWith("csv") or endWith("pdf")

in your case, i think, you can still use ASMA.

in a mapping you set ASMA field say FileType to "CSV" or "PDF". refer http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2664

and in conditions of receiver determination, use the context object FileType = "CSV".

regards,

BJagdishwar.

former_member181985
Active Contributor
0 Kudos

>>in your case, i think, you can still use ASMA.

>>in a mapping you set ASMA field say FileType to "CSV" or "PDF". refer http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2664

>>and in conditions of receiver determination, use the context object FileType = "CSV".

Jagadish, Receiver determination (PIPELINE step) comes into picture before mapping. So, this solution does not work.

Former Member
0 Kudos

Hi,

Can you please let me know how to achieve this using condition editor in receiver determination.

I have searched most..but could not.

Thanks

Kishore.

Former Member
0 Kudos

Dear Kishore

In your condition editor open the Left Operand

Select the Context Object radio button, go for the object names filename, click on OK

Select the operation as u2248 (third option)

In right Operand write .PDF/.XML

and complete your condition

Sourabh

Former Member
0 Kudos

chk this:

http://wiki.sdn.sap.com/wiki/display/XI/XpathConditioninReceiverDetermination

use operator CP like *.csv or *.pdf (or u can also use substring-after function)

Former Member
0 Kudos

Hi Sourabh,

my file name will be currentdate.csv orcurrentdate.pdf.

But here in condition, you are asking to check with file type = csv or file type = pdf

will this servere my requirement? however i wil give a try but please check and update me.

Thanks

Kishore

Former Member
0 Kudos

Thanks Sourabh and Amit.

Former Member
0 Kudos

Hi,

I have created DT,MT,MI,MM,IM(All objects)...and i have assigned my conext object to one of field in MI.

While am trying to add this in receiver detemination X Path editor, am not able to see this context object and then i tried to create X path from structure and that is also not coming. I am wondering what else i need to do...

Thanks

Kishore.

Former Member
0 Kudos

chk my reply in this thread:

http://forums.sdn.sap.com/thread.jspa?threadID=2025835&messageID=10582310#10582310

Edited by: AmitSri on Feb 27, 2012 6:31 PM

Former Member
0 Kudos

Amit,

But am on SAP PI 7.0

Thanks

Kishore

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear Kishore

Instead of X Path you have to go for Context Object

As mentioned in the reply above, you have to select ASMA parameters in your sender CC and then you will be able to see the filename in context object

Sourabh