*****output File format
Hi all,
Instead of Time stamp in the out put file ,we require the out put file format as xyz_a.txt,xyz_b.txt.......
eg:file name sample.txt out put required is sample_a,sample_b,sample_c......
is it possible in Xi?
Thanks,
Srinivasa
Hi,
Yes, you need to use variable substitution
http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6a316af5a23672e10000000a114a6b/frameset.htm
Filename : sample_%var%.txt
Keep the mode as Create
The value of Var will be made a, b, or c in message mapping.
also if you want to name the target file as the one which you have read you can make use of Dynamic configuration, as mentioned here (See adapter specific identifiers)
http://help.sap.com/saphelp_nwpi71/helpdata/en/44/69d7cfa4b633eae10000000a1553f6/content.htm
Regards
Suraj
Edited by: S.R.Suraj on Oct 7, 2009 4:55 AM
Similar Messages
-
Hi all,
Does somebody know what is the PDF output file format in Oracle EBS 11.5.10.2?
Is it PDF/X, PDF/E, PDF/UA, PDF/VT or something else?
Thanks and regards,
KarmitHi,
See this thread.
concurrent ouput to email
concurrent ouput to email
Regards,
Hussein -
UTL FILE OUTPUT FILE FORMAT ISSUE ON ORACLE 11G
how to format util file output align with column value with proper format.
set serveroutput on
DECLARE
CURSOR h1
IS
select 'TOTAL_ACCOUNT_REJECTS' as TOTAL_ACCOUNT_REJECTS ,
'PC' as PC ,
'RT' as RT,
'SERIAL' as SERIAL
from dual;
-- l_app_nm := RTRIM( TRIM( l_line ), CHR(13) );
CURSOR c1
IS
SELECT
company ,
user,
app,
account
FROM account_auth
WHERE ROWNUM < = 5;
lc_file_handle UTL_FILE.file_type;
lc_file_dir VARCHAR2 (100);
lc_file_name VARCHAR2 (50);
gov_005_payment_rec VARCHAR2 (1000);
BEGIN
lc_file_dir := 'OUTB';
lc_file_name := 'test.txt';
lc_file_handle := UTL_FILE.fopen (lc_file_dir, lc_file_name, 'W',1024);
FOR i IN h1
LOOP
gov_005_payment_rec :=
i.TOTAL_ACCOUNT_REJECTS
||' '
|| i.PC
|| ' '
|| i.RT
|| ' '
|| i.SERIAL;
UTL_FILE.put_line (lc_file_handle, gov_005_payment_rec);
END LOOP;
FOR i IN c1
LOOP
gov_005_payment_rec :=
i.company
||' '
|| i.user
||' '
|| i.app
||' '
|| i.account;
UTL_FILE.put_line (lc_file_handle, gov_005_payment_rec);
END LOOP;
EXCEPTION
WHEN UTL_FILE.INVALID_PATH THEN DBMS_OUTPUT.PUT_LINE('Invalid
path!');
WHEN UTL_FILE.INVALID_MODE THEN DBMS_OUTPUT.PUT_LINE('Invalid
mode!');
WHEN UTL_FILE.INVALID_OPERATION THEN DBMS_OUTPUT.PUT_LINE('Invalid
operation!');
WHEN OTHERS
RAISE;
END ;
OUTPUT : issue with file format
TOTAL_ACCOUNT_REJECTS PC RT SERIAL
&&&&&846 000000000000 APPLICATION123 20570
&&&&284 000000000000 APPLICATION133 20570
&&&2&&846 000000000000 APPLICATION163 20570
EXPECTED output ==> please advise me , how to create proper formatted output file using utl_file? thanks in advance.
TOTAL_ACCOUNT_REJECTS PC RT SERIAL
&&&&&846 000000000000 APPLICATION123 20570
&&&&284 000000000000 APPLICATION133 20570
&&&2&&846 000000000000 APPLICATION163 20570Example of creating a fixed width format file for a dynamically provided query, using the DBMS_SQL package...
As SYS user:
CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
As myuser:
CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
,p_dir IN VARCHAR2
,p_header_file IN VARCHAR2
,p_data_file IN VARCHAR2 := NULL) IS
v_finaltxt VARCHAR2(4000);
v_v_val VARCHAR2(4000);
v_n_val NUMBER;
v_d_val DATE;
v_ret NUMBER;
c NUMBER;
d NUMBER;
col_cnt INTEGER;
f BOOLEAN;
rec_tab DBMS_SQL.DESC_TAB;
col_num NUMBER;
v_fh UTL_FILE.FILE_TYPE;
v_samefile BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
BEGIN
c := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
d := DBMS_SQL.EXECUTE(c);
DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
ELSE
DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
END CASE;
END LOOP;
-- This part outputs the HEADER
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
WHEN 2 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),rec_tab(j).col_max_len,' ');
WHEN 12 THEN v_finaltxt := v_finaltxt||rpad(lower(rec_tab(j).col_name),greatest(19,length(rec_tab(j).col_name)),' ');
END CASE;
END LOOP;
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
IF NOT v_samefile THEN
UTL_FILE.FCLOSE(v_fh);
END IF;
-- This part outputs the DATA
IF NOT v_samefile THEN
v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
END IF;
LOOP
v_ret := DBMS_SQL.FETCH_ROWS(c);
EXIT WHEN v_ret = 0;
v_finaltxt := NULL;
FOR j in 1..col_cnt
LOOP
CASE rec_tab(j).col_type
WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
v_finaltxt := v_finaltxt||rpad(nvl(v_v_val,' '),rec_tab(j).col_max_len,' ');
WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_n_val,'fm99999999999999999999999999999999999999'),' '),rec_tab(j).col_max_len,' ');
WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
v_finaltxt := v_finaltxt||rpad(nvl(to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),' '),greatest(19,length(rec_tab(j).col_name)),' ');
END CASE;
END LOOP;
UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
END LOOP;
UTL_FILE.FCLOSE(v_fh);
DBMS_SQL.CLOSE_CURSOR(c);
END;
This allows for the header row and the data to be written to seperate files if required.
e.g.
SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
PL/SQL procedure successfully completed.
Output.csv file contains:
empno ename job mgr hiredate sal comm deptno
7369 SMITH CLERK 7902 17/12/1980 00:00:00800 20
7499 ALLEN SALESMAN 7698 20/02/1981 00:00:001600 300 30
7521 WARD SALESMAN 7698 22/02/1981 00:00:001250 500 30
7566 JONES MANAGER 7839 02/04/1981 00:00:002975 20
7654 MARTIN SALESMAN 7698 28/09/1981 00:00:001250 1400 30
7698 BLAKE MANAGER 7839 01/05/1981 00:00:002850 30
7782 CLARK MANAGER 7839 09/06/1981 00:00:002450 10
7788 SCOTT ANALYST 7566 19/04/1987 00:00:003000 20
7839 KING PRESIDENT 17/11/1981 00:00:005000 10
7844 TURNER SALESMAN 7698 08/09/1981 00:00:001500 0 30
7876 ADAMS CLERK 7788 23/05/1987 00:00:001100 20
7900 JAMES CLERK 7698 03/12/1981 00:00:00950 30
7902 FORD ANALYST 7566 03/12/1981 00:00:003000 20
7934 MILLER CLERK 7782 23/01/1982 00:00:001300 10
The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
Adapt to output different datatypes and styles are required (this is currently coded for VARCHAR2, NUMBER and DATE) -
Adhoc Query- problem with the output file format
Hi Gurus,
I have a problem in exporting the output of an adhoc query to Excel format.
The menu option I chose to export the report data into Excel is List>Export>Spreadsheet.
However,I think I've just pressed the wrong option to export my report and now I can't seem to change it from a HTML file option.
Can anybody help me correct this output setting.
Points assured for apt help...Hi Sushil,
There are two ways to save the output in the excel format.
As you have mentioned, you can use
List -> Export-> Spreadsheet.
Then select table. Now the output will open in a spreadsheet.
The other way is
List -> Export-> Local File
Here you need to select the option spreadsheet. Then mention the path where you want the file to be stored. Also mention the format as .xls
Hope this helps
Regards,
Brinda -
Hi experts,
I am currenty getting below output in my XML file and it is wrapped in message type MT_Test.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_Test xmlns:ns0="http://test.com/xi/T1/Data">
<Tests>
<schemaLocation>http://tempuri.org/TestSchema.xsd F:/documentation/MID/Release-Test/TestSchema.xsd</schemaLocation>
<Test>
<HeaderID>This is a string 1</HeaderID>
</Test>
</Tests>
</ns0:MT_Test>
and I want to change it to the below format.
<?xml version="1.0" ?>
<Tests xmlns="http://tempuri.org/TestSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tempuri.org/TestSchema.xsd F:/documentation/TEMP/Release-Test/TestSchema.xsd">
<Test HeaderID="RES-996-25885-527">
</Test>
</Tests>
Request you to give your inputs on how I can achieve this?Hi ,
You need a java mapping to produce exactly the output you posted here.
I assume you r working with PI 7.1 here is the java mapping code.
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import com.sap.aii.mapping.api.AbstractTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.api.TransformationInput;
import com.sap.aii.mapping.api.TransformationOutput;
public class FormatXML extends AbstractTransformation{
public void execute(InputStream in, OutputStream out)
throws StreamTransformationException {
try{
// TODO Auto-generated method stub
DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
DocumentBuilder builderel=factory.newDocumentBuilder();
/*input document in form of XML*/
Document docIn=builderel.parse(in);
NodeList l=null;
String schemaLocation="";
l=docIn.getElementsByTagName("schemaLocation");
if(l!=null)
schemaLocation=l.item(0).getTextContent();
schemaLocation=schemaLocation.replaceFirst("/MID/", "/TEMP/");
String outPut="<?xml version=\"1.0\" ?><Tests xmlns=\"http://tempuri.org/TestSchema.xsd\" " +
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
"xsi:schemaLocation=\""+schemaLocation+"\">"
+"<Test HeaderID=\"RES-996-25885-527\">"
+"</Test></Tests>";
out.write(outPut.getBytes("UTF-8"));
catch(Exception e)
throw new StreamTransformationException(e.getCause().toString());
public void setParameter(Map arg0) {
// TODO Auto-generated method stub
public static void main(String[] args) {
// TODO Auto-generated method stub
try{
FormatXML genFormat=new FormatXML();
FileInputStream in=new FileInputStream("C:\\Apps\\sdn\\format.xml");
FileOutputStream out=new FileOutputStream("C:\\Apps\\sdn\\format1.xml");
genFormat.execute(in,out);
catch(Exception e)
e.printStackTrace();
public void transform(TransformationInput arg0, TransformationOutput arg1)
throws StreamTransformationException {
this.execute(arg0.getInputPayload().getInputStream(), arg1.getOutputPayload().getOutputStream());
If you are new to java mapping pls follow this http://www.****************/Tutorials/XI/Mapping/Index.htm
You need to install eclipse and java 1.5.0 for PI 7.1. You also need proper library files for PI 7.1 which you need to download from PI server. Please follow this link http://wiki.sdn.sap.com/wiki/display/XI/WheretogetthelibrariesforXI+development
Regards
Anupam -
Output file formats in receiver file adapter
Hi,
Is it possible to create a tab delimited or a .CSV file in a receiver file adapter ??
-TeresaHI,
It is possible to create a tab delimited/.csv file in a receiver file adapter by choosing "File content conversion" as a Message Protocol. But you need to do content conversion based on structure.
-Regards,
Moorthy -
Changing the file format of spool output when scheduling a background job.
Hello Experts,
I have an issue. It is related to Spool output format. I created a job for one report program for which the output is a list output. I have added one recipient in the 'Spool list recipient' while creating the job SM36. After the job is finished the spool output is sent to the recipient mail id as .htm format as an attachment. But the attachment should be excel sheet or text file. No coding in the program should be used to convert the file format. Only settings in the spool while creating job should be manipulated. Please help me in solving this issue.
Regards.Hi Sunil,
You can use the logic for converting spool to PDF using program : RSTXPDFT4 . Alternatively you can use FM: CONVERT_ABAPSPOOLJOB_2_PDF . In this FM you need to pass the Spool id .
u can make use of these FM's SO_DOCUMENT_SEND_API1
SO_NEW_DOCUMENT_SEND_API1
Check out the following wiki:
https://wiki.sdn.sap.com/wiki/display/Snippets/ConvertsspoolrequestintoPDFdocumentand+emails
hope this will use full to you.
Thanks!! -
Hi All,
How can i configure output file name to the desired format generated in target directory in communication channel configuration in conf scenario.
ex: i want to generate the file in the below format..
YYYYMMDD_<Receiver>.TXT
Thanks and Regards
VenkateshHi,
This is the UDF u have to write in Mapping,
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;
Using this u will get the File name into target side,In this UDF add the Time stamp.
Check this link for more details.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Regards,
phani
Reward points if Helpful -
Required output File In UTF -8 NO BOM format
Hi,
I am Working with Idoc to File scenario.
Where the some of the data for the file will be in Chiniese.
So i used the file encoding parameters as GB18030 in file reciever.
But the legacy system to get process the format of the file should be UTF -8 NO BOM format.
So what encoding parameter should be used to get the output file in UTF -8 NO BOM and chiniese format.
Regards,
Manojthis might be helfulll check........
Under File Encoding, specify a code page.
The default setting is to use the system code page that is specific to the configuration of the installed operating system. The file content is converted to the UTF-8 code page before it is sent.
Permitted values for the code page are the existing Charsets of the Java runtime. According to the SUN specification for the Java runtime, at least the following standard character sets must be supported:
■ US-ASCII
Seven-bit ASCII, also known as ISO646-US, or Basic Latin block of the Unicode character set
■ ISO-8859-1
ISO character set for Western European languages (Latin Alphabet No. 1), also known as ISO-LATIN-1
■ UTF-8
8-bit Unicode character format
■ UTF-16BE
16-bit Unicode character format, big-endian byte order
■ UTF-16LE
16-bit Unicode character format, little-endian byte order
■ UTF-16
16-bit Unicode character format, byte order
More at - http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm -
How to download alv grid output(with field catalog) into excel file format
Hi all,
How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
Please help.
Regards,
Satya.Hi,
On list where alv is displayed, select export icon( green color -> ),select spread sheet.
This will display records in Excel sheet. -
ALV Grid to be run in background & to generate output file in Excel format
I use REUSE_ALV_GRID_DISPLAY in my program for the ALV output
My Requirement is Program to be run in a background since it is getting timed out when executed in foreground and also to generate the output file in Excel format. And we are using 4.6 C version.
how do i attain this?Hello,
One alternate solution can be :
Execute your report in background and then send the data to Spool .
From this spool , you can download the data in excel file.
SUBMIT xyz TO SAP-SPOOL
SPOOL PARAMETERS gt_print_parameters.
Regards,
Sandeep -
Output report data to excel file format or csv format
Is there any way to save softcopy of report output to excel file format or csv format.
Hi,
Regarding csv file format, i have no issues. The file is generating without any issues in using oracle reports without using any PL/SQL code.
My requirement is to design oracle reports to generate excel (.xls) file with multiple worksheets. Each sheets are having many data and graphs(chart).
Using oracle reports alone, how to achieve this.
In oracle reports 10g 1.2.0 version, I tried by creating .rdf file but, it is generating single worksheet only.
In oracle reports 10g 1.2.0 ver, I tried by creating .jsp file. For this first i am creating excel template about how my ouput column headings all that going to be with one sample hard coded data and save the excel file as web page.
Eg employee.html.
Next open the html file in oracle reports builder and double click the websource now, you will see the jsp tags, html and xml tags. Now include the contentType="application/vnd.ms-excel " and charset also.
Next, include the <rw:foreach id="G_EMPNO_1" src="G_EMPNO">
here insert the fieldl for each column by removing the hard coded values.
close the tag
</rw:foreach>
Save the file as .jsp and deploy it in oc4 enabled folder (say, devsuite_home/reports/j2ee/reports_ids/web
Start the oc4J server
Run it in the browser http://server:port/reports/emp.jsp?useride=uid/pwd@db
It is invoking the Microsoft excel with 3 sheets default and my emp table output in the first page.
We can save this output file as .xls file by clicking file -> save as.
1) The question is, it is working fine with Microsoft excel 97-2003 version. But for excel 2007, i am not able to create single html file like how 2003 save web page option.
2) I found this in oracle getting started demo
http://www.oracle.com/technology/products/reports/htdocs/getstart/demonstrations/index.html
Which is more useful. This is what i am looking for.
I done that in excel 2003 as per demo. But excel 2007 with reports 10g issues.
Is there any demo for 10g with excel 2007
3) For most of excel issues working fine with excel 2003 and 10g. But excel 2007 with 10g reports are issues.
I want the excel output from oracle reports with multiple worksheet similar to the above demo.
Thank you. -
Output file in not a proper format
Hello, My JAVA program generate an output file using FileWriter. The name of output file is output.dat (ie a NOTEPAD file). But when I open up the file it is not in proper format. All the text get clustered. But when I open the same file in MircoSoft Word its open with no problem. Is there any solution to this problem.
byeMost text editors will accept '\n' alone as the line terminator. Notepad is an exception.
Workarounds are:
1. Write an '\r' immediately before each '\n'.
2. Get a decent text editor. -
Concurrent Requests output file (pdf format) send to email
Friends -
Does any one implemented this.
Submit Conurrent Requests once the requests is completed send the output file(PDF Format) as an attachement to email.
Please provide us steps.
Regards
VSHHi,
See this thread.
concurrent ouput to email
concurrent ouput to email
Regards,
Hussein -
DME output files in CSV format
Hi,
Can anybody please let me know whether we can get the DME output files in CSV format using program RFFOJP_L?
Your help and time will be really appreciate.
Thanks & Regards,
Niki Shah
Edited by: Niki Shah on Aug 5, 2009 10:14 AMNo it will not work. You need full Photoshop (CS5)
Maybe you are looking for
-
Facing problem of Assigned Value in CJ33
Hi All, I am facinfg a problem with Assigned value shown in CJ33 T code. My Sceneraio is like this..... 1. I have activated availiblity controll on Released Budget. 2. I have maintained tolerence limit only for PR and PO. Now My problem is that I b
-
Hi Folks, I have a scenario wherein I need to identify Partial Payments for a Vendor/Customer. Vendor:- Vendor should always be in credit (ie Payment is made) and still if any item showing debit in open items tables is treated as a partial payment or
-
Serious Problem with Adobe TRYAL
Good Morning, I have the macbook pro 17 core duo, and my girlfriend have just buy one imac core 2 duo 17, FANTASTIC MAChine! but... Last night I've try to install photoshop CS2, Illustrator and InDesign... no one of these work! Illustrator tell me "i
-
How do I edit a submitted podcast?
I think i needed to check the box at the bottom to identify the content as EXPLICIT, but I cant remember if i did that. How to edit this submitted info? Beavis2084
-
Analyzing foreign keys constraints in Oracle.
Hello, I want to analyze the fk constraints between tables and a directed graph should be the result. I can make the query select * from all_constraints where owner = 'XYZ' and constraint_type = 'R'; But how can I retrieve the information about the r