How to give field name to Receiver File Name.
Hi ,
In my source target structure there is a field name
"job id" .
I need that value coming in that field name to be given to
Receiver File Name.
Thanks in Advance
Hi,
You could use the field name to the File Name. For that you could go ahead with variable substituiton in receiver communication channel.
In receiver Communication channel use variable substitution as
In file name -- %Var1%
In Variable substitution parameter give Var1 ---> payload:<field Name>
Refer
SAP Network Blog: An interesting usage of Variable Substitution in XI
/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
variable substitution
http://help.sap.com/saphelp_nw2004s/helpdata/en/8e/464442c1a1c253e10000000a1550b0/content.htm
Also see the below links to use the dynamic variable substitution
/people/michal.krawczyk2/blog/2005/03/29/xi-error--unable-to-convert-the-sender-service-to-an-ale-logical-system
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Also
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
Thanks
swarup
Similar Messages
-
Configure receiver file name as Sender file name
Hi All,
In PI7.1. We have scenario(file to file). Here the sender system send multiple files and In the receiver system we need to populate the same filenames as Sender file Names.
Could you please let me know is there a configuration to have Receiver file schem name As like sender file names.
Thanks in Advance,
Naga.Hi Naga,
This can be achieved using either variable substitution or Dynamic Configuration by enabling Adapter Specific Message Attributes in sender and receiver file channels.
If the sender file name and receiver file name needs to be exactly same then just check Adapter Specific Message Attributes in advanced tab of both sender and receiver channels. Check on File Name under that.
Lot of help over this is already available in sdn, kindly serach and you will get lot of helpful blogs and wikis
Regards,
Gautam Purohit
Edited by: Gautam Purohit on Apr 16, 2010 11:26 AM -
Hi All,
I want to write the receiver file name like test20091216.txt
I tried with Add Timestamp, but it is adding with time also which i dont require.
Here i want to say is iam not using any mapping to use Dynamic file name concept.
Please suggest me on this.
REgards>
Vamsi Krishna wrote:
> Sarvesh,
>
> iam not sure about the target FTP Server OS.
>
> i have one thought here, the process is as follows....
>
> ECC will generate a text file to XI Shared path, XI will pick up and deliver it to target FTP server path.
>
> Now this is doing with out any mapping, we can't do Dynamic Config. t=in this case.
>
> So my thought is i can ask ECC while writing the file with file name followed by date. EX: test20091216.txt
>
> so that in XI, can i just use the sender file name to receiver file name???
>
> REgards
Yes, if ECC can do this then problem solved. Just use ASMA setting in both sender and receiver adapter to write the same file name at receiver side.
There is ablog written by Michal, just search it.. -
Dynamic File Name for Receiver File Adapter
Hi All,
How can we use dynamic name for Receiver file adapter?
Can anyone help.
Thanks in Advance
ChemmanzHi Chemmanz,
The dynamic filename generation concept is as follows.
In your filename field. just give a variable with % symbols. (eg: %file% ).
Now, under the option Variable Name Substitution, you can give how the value has to be created.
It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
For the former, your give
message:interface_name ,etc
and for the payload part you give,
Payload: "your element root which u wanna acecss"
Just check this link out,
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
And read the contents under variable substitution and it will help you understand the concepts better.
If you have any clarifications, do get back,
Regards,
Bhavesh -
Receiver File Name assign dynamically
Hi friends,
In our scenario, receiver file name is assigned to dynamically. Example Inventory_Current date. Inventory is static, but CurrentDate is changed on runtime.
I was tried to Variable substitution method and UDF method. In this type dynamic value is mapped to target structure, so Receiver payload shows the dynamic value in output file. But we don't need that dynamic value. So, in variable substitution method and UDF method is not achived to my requirement.
Please any one help me how to change file name at runtime (receiver communication channel). If using any module program pls forward to me.
Thanks & Regards
VijayHi,
if we want to get the Output file name as One of the Field value from Payload and Current dase with it means,
1) Write one UDF & map Like this
Name(giri)-----UDFCurrent Date----MT_Target
2) Check the ASMA Option in Receiver Adapter Aloneu2026..
3)No need to check the ASMA Option in the Sender side
UDF Code:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
String Outputfile = conf.put(key,a);
return Outputfile;
Regards
Seshagiri -
How to get the Received File Name(using FILE.ReceivedFileName property) in BizTalk Map. Kindly provide with suggestions.
Regards, Vivin.try this
http://blogit.create.pt/blogs/tiagooliveira/archive/2009/02/02/Using-xpath-function-in-orchestrations.aspx
xpath(msgOut,"string(xpathquery)")=msgIn(FILE.ReceivedFileName)
You can't promote that field which occurs multiple times so in that case we use xpath()
Regards -
How is it posible to get the File name, size and type from a File out the H
How is it posible to get the File name, size and type from a File out the HttpServletRequest. I want to upload a File from a client and save it on a server with the client name. I want to conrole before saving the name, type and size of the file.How is it posible to get the File name, size and type from a File out the HttpServletRequest.
form JSP
<form name="form" method="post" action="procesuploading.jsp" ENCTYPE="multipart/form-data">
File: <input type="file" name="filename"/
Path: <input type="text" readonly="" name="path" value="c:"/
Saveas: <input type="text" name="saveas"/>
<input name="submit" type="submit" value="Upload" />
</form>
proces JSP
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="FileUploadBean" %>
<jsp:useBean id="TheBean" scope="page" class="FileUploadBean" />
<%
TheBean.doUpload(request);
%>
BEAN
import java.io.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletInputStream;
public class FileUploadBean {
public void doUpload(HttpServletRequest request) throws IOException
String melding = "";
String filename = request.getParameter("saveas");
String path = request.getParameter("path");
PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("test.java")));
ServletInputStream in = request.getInputStream();
int i = in.read();
System.out.println("filename:"+filename);
System.out.println("path:"+path);
while (i != -1)
pw.print((char) i);
i = in.read();
pw.close();
}Thanks it works great.
Here an excample from my code
import org.apache.commons.fileupload.*;
public class FileUploadBean extends Object implements java.io.Serializable{
String foutmelding = "geen";
String path;
String filename;
public boolean doUpload(HttpServletRequest request) throws IOException
try
// Create a new file upload handler
FileUpload upload = new FileUpload();
// Set upload parameters
upload.setSizeMax(100000);
upload.setSizeThreshold(100000000);
upload.setRepositoryPath("/");
// Parse the request
List items = upload.parseRequest(request);
// Process the uploaded fields
Iterator iter = items.iterator();
while (iter.hasNext())
FileItem item = (FileItem) iter.next();
if (item.isFormField())
String stringitem = item.getString();
else
String filename = "";
int temp = item.getName().lastIndexOf("\\");
filename = item.getName().substring(temp,item.getName().length());
File bestand = new File(path+filename);
if(item.getSize() > SizeMax && SizeMax != -1){foutmelding = "bestand is te groot.";return false;}
if(bestand.exists()){foutmelding ="bestand bestaat al";return false;}
FileOutputStream fOut = new FileOutputStream(bestand);
BufferedOutputStream bOut = new BufferedOutputStream(fOut);
int bytesRead =0;
byte[] data = item.get();
bOut.write(data, 0 , data.length);
bOut.close();
catch(Exception e)
System.out.println("er is een foutontstaan bij het opslaan de een bestand "+e);
foutmelding = "Bestand opsturen is fout gegaan";
return true;
} -
To test how can we use the opt 'logical file name' to name the file based
Hi Sir/Madam,
to test how can we use the opt 'logical file name' to name the file based on the selection made in the dtp run for extracting data as flat file.Hi Vishali,
In the DTP select the file location as application server and give the logical file path. The actual file and logical path can be created using transaction "FILE" and "AL11".
Rest of the process is same as that of extraction from local file.
Regards,
Durgesh. -
Dynamic Receiver file name in AS2 adapter
Hi Experts,
How to get dynamic receiver file name in AS2 adapter. We need receiver file name same as of sender file name.
We tried selecting dynamic attributes file name but we are getting followin error in CC.
Message processing failed. Cause: javax.resource.ResourceException: Fatal exception: com.seeburger.xi.connector.queue.TaskBuildException: Mandatory attribute dtAS2FileName is not present in XI message., Mandatory attribute dtAS2FileName is not present in XI message.
Thanks,
Harihi hari,
You can't do it manually. As both adapter are in different context.
You can go with UDF to slove ur problem.
Just extract the input file name using Dynamic configuration
Store that in some variable.
Use same name in the dynamic file name in AS2 receiver. Below code might be useful.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://seeburger.com/xi/common/dtAS2FileName", "DYNFILENAME");
conf.put(key,strfilename);
Thanks
Jai
Edited by: Jaideep Baid on Apr 9, 2010 9:16 AM -
Change in time stamp format in receiver file name
Hi,
We have a scenario as AS2 - PI - FTP Server (AS/400). We want target file name as BMMDDHHSS where B is constant and
MM (month e.g., 01), DD (day e.g., 12), HH (hour e.g.,11), SS (seconds e.g., 12). Is there standard way of doing this, just by changing some configuration in receiver file adpter?
Please let me know, how could we do this using PI. If script is optional, keeping as back-up only.
How come, naming dynamic receiver file names are so difficult in PI. I have been trying to get the answers for our another requirement like to name receiver file as C1.YYMMDD.C2 in a file pass through scenario for more than a month.
It is just file through scenarios, so we can't use variable substitution as we are not going to read content/payload of file
Thanks in advance,
- Riya PatilHi Shabarish
Thanks for your reply. I have trying to make this UDF work since almost a month with no luck. Can you please check where am I doing wrong?
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String SourceFileName = "C1." + a + ".C2";
conf.put(key, SourceFileName);
return " ";
In the above code, I am passing date as "a". And mapping CurrentDate (formatted) --> UDF --> Target root node.
I am getting the following error in SXMB_MONI:
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P1>com/sap/xi/tf/_MM_Lockbox_Filename_</SAP:P1>
<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
<SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:P3>
<SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_Lockbox_Filename_: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
Your help would be much appreciated.
Thanks,
Riya Patil -
How should we get the out put file-name same as in put file-name in file to
Hi frnds,
having hundreds of files in the sender system with different names, how should we get the out put file-name in the receiver system same as the in put file-name in file to file scenario ?
Thanks in advance.
truly,
snrvakiti.Hi,
In Receiver File Adapter you can set under 'Adapter-Specific Message Properties'
check Use Adapter-Specific Message Properties
check Fail on Missing Adapter Message Properties
Check File Name
Have a look at this link, [File_to_File|http://allsapnetweavernotes.blogspot.com/2008/09/how-can-i-access-filename-from-fileftp.html]
Regards,
P.Rajesh -
Payload as File name at Receiver File Adapter
Hi All,
I have a requirement for a PROXY to File Scenario where Receiver files has to be named dynamically with a value from the Payload that I get. Also the particular field that has the file name should be unmapped with the Receiver.
For Example,
<row>
<Name>Alex</Name>
<DOB>27062014</DOB>
<City>Delhi</City>
</row>
If this is the Payload I get, I want the Receiver file name to be "27062014.txt". At the same time this particular field should not be mapped at the Receiver end.
I have tried a few links which confuse me further.Kindly help me,
Thanks in advance,
Sree RamHi Sree,
Please check if the case is correct. refer the below discussion
Problem in variable substitution
reference blog for variable substitution
Variable Substitution for Directory or File name.
regards,
Harish -
Receiver file name with counter
While working on proxy to file scenario. I have to maintain receiver file name as ddmmyyyyxxx_nnn.xml,where xxx is constant and nnn is a counter which is suppose to be reset everyday.Anybody can help me on how to achive this...?
Hello Amit,
Yes. You can achieve this but only using File - NFS Protocol.
A new file is created for each document. The file name is extended with a counter, which is inserted before the file name extension (for example, default002.file). This selection is only available for the File System (NFS) transport protocol.
Make specifications for Counter Definition:
Prefix
Specify one or more characters that you want to add before the counter in the file name.
Format
Specify the first counter to be used. It must be a valid integer number. Leading zeros are permitted.
Step
Specify the counter increment.
Mode
Specify when the counter is to be added.
After First File
The counter is added when the file name is used unaltered for the first time.
Thanks
Pothana -
How to get field separator in flat file using GUI_DOWNLOAD function
hi,
how to get field separator in flat file using GUI_DOWNLOAD function.
thanking you.Hi,
Use WRITE_FIELD_SEPARATOR = 'X'.
Check this sample code
REPORT z_file_download.
DATA: w_name(90) TYPE c.
DATA:
BEGIN OF fs_flight,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
price LIKE sflight-price,
currency LIKE sflight-currency,
END OF fs_flight.
DATA:
BEGIN OF fs_head,
carrid(10) TYPE c,
connid(10) TYPE c,
fldate(10) TYPE c,
price(10) TYPE c,
curr(10) TYPE c,
END OF fs_head.
DATA:
t_head LIKE
TABLE OF
fs_head.
DATA:
t_flight LIKE
TABLE OF
fs_flight.
fs_head-carrid = 'CARRID'.
fs_head-connid = 'CONNID'.
fs_head-fldate = 'FLDATE'.
fs_head-price = 'PRICE'.
fs_head-curr = 'CURRENCY'.
APPEND fs_head TO t_head.
SELECT-OPTIONS:
s_carrid FOR fs_flight-carrid.
START-OF-SELECTION.
SELECT carrid
connid
fldate
price
currency
FROM sflight
INTO TABLE t_flight
WHERE carrid IN s_carrid.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = 'D:\flight.xls'
FILETYPE = 'ASC'
* APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* IMPORTING
* FILELENGTH =
tables
data_tab = t_head
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'D:\flight.xls'
filetype = 'ASC'
append = 'X'
write_field_separator = 'X'
TABLES
data_tab = t_flight
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc EQ 0.
MESSAGE 'Download successful' TYPE 'I'.
ENDIF.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Error dynamic File Name in Receiver File Adapter
Hi all,
Dynamic file name for Receiver file Adapter Problem
my multi mapping look like this in design mode
messages
message1
SD01_E
FileName
row
message2
SD02_E
FileName
row
by processing the xml look like this:
<ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
<FileName>L40SA939.xiConstant</FileName>
- <row>
or
<ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
<FileName>L40SA939.xiConstant</FileName>
- <row>
in file receivere adapter i have try this but it dos not work
payload:SD01_E,1,FileName,1
Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
is there any way to have access to Filename in different root elements??
regards
RalfHi Ralf,
i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
Regards,
Udo
Maybe you are looking for
-
How can I change the sensitivity of my trackpad?
Okay so I have the early 2008 Macbook Pro. I got these little buttons that conduct electricity and you can put them on your trackpad and they just sit there and look cute but you can actually use them (if you have set the computer to respond to taps)
-
What is a normal charge capacity after 6 months?
after 134 cycles my 6 month old Macbook pro has a full charge capacity of 1928mah. (From researchig it seems that a new battery is around 7000mah). I was hoping that after 6 months the battery's condition would still be "Normal" if not "Good" but it
-
Stuck with a "lookup up" question
hello forum, is there a function to search a column for a particular string, e.g. "*pic1*" (wildcards needed) and if there is a match than just return "pic1"? Somehow it sounds very simple - but right now I´m stuck with it. I tried "lookup" but could
-
Connecting Nintendo Wii To Laptop
hi there i am at university and have just recently got a Nintendo wii, due to lack of space i just wanted to know is there any way i can connect my games console to the laptop and play on there?
-
Revision: 16142 Revision: 16142 Author: [email protected] Date: 2010-05-16 14:21:40 -0700 (Sun, 16 May 2010) Log Message: Insync Refactorings, Module lib: Added missing parameters from IModuleInfo interface. Maven: Take Persistence out. Modifi