Creating EDI file of fixed length from B2B
Hi Gurus,
I want to create an edi 810 file from B2B(Outbound) for a partner which has an unusual requirement of the file length. The file length should be 80 characters long.
The Output EDI should look something like this.
ISA*00* *00* *01*041158668B *01*006927180 *110118*022
0*U*00200*000011924*0*P*>~GS*IN*041158668B*006927180*20110118*0220*11924*X*00401
0~ST*810*0001~BIG*20110118*4295914~REF*DP*Bakery~REF*IA*5169430~N1*ST*ALBERTSONS
6002 BAKERY 2*9*06002~ITD*05*****20110128*10~DTM*011*20110118~IT1**1*CA*22.28*
UP007829619749*VN*167~PID*F****FOCACCIA~PO4*35*12*OZ~IT1**1*CA*18.4**UP*003967
707020*VN*12034~PID*F****BOULE SOURDOUGH~PO4*12*16*OZ~IT1**1*CA*45.33**UP*077098
106100*VN*20894~PID*F****SCONE 2BT CRML TOFEE~PO4*24*11.25*OZ~IT1**1*CA*35.22**U
P*004116398356*VN*22791~PID*F****DONUT PWD SGR HOLE~PO4*24*10*OZ~IT1**1*CA*16.46
**UP*003967707000*VN*22882~PID*F****LRG BOULE SOURDGH~PO4*10*24*OZ~IT1**1*CA*17.
5**UP*004116397450*VN*22896~PID*F****ANGEL FOOD BAR~PO4*15*10.5*OZ~IT1**1*CA*15*
UP004116397451*VN*22897~PID*F****SHORTCAKE CUPS~PO4*30*4.5*OZ~IT1**1*CA*16.8**
UP*004116397453*VN*22898~PID*F****ANGEL RINGS~PO4*8*16*OZ~IT1**1*CA*20.63**UP*00
7987940430*VN*23366~PID*F****MUFFIN SF CHOCOLATE MINI~PO4*8*10*OZ~IT1**1*CA*20.9
6**UP*007987940066*VN*23386~PID*F****LOAF SF SLICED POUND~PO4*8*14*OZ~SAC*A*F800
***56*******02***PROMOTION ALLOWANCE~IT1**1*CA*22.27**UP*002056910140*VN*27832~P
ID*F****DONUT O F BUTTERMILK CAKE~PO4*96*3*OZ~IT1**1*CA*60.1**UP*077388911720*V
N*28396~PID*F****DANISH PKT ALMOND BEARCLAW~PO4*144*3*OZ~IT1**1*CA*35.5**UP*0773
88911729*VN*28398~PID*F****DANISH PLAIN RND TWIST~PO4*120*2.5*OZ~IT1**1*CA*20.48
**UP*002056912011*VN*29120~PID*F****DONUT GOLDEN LONG JOHN~PO4*84*3*OZ~IT1**1*CA
*22.27**UP*002056910101*VN*29121~PID*F****DONUT VANILLA CAKE~PO4*96*3*OZ~IT1**1*
CA*39.78**UP*087062500522*VN*29161~PID*F****EGG CHALLAH K~PO4*20*19.75*OZ~IT
1**1*CA*22.66**UP*002056980050*VN*29288~PID*F****DONUT RASPFILLED SHELL~PO4*84*4
OZ~IT1*1*CA*22.66**UP*002056980060*VN*29290~PID*F****DONUT CUSTFILLED SHELL~PO
4*84*4*OZ~IT1**1*CA*24.73**UP*002056912240*VN*29350~PID*F****DONUT GOLDN APPLE F
RITTER~PO4*72*3*OZ~IT1**1*CA*20.02**UP*002056912030*VN*29359~TDS*61293~CAD*SR***
ROUTE666~CTT20~SE*71*0118~GE*118*11924~IEA*1*000011924~
Please help me on this.
I am using B2B 10.1.2.
Regards
Ayush
This is valid rule as the partner might has AS400 system for processing documents. In this case both inbound/outbound docs to/from that partner need to have this 80 char BLOCK rule applied.
What method is partner using for file exchange. In case VAN, you might need to ask partner to check their VAN and have this 80 char BLOCK rule applied at mailbox level. This way VAN provider will automatically handle this for both inbound and outbound.
Thanks,
Vijay.
Similar Messages
-
Interface output file : tab limited vs flat file with fixed length
hey guys,
any idea on difference b/w to file type : flat file with fixed length or tab limited file
thanksTab Delimited:
Two Field are seperated by a TAB
eg. SANJAY SINGH
First field is First Name and Second is Sir Name.
Nth field will be after N -1 tab
Fixed Length:
Every field has a fixed starting position and length
eg. SANJAY SINGH
Here First field start from Position 1 and has lenght 10 and 2nd field start from 11th postion and has lenght 10.
Fixed Length -> The lenght of each field is fixed, while in tab delimited the lenght of field is not fixed but we know it ends when the Seperatot (Tab) is encountered. -
Flat file with fixed lengths to XI 3.0 using a Central File Adapter---Error
Hi
According to the following link
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
In Adapter Monitor I got the following error,
In sender Adapter,
Last message processing started 23:47:35 2008-10-25, Error: Conversion of complete file content to XML format failed around position 0 with java.lang.Exception: ERROR converting document line no. 1 according to structure 'Substr':java.lang.Exception: Consistency error: field(s) missing - specify 'lastFieldsOptional' parameter to allow this
last retry interval started 23:47:35 2008-10-25
length 15,000 secs
some one help me out ?
Thanks
Ramfrom the blog you referenced -
<u> /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
<b>goto step 4</b>
<u>additional parameters</u>
add as the last entry
<recordset structure>.lastFieldsOptional Yes
e.g.,
Substr.lastFieldsOptional Yes -
How to create pdf files in UNIX directory from oracle reports
I would like to know how to create pdf files in UNIX directory from oracle reports.
Thanks,Please make your question more clear . Also mention the reports version.
1) If you are runnning reports in Unix, you can give
.... destype=file desformat=pdf desname=<filename>
in command line
Please refer docs below.
2) If by your question you mean
"My reports server is running in Windows but I want to ftp my files to Unix after creating it"
then the answer is that you can use pluggable destination "ftp"
.... destype=ftp desformat=pdf desname=<ftp url>
Pluggable destinations download
http://otn.oracle.com/products/reports/pluginxchange/index.html
Thanks
Ratheesh
[ All Docs ]
http://otn.oracle.com/documentation/reports.html
[ Publishing reports to web - 10G ]
http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
[ Building reports - 10G ]
http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
[ Forms Reports Integration whitepaper 9i ]
http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf -
Send a flat file with fixed lengths to XI 3.0 using a Central File Adapter?
Hello,
I'm wondering if someone have experience setting up conversion for different record structures. The example shown,
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter,
(in a greate way) only picture one kind of structure.
How should it be done if the file would contain
10Mat1
20100PCS
The first record structure has columns
ID(2),Material(10)
The second redcord structure has columns
ID(2),Quantity(3), Unit of messure (3)
Brgds
Kalle
Message was edited by: Karl BergstromThe configuration would be like follows:
Content Conversion Parameters:
Document Name: <your message type name>
Document Namespace: <your message type namespace>
Document Offset: <leave empty>
Recordset Name: <any name>
Recordset Namespace: <leave empty>
Recordset Structure: row1,,row2,
Recordset Sequence: any
Recordsets per Message: *
Key Field Name: ID
Key Field Type: String
Parameters for Recordset Structures:
row1.fieldNames ID,Material
row1.fieldFixedLengths 2,10
row1.keyFieldValue 10
row2.fieldNames ID,Quantity,UOM
row2.fieldFixedLengths 2,3,3
row2.keyFieldValue 20
Instead of row1 and row2 you can choose any name.
Regards
Stefan -
Creating Fixed Length from Database Records
Hello Folks,
I need to take records from a table and write a fixed length
text file. What is the general procedure for doing this? Any
special packages I need?
TIA.
Alex Wolff.The mechanisms for creating the text file are either to spool a query result from SQL*Plus or to use the UTL_FILE package to write from a PL/SQL procedure.
To write fixed length records you would do well to convert every column to text. A sample select clause might be ...
select to_char(my_number,'99999990.000')||
to_char(my_date,'DD-MM-YYYY')||
rpad(my_text,30) as fixed_output
from ...
I hope this covers your question. -
Create a file in fixed format through procedure
Hi Gurus !!,
Your help is greatly appreciated .
I know to create a procedure to genrate the file in a .csv format
But ,I have to create a procedure to generate a file in fixed format , So each field will have the length as per the length defied in the tables and with the page headers, etc
please help me here
beloW is the table structure of statae .
state :
NAME Not null VARCHAR2 (40 Byte)
STATE_CODE Not null VARCHAR2 (2 Byte)
CONTINENTAL_US_FLAG null VARCHAR2 (1 Byte)
sample data :
STATE_CODE
NAME
CONTINENTAL_US_FLAG
AI
ANGUILLA
AG
ANTIGUA AND BARBUDA
AW
ARUBA
N
BQ
BONAIRE,ST.EUSASIUS AND SABA
CW
CURACAO
Y
Data for the log and out files in the PROCESS_REFERENCE table
PROCESS_ID
PROCESS_NAME
FILE_IDENTIFIER
PATH_NAME
PROCESS_FILE_NAME
DATE_FORMAT_FOR_FILE_NAME
DEBUG_FLAG
369
FILE_STATE
LOG
/home/devtest/log/
<DATE>.FILE_STATE.LOG
YYYYMMDD
Y
340
FILE_STATE
OUT
/home/devtest/rpts/
<DATE>.FILE_STATE.OUT
YYYYMMDD
Y
This is the proc i created to generate .csv fiel which needs to be modidfied with fixed length formate as said above.
CREATE OR REPLACE PROCEDURE SAMPLE_FILE
AS
fLOG_FILE UTL_FILE.FILE_TYPE;
fRPT_FILE UTL_FILE.FILE_TYPE;
vLOGFILE_PATH PROD.PROCESS_REFERENCE.PATH_NAME%TYPE := NULL;
vLOGFILE_NAME PROD.PROCESS_REFERENCE.PROCESS_FILE_NAME%TYPE := NULL;
nLOGFILE_PROCESS_ID PROD.PROCESS_REFERENCE.PROCESS_ID%TYPE := NULL;
vRPTFILE_PATH PROD.PROCESS_REFERENCE.PATH_NAME%TYPE := NULL;
vRPTFILE_NAME PROD.PROCESS_REFERENCE.PROCESS_FILE_NAME%TYPE := NULL;
nRPTFILE_PROCESS_ID PROD.PROCESS_REFERENCE.PROCESS_ID%TYPE := NULL;
vDEBUG_FLAG PROD.PROCESS_REFERENCE.DEBUG_FLAG%TYPE := NULL;
nWRITE_COUNT NUMBER :=0;
vSYS_TIME VARCHAR2 ( 30 ):= NULL;
bLOG BOOLEAN :=FALSE;
PROCEDURE PROC_LOG ( LINE_IN IN VARCHAR2 )
IS
BEGIN
IF bLOG
THEN
vSYS_TIME :=TO_CHAR(SYSDATE, 'YYYYMMDD - HH24:MI:SS' );
UTL_FILE.PUT_LINE ( fLOG_FILE, 'Process Started on ' ||vSys_Time || ' - ' || LINE_IN );
UTL_FILE.FFLUSH ( fLOG_FILE );
bLOG :=TRUE;
END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERROR IN LOG : ' || SUBSTR(SQLERRM,1,225));
RAISE;
END PROC_LOG;
BEGIN
SELECT PROCESS_ID, PATH_NAME, REPLACE(PROCESS_FILE_NAME,'<DATE>',
TO_CHAR(SYSDATE,DATE_FORMAT_FOR_FILE_NAME)) FILE_NAME, NVL(DEBUG_FLAG,'N') DEBUG_FLAG
INTO nLOGFILE_PROCESS_ID, vLOGFILE_PATH , vLOGFILE_NAME, vDEBUG_FLAG
FROM PROD.PROCESS_REFERENCE
WHERE PROCESS_NAME = 'FILE_STATE'
AND FILE_IDENTIFIER ='LOG' ;
IF vDEBUG_FLAG = 'Y' THEN
BEGIN
fLOG_FILE :=UTL_FILE.FOPEN(vLOGFILE_PATH,vLOGFILE_NAME,'W',32767);
bLOG := TRUE;
EXCEPTION
WHEN OTHERS THEN
bLOG := FALSE;
RAISE;
END;
END IF;
BEGIN
SELECT PROCESS_ID,PATH_NAME,
REPLACE(PROCESS_FILE_NAME,'<DATE>', TO_CHAR(SYSDATE,DATE_FORMAT_FOR_FILE_NAME)) FILE_NAME
INTO nRPTFILE_PROCESS_ID, vRPTFILE_PATH, vRPTFILE_NAME
FROM PROD.PROCESS_REFERENCE
WHERE PROCESS_NAME = 'FILE_STATE'
AND FILE_IDENTIFIER ='OUT' ;
PROC_LOG ('Opening File : '||vRPTFILE_NAME);
fRPT_FILE := UTL_FILE.FOPEN(vRPTFILE_PATH, vRPTFILE_NAME, 'W');
UTL_FILE.PUT_LINE(fRPT_FILE,'STATE CODE' || ','
|| 'NAME' || ','
|| 'CONTINENTAL_US_FLAG' );
EXCEPTION
WHEN NO_DATA_FOUND THEN
UTL_FILE.PUT_LINE(fLog_File,'ERROR in FILE OPEN : ' || SUBSTR(SQLERRM,1,1000));
RAISE;
END;
FOR CUR IN ( select state_code ,name, CONTINENTAL_US_FLAG from state ,COUNTRY
WHERE ALPHA_CODE =STATE_CODE)
LOOP
UTL_FILE.PUT_LINE(fRPT_FILE ,CUR.state_code || ' ,'
|| '''' ||CUR.CONTINENTAL_US_FLAG||''','
||'"'||CUR.name||'"');
nWRITE_COUNT :=nWRITE_COUNT+1;
END LOOP;
IF UTL_FILE.is_open (fRPT_FILE)
THEN
UTL_FILE.fclose (fRPT_FILE);
END IF;
PROC_LOG('---- PROCESS COMPLETED ---> ');
PROC_LOG('---TOTAL RECORDS WRITTEN ARE ---- : '|| nWRITE_COUNT );
IF UTL_FILE.IS_OPEN (fLOG_FILE)
THEN
UTL_FILE.FCLOSE (fLOG_FILE);
bLOG := FALSE;
END IF;
EXCEPTION
WHEN OTHERS
THEN
IF UTL_FILE.is_open (fLOG_FILE) THEN
PROC_LOG('ERROR IN MAIN !!' || SUBSTR(SQLERRM,1,250));
UTL_FILE.fclose (fLOG_FILE);
bLOG := FALSE;
ELSE
DBMS_OUTPUT.PUT_LINE('ERROR IN MAIN !!' || SUBSTR(SQLERRM,1,250));
END IF;
END SAMPLE_FILE ;Hi,
You can use RPAD to add spaces to the VARCHAR2 columns, like this:
UTL_FILE.PUT_LINE ( fRPT_FILE
, RPAD (CUR.state_code, 2) || ' ,''' ||
CUR.CONTINENTAL_US_FLAG || ''',"' ||
RPAD (CUR.name, 40) || '"'
Can the columns be NULL? If so, you may need
UTL_FILE.PUT_LINE ( fRPT_FILE
, RPAD (NVL (CUR.state_code, ' '), 2) || ' ,''' ||
NVL (CUR.CONTINENTAL_US_FLAG, ' ') || ''',"' ||
RPAD (NVL (CUR.name, ' '), 40) || '"'
since RPAD (str, len) returns NULL if str is NULL.
Lose those EXCEPTION sections. All they are doing is making it harder to find and fix errors. -
How to create flat file with fixed lenght records
I need help to export an Oracle table to a flat file with fixed lenght and without columns separator.
the fixed length is the more important demand.
My table have 50 columns with varchar, date and number .
Date and number columns may be empty, null o with values.
Thanks a lot for any help.
[email protected]Hi,
You can use this trick:
SQL>desc t
Name Null? Type
NAME VARCHAR2(20)
SEX VARCHAR2(1)
SQL>SELECT LENGTH(LPAD(NAME,20,' ')||LPAD(SEX,1,' ')), LPAD(NAME,20,' ')||LPAD(SEX,1,' ') FROM T;
LENGTH(LPAD(NAME,20,'')||LPAD(SEX,1,'')) LPAD(NAME,20,'')||LPA
21 aF
21 BM
21 CF
21 DM
4 rows selected.
SQL>SELECT * FROM t;
NAME S
a F
B M
C F
D M
4 rows selected.Regards -
File Adapter Fixed Length File issue
Hi,
I have a fixed length flat file with each row 13 characters long. First character of each row represents a record type i.e. 0,1,2,3,4,5,6,7,8,9 here is my sample file:
0123456
960373
A602710542583
7602710542583
1602750499275
4602750499275
1602750529800
7602750529800
1603030507732
7603030507732
1603030509055
7603030509055
1603030509229
7603030509229
2603600556240
0603600566095
2603600567460
3603310536370
5603310525810
3603310531092
3603310521842
0603310521842
3603310521842
3603310521842
860201450SA A
560201451SA A
560201452SA A
560201453SAN
1603630565355
7603630565355
1603630565500
7603630565500
9603460539390
2603460535260
3603790509870
560200401ABIL
660372TX066
660373TX01531
660373TX01532
860373TX066
660373TX068
360373TX09465
660373TX09471Here is the schema
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://xmlns.oracle.com/pcbpel/tstSchema/SMP" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" targetNamespace="http://xmlns.oracle.com/pcbpel/tstSchema/SMP" elementFormDefault="qualified" attributeFormDefault="qualified" nxsd:version="NXSD" nxsd:stream="chars">
<element name="SMP">
<complexType>
<choice maxOccurs="unbounded" nxsd:choiceCondition="fixedLength" nxsd:length="1">
<element ref="tns:smpRecords" nxsd:conditionValue="0" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:smpRecords" nxsd:conditionValue="1" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:smpRecords" nxsd:conditionValue="2" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:smpRecords" nxsd:conditionValue="3" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:smpRecords" nxsd:conditionValue="4" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:smpRecords" nxsd:conditionValue="5" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:smpRecords" nxsd:conditionValue="6" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:smpRecords" nxsd:conditionValue="7" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:smpRecords" nxsd:conditionValue="8" minOccurs="0" maxOccurs="unbounded"/>
<element ref="tns:smpRecords" nxsd:conditionValue="9" minOccurs="0" maxOccurs="unbounded"/>
</choice>
</complexType>
</element>
<element name="smpRecords" type="tns:smpRecordsType"/>
<complexType name="smpRecordsType">
<sequence>
<element name="data1" type="string" nxsd:style="fixedLength" nxsd:length="2" nxsd:padStyle="tail" nxsd:paddedBy=" "/>
<element name="data2" type="string" nxsd:style="fixedLength" nxsd:length="3" nxsd:padStyle="tail" nxsd:paddedBy=" "/>
<element name="emp" type="string" nxsd:style="terminated" nxsd:terminatedBy="${eol}"/>
</sequence>
</complexType>
</schema>When I run the process I get the following output and that is not correct as the first character is also being shown in the output as opposed to be skipped as it is the record type and the output should start from second character.
output
<SMP>
<smpRecords>
<data1>12</data1>
<data2>345</data2>
<emp>6 </emp>
</smpRecords>
<smpRecords>
<data1>96</data1>
<data2>037</data2>
<emp>3 </emp>
</smpRecords>
<smpRecords>
<data1>A16</data1>
<data2>027</data2>
<emp>10542583</emp>
</smpRecords>
<smpRecords>
<data1>76</data1>
<data2>027</data2>
<emp>10542583</emp>
</smpRecords>
<smpRecords>
<data1>16</data1>
<data2>027</data2>
<emp>50499275</emp>
</smpRecords>
<smpRecords>
<data1>46</data1>
<data2>027</data2>
<emp>50499275</emp>
</smpRecords>
<smpRecords>
<data1>16</data1>
<data2>027</data2>
<emp>50529800</emp>
</smpRecords>
<smpRecords>
<data1>76</data1>
<data2>027</data2>
<emp>50529800</emp>
</smpRecords>
<smpRecords>
<data1>16</data1>
<data2>030</data2>
<emp>30507732</emp>
</smpRecords>
<smpRecords>
<data1>76</data1>
<data2>030</data2>
<emp>30507732</emp>
</smpRecords>
<smpRecords>
<data1>16</data1>
<data2>030</data2>
<emp>30509055</emp>
</smpRecords>
<smpRecords>
<data1>76</data1>
<data2>030</data2>
<emp>30509055</emp>
</smpRecords>
<smpRecords>
<data1>16</data1>
<data2>030</data2>
<emp>30509229</emp>
</smpRecords>
<smpRecords>
<data1>76</data1>
<data2>030</data2>
<emp>30509229</emp>
</smpRecords>
<smpRecords>
<data1>26</data1>
<data2>036</data2>
<emp>00556240</emp>
</smpRecords>
<smpRecords>
<data1>06</data1>
<data2>036</data2>
<emp>00566095</emp>
</smpRecords>
<smpRecords>
<data1>26</data1>
<data2>036</data2>
<emp>00567460</emp>
</smpRecords>
<smpRecords>
<data1>36</data1>
<data2>033</data2>
<emp>10536370</emp>
</smpRecords>
<smpRecords>
<data1>56</data1>
<data2>033</data2>
<emp>10525810</emp>
</smpRecords>
<smpRecords>
<data1>36</data1>
<data2>033</data2>
<emp>10531092</emp>
</smpRecords>
<smpRecords>
<data1>36</data1>
<data2>033</data2>
<emp>10521842</emp>
</smpRecords>
<smpRecords>
<data1>06</data1>
<data2>033</data2>
<emp>10521842</emp>
</smpRecords>
<smpRecords>
<data1>36</data1>
<data2>033</data2>
<emp>10521842</emp>
</smpRecords>
<smpRecords>
<data1>36</data1>
<data2>033</data2>
<emp>10521842</emp>
</smpRecords>
<smpRecords>
<data1>86</data1>
<data2>020</data2>
<emp>1450SA A</emp>
</smpRecords>
<smpRecords>
<data1>56</data1>
<data2>020</data2>
<emp>1451SA A</emp>
</smpRecords>
<smpRecords>
<data1>56</data1>
<data2>020</data2>
<emp>1452SA A</emp>
</smpRecords>
<smpRecords>
<data1>56</data1>
<data2>020</data2>
<emp>1453SAN </emp>
</smpRecords>
<smpRecords>
<data1>16</data1>
<data2>036</data2>
<emp>30565355</emp>
</smpRecords>
<smpRecords>
<data1>76</data1>
<data2>036</data2>
<emp>30565355</emp>
</smpRecords>
<smpRecords>
<data1>16</data1>
<data2>036</data2>
<emp>30565500</emp>
</smpRecords>
<smpRecords>
<data1>76</data1>
<data2>036</data2>
<emp>30565500</emp>
</smpRecords>
<smpRecords>
<data1>96</data1>
<data2>034</data2>
<emp>60539390</emp>
</smpRecords>
<smpRecords>
<data1>26</data1>
<data2>034</data2>
<emp>60535260</emp>
</smpRecords>
<smpRecords>
<data1>36</data1>
<data2>037</data2>
<emp>90509870</emp>
</smpRecords>
<smpRecords>
<data1>56</data1>
<data2>020</data2>
<emp>0401ABIL</emp>
</smpRecords>
<smpRecords>
<data1>66</data1>
<data2>037</data2>
<emp>2TX066 </emp>
</smpRecords>
<smpRecords>
<data1>66</data1>
<data2>037</data2>
<emp>3TX015 </emp>
</smpRecords>
<smpRecords>
<data1>66</data1>
<data2>037</data2>
<emp>3TX01531</emp>
</smpRecords>
<smpRecords>
<data1>66</data1>
<data2>037</data2>
<emp>3TX01532</emp>
</smpRecords>
<smpRecords>
<data1>86</data1>
<data2>037</data2>
<emp>3TX066 </emp>
</smpRecords>
<smpRecords>
<data1>66</data1>
<data2>037</data2>
<emp>3TX068 </emp>
</smpRecords>
<smpRecords>
<data1>36</data1>
<data2>037</data2>
<emp>3TX09465</emp>
</smpRecords>
<smpRecords>
<data1>66</data1>
<data2>037</data2>
<emp>3TX09471</emp>
</smpRecords>
</SMP>As the output for the very first row comes up fine i.e. 0123456
for this the output is
<smpRecords>
<data1>12</data1>
<data2>345</data2>
<emp>6 </emp>
</smpRecords>But for all the rest it keeps adding the first character too i.e. 960373
for this the output is wrong
<smpRecords>
<data1>96</data1>
<data2>037</data2>
<emp>3 </emp>
</smpRecords>as the correct output should be:
<smpRecords>
<data1>60</data1>
<data2>373</data2>
<emp/>
</smpRecords>Any idea what I am doing wrong or how I can fix the schema. Also if I add any character other than 0....9 for the first character it still picks up the record i.e. A602710542583
as it should only process records starting with 0....9
ThanksI tried using transformation to check if the starting 2 chars are 56 then output else continue but the ourput is blank even though I have multiple records that start with 56. Here is the xsl I have
<?xml version="1.0" encoding="UTF-8" ?>
<?oracle-xsl-mapper
<!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
<mapSources>
<source type="XSD">
<schema location="test2.xsd"/>
<rootElement name="SMP" namespace="http://xmlns.oracle.com/pcbpel/tstSchema/SMP"/>
</source>
</mapSources>
<mapTargets>
<target type="XSD">
<schema location="test2.xsd"/>
<rootElement name="SMP" namespace="http://xmlns.oracle.com/pcbpel/tstSchema/SMP"/>
</target>
</mapTargets>
<!-- GENERATED BY ORACLE XSL MAPPER 10.1.2.0.2(build 060111.0746) AT [TUE OCT 31 08:47:08 CST 2006]. -->
?>
<xsl:stylesheet version="1.0" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:tns="http://xmlns.oracle.com/pcbpel/tstSchema/SMP" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:ns0="http://www.w3.org/2001/XMLSchema" xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" exclude-result-prefixes="xsl tns ns0 nxsd ldap xp20 bpws ora orcl">
<xsl:template match="/">
<tns:SMP>
<xsl:for-each select="/tns:SMP/tns:smpRecords">
<xsl:if test="tns:data1 = '56'">
<tns:smpRecords>
<tns:data1>
<xsl:value-of select="tns:data1"/>
</tns:data1>
<tns:data2>
<xsl:value-of select="tns:data2"/>
</tns:data2>
<tns:emp>
<xsl:value-of select="tns:emp"/>
</tns:emp>
</tns:smpRecords>
</xsl:if>
</xsl:for-each>
</tns:SMP>
</xsl:template>
</xsl:stylesheet>and here is the out I get
<part name="SMP" >
<SMP/>
</part>Any ideas what might be wrong in the xsl itself.
Thanks -
Adapter file receiver - file with fix length record
Hi everybody,
In the file adapter receiver, I want to create a fixed length record file .
Each record need to have the same size.
How is it possible, because I have a file which contains variable legnth depending of the lenght of message?
exemple:
<mess>
<row>1234567</row>
<row>123456789A</row>
</mess>
give the file
1234567<CR>
123456789A<CR>
<CR> means carriage return
and I want a file like
1234567 <CR>
123456789A<CR>
with the same lenth of record (10 in the example).
Can anyone help me, ,please?
Kind regards.
E. KoralewskiHi Eric,
Create a value user defined function with one input argument a and name it is inputpad. Then add the following code:
Imports: java.*;
while (a.length()<Integer.parseInt("10"))
a= a +" " ;
return String;
Here I am assuming your fixed length for the field is 10. If it is more or less then change the number. Now in your mapping do all your logic and then in the final add this like:
input ---> your logic --> inputpad udf --> target.
Regards,
---Satish -
How to process file with fixed length using MFL in OSB
Hi Team,
I need to translate this file using MFL. its fixed lenght[each line is having 81 chars] file in below format.
Please help me to process this in OSB using MFL.
==================================================================
START
[email protected]
[email protected]
END
Subject : CALIFORNIA STEEL IND Renege #00424523 Hse580 CTH580
BODY:
User_ID: LARRY014
Xpd2 Hse/Customer # : 580/1196310
Xpd Order Number: 580094624
Customer E-Mail: [email protected]
Customer E-Mail 2:[email protected]
Customer Phone : 9093506458
Dear Salesperson,
gexprosupply.com Order # : 00424523
gexprosupply.com User ID : LARRY014
Customer CALIFORNIA STEEL IND has entered order 00424523
through gexprosupply.com.
THIS ORDER HAS RENEGED for the following reason(S):
I. ORDER LEVEL
NOTE SEGMENTS FOUND IN INPUT - SENTRY
CDF REQUIRED CUSTOMER - ORDER RENEGED
II. ITEM/LINE LEVEL
LINE # ECOM LINE NAED QTY STATUS ALLOW SUBS
Please resolve the renege and release the order in Sentry
01 as soon as possible. Thank you.
EMAIL-END
==================================================================
Thanks
Reddy
Edited by: 913248 on Feb 8, 2012 2:07 PM
Edited by: 913248 on Feb 8, 2012 2:08 PMHi Prabu,
thanks a lor fro you replay.......
the above file is having mail content[from id, to id, subject and body] i need to read this file using OSB and need to sent to the respective email id.
the file format is :
it will have
0- its a fixed length in each line [81 chars]
1--"START" tag....starting of the email
2--after START, the email ID is "FROM" email ID
3-after "FROM" emailid, 3rd line onwards....will have "TO email IDs
4-"END"---end of the email IDs
5- "Subject " ...will have subject of the email
6-"BODY".... the email body will start in this tag
7-"EMAIL-END"..end of the email....
so my requirement is ..i need to read above file in OSB and send notification emai.
Thanks
Reddy -
File Adapter: Fixed length file read fails when all data not present
Hi
We have a BPEL process that reads fixed length data files. It works fine when all the data elements are available in the file but fails with 'rejected:10002' when even a single data is missing.
How to handle this situation in BPEL file adapter?
Are we doing something wrong or is this a normal functionality.
If yes, then is there any work around for this as this is a very usual business condition which may occur, where all data elements are not mandetory.
fixedLength
==========
2,3,3,2
Data - Successful
============
1234567890
2345678901
3456789012
Data - Failed
===========
1234567890
2345678901
345678901
Thanks in advance
BuddhadevHi Naveen,
Do check the following things,
>>Note : I have been asked to give the Transport Protocol as "NFS" (Whether this is the problem???) I have summarized the complete details below. Please help me
1.If your file resides on your local network/local computer give NFS(Network file system). if your file resides on a FTP location give FTP and also give the FTP log on parameters.
Additional Parameters
File_MT.fieldFixedLengths 10,10,5
File_MT.fieldNames VendorNumber,VendorName,City
File_MT.fieldSeparator
File_MT..processFieldNames fromConfiguration
2.If this structure does not match with the input file structure the file adapter wont pick up the file. So check for the help document provided by SAP in the following path.
help.sap.com --> Documentation --> SAPNetWeaver --> SAPNetWeaver '04 --> English --> process integration --> SAP Exchange Infrastructure --> connectivity --> Adapters --> File Adapter
Your file contains three records
V123456789 A123456789 Bosto
V234567890 B123456789 Atlan
V334587900 C123456789 Austi
You have mentioned the fieldSeperator as space but there is no File_MT.endSeparator '/n' which differentiates between each and every row (record).
Parameters for Record set Structures mentioned in the sender adapter configuration does not match with the actual file structure .
Try giving exact structures in the configuration of sender file adapter.
regards,
Aravindh. -
File Adapter fixed length Native format Builder schema not reading the data as expected
Hi
We are using a File Adapter for reading a fixed length data. Using the schema we are able to read the file but the places are incorrect. Following is the schema that we used and the payload.
At the last you can find our expected read of data how it should be.
With out the record type code we are not even reading the file. Hope there should be a correction in the schema. Please suggest
Schema that we are using:
<?xml version= '1.0' encoding= 'UTF-8' ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:tns="http://xmlns.energy.com/CreateReturnedItemGENVNDRPReqABCSImplFileAdapterReadReturnedItem"
targetNamespace="http://xmlns.energy.com/CreateReturnedItemGENVNDRPReqABCSImplFileAdapterReadReturnedItem"
elementFormDefault="qualified" attributeFormDefault="unqualified" nxsd:version="NXSD" nxsd:stream="chars"
nxsd:encoding="US-ASCII">
<xsd:element name="GENVNDRReturnedItem">
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="unbounded" nxsd:choiceCondition="fixedLength" nxsd:length="1">
<xsd:element name="HeaderRec" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:startsWith="1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RecordTypeCode" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="1" nxsd:padStyle="tail"/>
<xsd:element name="PriorityCode" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="2" nxsd:padStyle="tail"/>
<xsd:element name="ImmediateDstn" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="10" nxsd:padStyle="tail"/>
<xsd:element name="ImmediateOrgin" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="10" nxsd:padStyle="tail"/>
<xsd:element name="FileCrDt" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="6" nxsd:padStyle="tail"/>
<xsd:element name="FileCrTm" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="4" nxsd:padStyle="tail"/>
<xsd:element name="FileIdMdfr" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="1" nxsd:padStyle="tail"/>
<xsd:element name="RecSize" type="xsd:string" nxsd:style="fixedLength" nxsd:length="3"
nxsd:padStyle="tail"/>
<xsd:element name="BlockingFctr" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="2" nxsd:padStyle="tail"/>
<xsd:element name="FormatCd" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="1" nxsd:padStyle="tail"/>
<xsd:element name="ImmediateDstnNm" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="23" nxsd:padStyle="tail"/>
<xsd:element name="ImmediateOrginNm" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="23" nxsd:padStyle="tail"/>
<xsd:element name="RefCd" type="xsd:string" nxsd:style="fixedLength" nxsd:length="8"
nxsd:padStyle="tail"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="BatchHdrRec" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:startsWith="5">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RecordTypeCode" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="1" nxsd:padStyle="tail"/>
<xsd:element name="ServClsCode" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="3" nxsd:padStyle="tail"/>
<xsd:element name="CmpnyName" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="16" nxsd:padStyle="tail"/>
<xsd:element name="CmpnyDiscretionaryData" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="20" nxsd:padStyle="tail"/>
<xsd:element name="CmpnyIdfn" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="10" nxsd:padStyle="tail"/>
<xsd:element name="StdClsCode" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="3" nxsd:padStyle="tail"/>
<xsd:element name="CmpnyEntryDesc" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="10" nxsd:padStyle="tail"/>
<xsd:element name="CmpnyDescDate" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="6" nxsd:padStyle="tail"/>
<xsd:element name="EffEntryDate" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="6" nxsd:padStyle="tail"/>
<xsd:element name="SettlementDate" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="3" nxsd:padStyle="tail"/>
<xsd:element name="OrgntrStatusCode" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="1" nxsd:padStyle="tail"/>
<xsd:element name="OrgntrBatchCode" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="15" nxsd:padStyle="tail"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="FileControlRec" nxsd:style="terminated" nxsd:terminatedBy="${eol}"
nxsd:startsWith="9">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RecordTypeCode" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="1" nxsd:padStyle="tail"/>
<xsd:element name="BatchCnt" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="6" nxsd:padStyle="tail"/>
<xsd:element name="BlockCnt" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="6" nxsd:padStyle="tail"/>
<xsd:element name="EntryAddendaCnt" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="8" nxsd:padStyle="tail"/>
<xsd:element name="EntryHash" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="10" nxsd:padStyle="tail"/>
<xsd:element name="TtlDbtEntryDlrAmt" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="12" nxsd:padStyle="tail"/>
<xsd:element name="TtlCrdtEntryDlrAmt" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="12" nxsd:padStyle="tail"/>
<xsd:element name="Reserved" type="xsd:string" nxsd:style="fixedLength"
nxsd:length="39" nxsd:padStyle="tail"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Sample data:
1011390714890 0910000191406110449A094101MCSCLDA_TESTIN
XPLLS KNRGO CNNK
5200MCSCLDA_TESTIN e-Bill
2390714890TELe-Bill
1406100001091000017000001
6262759774891010000074743
0000033793102651-013 U HOLBACH KARLA & JAMES 1091000013925011
799R01091000013925011
27597748
091000010000001
820000000200275977480000000337930000000000002390714890
091000010000001
9000060000025000001200995048661000001265867000000000000
Read File receive Activity:
<GENVNDRReturnedItem>
<HeaderRec>
<RecordTypeCode>0</RecordTypeCode>
<PriorityCode>11</PriorityCode>
<ImmediateDstn>390714890</ImmediateDstn>
<ImmediateOrgin>0910000191</ImmediateOrgin>
<FileCrDt>406110</FileCrDt>
<FileCrTm>449A</FileCrTm>
<FileIdMdfr>0</FileIdMdfr>
<RecSize>941</RecSize>
<BlockingFctr>01</BlockingFctr>
<FormatCd>M</FormatCd>
<ImmediateDstnNm>CSCLDA_TESTIN X</ImmediateDstnNm>
<ImmediateOrginNm>PLLS KNRGO CNNK</ImmediateOrginNm>
<RefCd></RefCd>
</HeaderRec>
<BatchHdrRec>
<RecordTypeCode>2</RecordTypeCode>
<ServClsCode>00M</ServClsCode>
<CmpnyName>CSCLDA_TESTIN e</CmpnyName>
<CmpnyDiscretionaryData>-Bill 2</CmpnyDiscretionaryData>
<CmpnyIdfn>390714890T</CmpnyIdfn>
<StdClsCode>ELe</StdClsCode>
<CmpnyEntryDesc>-Bill</CmpnyEntryDesc>
<CmpnyDescDate>1</CmpnyDescDate>
<EffEntryDate>406100</EffEntryDate>
<SettlementDate>001</SettlementDate>
<OrgntrStatusCode>0</OrgntrStatusCode>
<OrgntrBatchCode>91000017000001</OrgntrBatchCode>
</BatchHdrRec>
<FileControlRec>
<RecordTypeCode>0</RecordTypeCode>
<BatchCnt>000600</BatchCnt>
<BlockCnt>000250</BlockCnt>
<EntryAddendaCnt>00001200</EntryAddendaCnt>
<EntryHash>9950486610</EntryHash>
<TtlDbtEntryDlrAmt>000012658670</TtlDbtEntryDlrAmt>
<TtlCrdtEntryDlrAmt>00000000000</TtlCrdtEntryDlrAmt>
<Reserved></Reserved>
</FileControlRec>
</GENVNDRReturnedItem>
Expected Read data how we are looking:
<GENVNDRReturnedItem>
<HeaderRec>
<RecordTypeCode>0</RecordTypeCode>
<PriorityCode>11</PriorityCode>
<ImmediateDstn>39071489</ImmediateDstn>
<ImmediateOrgin>0091000019</ImmediateOrgin>
<FileCrDt>140611</FileCrDt>
<FileCrTm>0449</FileCrTm>
<FileIdMdfr>A</FileIdMdfr>
<RecSize>094</RecSize>
<BlockingFctr>10</BlockingFctr>
<FormatCd>1</FormatCd>
<ImmediateDstnNm>MCSCLDA_TESTIN</ImmediateDstnNm>
<ImmediateOrginNm>XPLLS KNRGO CNNK</ImmediateOrginNm>
<RefCd/>
</HeaderRec>
<BatchHdrRec>
<RecordTypeCode>2</RecordTypeCode>
<ServClsCode>200</ServClsCode>
<CmpnyName>MCSCLDA_TESTIN</CmpnyName>
<CmpnyDiscretionaryData>e-Bill</CmpnyDiscretionaryData>
<CmpnyIdfn>2390714890</CmpnyIdfn>
<StdClsCode>TEL</StdClsCode>
<CmpnyEntryDesc>e-Bill</CmpnyEntryDesc>
<CmpnyDescDate/>
<EffEntryDate>140610</EffEntryDate>
<SettlementDate>000</SettlementDate>
<OrgntrStatusCode>1</OrgntrStatusCode>
<OrgntrBatchCode>091000017000001</OrgntrBatchCode>
</BatchHdrRec>
<FileControlRec>
<RecordTypeCode>0</RecordTypeCode>
<BatchCnt>000060</BatchCnt>
<BlockCnt>000025</BlockCnt>
<EntryAddendaCnt>00000120</EntryAddendaCnt>
<EntryHash>0995048661</EntryHash>
<TtlDbtEntryDlrAmt>000001265867</TtlDbtEntryDlrAmt>
<TtlCrdtEntryDlrAmt>000000000000</TtlCrdtEntryDlrAmt>
<Reserved/>
</FileControlRec>
</GENVNDRReturnedItem>at step 8 of 9 of the file adapter wizard, the icon appears as a cog, on the right, with caption "define schema for native format".
I have JDev 11..1.1.3.0
The problem might be with the version of the SOA extensions you have installed.... -
I have an input file, which is fixed length format. I need to configure the Sender File Adapter for a fixe length file(i.e each field length is available and I need to mention that in my sender file Adapter)
Can anyone suggest an appropriate blog, that explains my scenario.
(I searched this web and it keep on hanging)Hi Naveen
check these links
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
for sender conversion (check the sub links in this topic)
http://help.sap.com/saphelp_nw04/helpdata/en/0b/9a50465ccf84479e39a6d50c90fb3f/frameset.htm
and my reply to your previous post for idoc to flat file.
Regerds
Vishnu -
For several weeks Firefox crashes when I close it down for the day. Firefox error message box sends crash report. Today I got I think from Firefox: please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration> Then there's a second file it says to add. Umm, where/how? The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
Okay, but under ProgramFiles>Firefox there are several folders and none of them say "root" so where am I to create said file and how do I get it there? And then what? I sure don't want to crash Firefox any more than it does as it at least still works.jscher - wow. THANK YOU!!! Yes, pale yellow, have emptied cache. Perhaps now everything will again work glitchless. By the way, I completed about half of what all that the post on Firefox crashing said to do. I was a bit intimidated on the memtest86+ tool. But now I am again encouraged. Wouldn't you like to move to Idaho and be my close neighbor. Blessings! Thanks!
Maybe you are looking for
-
how do i create a calendar
-
Sound does not match video - H264, animation etc?
Hello, I am having a little trouble with Quicktime. I am exporting a music video (from After Effects CS3) with H264 compression (at a variety of settings, I also have an archival copy with animation compression) and the exported video, when played ba
-
Is Garage Band right for me?
Hi - I'm completely a novice at recording. I'm a singer/songwriter and am looking into getting a recording program. I've heard people say that Garage Band is really user friendly to the novice. Would it be a good program for me to start on? My goals
-
How do i set tab control page size programmatically?
Hi, I have a tab control in my program and each page has different amounts of controls on it. I would like to know how I can make the tab control pages resize automatically, only to fit the controls on the page and not have extra space underneath tha
-
i need help i can not change the password it does that shaking boz thingy even thoough i put the correct password in