cancel
Showing results for 
Search instead for 
Did you mean: 

Flat file interface determination condition

Former Member
0 Kudos

hi All,

I have a scenario in which my sender sends a flat file and i need to check in the interface determination if the first four characters is the plant value. Based on that i need to route it to a different mapping.

I am aware of a solution in which we can use a basis receivers mappping in which we can set a variable binding which can be checked in the interface determination.

But I have seen a few cases like

"/p1:FlatFile/LIST[(starts-with(" XXXX"))]" in the condition with EX operator and empty on the RHS.

If we can use this, the effort would be much reduced. Please let me know how to do this in case of flat files if possible.

Regards,

Ninu

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member184789
Active Contributor

Hi,

I don't think having a flat file will cause you any issues. You will be having file content conversion for converting it into an XML for mapping right?? You can have the condition on the field which you are converting from the flat file.Are you facing an issue with the config??Can u consult the below link for customizing XPATH:

http://wiki.sdn.sap.com/wiki/display/XI/Xpath+Condition+in+Receiver+Determination

http://wiki.sdn.sap.com/wiki/display/XI/To+Exist+Or+Not+to+Exist+is+the+Question

Former Member
0 Kudos

hi,

Thanks for your comments.

Please note that mine is a special case in which there is no content conversion in the channel. Instead only when the file reaches the mapping there is a java code to convert into xml and map.

So it means, i need to do a condition checking on a FLAT FILE and not on an XML.

REgards,

Ninu

gagandeep_batra
Active Contributor
0 Kudos

hi ninu,

Can you give the name of the file according to your plant number, if yes then put the condition on file name as define in above blog.

Regards

gAgan

Former Member
0 Kudos

no gagan. There is no specific filename...:(

Best regards,

Ninu

former_member184789
Active Contributor
0 Kudos

Hi Ninu,

Have you thought about using enhanced receiver determination.

Former Member
0 Kudos

hi Adarsh,

Using a basis receivers mapping would be my last choice. If there is another way out of it i would prefer that.

REgards,

Ninu

Former Member

Hi Ninu,

Unfortunately this won't work. XPATH needs a properly formed XML document as input so a text stream input is not suitable.

My suggestion would be to use Content Conversion to at least just split the document into a flat XML structure like below:

<Document>

     <Line></Line>

     <Line></Line>

</Document>

You can then use an XPATH expression in the interface determination like:

//Document/Line[starts-with(.,'search string')]

Regards,

Nick

ambrish_mishra
Active Contributor
0 Kudos

Hi Ninu,

Once you have come up with the XML and determining logic, you can do multi-mapping as the next step.

Ambrish

gagandeep_batra
Active Contributor
0 Kudos

Hi Ninu,

I think you can go for CP(contain pattern) option for condition

ex. your plant no is start with 1234

you just give condition like 1234*

check my blog  for more information that may help you

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/28/step-by-step-use-of-fccrd-based-o...

Regards

gagan