Fixed Length RFC Values?
I have an RFC call I need to make. The results of the call contained a fixed length field. Naturally, the leading/trailing whitespace of this field is trimmed by the XML parser. To persist the whitespace I'll need to use CDATA which is unparsed. However, I haven't found a way to modify the data structure or call to make that XML element use the CDATA block. Can anyone share their tips for solving this condition?
Hi,
CDATA conversion shd be done in the function Module. unfortunatley i am not ABAPer so i don't how, but i know this shd be done at ECC.
when the function module is coded to generate the field with CDATA, PI will not trim the spaces.
This is not the solution but thought this info may guide you in right path
Regards,
Sukarna.
Similar Messages
-
Fixed length XSD - values right bounded
Hi
I have designed a BPEL process to write a fixed length file in to a folder. I have associated an XSD to the output file adapter. my output contents are written in fixed length but all the fields are right bounded, For example let us take the field width of VINNumber is 17 , if my input vinnumber width is 15 then the Vinnumber starts with 3 rd column instead of 1st column. Can you please advice me where to change in the XSD.
MY XSD
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://wwlnamespace.com" xmlns:tns="http://wwlnamespace.com" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" nxsd:encoding="US-ASCII" nxsd:headerLines="0" nxsd:headerLinesTerminatedBy=${eol} nxsd:stream="chars" nxsd:version="NXSD">
<xsd:element name="CarloInfo" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="CarloDetails" maxOccurs="unbounded"
nxsd:style=array nxsd:cellSeparatedBy=${eol}>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="VINNumber" type="xsd:string" nxsd:style="fixedLength" nxsd:length="17"/>
<xsd:element name="PFDCode" type="xsd:string" nxsd:style="fixedLength" nxsd:length="5"/>
<xsd:element name="SEOrderNumber" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10"/>
<xsd:element name="ETAatZeebrugge" type="xsd:string" nxsd:style="fixedLength" nxsd:length="12"/>
<xsd:element name="WeightKGM" type="xsd:string" nxsd:style="fixedLength" nxsd:length="6"/>
<xsd:element name="CubicMeters" type="xsd:string" nxsd:style="fixedLength" nxsd:length="5"/>
<xsd:element name="BLNumber" type="xsd:string" nxsd:style="fixedLength" nxsd:length="12"/>
<xsd:element name="VesselName" type="xsd:string" nxsd:style="fixedLength" nxsd:length="20"/>
<xsd:element name="PositiononTerminal" type="xsd:string" nxsd:style="fixedLength" nxsd:length="3"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Thanks in advanceHi,
I have the same problem. Did you find a solution for the "right bound" values?
I don't think that a transformation is the solution, because I get my data as the result of a transformation. This data is NOT in fixed length format yet. The file adapter itself in "fixed length" mode takes my data and adds the required number of spaces. That's great, BUT: it adds the spaces BEFORE my data, not after it.
Sample (. means space):
I get:
.....................Dirk.............Mueller
...................Ramona.............Mueller
Instead of:
Dirk.....................Mueller.............
Ramona...................Mueller.............
Any suggestions, if this can be configured in file adapter?
Torsten -
Multiple idoc segment values to field fixed length FCC
Friends,
I need help to resolve a mapping issue. here is the brief about the scenario.
Scenario: IDoc to Flat file Fixed length fields
Issue: Idocs has values in multiple segments. i need to check condition for each segment occurrence if value exists then pass value if not then pass constant (i have to pass constant so that i can get the actual column width after FCC)
Iam using the following logic.
If condition then value1 -> remove contexts -> split by value -> target
My scenario works fine for the above mapping however when i try introduction a constant in "if then else" then all my contexts in the target structure messes up.
Thanks for your help.
Regards,
PavanDid you tried MapWithDefault before Remove Contexts? To give more perfect solution , we would like to see a sample structure.
raj. -
Java value objects to fixed-length flat file?
I am searching for framework or third party API, which can convert a java bean to fixed length record.
I want to automate this solution, using some mapping files. (Like hibernate API for java <----> xml conversions)
if anybody can give me any url or suggest ways, i would appreciate that...
thanks
ashishBut as business requirements change or new
integration happens.. it is possible, You can count on it.
java beans get
more data elements.. so i want solution which is
flexible easy to change or experiment ..during
development and after being deployed. I would create two classes for representing the copybook layout. One for the whole thing and another for each element. Each field will have the length type and any special formatting rules. i.e. you will have mutiple types of field classes implementing the Field interface. Then put these in a LinkedHashMap and as you are adding them set another field which will be the offset from the beiginning of the record. The Record class will hold these Fields and other Records.
Then create a schema text file format and load that in on startup. Then you buld the data like a you would a DOM model in your application.
I wish someone had done that in our code instead of copying, pasting and editing this:
int length = 10;
int offset = 500;a bazillion times. That's real fun when you want to add fields. The damn methods aren't even in consecutive order. -
Need to download a file which si space delimted and has fixed length char
Hi,
I have a custom report which downloads an output file in text format.I need the contents to be space delimited.My file data contains numbers as well as characters.I ahve pased the parameter WRITE_FIELD_SEPARATOR = ' ' in the FM.Hwoever the space is introduced only oif the column value is a character.If its a number/digit,the columns are not seperated by space.
Now my data appears like that:
0000101310179.28 +0827200808 DHLBSRF VISA AUG 2008US021SW111 RYAN,BICOVNY
I want my data to be like this :
0000101310 179.28 + 0827200808 DHLBSRF VISA AUG 2008 US02 1SW111 RYAN,BICOVNY
DO I need to pass any additinal parametre?Also for fixed length characrets,do i need to pack/unpack data before passing to the FM ?
Thanks.Hi,
try this way.
REPORT ztest_notepad.
DATA: BEGIN OF it_download OCCURS 0,
data TYPE string,
END OF it_download.
DATA: BEGIN OF it_vbrk OCCURS 0,
vbeln TYPE vbrk-vbeln,
fkart TYPE vbrk-fkart,
fktyp TYPE vbrk-fktyp,
netwr TYPE vbrk-netwr,
END OF it_vbrk.
DATA : l_netwr TYPE char21.
"START-OF-SELECTION.
START-OF-SELECTION.
SELECT vbeln
fkart
fktyp
netwr
FROM vbrk
INTO CORRESPONDING FIELDS OF TABLE it_vbrk
UP TO 100 ROWS.
LOOP AT it_vbrk.
l_netwr = it_vbrk-netwr.
CONCATENATE it_vbrk-vbeln
it_vbrk-fkart
it_vbrk-fktyp
l_netwr
INTO it_download-data
SEPARATED BY space.
APPEND it_download.
CLEAR it_download.
ENDLOOP.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\test.txt'
filetype = 'ASC'
TABLES
data_tab = it_download.
Thanks
Venkat.O -
Issue with Mapping Spaces for Receiver Flat File Fixed Length
Hi Mapping experts,
my scenario is receiver FILE (fixed length)
so if a validation applied on a target field returns false then I need to pass the spaces having the number of characters defined for that field
example
targetField length = 8
using "IF" function to perform validation, if validation is true THEN = FIELD
if validation is false ELSE = "________" (underscore to represent 8 spaces)
the problem is the validation is of multiple occurences in one queue and if the "true" statement is on the 6th row, I get _________ which is the value of the 1st row (which is correct because rows 1 to 5 are all false therefore having the value of ELSE which is _______ mapped to it)
How can I get the value of the TRUE row regardless of what row it is located?
e.g. IF = input is 5 rows of validation, TRUE is in the 3rd row, i will get the 3rd row value
IF = input is 5 rows of validation, NO TRUE Value, return 8 spaces
right now when i Display Queue values are
iF:in0 iF:in1 iF:in2 iF:out
1111 false [_________] [_________]
2222 false [_________]
3333 true 3333
4444 false [_________]
5555 false [_________]
In above Queue i only get the value of the 1st row which is ________ --> because my target field occurrences definition in Data Type is 0....1
if I change Data Type occurrences to 1...unbounded I get 5 target fields generated --> WRONG because target file is fixed field, so only one occurence of that target field is requiredCan you give me the idea of what validation are you using so that anyone can help you with the UDF straightaway
because you need to have a UDf in place which will iterate the number of times the field occurs and then it will check the entire queue first ,where validation is true and only at the instant it will return the value
if the entire queue is value it will return the 8 underscores
I hope this is what you wanted
regards
ninad -
Gui_download issue - trailing spaces getting truncated for fixed length fil
Hi All,
I have a requirement where I need to download an internal table as a fixed length file.
The code is as follows:
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = L_FILE
FILETYPE = 'ASC'
APPEND = 'X'
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = ' '
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = IT_TEXT
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
Each row in the internal table IT_TEXT is 242 chars long.
The FM is truncatinf the trailing blanks on the file. How do I get the FM to not truncate the trailing blanks in each row?
My internal table has multiple rows and the number of rows on the table should be same as the number of rows on the downloaded file.
I tried setting the WRITE_LF parameter to space.
In this case, the trailing spaces are not truncated(which is as per my requirement), BUT all the rows in the internal table appear in a single line on the downloaded file instead of multiple rows.
I also tried setting the TRUNC_TRAILING_BLANKS field to space but that does not work either. Spaces at the end of the row are still truncated.
so the requirement is: the spaces at the end of each row should not be truncated and
each row on the internal table should have a corresponding row on the downloaded file.
(it is a fixed length file)
I also tried using the following code
class cl_abap_char_utilities definition load.
DATA: BEGIN OF IT_TEXT OCCURS 0,
TEXT(242) TYPE C,
cr_lf TYPE c VALUE cl_abap_char_utilities=>cr_lf,
END OF IT_TEXT.
when i compile, i get the following error
The type "CL_ABAP_CHAR_UTILITIES" is unknown.
Im using R/3 4.6C. Could this be a problem?
Please suggest a solution for this problem.
Thanks!
Sandeep
Edited by: sandeep reddy on Jul 25, 2008 7:16 PMHi,
Try this..This worked..Add a dummy character at the end of the internal table...Then pass trunc_trailing_blanks = ' '...
PARAMETERS: p_file TYPE rlgrap-filename
DEFAULT 'c:\test_download.txt'.
DATA: BEGIN OF s_data,
data TYPE char10,
dummy, " Added this.
END OF s_data.
DATA: t_data LIKE TABLE OF s_data.
s_data-data = 'Test'.
APPEND s_data TO t_data.
s_data-data = 'Test2'.
APPEND s_data TO t_data.
s_data-data = 'Test3'.
APPEND s_data TO t_data.
s_data-data = 'Test4'.
APPEND s_data TO t_data.
* Download.
DATA: v_file TYPE string.
v_file = p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_file
trunc_trailing_blanks = ' '
TABLES
data_tab = t_data
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.
Thanks
Naren -
XSLT Mapping : XML to Fixed Length File
Hi,
I have to code a XSLT mapping which converts the XML into a Fixed Length File Format. I am getting the output but it has some garbage values (Some extra spaces in front of first record and also extra blank lines before the first record)
I am pasting my xsl sheet :
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="yes" media-type="text/plain"/>
<xsl:template match="Employees">
<xsl:for-each select="Employee">
<xsl:value-of select="Name"/>
<xsl:value-of select="ID"/>
<xsl:value-of select="ADD"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
My input XML file is as follows:
<?xml version="1.0"?>
<p1:Test02 xmlns:p1="http://www.infosys.com/xi/training/hyd/66289">
<Employees>
<Employee>
<Name>Anurag</Name>
<ID>1121</ID>
<ADD>Hyderabad</ADD>
</Employee>
<Employee>
<Name>Divya</Name>
<ID>1122</ID>
<ADD>Hyderabad</ADD>
</Employee>
<Employee>
<Name>Rasmi</Name>
<ID>1123</ID>
<ADD>Bangalore</ADD>
</Employee>
</Employees>
</p1:Test02>
And the output i am receiving is as follows:
Anurag1121Hyderabad
Divya1122Hyderabad
Rasmi1123Bangalore
Please do help.....hi,
>>>>
<xsl:output method="text" indent="yes" media-type="text/plain"/>
you allow the spaces by using indent="yes"
try with indent="no"
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
A better way of building the fixed-length String
I created the following code to build a fixed length string. I checked other posts for the same topic, but I found mine is better. The code below converts a double numeric value to a fixed length string with padding of white spaces (or other types):
Line 15 initializes the char array to while space; line 13 creates a character array; lines 17, 18 copy the array created in line 13 to the one initialized in line 15.
Any comment is welcomed.
1. import java.text.*;
2.
3. public class jformat {
4.
5. public static void main(String[] args) {
6.
7. char[] fb=new char[14];
8. char[] tb;
9. int c, f;
10. DecimalFormat fmt=new DecimalFormat("########0.00");
11. double dbl=12345.66;
12.
13. tb=fmt.format(dbl).toCharArray();
14.
15. for(c=0; c<fb.length; c++) fb[c]=' ';// this line is not required in JDK 1.5
16.
17. for(c=tb.length-1, f=fb.length-1; c>=0; c--, f--){
18. fb[f]=tb[c];
19. }
20. System.out.println(new String(fb));
21.
22. }
23.
24. }Here's a couple of alternatives. One uses a StringBuffer and the second, for Java 5 only, uses the Formatter capabilities.
import java.text.DecimalFormat;
public class jformat
public static void main(String[] args)
int fieldSize = 14;
double dbl = 12345.66;
String dblString = new DecimalFormat("0.00").format(dbl);
StringBuffer sb = new StringBuffer();
for (int j = 0; j < fieldSize - dblString.length(); j++)
sb = sb.append(' ');
System.out.println(sb.append(dblString).toString());
* The above code works in Java versions 1.3, 1.4, and 1.5.
* However, 1.5 provides the Formatter class, and the single
* line below can replace the preceeding code.
System.out.printf("%14.2f%n", dbl);
} -
Uploading the fixed length file into intenral table
hi folks,
I have a file in the fixed length format, need to upload that into the intenral table. How to do that? I have done with comma delimited file using 'SPLIT' command how to go about this?
I cannot change the fiel format have to use this..
Thanks in advance for your help.
VinuHi,
Create a structure exactly as the length of the file..
Example
Assuming your file has first 10 characters for customers and next 4 characters for company code..
CUST1234561000
DATA: BEGIN OF FILE_STRUC,
KUNNR(10),
BUKRS(4),
END OF FILE_STRUC.
if you assign the file value to the structure FILE_STRUC..automatically the first ten characters will be stored in the KUNNR field and next characters will be stored in the BUKRS field..
Move the file line to the internal table ITAB of the same structure FILE_STRUC.
THanks,
Naren
Message was edited by: Narendran Muthukumaran -
Upload a Fixed Length file in terms of Bytes..
Hi,
Here is my query.
I have a fixed length file that I need to upload into my program from my presentation server.
The file is in a Shift-JIS Format.
The file is a fixed length format. But it is fixed interms of the number of bytes that each column occupies.
Eg. The 1st column takes 8 bytes, the second 15 bytes, so on and so forth. We do not know the no. of characters each column takes... just the numbe of bytes.
This is how I had approached the upload.
I created an internal table with just one field of type XSTRING.
I used GUI_UPLOAD FM with CODEPAGE = `8000`.
But i noticed during debugging that in each record, the moment a SPACE occured in the input file, it would stop reading and go to the next record in the file. Meaning, I loose all the data after the first occurance of SPACE.
Am I missing something here?? Why does the FM truncate after the first SPACE. ??
Do I need to declare the internal table in any other format..??" May be placing a carriage return end of each records
" will solve your problem
class cl_abap_char_utilities definition load.
data : begin of itab,
field1(1) type c,
field2(2) type c,
field3(3) type c,
field4(4) type c,
crlf(2) type c value cl_abap_char_utilities=>cr_lf. "<<<See this line<<<
data : end of itab.
Data : begin of itab1 occurs 0.
Field(20) type c.
Data : end of itab1.
Loop at itab.
Move itab to itab1.
Append itab1.
Endloop.
Open dataset ........
Loop at itab1.
Transfer itab1 TO dataset.
Endloop.
a® -
Greetings,
I'm creating an application that need to create a fixed length file on a UNIX system and need help. I have an internal table(s) which contain structures with fields of different lengths (type c) and so I have a routine that concatenates these fields into a single record to be sent to a file using the open dataset. This process is squeezing out all my spaces and so my fixed length file is lost. Can someone assist in creating a fixed length file from an internal table without using delimiters?
Thanks!" May be placing a carriage return end of each records
" will solve your problem
class cl_abap_char_utilities definition load.
data : begin of itab,
field1(1) type c,
field2(2) type c,
field3(3) type c,
field4(4) type c,
crlf(2) type c value cl_abap_char_utilities=>cr_lf. "<<<See this line<<<
data : end of itab.
Data : begin of itab1 occurs 0.
Field(20) type c.
Data : end of itab1.
Loop at itab.
Move itab to itab1.
Append itab1.
Endloop.
Open dataset ........
Loop at itab1.
Transfer itab1 TO dataset.
Endloop.
a® -
Export to fixed length field format
Sometimes we need to export records from our student system as fixed length text file to integrate with other software.
Basically the report will only contains rows of records, But we want to export it to fixed length field text file.
And then automate the process.
We also have Crystal enterprise server. What is the easy and best way to accomplish this?
ThanksSorry. Please ignore my last message. It went into the wrong thread.
There is one huge problem with exporting to Fixed Length in 8.5. The Fixed Length will truncate any trailing white space. So if you have a could that's 5 characters long but the current value is only 3, it will only be 3 characters long.
To get around this, I've had to create a formula for each column in the report and check the lenght of the field and pad or truncated accordingly.
For example:
If Length ({Table.FIELD1}) > 10 Then
{Table.FIELD1} [1 to 10]
Else {Table.FIELD1} & ReplicateString ("*", (10 - Length ({Table.FIELD1}));
So this column should be 10 characters long. If the field is longer than 10 characters it will truncate it to 10, otherwise it will pad the extra spaces with *. You can't use spaces to pad because the export driver will truncate them so I decided * were the best choice because for my purposes I knew that character would never be used.
Good luck,
Brian -
Download data to Fixed Length Text File
Can anyone share the sample code on how to download data into fixed length text file and place the file in the server directory?
One way i would advice is to declare a text variable and move values using offset.
Eg:
move: <struc>-fld1 to l_text(8),
<struc>-fld2 to l_text+8(3),
<struc>-fld3 to l_text+11(15).
transfer l_text to <file>.
Try this approch and see the result.
Kind Regards
Eswar -
Defaulting fixed length file fields to 'blank'
Hi,
I am currently working on an outbound interface which results in the construction of a fixed length record flat file. At the moment I am having to deal with each field in person to ensure that either a value,or a blank is mapped to the target field as each field is mandatory. Is there an easier way to do this such as using the 'default' setting in the data type definition with some special character to represent a blank so that I dont have to worry about missing values in my message.
Regards,
PeteHi
I have the same problem, and didn't find any way to default the fields.
It helps to use the function "mapWithDefault", but you still have to deal with each field.
Br,
Elling
Maybe you are looking for
-
Classic ASP - "ORA-01722: invalid number" using OraOLEDB.Oracle driver
I am working on doing some maintenance updates to a Classic ASP website, and I need to be able to run an insert/update statement for putting values into a lookup table. I am currently running into an "ORA-01722: invalid number" error when trying to u
-
How to use Callout in B2B on the basis of STATUS
Hi, If there occurs a validation error in the B2B EDI contents, what mechanism can be used to update that status back to the source system? We are using B2B Adapter in the BPEL Process to pass the XML file and B2B generates an EDI file for us. Now, i
-
Rolling back the transaction from stateful session bean
Hi, How can I mark the transaction to be rolled back in a stateful session bean implementation?. Should I call setRollbackOnly method or throw a RemoteException or throw an EJBException, etc.? the configuration is : OC4J 9.0.4 Stateful session bean R
-
U00BFCan i execute a program remotely?
Hi, ¿can i execute a program remotely whitout to use a function module rfc enabled?
-
[SOLVED] Wireless card works, but configuration and software doesn't
Hi, I could manage to activate my Atheros wireless card using the madwifi drivers. I wanted to use knetworkmanager, but unfortunatly i doesn't recognize any of my network devices. I've read the other networkmanager threads, changed the daemons order,