Howto give payload for variable substitution
hi experts,
I need to add variable after file name.
So I used variable
My payload is
- <ns1:MTI_RCIInterface xmlns:ns1="http://abcd.com/FI_IDOC_XXX_FILE">
- <RS>
- <HEADER>
<H_CODTYPENR>H</H_CODTYPENR>
<H_IDENT>EDCXQ42</H_IDENT>
<H_NUMSEQ>00001</H_NUMSEQ>
<H_DATE>20080613</H_DATE>
</HEADER>
I want to use H_IDENT.
Please suggest what i give in refernce
I gave
payload:RS,1,HEADER,1,H_IDENT,1
pl. help
Akhil
if u r using SP12
then
Solution to the problem encountered using Variable Substitution with XI-SP12
/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
SAP NetWeaver XI: Variable Substitution with Adapter-Specific Message Attributes via DynamicConfigurationBean
/people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapter-specific-message-attributes-via-dynamicconfigurationbean
regards
chandrakanth
Similar Messages
-
File-Adapter: Variable substitution form payload XML-attribute
Hi experts,
is possible to use XML-attribute-content for variable substitution in file-Adapter?
extract from XML:
<?xml version="1.0" encoding="utf-8" ?>
- <all>
- <transaction <b>file="filename"</b>>
- <table name="BPAADDRESS" options="insertIfUpdateFails">
- <record id="1">
<hkeycol name="BPAMAINHKEY">0010500345</hkeycol>
<hkeycol name="USAGE">Invoice</hkeycol>
</transaction>
I want to get the value "filename" = attribute file of transaction.
Is this possible?
Thanks a lot,
FlorianI have done this taking a field from the XML.
You have to map the location of the field within the XML...
Taken from:
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
Variable Substitution (Target Directory/File Name Scheme)
If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
● Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
The variables can refer to attributes of the message header or elements of the message payload.
○ If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,
message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)
message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)
For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.
If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").
○ If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
namea,nameb,... corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
The description begins at the root of the document and ends at the respective element.
To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (Example Value) is set as the value for a specified variable.
<?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>
● To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.
Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters /, \, and ... -
Receiver File Adapter:Variable substitution :FATAL ERROR
HI all
as per the previous thread :
<b>Receiver File Name Variable Substitution :payload: Fatal Error
in our idoc to file sceanrio, we are using simple <b>graphical mapping.</b>
for dynamic file name , variable field is at <b>Target message type</b>,So on using <b>Variable substitution</b>, again the error is same :
SAXException while parsing XML payload: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) .
<b>Our XI Component version : 2004
WAS 6.4 SP 15</b>
Thanks
ARAshutosh,
There is nothing to do with your mapping programs. Its the mistake in ur reciever file adapter configuration for variable substitution.I asked u whether u changed message mapping in order to implement the UDF!!
Did u tried checking the audit log. Ok just to see where u are going wrong, instead of using Payload :... in Variable substitution use Message:..... and give some interface name so that to check whether the file is created with Interface name.
Juz give a try!!!
Best regards
raj. -
Transportaion probled for Variable Substitutiom Method
hi all,.
we have done variable substitution method in DEV, but it not reflecting in QA.
also tell me wht r the things we need to change manually after importing the object into INT and QA?
regards
sreeniHi Chirag,
Tank you very much.
we are using CMS for this transportations in XI.
I have created one CC as RCVR and we have used Message all as FCC.
Now exported in DEV then it ready to import in CMS. If we import this in CONSODITION TAB of CMS, then it is imported into my QA.
Now, I open the that Scenario in ID of QA.
Here My doubt is:
In CC channel we have give some values manually for EXAMPLE, Target DIR.
What abt file name scheme?
If we use FCC and to get File Name as dynamic form PayLoad Values.
For that we can use Variable Substitution Method using percenatge simbles.
And we have to check the check box for Variable Substitution Method Enable.
After checking the check box, we have to give variable names and values from PayLoad data.
Ok,
now my doubt is,
Whethere we have to change the following manually or not.
1) Taget Directory
2) File name scheme
3) FTP Server Name
4) User ID (FTP)
5) Pasword
6)Check Box (for Variable Substitution Method Enable)
7)For this Variable Substitution Method, variable names which we used for FIle Name Scheme and its values right.
plz
revert
regards
sreeni -
'Variable Substitution' error - Expected numeric element index
Hello everyone!
I'm using the 'variable substitution' property in XI to replace the filename of the output file to a value in the message payload.
Here are the parameters I provided:
File Name Scheme: %filename%.xml
Variable Name: filename
Reference: payload:ORDERS05,1,recordset,1,IDOC,1,E1EDK02,BELNR,1
I'm getting this error in the adapter engine:
Caught exception while initializing variable substitution engine: Cannot parse pseudo-path for variable substitution: 'filename': Expected numeric element index, got 'BELNR': For input string: "BELNR"
Can anyone tell me what this means, and how I can fix this problem?
Thanks in advance!
GlennYup, raj! it's IDOC to file.... I did what you asked but I'm now getting this error:
MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
any idea what it means?
Kind regards,
Glenn -
Error with variable substitution..
Hi
I am getting following error message for variable substitution
*Message processing failed. 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: date_stamp: 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: date_stamp
<?xml version="1.0" encoding="UTF-8" ?>
- <I813_EModMCS_IB_MT>
- <Records>
<ModMod>111</ModMod>
<DesModdcr>222</DesModdcr>
- <Date_Stamp>
<Date_Stamp>20080338</Date_Stamp>
</Date_Stamp>
</Records>
</I813_EModMCS_IB_MT>
date_stamp payload:I813_EModMCS_IB_MT,1,Records,2,Date_Stamp,3,Date_Stamp,1
Would appriciate if you can correct the variable substitution...
RegardsTo reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (u201CExample Valueu201D) is set as the value for a specified variable.
<?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>
Edited by: Progirl Progirl on Jul 17, 2008 8:04 AM -
Issue with Variable Substitution
Hi,
We have a scenario where we need to use the data from Payload for further processcing of the messeges.The payload looks like the one given below.
<?xml version="1.0" encoding="utf-8" ?>
- <ns1:MT_NOTIFICATION xmlns:ns1="http://WM_ERRHAND" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <PROXYRESPONSE>
<STATUS>YES</STATUS>
<NAMESPACE>WM_INVOICE</NAMESPACE>
<INTERFACENAME>MI_INVOICE_MOORE_ACK_IN</INTERFACENAME>
<PROXYNAME>ZXIII_MI_INVOICE_MOORE_ACK_IN</PROXYNAME>
</PROXYRESPONSE>
</ns1:MT_NOTIFICATION>
In adapter, for variable substitution we have specified as below:
payload:MT_NOTIFICATION,1,PROXYRESPONSE,1,NAMESPACE,1
but getting an error "Message processing failed: Error during variable substitution: java.text.ParseException: Variable 'namespace' not found in variable substitution table"
Is the variable that we have declared is right or is there anything we have missed out. Any helpful answers will be rewarded
Thanks and regards,
Ram.Hi Ram,
The substitution looks fine.
Did you read this,
<i>To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.
Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters /, \, and ...</i>
Try seleting this option and checking the same.
Regards,
Bhavesh -
File adaptor and variable substitution
i have used variable substitution in the reciever comm channel to dynamically alter the folder ...Question is ..is there a way to do this from the sender comm channel..
I know, i know we can write a custom module..etc..etc..
I mean besides that ..is there a way sap provides out of the box...
Michal..what do you think..?
PS: your blog on var subst is very good !
Regards
VenkatHi Venkat,
For implementing variable substitution on the sender side. you can develop your own module as per your requirement.
Only question is you can easily implement this on receiver side receives payload information coming after the mapping. While processing communication channel, it has payload to refer for variable substitution..
While on the sender side communication channel do not have payload to implement variable substitution.
Can you explain in detail about condition you want to apply in variable substitution.
- Gaurav Jain -
HOW TO ACHIEVE THE Variable Substitution THROUGH MODULE BEAN
Hi All,
i know the variable substitution for getting the one the value from the payload.
how can we achieve same thing through using the module been. below screen for your reference.
help us module bean for variable substitution.
Regards,
KesavaHi,
refer the below link..
http://scn.sap.com/people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapter-specific-message-attributes-via-dynamicconfigurationbean
Regards
srinivas -
Variable substitution using attribute
hi,
i want to use an attribute of an elemnet in variable substitution.
i know how to use element in variable substitution and i know that i can use message header attributes
in variable substitution, but if i create an element with an attribute how do i use it
(or is there a simple way to map a value in message mapping to message header attributes)?
Thanks
TomerHi
Attribute is not supported for variable substitution.
You can try setting values for the Dynamic configuration and use it
SAP NetWeaver XI: Variable Substitution with Adapter-Specific Message Attributes via DynamicConfigurationBean
Thanks
Gaurav -
Variable substitution parameter
Hi All,
I have a scenario where in i am creating a flat file . File name is being taken from the payload using variable substitution parameter . But while wrting to a file , i need to make sure that File name doesnt get written in the file .
Is there anyway i can avoid filename getting written into the file.
Regards
Vinay P.Hi,
You can Use ASMA Properties of file adapter .
Step 1. Create UDF with following code.
try
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String MyFileName = "_ASMA.txt";
conf.put(key, MyFileName);
return MyFileName ;
catch(Exception e)
String exception = e.toString();
return exception;
this is an example : Here i have Hard coded the File Name in MyFileName String.
If You Want file name from Target Message Type , Create your UDF as Parameterized UDF, and Pass Filename as argument to that Parameter
Step 2:
Map This Parameterised UDF Function to Root Node, so that it will return value to root node.
Step 3:
On Receiver adapter .
Tick the Set Adapter Specific Message Attribute on advanced Tab.
Step 4:
Tick File Name.
Rest is same....
I hope this will help you ...
Regards
Prabhat Sharma. -
FILE CONTENT CONVERSION/ VARIABLE SUBSTITUTION
Hi Experts,
I have a reciver file which should have
HEADER
field 1
field 2
DETAIL
field 1
field 2
TRAILER
field 1
field 2
My reciever structure is
HEADER
field 1
field 2
DETAIL
field 1
field 2
TRAILER
field 1
field 2
TEMP
field 1
I am using TEMP field1 only for variable substitution and do not want
it to be written to file. How can i use it in FCC.
Pl. Help
AkhilHi,
Plz do refer the folowing links:
Sender -
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
Key value:
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter -
TAB delimited
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
NAB the TAB (File Adapter)
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
Receiver FCC no need of Endseparator
/people/shabarish.vijayakumar/blog/2007/08/03/file-adapter-receiver--are-we-really-sure-about-the-concepts
Regards,
Vinod. -
White lines generated in a txt File when using variable substitution
Hello,
I have a problem with a File generated by XI, my File Adapter is using variable substitution with reference to a field of my message type. I use content conversion as well and the generated file has a white line in top of file.
How could I avoid this and make the white lines disappear? I was trying a lot of things but I dont really know how to solve this issue, the following is the data type used:
<FILE_NAME></FILE_NAME>
<COMPANY>
<COMPANY_CODE></COMPANY_CODE>
<COMPANY_NAME></COMPANY_NAME>
<ADRESS></ADRESS>
</COMPANY>
FILE_NAME is the field I use for variable substitution and COMPANY is declare as 0..unbounded.
Thanks a lot in advanced,
LuisHi Jai,
I have declare the following Content Conversion parameters:
Recordset Structure: COMPANY
FILE_NAME.fieldFixedLengths 0
FILE_NAME.fixedLengthTooShortHandling cut
COMPANY.fieldFixedLengths 10,80,10,2,50,30,5,5,2,50,50
COMPANY.addHeaderLine 0
COMPANY.endSeparator 'nl'
But it does not work, I have the same white line in the beginning of the file. Do you have any other suggestion??
I couldnt find the blog written by Sravya either, could you post the link?
Thanks a lot,
Luis -
Variable Substitution need to define pay load for the following structure
Hi All
Please help me for defining the pay load for the following structure for the Variable Substitution
for genearing the file dynamically fro the payload
Target structure is like this
MT_RFQ_IND_IDOC_MYSPACE_TARGET............> my message type
<HEADER>
< FileName>
<INDI>
<RFQNO>
<DOCUTYPE>
< ITEM>
<FEILD1>
<FEILD2>
<FEILD2>
please help me
thanking you
SridharHi,
should this var1 given in any data type of my IR - No
in variable substitution, in value give the complete thing which i said above in italics i.e. payload:MT_RFQ_IND_IDOC_FILE_TARGET,1,hEADER,1,FileName,1
which user you used for CPACache refresh - it can only be done by XIDIRUSER.
Regards,
Rajeev Gupta
Edited by: RAJEEV GUPTA on Feb 6, 2009 7:34 AM
Edited by: RAJEEV GUPTA on Feb 6, 2009 7:35 AM -
Variable substitution not working for dynamic file name in Receiver File CC
Hi Experts,
I am doing the scenario of Proxy sender to File receiver and my purpose is to Create the text file
as per the filename available in Source Message payload.
I am using the Variable Substitution method for this as shown below.
Source Message Structure:-
<Row> -
having Cocurence 1.1
<Filename> -
having Cocurence 1.1
<Item> -
having Cocurence 1.Unbounded
<Field1>
<field2>
<Item>
<Item>
<Field1>
<field2>
<Item>
<Row>
Target structure is same as the source structure and i have mapped the Filename field of the Source
with the Target structure Filename.
In ID the following is the File receiver CC Configuration.
File Name Scheme:- %Dyn_filename%
In Advance tab, I have selected the Enable option and added one row as Variable name %Dyn_filename%
and Reference as payload:Row,1,Filename,1
In testing I am getting the Error as 'variable Dyn_filename is not found in Message payload'.
Please suggest me.
Regards,
JageshHi Pooja,
Hi Pooja,
Thanks for your valuable reply..
I tried with the same. but still Filename is appearing in Output file.Giving you some details regarding my Receiver File Configuration settings.
Target Message Type:-
<MT_Target_Struct>
<Row>----
1.1 occurence
<Filename_test>----
1.1 occurence
<ITEM>----
1.unbounded occurence
<Field1>
<Field2>
<ITEM>
<ITEM>
<Field1>
<Field2>
<ITEM>
<Row>
<MT_Target_Struct>
Recordset structure:- Row,Filename_test,ITEM
Row.fieldSeparator----
>'nl'
Filename_test.fieldFixedLengths----
>0 (Zero)
Filename_test.fixedLengthTooShortHandling----
>Cut
ITEM.fieldSeparator----
>,
ITEM.endSeparator----
>'nl'
I want only ITEM node to be written in the output file.
Please suggest.
Regards,
Jagesh
Maybe you are looking for
-
the only message that comes up now when I close is 'you are about to close x number of tabs' with no offer to save anything.
-
Problems with JList (multiple selection)
hi! i have a simple question.. why does this construct not work? i recieve a Casting Exception! recList is a JList! if(source == send){ String[] rec = (String[])recList.getSelectedValues(); String message = messageArea.getText(); thx, chris
-
Strange repetitive entry in system log
8/7/11 7:06:10.000 PM kernel: macx_swapon SUCCESS 8/7/11 7:06:11.000 PM kernel: (default pager): [KERNEL]: default_pager_backing_store_monitor - send LO_WAT_ALERT 8/7/11 7:06:11.000 PM kernel: macx_swapoff SUCCESS 8/7/11 7:06:44.000 PM kernel: (defau
-
Hello Guys, I m getting an error in tcode st0s "No RFC : No Data Available" in Last Minut's Load. As per SAP reply i have to set system time zone. Anybody know how to set system time zone. Pl give me detail steps. Thanks, Danniel
-
Macbook Pro 10.1 - suddenly no sound (X'd out) in flash videos (Youtube)
Title says it all. System is 10.8.3, all possible system updates installed and relevant software including latest available version of Adobe flash player. Youtube videos in browsers (Safari and Firefox) show an X'd volume control and have no sound. A