Dynamic interface determination based on file content
Dear all,
I am trying for a while to solve my issue, but wasn't able to find the answer. Maybe you could point me in the right direction whether using standard or BPM...
I've got one file with multiple entries. Dependend on a field value, I would like to call the right interface and Idoc.
Sample message:
<customers>
<customer>
<name>ABC</name>
<city>XYZ</city>
<trigger>A</trigger>
</customer>
<customer>
<name>DEF</name>
<city>QRT</city>
<trigger>A</trigger>
</customer>
<customer>
<name>GHI</name>
<city>JKL</city>
<trigger>B</trigger>
</customer>
<customer>
<name>MKN</name>
<city>TZG</city>
<trigger>A</trigger>
</customer>
</customers>
Dependend on the content of field "trigger" I would like to send the message to the correct interface (Idoc). I was able to trigger the interface selection in my interface determination based on a condition. So I am looking for field trigger and if = A -> Interface A is called and if = B -> interface B is called. However, it seems it is only checking for the first entry of my payload and then sending all customers to the same interface, no matter what I've got in the trigger field. What I would need is a message split and then only posting the correct rows to the selected interface.
Any ideas would be highly appreciated.
Thanks a lot,
Jens
Hi Jens,
I can think of two options:
1) The logical expression (condition) in the Interface Determination can hold a XPath expression. In your case, it could be complex, as one single XPath has to loop at all the line times for an occurrance.
Some XPath help is available at: http://www.w3schools.com/xpath/xpath_functions.asp#sequence
/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
The objective will be to remove the contexts on the trigger node to get a sequence consisting only of the trigger values, and then performing an 'index-of' function on value 'A'. If the result is a null value, then that trigger does not exist and the interface determination will not pass for 'A'. Similar condition can be used for other values of trigger.
2) Create a separate receiver system / service for each interface A, B etc. Then you can use the enhanced Receiver Determination feature in the IR itself if you are on SP16. Check this:
/people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16
Good luck,
Bhanu
Similar Messages
-
Create a group based on file contents
Hello!
I'm investigating options to create a dynamic group based on periodic check of file content. I have a Shavlik updater which is patching custom groups based on file contents. I would like to create a dynamic group which should return all Windows Computer
classes that are found from this file. Anything close to sensible was found at https://www.youtube.com/watch?v=gxASdzHFTOU where author created an attribute of based on "SELECT * FROM CIM_DataFile" and then created a group out from it - but it checks
file existence, not content, would launch against all Windows Clients (and we have 1000+ of these monitored) - certainly not a valid way.
Is there any way I could do that in a simple, straightforward way?
Thanks in advanceOk, I got it. Have you tried modifying the group membership with powershell?
Modifying Explicit Group Membership in SCOM 2012 with PowerShell
http://blogs.msdn.com/b/rslaten/archive/2013/06/27/modifying-explicit-group-membership-in-scom-2012-with-powershell.aspx
Automate your group creation with Powershell
http://blog.coretech.dk/kra/automate-your-group-creation-with-powershell/
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
Splitting the Idoc data into 2 diff files based on file content.
Hi Experts,
Mine is a SAP - XI - File Scenerio. A perticular Idoc when triggered has a segment 4 with a Field KONDART. This Segment 4 is optional in nature and can appear n nos of times. Initially KONDART carried a value ABCD and created a File called PLU, containing 14 fields.
Now the value of KONDART can carry ABCD as wll as many other values.
The current requirement is , if the Value of KONDART is ABCD , EFGH, etc etc , then it will create the PLU file as usual, but the moment the KONDART value is XYZ , then it will create the PLU as well as a new file called MRP, carrying only 4 fields .
I can understand that I need to make a new DT, MT , MI . I can' make out, if i call it in Messege Mapping the PLU as well as MRP structure and map them according ly, I simply cant make out , hw to make it conditional based on the content of KONDART.
Should I go for messege splittng, like in the second messege type , the Structure will get mapping data only if the KONDART Value is XYZ.
Is my understanding OK.
I think I can check this in Messege Mapping itself. calling 2 messege types and put a CREATEIF kind of logic for the KONDART = XYZ condition.
Pls correct me / Comment .
Regards,
Arnab Mondal.Hi,
If I have understood your problem correctly then the solutin can be like this..
First of all create two separate mappings as well as Interface mappings (based on your different data types).
In ID, just do the conditional "Interface Determination", so whenever your condition(s) will be true the respective interface mapping(s) will be triggered and offcourse create two CC respectively.
Now when you do the "Receiver Determination" assing correct CC to corresponding interfaces.
Regards,
Sarvesh -
Conditional Interface Determination with Flat Files
Hello,
I have one sender interface (dummy) which could either hold a flat file or an XML file. On receiver side there is one system with two receiver interfaces, one should be used for the XML structure and one for the flat structure.
My requirement is to have a conditional interface determination with an (exclusive) OR logic. Pseudo code:
The XML structure has "submission" as root node. So I use the condition (/submissioin) EX to determine whether it is an XML file and I check with not(/submission) EX to determine whether it is a flat file. However the condition does not work using a flat file ("Unable to find an inbound interface"). Could it be, that the conditional expression never is true in case a flat file arrives? How can I achieve this requirement?
What I additionally do with the flat file is just calling a Java Mapping that sets dynamic attributes for a file receiver, the flatfile itself is dumped on a file system without any addtional conversion logic.
Thank you for your advice.How can I ingnore a message in case a condition applies? I am just aware of the fact that you can ignore messages in case NO condition applies.
Couldn't you simply reverse the logic and use "not equals"? Or perhaps you can use the EX operator to alter your conditions... here is more info on the EX (exists) operator
Re: ConditionEditor: Check if element is empty
What is best practice in this case? Should I use a "dummy receiver"? However if I use a dummy receiver I think I would receive a "interface determination not found" error. How would you do that?
I've never found the need to work with dummy receivers so I cannot comment there. -
How to get a dynamic receiver determination based on a table an SAP PI ABAP Stack
Hello folks,
currently I get stuck dealing with a problem about the receiver determination. Let me first describe the Problem: We are using to different SAP ERP- backend system in our test enviroment. But only of this systems is marked as current "actuall" test system. Every once in a while we need to switch between these two systems and mark the other one as the actual test system.
This is the point were it get's a little bit time consuming for me: We have about 50 interfaces were I need to change the receiver from test system A to test system B or vice versa. So I thought about creating a more dynamic way to determine the actual test system:
Therefore I have created a table on the ABAP stack of our PI (7.31 double stack) with just one field that holds the current test system. Now I would like to create a dynamic receiver determination where I call the RFC-function RFC_READ_TABLE. But how can I acess a table from the grapchical mapping of the pi which is stored on the PI?
Is there mybe another fundamental way to retrieve the actuall test system within the mapping?You can go for enhanced receiver determination, where in you can determine the receiver system using a graphical mapping.
Now in that graphical mapping, use the standard function " RFC Look up" and make a call to bapi and get the actual receiver system.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40b64ca6-b1e3-2b10-4c9b-c48234ccea35?QuickLink=index&…
Step by Step guide to Explain Enhanced Receiver Determination - Application Server Infrastructure - SCN Wiki -
Receiver File adapter: dynamic folder name based on file name
Hi there,
is it possible to set up one communication channel that will use different target folders based on file name?
E.g.
File abcdef will be saved to /root/abcdef/abcdef or /root/abcdef/abcdef.txt
File xyz will go to /root/xyz/xyz or /root/xyz/xyz.txt
I know I could use Sender/Receiver Service, Interface/namespace or data from message for variable substitution but could not find an easier solution for this scenario than to create multiple communication channels.
Thanks.If you haven't a message mapping, then you can create only an interface mapping with an abap mapping.
In your abap mapping:
DATA l_record type mpp_dynamic.
l_record-namespace = 'http://sap.com/xi/XI/System/File'.
l_record-name = 'FileName'.
l_record-value = "your filename"
dynamic_configuration->add_record( l_record ).
l_record-namespace = 'http://sap.com/xi/XI/System/File'.
l_record-name = 'Directory'.
l_record-value = "your directory ".
dynamic_configuration->add_record( l_record ).
Afther that, you must activate Adapter Specific Message Attributes (directory and/or filename) in your target communication channel .
Regards,
Carme. -
Dynamic Interface Determination Using the same Business System
Folks...
Does anyone have any good ideas on how to build a scenario where the same business system is used, but the interface mapping needs to be dynamic? I have a single JMS sender and 40 different message types on one side, and 40 ABAP Proxies on the other. The two solutions I see are as follows:
1. Create 40 separate JMS Senders with 40 different sender agreements
2. Create 40 Business Services for the same ECC system and utilize XPath expressions to support conditionally selecting an interface mapping
Neither of these in my mind is a great solution, does anyone have any others?
Mahalo,
JonathanHi, I came cross the same problem on my current project, now I have following solution:
Create a number of JMS sender adapters, they all connect to same queue, but each JMS sender adapter only pick up particular type of message based on one JMS message property value. The message provider will be responsible to set the property value when they send message into the queue.
In JMS sender adapter, Parameter Tab -> Advanced Tab ->check Set Adapter-Specific message Attributes ->check Specify Additional JMS Message Properties (Maxmum of 10) -> Add Property name, e.g. "MsgType"
->Processing Tab -> Input Value in "JMS Message Selector", e.g. MsgType='WorkOrder'
after above setup, this adapter will only pick up messages that with "MsgType" Property value "WorkOrder"
For each type of adapter, you will create a JMS sender adapter and repeat the steps above, just put on the different Property value.
This approach will have number of Integration Scenarios, hence will have number of Sender Agreement.
I have tested the approach and it works.
Liang -
Interface Determination for source file without namespace definition
Hi,
I have the following problem:
I am developing a file to IDoc scenario in AEX 7.31. All design objects in ESR and configuration objects in ID are created and the sender communication channel is running. Now I got a test file. It starts directly with the data elements but does not contain the root element as defined in my data type. To make it clear:
Data Type in ESR:
DT_DatatypeA
-- Record [1..unbounded]
---- Field1
---- Field2
The File looks as follows (it lacks the root element 'DT_Datatype_A'):
<Record>
<Field1>...</Field1>
<Field2>...</Field2>
</Record>
<Record>
<Field1>...</Field1>
<Field2>...</Field2>
</Record>
When I try to send it via PI I get the following error:
When I add the XML root element <ns0:DT_DatatypeA ns="..."> manually to the file (and the corresponding end tag), the message is processed correctly.
How can I solve this issue? The file is created by a legacy system which does not know anything about my PI namespaces.
Thanks in advance!i am bit confused here.
how does your input look like? i.e when sender generates the files..
is that like below xml?
<Record>
<Field1>...</Field1>
<Field2>...</Field2>
</Record>
<Record>
<Field1>...</Field1>
<Field2>...</Field2>
</Record>
or
is it a flat file? and you use FCC in the sender adapter to convert it into xml?
Field1,Field2
Field1,Field2 -
Condition based Interface determination
Hi ,
Environment : PI 7.1.
Scenario : File to Proxy.
In this scenario , We have a single file interface which reads a file and routes the data to two different inbound interfaces.
Steps followed to do this -
>>Defined two inbound interfaces interface1 & interface2.
>>Both interfaces are pointed to same ECC system.
>>Read the file using a single sender file communication channel.
>>Define receiver ECC in the receiver determination.
>> Define interface determination based on a value of a field in the file structure(source structure). Used XPATH to define this content based routing and selected operation mapping specific to the interface.
1 sender agreement
1 receiver determination ( not using enhaced receiver determination because we have only one receiver)
1 interface determination which has two receiving interfaces based on XPATH condition ( maintain order runtime is checked)
2 Receiver agreements.
2 Communication channels.
For example if you have 10 lines in a file , out of which if 5 lines has a value related to interface 1 & 5 lines has a value related to interface 2. It should push the data into two different proxies as configured.
We are facing a problem in this scenario -
There is no consistency in the logic. Some times it runs interface 1 & some time it executes interface 2.
based on condition 1 it routes the data to interface 1 successfully but the structure is not getting created for interface 2 so it is giving an error stating the interface 2 structure is not available.
In SXMB_MONI the branching steps show two subnodes but if you see the log it shows that in subnode 1 the sender is sender interface & the receiver is interface 1 based on the filter condition. If you see the log for subnode 2 then it shows the sender is sender & the receiver as interface 2 below that it shows another entry which shows the reciver interface is interface2.
Please evaluate and let us know if the approach we are following works or not. If there is any limitations please let us know how to achive this.
Regards,
ReddyHi,
Your design is correct but here you missed one point. Here the message is send either to receiver1 or receiver2 depending on the condition but not both. As this does not result in multiple messages with the same payload because only one condition can ever be true at runtime. For more details see the below link
http://help.sap.com/saphelp_nw04/helpdata/en/46/8015de950e6be3e10000000a155369/frameset.htm
If you want to create multiple message then you need do 1:n mapping :
http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417700)ID2056393550DB10021342992851308291End?blog=/pub/wlg/2927
Shweta. -
Conditional step in interface determination
Hi All,
The Scenario is a proxy to file server..
we are sending datas to different service based on File Content Conversion..
Depending on the data on a certain field the records are delivered to different location.adapter we use is a file adapter.
For this we need to give the conditional step in interface determination..
the sender is a message system and the receiver is a business service.
The issue here is when i try to give the condition in interface determination the error below appears.
"<b>Message interface does not exist in any software components installed on this business system</b>"
due to this we are not able to get the structure of the specified message type in the condition editor...
What can be done here to give the conditions in the condition step?Hey
The error occurs if the GUID of the software component at the SLD is different to the one at the repository. Please compare the GUID at the SLD -> Administration -> Content Maintenance -> Dropdown "Component Version" -> Dropdown "Software Component Version". At the Integration Repository you select the Software Component Version at at the tab "Keys" you find the related GUID.
The error occured because the Software component has been created manually at the system. The repository content came from another system via import with own SLD (and because of that with another GUID for the software component).
source:https://forums.sdn.sap.com/click.jspa?searchID=3574640&messageID=945384
Thanx
Ahmad -
Enhanced interface determination IN BPM
Hello experts,
Question is in the title.
I'm in PI 7.0 and i think it's not possible. Can you confirm it ?
Thank you for your responses.
Regards.Yes ! ;o)
But, i have a scenario with BPM : file -> synchronous call bapi -> 2 split mapping (using enhanced interface determination) -> possibility 4 files.
It's not a problem for me, because i will 'stop' BPM afterthe Bapi call, but i have to create most CC.
It was just an quastion for me.
Thanks. -
Sender adapter processing based on done file content
hi
sender system creates a done file, after the creating of actual file. SAP PO 7.4 first need to read the done file for the list of files to be processed from the same folder.
for eg:
source folder files:
xxx11092014.xml
yyy11092014.xml
zzz10092014.xml
done11092014.xml
content of done file:
<files>
xxx11092014.xml
zzz10092014.xml
<files>
In SAP PO 7,4 first need to read the done file, based on the content of the file xxx11092014.xml & zzz10092014.xml need to be processed in sap po and
all the three file xxx11092014.xml, zzz10092014.xml & done11092014.xml need to be deleted. leaving behind the yyy11092014.xml for which new done file will be created..
Could anyone please throw some light on this scenario to implement???Hi,
Please check below steps helpful for your requirement by creating two flows and additional files.
Interface1: This interface to read the filenames from done*.xml and generate the additional files with same name with different extension like xxx11092014.txt and zzz10092014.txt for interface2 to pick.
1. Configure your sender CC to pick file done*.xml
2. Use multimapping to create multiple messages based on how many files under <files>
3. Create additional files in receiver file adapter with same name with different extension by using variable substitution.
One IDOC to Multiple Files sending to Multiple folders of the FTP using single Communication Channel (SAP XI-PI Process …
Interface2: This interface to pick files having only additional files with same namepart
1. Configure your sender CC to pick files having additional files by enabling Additional Files
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816?QuickLink=index&…
Regards,
Praveen -
Read incoming EDI File content and FTP file on R/3 server based on value
Hi,
We have the below scenario:
The incoming file is received in XI in the below directory:
/usr/feeders//interfaces/EP1/abc
The file name is- TCDE.BLQSAM.OCAA2682.C0084031
The file contains some data like below:
UNBUNOA:3HEXAGON-ABCABC10268002090806:1004+403140015324'
UNH1CONTRL:2:2:UN:APACS'
UCI1000284217ABC10268002HEXAGON-ABC7+C00'
Based on this incoming file reference number in line 3 as given (1000284217) for example, a lookup needs to be made in R/3 in a table to determine if the file should be placed in directory A or Directory B in R/3 without any XML conversion.
I have made the scenario and the details are as below:
Created the new Mapping Archive in the IR and import this .jar
Created an Interface mapping for the Control File processing and select the mapping program from the archive
Created a Business Service called "BSY_ECC6_FI_CENTRAL" and a communication channel called "CCIA_01_RFC_RECEIVER", for the connection to the R/3 system of type RFC and will have to have the connection settings for the R/3 backend with the client which has the data in it for the FM call.
I have the java code that I can forward you for reference.
I am not able to run the scenario successfully.
Plaese advise as to how I can develop this scenario.
Regards,
ArchanaHi Archana,
Based on this incoming file reference number in line 3 as given (1000284217) for example, a lookup needs to be made in R/3 in a table to determine if the file should be placed in directory A or Directory B in R/3 without any XML conversion.
Created the new Mapping Archive in the IR and import this .jar
Created an Interface mapping for the Control File processing and select the mapping program from the archive
Created a Business Service called "BSY_ECC6_FI_CENTRAL" and a communication channel called "CCIA_01_RFC_RECEIVER",
for the connection to the R/3 system of type RFC and will have to have the connection settings for the R/3 backend with the
client which has the data in it for the FM call.
What i understand from your Qs is, you want to get the location where the file need to be placed from the table in R/3 system
based on the ref. no mentioned in source EDI file, and the target file should be placed as a flat file format.
You are using RFC lookup to get the details of the location in Java mapping, Once you have the location you can map it to the
element in payload and using varaible substitution you can specify the target directory.
Regards,
Prasanna -
IDoc to file- How to include conditions in Interface determinations
Hi,
In interface Determination i am trying to add the conditions based on IDoc structure field value. But when i clicked on Condition editor i don't find Idoc stucture in editor XPath.
Please suggest me how i can add the condtions in the Interface determination in IDoc to file Senario.
Thanks in Advance...
Regards
SreeniHi Sudhir,
I have tried as you mentioned, but still its not working. Below i am providing my inbound payload.
Could please let me know how i have to mention in condition editor to refer the IDoc field
ZGHIER01/IDOC/Z1GLHIERH/SETNAME
<?xml version="1.0" encoding="UTF-8" ?>
- <ZGHIER01>
- <IDOC BEGIN="1">
+ <EDI_DC40 SEGMENT="1">
- <Z1GLHIERH SEGMENT="1">
<CATEGORY>GLHIER</CATEGORY>
<SETNAME>PEGPL_AG</SETNAME>
+ <Z1GLHIERD SEGMENT="1">
+ <Z1GLHIERI SEGMENT="1">
+ <Z1GLHIERI SEGMENT="1">
+ <Z1GLHIERI SEGMENT="1">
+ <Z1GLHIERI SEGMENT="1">
</Z1GLHIERH>
</IDOC>
</ZGHIER01>
Thanks & Regards
Sreeni
Edited by: Sreenivasulu Reddy jonnavarapu on Dec 12, 2008 10:39 PM -
Query - Content Based Routing - File to File
Hi,
I'm trying to create a scenario which sends a file (multiple records) to multiple receivers based on the Header(System) of the record.
File format:
<System,Name,Age,Qualification>
If the System value is "Sys1" then it should be written into the file A, else into the file B.
Please let me know the different ways of doing it.
Is BPM mandatory for this scenario?
Thanks,
Rakesh.Hi Rakesh,
This scenario you are trying can be done using CONDITIONAL RECEIVER DETERMINATION and RB SPLIT
To do this without using a BPM.
1. Create your mapping program that will map the information from the source file
into the destination idoc. This has to be a 1:N split. Just make sure that the destination message type and message interface are are of occurrence N.
2. Also, you will have 2 destination interfaces and 2 interface mapping, one for the IDOC and one for the mail.
Now, there are a few essential steps in your configuration,
1. In the receiver determination, specify the 2 receiver systems, one for your IDOC and the other for your MAIL.
2. Now, you will have a condition window. Just type the condition on the basis of which the receiver has to be determined for the mail and the idoc business system. Just remember that the condition can be specified only for the source message.
2. In the Interface Determination, you have an option called RB CLASSIC and RB SPLIT. To do a 1:N split, you will have to do a RB_SPLIT.
Thus, your solution can be devised without a BPM wich I guess is preferred because of performance issues.
You can also go through the following to understand the step by step procedure to have 2 receivers:
<a href="/people/suraj.sr/blog/2006/01/05/multiple-inbound-interfaces-within-a-service Inbound Interfaces within a Service</a>
<a href="/people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers receiver Scenario</a>
I hope I have answered your query.
Regards,
Abhy
Maybe you are looking for
-
Web services API call to join a user to a cost centre
I can't find the call for this, does anyone know it please? thanks in advance. J
-
Smart playlists not updating without syncing
I've had the 30GB video for over a year. All the latest iTunes software and Vista OS. I probably have over 100 playlists of both kinds (static and "smart"). Some time in the past few months (maybe a year), the smart playlists stopped updating dynamic
-
Using a standard infoobject as a reference infoobject ???very urgent!!
hi guys, i have to develop a report. so now here my requirement is that i have to display the fields in the report from an ods. Here there is one standard infoobject extracted from r/3 and is been used as a reference object for one zfield. Now the re
-
Refresh or Reload Issue with Multiple Blcoks in the One View
Hi All We have one view which consists of multiple blocks say multiple UI container elements. Each container contains different UI elements and business logics. For example: Having Container 1 and Container 2. If we are doing any action in Container2
-
Is is possible to use AdobeLibraryAPI.js to create a custom library on Android
With the iOS App Builder, we are allowed to upload our own custom library Zip file. The library uses AdobeLibraryAPI.js to interact with entitlement and fetch folios. We are having problems trying to implement the same custom library from our iOS a