Creating XML-files in ABAP with format ISO-8859-1 after the use of unicode
Hello,
We have a problem with XML-files created in z_abap-programma.
Before the use of unicode the XML-file was of the format: ISO-8859-1.
After the introducting of unicode the format is UTF-16.
In the abap-program we are using:
CALL TRANSFORMATION xls-program
SOURCE t_vbak = it_vbak
RESULT XML xmlstring.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = xmlstring
IMPORTING
buffer = lx_xml_as_string.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lx_xml_as_string
IMPORTING
output_length = li_xml_size
TABLES
binary_tab = ltb_xml_table.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = li_xml_size
filename = lc_filename
filetype = 'BIN'
CHANGING
data_tab = ltb_xml_table
EXCEPTIONS
OTHERS = 24.
Is it prossible to create the XML-file with the format ISO-8859-1 after the unicode, please can you explane how to solve this problem.
Regards,
Theo Pijlman
hi theo,
did you read my thread i wrote some days before ? have a look in my sample coding find " if_ixml_encoding ..... " there you can set the encoding of character .
greetz
tony
thread:
Re: abap to xml
SAP Explanation for Interface if_ixml_encoding :
http://help.sap.com/saphelp_nw04/helpdata/de/bb/5766a6dca511d4990b00508b6b8b11/content.htm
Similar Messages
-
Create XML file from ABAP with SOAP Details
Hi,
I am new to XML and I am not familiar with JAVA or Web Service. I have searched in SDN and googled for a sample program for creating XML document from ABAP with SOAP details. Unfortunately I couldn't find anything.
I have a requirement for creating an XML file from ABAP with SOAP details. I have the data in the internal table. There is a Schema which the client provided and the file generated from SAP should be validating against that Schema. Schema contains SOAP details like Envelope, Header & Body.
My question is can I generate the XML file using CALL TRANSFORMATION in SAP with the SOAP details?
I have tried to create Transformation (Transaction XSLT_TOOL) in SAP with below code. Also in CALL transformation I am not able to change the encoding to UTF-8. It's always show UTF-16.
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
<xsl:template match="/">
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Header>
<CUNS:HeaderInfo>
<CUNS:InterfaceTypeId>10006</InterfaceTypeId>
<CUNS:BusinessPartnerID>11223344</BusinessPartnerID>
<CUNS:SchemaVersion>1.0</SchemaVersion>
<CUNS:DateTime>sy-datum</DateTime>
</CUNS:HeaderInfo>
</SOAP:Header>
<SOAP:Body>
<xsl:copy-of select="*"/>
</SOAP:Body>
</SOAP:Envelope>
</xsl:template>
</xsl:transform>
In ABAP program, I have written below code for calling above Transformation.
call transformation ('Z_ID')
source tab = im_t_output[]
result xml xml_out.
call function 'SCMS_STRING_TO_FTEXT'
exporting
text = xml_out
tables
ftext_tab = ex_t_xml_data.
Please help me how to generate XML file with SOAP details from ABAP. If anybody have a sample program, please share with me.
Is there any easy way to create the XML file in CALL Transformation. Please help.
ThanksTry ABAP forum, as it seems not to be PI related.
-
Creating XML file from ABAP internal table data....
Hello,
I am fethcing data froma custom table and I have to write data in XMl format. Following is the XML format in which I want data. Is there any function module iN SAP which will help me in writing data from internal table to XML file ?
<batch>
<invoice>
<StatusCode>10</StatusCode>
<paymentamount>122.00</paymentamount>
<ReferenceNumber>70980934</ReferenceNumber>
</invoice>
<invoice>
<StatusCode>90</StatusCode>
<paymentamount>122.00</paymentamount>
<ReferenceNumber>70980934</ReferenceNumber>
</invoice>
<control>
<InvoiceCount>2</InvoiceCount>
</control>
</batch>
Please help.
Regards,
Jainam.I suggest you look into "simple transformations". That's SAP's most recent technology for such purposes, as far as I know.
http://help.sap.com/abapdocu_70/en/ABENABAP_ST.htm
Thomas -
How can I create a file in iMovie with a lengthy audio file, but only 1 picture?
Let me state first off that I'm a blind user using the Voiceover screen-reader in OS X.
Now, I want to upload some audio to Youtube, but they do not allow simple MP3 files. As such, I want to create a file in iMovie with my audio and 1 picture to use as a visual. Within iMovie, I add my audio file, select a picture, but when I publish, the audio is cut off after only a few seconds. Can someone please explain how I can fix this issue so my entire audio clip will play?iMovie is a visual medium, so you need to make the duration of your photo at least as long as your voiceover track. You should be able to double click on your photo and then enter a duration.
See iMovie Help at this link.
http://help.apple.com/imovie/#mov3a883915
An MP3 file may work for you, but for best results, use a WAV or AIFF file (uncompressed). You can convert MP3 to AIFF in iTunes. Let me know if you need instructions. -
How to create xml file in iOS and how to send data to web using SOAP protocol.
How do you create xml files in iOS and how do you send data to the web using a SOAP protocol?
Is that what you meant to say? -
Creating XML files with the DME
Hi All,
I'm working on an integration project between my company and HSBC, they are requesting that we supply our AP payment files for foreign currency in XML format.
I have some limited experience with the DME and know it can create XML files, however, the elements available for XML files are different to standard flat files. Also it doesnt seem like I can create files with multiple levels? e.g.
<InitgPty>
......... <Id>
............... <OrgId>
...................... <BkPtyId>ABC00103003</BkPtyId>
.............. </OrgId>
........ </Id>
</InitgPty>
Does anyone have any documentation or experience with creating XML files with DME?
thanks
Phil.Hi,
Please ask any Implementation team in ABAB or Report painter team with your friends,
Thanks and REgards
N.Soma Sundaram -
Creating an xml file from abap code
Hello All,
Please let me know which FM do I need to execute in order to create an XML file from my ABAP code ?
Thanks in advance,
Paul.This has been discussed before
XML files from ABAP programs -
What's the best way to create XML file with a schema from a database table?
Hi,
I want to create an XML file from a database table (which has over 600 columns) using XML schema (.xsd file). I want to know the best way to do this.
The output XML file is NOT a direct data dump from the DB table, there�re some logic around it, such as the XML file has some hierarchy with repeating tags.
I have done this using JAXB by creating Java classes form XML schema, but I don�t want to map 600 DB columns to these Java classes manually, and loop through the record set to create repeating tags.
I know there are few tools around now like MapForce (Altova), how do people do these now?
Thanks,
ChandiCan you use a schema when we compose XML doc from Database tables?
Actually, I'm using SQL Server (sorry, wrong forum). But, I thought a Java tool would have a solution for me. -
SQL Error : missing expression - Creating XML file with ODI
Hi,
I saw threads about errors like this and read that maybe it can come from how I chose the staging area. I still can't see where the problem is. I'm trying to create an xml file from data stored in a Oracle database. The interface which execution fails select data from tables and create a tag in the XML file. Here are information about it :
The staging area is diferent from the target and is an oracle database schema. (I guess it creates temporary tables in that schema ?)
In the flow tab, the LKM is LKM SQL to SQL, the option delete temporary objects is set to yes.
The IKM choice for the target is IKM SQL Control Append and options are as following :
- insert : yes
- commit : yes
- flow contreol : no
- recycle errors : no
- static control : no
- truncate : no
- delete all : no
- create target table : yes
- delete temporary objects : yes
Columns mapping in the target are the following :
WKID > THEADER.WKID
EXTID > THEADER.EXTID
ORDER > THEADER.ORDER
INSTFK > THEADER.INSTFK
For every column in the target :
- Run on source
- Updating : insert, update and ud4 are checked
no update key is defined
In the operator, the step failing when running the interface is the loading data in the work table.
If you need the SQL request in the execution plan, or anything else, please tell me.
Thank you in advance for any help on this.
MarieIt would help if you provide error message and its stack trace.
Please also look at the documentation (If not already done so) for creating xml file XML Files - 11g Release 1 (11.1.1) -
Transforming XML File to abap structure
Hello,
I am working in a new project for making an input interface.
The problem to resolv is :
1>Reading an XML file on a unix Server
2>Transforming this file in abap structure with the instruction
call transformation.
Format of the input file :
<LISTEART>
<ART code="A01" label="Designation A01"/>
<ART code="A02" label="Designation A02"/>
<ART code="A03" label="Designation A03"/>
<ART code="A04" label="Designation A04"/>
<ART code="A05" label="Designation A05"/>
</LISTEART>
Format of the abap structure :
DATA : BEGIN OF ws_art,
code(4) TYPE c,
label(3) TYPE c,
END OF ws_art.
DATA : wt_art LIKE ws_art OCCURS 0 WITH HEADER LINE.
is it possible to transform the input file to an internal table
with the call transformation ?
CALL TRANSFORMATION transfo
SOURCE XML xml_string
RESULT para = result.
Somebody can explain me how to create links between xml file
and abap structure ?
with regards
JLuc Ledoux
[email protected]Hi,
try like this.
TYPES: BEGIN OF day,
name TYPE string,
work(1) TYPE c,
END OF day.
DATA: BEGIN OF week,
day1 TYPE day,
day2 TYPE day,
day3 TYPE day,
day4 TYPE day,
day5 TYPE day,
day6 TYPE day,
day7 TYPE day,
END OF week.
DATA xml_string TYPE string.
DATA result LIKE week.
week-day1-name = 'Monday'. week-day1-work = 'X'.
week-day2-name = 'Tuesday'. week-day2-work = 'X'.
week-day3-name = 'Wednesday'. week-day3-work = 'X'.
week-day4-name = 'Thursday'. week-day4-work = 'X'.
week-day5-name = 'Friday'. week-day5-work = 'X'.
week-day6-name = 'Saturday'. week-day6-work = ' '.
week-day7-name = 'Sunday'. week-day7-work = ' '.
CALL TRANSFORMATION ...
SOURCE root = week
RESULT XML xml_string.
CALL TRANSFORMATION ...
SOURCE XML xml_string
RESULT root = result.
Regards,
Vijay -
Help in creating XML documents in ABAP using XI in new version ECC6.0
Hello All:
I am pretty comfortable with XML and XSLT but new to XI. Is there a way of creating XML documents in ABAP using XI in new version ECC6.0? Please provide me with any links or any information you may have. All the answers will be rewarded.
Thanks.
Mithunhi,
U cant create XML data in ABAP.
to send the data to the XI, u have to use the IDOC or RFC FM, from there IDOC or RFC adapters will read the data in the same format and these adapters will convert the data in to XML .Bcoz XI understand only XML data.
from there XI will process and route them to Destination, by using anthor adapter.
here u can use file adapter if u want data in file foramat from the IDOC or RFC .
So XI is the integration tool only.
reward points if helpful
ragards
sreeni -
Can we do a Secure FTP for an XML file from ABAP when firewall is enabled?
Hi all,
I have a requirement to send an XML file to an External FTP Server which is out of our corporate network and our firewall is enabled.
I have to send an XML file with Purchase Order details. I completed that with the help of this blog https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2657. [original link is broken] [original link is broken] [original link is broken]
Now I need to FTP the XML file that is generated. How should I be doing this? Can some of help me with this?
I need to do a Secure FTP to the external non SAP server which is out of our corporate network and our firewall is enabled. Can some one tell me if SFTP is possible in ABAP.
This is not a web service. I am working on dropping an XML file in an external FTP serveru2026 I have searched the forums but still in a confusion if weather Secure FTP is possible in ABAP or not when our company firewall is enabledu2026
If some one encountered this situation earlier please help,,,..any help will be highly appreciated.
Regards,
Jessica SamThanks a lot for your valuable suggestions Richu2026
I agree with you Rich that web services would be a better option. But I need to send this file to an external third party and they dont have web services.
They are telling us that either we can send them an XML file or a CSV file in the format that they want. We decided to go with XML file format.
I am done with formatting the Purchase Order details in the format that they want. Now the challenge is that I need to send this FTP file to them and it should be a Secure FTP when our fire wall is enabled,
When you say
1) Run an ABAP program to generate the XML file and put it on the local PC
2) Log into the FTP site via some FTP client, could simply be windows as well.
3) Manually cut/paste the file from the PC to the FTP site.
For Step 1 running ABAP Program can I schedule a batch job?
For Step 2 and Step 3 can I automate it in any other way..if not in ABAP?
Can I advice my company to follow any alternate method in which they can automate this step 2 and step 3u2026if not in ABAP can it be possible in any other way as the third party does not have web services I now have no other alternative.
Please Helpu2026
Regards,
Jessica Sam -
Create XML file by using servlet
Hi, Is there anyone who sucessfully create XML file by taking parameters from a web form? If so, hope you could share the code with me. I moved the code from the example to servlet. it keeps returning null pointer exception on the root node.
java.lang.NullPointerException: at oracle.xml.classgen.CGDocument.(CGDocument.java:62)
nullHi everybody,<br /><br />the code works good now. so it should be available for everybody who needs it:<br /><br />---------------- my code --------------------------------------<br /><br />var container = "";<br /><br />container = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";<br />container = container + "<all>\n";<br />container = container + "<header>\n";<br />container = container + "<author>author name</author>\n";<br />container = container + "<authorMail>[email protected]</authorMail>\n";<br />container = container + "</header>\n";<br />container = container + "<body>\n";<br />container = container + "<name>" + value + "</name>\n";<br />container = container + "<adresse>" + value + "</adresse>\n";<br />container = container + "<ort>" + value + "</ort>\n";<br />container = container + "<staat>" + value + "</staat>\n";<br />container = container + "<plz>" + value + "</plz>\n";<br />container = container + "<land>" + value + "</land>\n";<br />container = container + "</body>\n";<br />container = container + "</all>\n";<br /><br />var myDoc = event.target;<br />myDoc.createDataObject("export.xml", container);<br />myDoc.exportDataObject("export.xml");<br /><br />app.mailMsg(false, "mail-address1; mail-address2", "", "",<br />"mail subject", "mail body");<br /><br />---------------- end of my code ------------------------------- <br /><br />now i'm looking for a solution to automatically attach the file to this mail and directls sent it without to call up the mail client.<br />if anybody has got an hint, you're welcome ;-)
-
Create XML file on application server (unix directory) from internal table
Hallo everybody,
I have got the following problem:
I am working with <u><b>release 4.6C</b></u> and have got to create XML files from HR master data and organizational data respectively.
This takes place in 3 steps:
1. Collect the data in an internal table
2. Convert the data to XML format using the function module 'SAP_CONVERT_TO_XML_FORMAT'
3. Download the data
If I download the converted data, which are in an internal table, to the presentation server via the function module WS_DOWNLOAD and open it with the Internet Explorer, everything is ok.
If I download the converted data to the application server, i.e. into a unix directory via
open dataset, loop at internal table, transfer working area to file, close dataset
and then try to open it, this is not possible, because after the last tag some unreadable characters, e.g. a square, appear that arent supposed to be there. Thats what my colleagues told me, for I havent got access to the server.
I have no idea where these characters come from and how I can get rid of them. I guess that either I have to modify (how?) the table with the converted data before the download or I have to use another way to convert the data. For the second way I would probably have to work with an XML class or an XML interface. Unfortunately II am not an expert in working with classes so sample coding would have to be rather detailed.
Heres some more information about how I work with the conversion function module:
call function 'SAP_CONVERT_TO_XML_FORMAT'
exporting
i_field_seperator = lv_field_seperator
i_line_header = lv_line_header
i_filename = lv_xml_file
i_appl_keep = ' '
i_xml_doc_name = lv_xml_doc_name
importing
pe_bin_filesize = lv_result
tables
i_tab_sap_data = gt_data
changing
i_tab_converted_data = lt_tab_converted_data
exceptions
conversion_failed = 1
others = 2.
lv_field_seperator = X.
lv_xml_doc_name = Personalstammdaten Publikation
lv_result: type i
gt_data: fields: PERNR, PERSG, PERSK etc.
types:
begin of truxs_xml_line,
data(256) type x,
end of truxs_xml_line.
types:
truxs_xml_table type table of truxs_xml_line.
data:
lv_tab_converted_data type truxs_xml_line,
lt_tab_converted_data type truxs_xml_table
open dataset lv_xml_file for output in binary mode.
loop at lt_tab_converted_data into lv_tab_converted_data.
transfer lv_tab_converted_data to lv_xml_file.
endloop.
close dataset lv_xml_file
lv_xml_file: /usr/users/.../.../Personendaten_2004-11-02.xml
Hope the information is detailed enough! Otherwise let me know. Thank you in advance.
Message was edited by: Johannes SchwehmHi Raja,
tried the "TEXT" mode, but that didn't help.
There are still characters after the last tag, that are not supposed to be there including a date that is not
the creation date of the file.
Thank you for your help.
Regards
Johannes -
What the best way to create XML files from JAVA application?
Hi to all,
I need to edit and to create new filex in format of xml. I know to parse, but what would be the best way to do:
1. - Create new file, create like simle text file, or there is some clases that know to do it in more simple way
2.a - Edit XML file, to take some data and add it to the XML in the place I want to.
2.b - Also Edit, but not to add fields, just update some of them.
Code examples or links to samples woul be welcomed.
Best regards, Nick.I have tried working with XML directly using the Java classes but this was a pain. I then looked at DOM4J and JDOM and found JDOM easier to use.
Maybe you are looking for
-
Hi, We are doing a mid year golive hence results from April to August has been uploaded. while exiting the payroll of August the retoactive date has been set to 06 2007 , i.e., 01.09.2007 so that no retro active calculation happens for the pre
-
Hi Adobe Support, I would like Uninstalled Adobe Acrobat 9 Pro but th "Register" option is Locked. I would like installed this Adobe Acrobat 9 pro an other computer but I don't found the "Serial / Number" Thanks for your Help
-
Process Code for Outbound Production Order??
Does anybody know the Process Code for Outbound Production Order?? BASIC Type : LOIPRO01 Message Type : LOIPRO Regards, Ravi
-
Error in Infopackage- retrieve error data
Hello experts, During execution of infopackage to extract data from ECC i had this error : "Error in codepage mapping for source system" read some thread i understand there was some idoc in error therefore i found the problem in BD87 in source system
-
How to execute dir dos command in Runtime Execution
Hi All, Does anybody know how to execute the dir command in DOS in the runtime execution for example, when we open the command prompt, c:\Documents and Settings\java> e: e:\cd java e:\dir *.* how we can list the directory in runtime execution?