Payload Filename
Hi
I want to include the filename of my file I am sending in the XI system, along with the payload.
I have done dynamic settings in the communication channel and I can see the file name in the Dynamilc configuration.
Can you tell me in which table the name of the file is stored?
>>I want to include the filename of my file I am sending in the XI system, along with the payload.
1. Create a filed in to structure to hold the file name.
2. Use this UDF to retrieve the file name from the synamic configuration.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.get(key);
return ourSourceFileName;
Thanks
SaNv...
Similar Messages
-
Error in Variable Substitution
Dear All,
Result Payload:
<ns1:MT_Level1 xmlns:ns1="http://test.com">
<Header>
<Separator>,</Separator>
</Header>
<Detail>
<FileNumber>30</FileNumber>
<LinkToNextLevel />
<Expansion1>0</Expansion1>
<Expansion2>0</Expansion2>
<Expansion3>0</Expansion3>
<Expansion4>0</Expansion4>
</Detail>
<Detail>
<FileNumber>30</FileNumber>
<LinkToNextLevel />
<Expansion1>0</Expansion1>
<Expansion2>0</Expansion2>
<Expansion3>0</Expansion3>
<Expansion4>0</Expansion4>
</Detail>
<FileNode>
<FileName>test.txt</FileName>
</FileNode>
</ns1:MT_Level1>
I want to use "File Name" in the "File Node" node for my variable substitution.
In the configuration:
File Name Scheme = %filename%
Variable = filename
reference = payload: Messages, 1, Message, 1, MT_Level1, 1, FileNode, 1, FileName, 1
Note: I'm using multimapping (1 to N).
File Name path is /ns0:Messages/ns0:Message2/ns1:MT_Level1/FileNode/FileName ( from right click in the file name --> copy path).
I got following error:
"Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: filename"
Please advise!
Best Regards,
Victor.Dear All,
My problem is solved!
The issue is because I don't put the interface mappings sequence as the same sequence as the message mappings sequence. Hence the structure name that i put in the variable substitution all are not match with the structure name in the payload even though all have the file name element.
So what i did is i have to reorder the sequence of my message mappings to be the same sequence as the interface mappings sequence.
Thanks for all that trying to help!
Appreciated it guys.
BTW, for the variable reference it's correct that i no need to put message and message2 as the reference.
payload:MT_Level1,1,FileNode,1,FileName,1 will do.
Best Regards,
Victor. -
Variable substitution in XI (7.0 version).
Maybe you could give us a short hint regarding an error we are getting during the variable substituion in an outbound file adapter.
How can we specify a namespace in the variable substituion?
Without namespace this is working well, but we don't know how to specify the namespace.
We get this error essage: #2006-03-17 15:29:07 CET: Message processing failed: Error during
variable substitution:com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: FileName
Here comes our file:
<?xml version="1.0" encoding="UTF-8" ?>
<ns1:GMPluTxn xmlns:ns1="http://sap.com/xi/GMStoreConnectivity">
<GMFileHeader> <StoreNumber>0000002101</StoreNumber> <FileName>PluTxn</FileName> </GMFileHeader> <UpdateType>1</UpdateType> <PLU>000000000000610733</PLU> <RetailPrice>0.99</RetailPrice> <QuantityDescription>BX</QuantityDescription> </ns1:GMPluTxn>
We set the flag 'enable variable subsitution' and specified the filename
variable as follows:
FileName payload:ns1:GMPluTxn,1,GMFileHeader,1,FileName,1
The FileName variable is used in the File Name Scheme field:
%FileName%.asc
Thanks in advance.Give it like this and see if it works
FileName payload:GMPluTxn,1,GMFileHeader,1,FileName,1 -
Maybe someone can give me a short hint regarding an error we are getting during the variable substitution in an outbound file adapter.
How can we specify a namespace in the variable substituion?
Without namespace this is working well, but we don't know how to specify the namespace.
We get this error essage: #2006-03-17 15:29:07 CET: Message processing failed: Error during
variable substitution:com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: FileName
Here comes our file:
<?xml version="1.0" encoding="UTF-8" ?>
<ns1:GMPluTxn xmlns:ns1="http://sap.com/xi/GMStoreConnectivity">
<GMFileHeader> <StoreNumber>0000002101</StoreNumber> <FileName>PluTxn</FileName> </GMFileHeader> <UpdateType>1</UpdateType> <PLU>000000000000610733</PLU> <RetailPrice>0.99</RetailPrice> <QuantityDescription>BX</QuantityDescription> </ns1:GMPluTxn>
We set the flag 'enable variable subsitution' and specified the filename
variable as follows:
FileName payload:ns1:GMPluTxn,1,GMFileHeader,1,FileName,1
The FileName variable is used in the File Name Scheme field:
%FileName%.asc
Thanks in advance.Hi Malika,
Do not mention ns1 in the variable substitution.
Why you need to mention the namespace in the variable substitution ?
Just Mention GMPluTxn,1,GMFileHeader,1,FileName,1
Like this.
If you want to get the output file name with namespace, then try to get the namespace as part of your payload(i.e part of your message type ). Then if you don;t want it in the Output file, you can cut it using cut option of File Receiver Adapter.
For more-
/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm
Regards,
Moorthy -
Error-Receiver File Adapter using Variable substitution when file is empty
XI Experts,
We are on PI 7.0, SP14.
We are using variable subtitution to get the filename from source message. This works fine as long as we have data in the payload for filename element. But we have a scenario where we don't have to create file when certain condition does not exists in source message so in the message payload filename element will not exists in such condition and file will be empty and we should not create file.
Parameter in the communication channel for Handling empty message is "Ignore".
Does anyone knows how to handle this scneario. We don't want to default any file name in the message mapping if source file name element does not exists.
We are following getting error in the Adapter engine.
MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: file: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: file
Thanks
MPYou can implement this by writing the module to throw an exception or whatever method you want to execute.
If you don't want to receive an error message then module is suitable for you.
Gaurav Jain -
I am trying to emulate the human task in BPEL process. here is the test source to emulate the human task
<initiate operation="process">
<inboundMessage>
<part fileName="input_row_id_120780.xml" name="payload"/>
</inboundMessage>
</initiate>
<activityDriver name="initiateTask_WorkFlowFollowUpInitiate_1">
<emulate duration="PT">
<inboundMessage>
<part fileName="initiate_response_12780.xml" name="payload"/>
</inboundMessage>
</emulate>
</activityDriver>
<activityDriver name="receiveTaskUpdates_WorkFlowFollowUpInitiate_1">
<triggerOnMessage doBeforeActivity="true" onMessageName="initiateCompleted">
<inboundMessage>
<part name="payload" fileName="initiate_withdrawn_120780.xml"/>
</inboundMessage>
</triggerOnMessage>
<assertValue variableName="inputVariable" partName="payload"
comparisonMethod="string" fatal="false" patternMatch="true">
<message>test</message>
<actualPath>/client:WorkFlow4FollowUpProcessProcessRequest/client:input</actualPath>
<expected>[0-9]+</expected>
</assertValue>
</activityDriver>
but it does not seem to be working. I cannot see any human task created in the worklist application but the instance keep waiting for the callback message which I am already giving through "triggerOnMessage".
I dont understand what am i doing wrong. Other thing I want to do is can I use the "triggerOnMessage" without emulating the "initiateTask" response.Hi Clemens,
Thanks for the reply. I was not setting the correlation sets previously. but now when I setup the correlation sets, I am getting the following exceptions.
I am running 10.1.3.5. I tried redeploying the process but with no success. I am using the pick activity to receive callbacks.
I also see bug *5332819* on metalink. It says this issue was fixed in 10.1.3.2. But still I am running into to the same issue with 10.1.3.5. Any suggestion or workaround
ORABPEL-03802
Correlation definition not registered.
The correlation set definition for operation "onSubTaskUpdated", process "WorkFlow4FollowUpProcess", has not been registered with the process domain.
Please try to redeploy your process to the process domain.
I am using the taskId as the correlation property.
correlation property
<bpws:property name="taskID_prop" type="xsd:string"/>
property aliases
<bpws:propertyAlias propertyName="pns1:taskID_prop" messageType="ns1:initiateTaskResponseMessage" part="payload"
query="/ns1:initiateTaskResponse/ns3:task/ns3:systemAttributes/ns3:taskId" xmlns:ns1="http://xmlns.oracle.com/bpel/workflow/taskService"
xmlns:ns3="http://xmlns.oracle.com/bpel/workflow/task" xmlns:ns2="http://xmlns.oracle.com/bpel/workflow/common"/>
<bpws:propertyAlias propertyName="pns1:taskID_prop" messageType="ns1:taskAssignedMessage" part="payload"
query="/ns1:taskAssignedMessage/ns2:task/ns2:systemAttributes/ns2:taskId" xmlns:ns1="http://xmlns.oracle.com/bpel/workflow/taskService"
xmlns:ns2="http://xmlns.oracle.com/bpel/workflow/task"/>
<bpws:propertyAlias propertyName="pns1:taskID_prop" xmlns:ns2="http://xmlns.oracle.com/bpel/workflow/taskService"
messageType="ns2:taskMessage" part="payload" query="/ns1:task/ns1:systemAttributes/ns1:taskId"
xmlns:ns1="http://xmlns.oracle.com/bpel/workflow/task"/>
<bpws:propertyAlias propertyName="pns1:taskID_prop" messageType="ns1:subTaskUpdatedMessage" part="payload"
query="/ns1:subTaskUpdatedMessage/ns1:parentTaskId" xmlns:ns1="http://xmlns.oracle.com/bpel/workflow/taskService"
xmlns:ns3="http://xmlns.oracle.com/bpel/workflow/task" xmlns:ns2="http://xmlns.oracle.com/bpel/workflow/common"/>
<bpws:propertyAlias propertyName="pns1:taskID_prop" messageType="ns1:taskUpdatedMessage" part="payload"
query="/ns1:taskUpdatedMessage/ns2:task/ns2:systemAttributes/ns2:taskId" xmlns:ns1="http://xmlns.oracle.com/bpel/workflow/taskService"
xmlns:ns2="http://xmlns.oracle.com/bpel/workflow/task"/>
<bpws:propertyAlias propertyName="pns1:taskID_prop"
messageType="ns1:initiateTaskMessage" part="payload" query="/ns1:initiateTask/ns2:task/ns2:systemAttributes/ns2:taskId"
xmlns:ns1="http://xmlns.oracle.com/bpel/workflow/taskService" xmlns:ns2="http://xmlns.oracle.com/bpel/workflow/task"/>
Correlation Set
<correlationSets>
<correlationSet name="TaskIdCor" properties="ns20:taskID_prop"/>
</correlationSets>
Use in invoking the task service.
<correlations>
<correlation initiate="yes" set="TaskIdCor" pattern="in"/>
</correlations>
Use in the pick OnMessage activities.
<correlations>
<correlation initiate="no" set="TaskIdCor"/>
</correlations>
Edited by: tanvirmp on Dec 17, 2009 11:27 AM -
Filename in Attachement payload
Hy,
I have to detach an email attachement on my file System.
That's works but I'm not able to maintain the same filename.
Can anybody help me.
Thanks
MatHi Mattia,
If your file name is a part of your email atttachment ( the payload ), then you can dynamically create your file name.
To do this,in the filename of the receiver file adapter, give the filename a <b>%var%</b>.
Anything between % is treated as a varibale by XI. Now, under variable name substitution, you will have to give the value of var and this will act as the filename.
You can access the payload using <b>payload:</b> and the XPATH.
For info on how to do this, check the topic<b> VARIABLE SUBSTITUTION</b> in this link.
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
hope this helps,
Regards,
Bhavesh -
Hello experts,
Is there anyway I can get filename and populate in the payload so I can see it as an additional tag in SXMB_MONI? This is from sender file adapter that I want to capture file name. If possible, I would also like to populate interface name, message ID in the payload in SXMB_MONI. I have read Dynamic Configuration blogs but that brings the filename in the Dynamic Configuration but I would like to get them in payload.
Thanks,
JohnJohn,
I think, this it is possible by implementing
1. Java Mapping
2. UDF
Please refer this help link which clearly explains how to access message id, interface name etc.
[http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm]
Regards
Ramesh -
File Receiver - Dynamically create filename from data in payload
Hi there.
Can anyone tell me the approach I need to take to be able to use the data in one field to determine the filename in the file receiver adaptor.
I have a requirement that requires that I save a file with the following mask:
xxxx_xxx<b><date extracted from field in payload></b>.csv
I would appreciate any help on this.
Thanks in advance.
Mick.Hi Mick,
you just need to use adapter specific parameters
and you will be able to set the name in your mapping
(from your payload)
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
Processing the filename in the payload
Hi,
I am getting the filename in the payload, I want to read that file.
How do I achieve this..
Regards,
VarunHi,
For Example if we want to get the Input file name & Directory Details into Target message.
Ex:
I/P File name is :::::231004.xml Ftp Serve Path : //xideveloper/Test_XI/PO
O/P File name can be :::Any thing
Input File : 231004.xml
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_TEST_AGCO xmlns:ns0="http://tafe.test.com">
<Header>
<NAME>giri</NAME>
</Header>
</ns0:MT_TEST_AGCO>
Output File : Out.xml
Here in this output we are able to get the Filename & Directory Info in the FileName_1 Field.
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_target xmlns:ns0="http://test.com">
- <Header>
<Name_1>giri</Name_1>
<File_Name_1>231004.xml //xideveloper/Test_XI/PO/</File_Name_1>
</Header>
</ns0:MT_target>
You should capture the Source File name & Directory Info into Target Message.
1) Write One UDF & Map Like Constant(u201Cu201D)---UDF----FileName_1
2) In Advanced mode check the check box Set Adapter-Specific Attributes
3) Check the ASMA Parameters in Sender Adapter Alone
4) No need to check the check box ASMA in the receiver side
UDF Code:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//for getting filename
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
//for getting directory
DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
/similarly for getting filetype, filesize you need to specify in the above code instead of filename or directory/
String FileName = conf.get(key1);
String Directory = conf.get(key2);
String Cat = FileName+ " "+Directory;
//return FileName;
//return Directory;
return Cat;
Regards
Seshagiri -
Accessing the filename in the payload
Hii
I want to process the filename (eg:sample.xml) from the payload of the message.
<Message>
<Method/>
<Source>sample.xml</Source>
<Target/>
</Message>
And use the filename in other scenario.
Regards,
VarunHi Varun
Use variable substitution
File name : %FileName%
Enable variable substitution in Receiver File adapter.
Variable name = FileName
Reference = payload:Message,1,Method,1,Source,1
For more info refer
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Thanks
Gaurav -
Sender filename in receiver payload without using mapping.
hi Experts,
I have a File to RFC scenario. wherein i need to pass source filename and filepath as parameter to RFC whenever file arrives at source directory.
I am not using IR contents. What could be the simplest way to achieve this.
One way ofcourse is to write an adapter module to generate Receiver payload with the required information.
Can we have even more easier way to achieve this. Can something be done in Content conversion to get the receiver xml payload with filename and filepath?
Regards,
GirishHi Girish
You can use IR mapping for a binary source data, but it must be a Java class, not an abap or graphical mapping.
Regards,
Carme. -
Filename from payload - FTP receiver adapter
Hello everyone!
I have a scenario wherein I need to get the value from a field coming from an IDOC and then give that value as the "filename" of the file that is saved in the FTP folder.
IDOC > XI > FILE
For example, if /ORDERS05/IDOC/E1EDK02/BELNR = 620000123
then I want the name of the file to be saved in the FTP folder to be 620000123.xml
I understand you may use the 'variable substitution' property in the FTP receiver adapter, but subsequent attempts at trying to configure that property have resulted in errors. Can anyone help me out?
Warm regards,
Glenndo u have recordset name (root message)
For Ex: If you want to refer to the field which is bold
below is your variable substuition:
payload:root,1,e1,1,e2,2
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<dummy>
<e1>
<e2>Data_1</e2>
<f/>
<g attr="abc">text</g>
<e2>Data_2</e2>
</e1>
</dummy>
<e1>
<e2>illegal/value</e2>
<f/>
<g attr="abc">text</g>
<e2 attr="fghij">Example Value</e2>
</e1>
</root>
Similarly
for your strucutre:
<MS_MT>
<order>
<number>
the variable substuition would be
payload:MS_MT,1,order,1,number,1
you have to give complete XML to arrive to this value. -
Q? how to change filename of receiver adapter includeing payload attribute?
hi all.
our scenario is IDOC - XI - FILE.
IDOC is standard type .xml"
Despite of searching help library, just read about how to change using payload value.
How to change the filename using payload attribute?
Message was edited by: ChangSeop SongHi,
You can create the file name dynamically from the payload of the receiver adapter as follows.
From the requirement you have stated, you want your file to be named as,
TPSDLS<shipmentid>.
For this, in the reciver file adapter, give your filename as <b>TPSDLS%var%</b> and under variable name substitution,
<b>var</b> --> <b>payload:IDOCTYPE,1,Shipments,1,ShipmentID,1</b>
here, var acts as your variable name and it first looks for IDOCTYPE and its first occurence, shipment and its first occurence and finally, shipmentID and its first occurence. There by generating the filename dynamically.
For more info on this, check the topic <b>variable substitution</b> under this link.
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
hope this helps,
let me know if you have any clarification,
regards,
bhavesh -
Dynamic Filename from source IDOC payload
Hi,
I have a scenario IDOC --> ABAP Mapping --> Flat File. I need to create the receiver file name dynamically with the document number from souce IDOC. Since the target payload is flat file I don't know whether I can use the variable substitution. Also can I use the dynamic configuration with ABAP Class mapping.
Please help.
Thanks.
SriniActually Henrique's reply in this thread has the exact code,
Re: Abap mapping and variable substitution in File adapter
METHOD if_mapping~execute.
DATA l_record type mpp_dynamic.
* copy payload
result = source.
* add an adapter specific attribute
l_record-namespace = 'http://sap.com/xi/XI/System/File'.
l_record-name = 'FileName'.
l_record-value = 'test.xml'.
dynamic_configuration->add_record( l_record ).
ENDMETHOD.
Regards
Bhavesh
Maybe you are looking for
-
Shipping legacy MSDS uploaded which are in pdf format
Hi Friends, Do not get mislead by Questiom Here is the requirement. In our project, We have imported legacy MSDS in PDF format. For this we created a program to upload legacy MSDS in PDF format. The generation variants are of type "MSDS" and not "IBD
-
"java.lang.ClassNotFoundException" when creating a CFC instance inside a webservice
This question is also up on stack overflow: http://stackoverflow.com/questions/10089962/coldfusion-web-service-failing-to-see-componen t I've got a CFC that I'm going to access with ?wsdl as a SOAP webservice. If I call the CFC directly in a browser,
-
PSE 8 - Kodak Gallery, keine Seitenverbindung
Ich will Abzüge von PSE8 über Kodak Gallery bestellen. Meine Internetverbindung ist aktiv. Aber PSE 8 findet nicht die Seite von Kodak Gallery. Was muss ich machen und wer kann mir helfen?
-
Hi Gurus, 1)In case of Purchase orders with excisable tax code,the system is allowing to do invoice verification even if RG 23 Part 2 has not been updated.The system is automatically reversing the GR/IR Clearing account even if J1IEX has not been don
-
EC-CS-currency translation key 5 - Translation of each period at applicable
Hi, When using translation key 5 (Translation of each period at applicable rate for the period) in our methods, for this to translate local currencies per period, do we have to run our currency translation methods EVERY period, or can we run it just