Developing custom translator for converting xml to edi
Hi Gurus,
I am trying to justify using Oracle B2B if my only requirement is to be able to translate data from flat files to EDI and vice versa.
My use case is
Application Data ------------> ESB ---------------------------------------> Custom Translator --------------------------> EDI Document
........................(flat file).................(flat file converted to XML)........................ convert xml to edi
Is this solution possible. If so, can somebody share details about how to write these custom translators.
tia,
Amit
Thanks so much for your responses.
What I have seen so far is that if <G_SN1> contains two entries of <S_N1> then the error above is generated (Could only identify segment S_N1 as dirty!).
For instance,
<G_SN1><S_N1><D_98>VN</D_98><D_66>1</D_66><D_67>0000010003</D_67></S_N1> <S_N1><D_98>ST</D_98><D_66>1</D_66><D_67>0000010003</D_67></S_N1></G_SN1>
Is there a way to modify the mapping in Seeburger in such a way that it would allow/accept two occurrence of <S_N1> under <G_SN1>?
Similar Messages
-
Call Pipeline in orchestration for converting XML to flat file
Hi ,
Can we call Pipeline in orchestration for converting XML to flat file ?
Or we have some another option for this task ?
PrakashHi,
You can refer this article from Abdul Rafay on how to work with Flat files and how to call receive and send pipelines within your orchestration. He
has provided detailed step by step explanation of the process.
Calling Send and Receive Pipelines
from the orchestration expression shapes
The code shared by Abdul at http://abdulrafaysbiztalk.wordpress.com/files/2009/06/processingflatfiles.doc (Change the extention to rar) and try it.
One common mistake I have seen people doing will working with Flat File Assembler is that they miss to set the Document schema property in the Properties
window to the flat file schema.
If the Document schema property is not specified, runtime schema discovery will be attempted. During schema discovery, BizTalk Server attempts
to determine the correct flat file schema to assemble the message with, based on the namespace and root node of the message, its added performance hit.
Rachit -
Developing Custom Actions for MII 12.0.4
Hi,
I read about the possibility of developing custom actions for the MII Workbench.
There are some articles that deal with this topic, they all describe a reference class called "ActionReflectionBase" that implements the Interfaces that have to be implemented (IConfigurable, IAction, IMappable and IInvoke).
I develop whit Eclipse and I have already imported the needed JAR Files in my project (LHCommon.rar and Lighthammer.jar). But I am not able to find the ActionReflectionBase class in the package com.sap.xmii.xacute.actions where it should be!
I'm using MII version 12.0.4, please tell me where I can find this class?
As a workaround I implement the interfaces directly:
public class Calculator implements IConfigurable, IAction, IMappable, IInvoke {
,but it would be more confortable to extend the reference class.
Please help me.
Best Regards,
RobertI have found my problem. I imported the jar files directly into the project and not into the jar library. So Eclipse was not able to find the ActionReflectionBase class. Now everything works!
-
Tools for Developing/Customizing Forms for Oracle Apps R12.1
Hi All,
Could you please help me identify the tools and correct version for developing and customizing Forms for Oracle E-Business Suite R12.1?
Regards,
KKAlso, could you please elaborate your 2nd point regarding template.fmb The Oracle EBS uses a framework. Starting any new (custom) form for the EBS should ALWAYS begin with the template.fmb to ensure your new form has all of the required objects to comply with EBS Forms development standards. You might want to take a look at the Oracle Applications Documentation library. Select your EBS version and then scroll to the Standards section and review the following documents:
<ul>
<li>Oracle Applications Developer's Guide
<li>Oracle Applications User Interface Standards for Forms-Based Products
<li>Oracle Application Framework Personalization Guide
</ul>
Craig... -
Error in Seeburger maaping while converting XML to EDI
Hi All,
I have developed an interface which Idoc to file. While running my scenario my Idoc is mapped to EDI Xml and in reciever communication channel when my EDI XML invokes X2E mapping it gives me below error. I have check the payload in communication channel monitoring and it does contain a value.
Here is the error. Please help
Message processing failed. Cause: Error in BICMODULE-module:Temporary error: BIC XI Adapter call failed. Reason: Error: [Error:ID=3031;LEVEL=3] Field writeField(): Mandatory Field UNB.UNZ:0020[0] not filled - replace with defaultvalue : . DESCRIPTION: Field Warning: The mandatory Field [not specified][[not specified]] is not filled - it was auto filled with the defaultvalue: [not specified].
Regards
AvanishHi Avanishwathi,
Mandatory Field UNB.UNZ:0020[0] not filled - replace with defaultvalue
Looks like you are working with EDIFACT one.The mandatory field UNB.UNZ:0020 might not be getting value durig run time.So do chek the availability of the proper value in the test data.As experts said test in BICmapping designer also and make sure it works there with the test data.
Thanks,
Ram. -
Which unix command for converting xml to pdf
Anybody know the command in unix to convert docbook xml to PDF???
is it xsltproc or pdfwrite???
thanx"ooba" <[email protected]> wrote in message
news:gl2klg$rap$[email protected]..
>I know this is the Flex Group, but I'm getting no love
from the Flash
>group.
> 1. I need to build a thick client
> 2. I have 0 experience with Flex or AIR
> 3. I have built alot of Flash web components and a few
thick clients
> 4. I only have one week to get something working
>
> Can anyone tell me if it is even possible for Flash to
generate a PDF file
> from an imported XML file? or to browse a systems and
allow the user to
> select
> an xml file to load?
You'd need to upload the file to a server and have the server
do this.
> I need to have the client select an xml file that and
the thick client
> would
> then use a predefined xsl file and (missing this part)
need to convert the
> xml
> out to a human readable PDF format.
Depending on what server-side technology you are using, there
are probably
PDF libraries you could use.
> If you have another suggestion on how to do this please
post suggestions.
>
> All I know right now is that I need to construct a thick
client to do
> this,
> and being that Flash has been what I have built thick
clients on before
> I'd
> like to do it in Flash rather than try and figure out
how to do it in C#
> .Net
> in less than a week.
You won't be able to do it with Flash or Flex alone.
HTH;
Amy -
Developing custom controls for Third Pary softwares
Hello,
I am using a third party software that is a little bit old but it is still used at work. From this software it is possible to design windows forms that later on are loaded to smalls IPCs with windows embedded (XP and CE) and by lunching and application in
the IPCs these forms can be used.
From the form designs section of this software there is a "smart toolbox" from were the controls can be dragged and dropped (please see attached image). These controls seems to be designed by the third party software.
My cuestion is the following:
How can I design my own custom control? Is there any way that I can desing this controls from visual studio? what version?
Thanks,
Enrique.
Kikeman Electric Systems EngineerHi Enrique,
-->Is there any way that I can desing this controls from visual studio? what version?
I suggest you using the VS2013, it's free and it contains more new features. You could download this version from the below site:
https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#DownloadFamilies_2
-->How can I design my own custom control?
You could add the custom control like the following way.
1) Right-click on the toolbox, then choose "Choose Items.."
2) Click the "Browse..." button to choose the custom control. (Your dll files)
If you have any other concern regarding this issue, please feel free to let me know.
Best regards,
Youjun Tang
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
CS5 PS - ? Developing Custom Materials For Repousse
I was curious if there is a way to define custom root level materials that would be available for all projects without having to go through the Materials option list and adjust aspects (environment, Diffuse, opacity, etc.) for each particular surface in an object.
Thanks for any information
jack StrawHi,
So you downloaded the Materials.zxp and used Extension Manager to install?
Do you have any of the .p3m files here:
Users/user/Library/Application Support/Adobe/Adobe Photoshop CS5/Presets/Materials
or /Applications/Adobe Photoshop CS5/Presets/Materials
If not, that's where they should be. We've seen the Extension Manager installation have various problems including silent failures. You can change the Materials.zxp extesion to .zip and then unzip to find the individual material files. Copy them manually over to the user directory.
Now launch Ps and with a 3D layer selected and an existing material targeted, click the material picker icon and then go to the upper right flyout. From this menu you should be able to replace/append the previewed material samples. Hopefully this screen shot illustrates this OK.
regards,
steve -
Desktop Integration for customized translator applications
Hi,
For the customized translator applications (trained systems) built using microsoft translator hub, is it possible to integrate them with MS Office and all other tools, servers and web applications that are automatically integrated to the out-of-the-box microsoft
translator? Our intention is to avoid out-of-the-box translation and have our own customized translation for all the integrations we use. If this is possible, please direct me to the corresponding documentation.Hi Chaya,
Sorry for the delayed response. It is possible to use your own custom translator for word and some other tools/applications. Please check the following for MS word:
http://www.microsoft.com/translator/word.aspx
https://store.office.com/translator-WA104124372.aspx?assetid=WA104124372
Please let us know specific tools and applications that you are interested in and we can provide details on if they support custom translation or not.
Thank you -
Convert XML to SAP internal table
Hi gurus,
My program is suppose to get current exchange rate file from website and upload it in SAP.
by using FM 'HTTP_GET', im getting the data in XML format.My problem is..i have tried to use transformation but failed to
map it against XML data element..and i have tried to use CALL FUNCTION 'SCMS_TEXT_TO_XSTRING' and then CALL FUNCTION 'SMUM_XML_PARSE' but it returns initial value with error ''line 0 col 12-unexpected symbol: '>'' .
Below is an excerpt of my XML file:
..<xml version>
..<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
.. xmlns:o="urn:schemas-microsoft-com:office:office"
.. xmlns:x="urn:schemas- microsoft-com:office:excel"
.. xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
.. <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> <WindowHeight>10875</WindowHeight>........ <WindowWidth>13260</WindowWidth><WindowTopX>480</WindowTopX><WindowTopY>30</Wind
.. <Style ss:ID="Default" ss:Name="Normal">
.. <Alignment ss:Vertical="Bottom"/>
.. <Borders/>
.. <Font/>
.. <Interior/>
.. <NumberFormat/>
.. <Protection/>
.. </Style>
.. <Style ss:ID="BoldColumn">
.. <Font ss:FontName="Microsoft Sans Serif" x:Family="Swiss" ss:Bold="1"/>
.. <Worksheet ss:Name="Page1"><Table ss:StyleID="s21" > <Column ss:Width="130"/> <Column ss:Width="85"/> <Column .. ss:Width="85"/> <Column ss:Width="85"/> <Column ss:Widt
.. Cell><Cell ss:MergeAcross="1" ss:StyleID="BoldColumn"><Data ss:Type="String">Average Buying Rates</Data></Cell><Cell .. ss:MergeDown="1" ss:StyleID="BoldColumn"><Data ss:Type="Stri
.. ss:Type="Number">47.3732</Data></Cell><Cell ss:StyleID="Decimal"><Data ss:Type="Number">47.5374</Data></Cell><Cell .. ss:StyleID="Decimal"><Data ss:Type="Number">48.2323</Data></Ce
.. " ><Data ss:Type="String">HONG KONG</Data></Cell><Cell ss:StyleID="StringLiteralCenter" ><Data .. .. ss:Type="String">HKD</Data></Cell><Cell ss:StyleID="Decimal"><Data ss:Type="Numb
.. ss:Type="Number">22.8131</Data></Cell><Cell ss:StyleID="Decimal"><Data ss:Type="Number">23.2595</Data></Cell>.. .. </Row><Row><Cell ss:StyleID="StringLiteral" ><Data ss:Type="String"
.. ss:StyleID="StringLiteralCenter" ><Data ss:Type="String">IDR</Data></Cell><Cell ss:StyleID="Decimal"><Data .. ss:Type="Number">3.0395</Data></Cell><Cell ss:StyleID="Decimal"><Data
.. ecimal"><Data ss:Type="Number">30.6424</Data></Cell></Row><Row><Cell ss:StyleID="StringLiteral" ><Data .. ss:Type="String">AUSTRALIA</Data></Cell><Cell ss:StyleID="StringLiteralCe
.. ell ss:StyleID="Decimal"><Data ss:Type="Number">0.3392</Data></Cell><Cell ss:StyleID="Decimal"><Data .. ss:Type="Number">0.3409</Data></Cell><Cell ss:StyleID="Decimal"><Data ss:Typ
.. StringLiteral" ><Data ss:Type="String">DENMARK</Data></Cell><Cell ss:StyleID="StringLiteralCenter" ><Data .. ss:Type="String">DKK</Data></Cell><Cell ss:StyleID="Decimal"><Data ss
.. ata ss:Type="Number">4.4550</Data></Cell><Cell ss:StyleID="Decimal"><Data ss:Type="Number">4.6073</Data></Cell>.. </Row><Row></Row><Row></Row><Row><Cell ss:MergeAcross="4" ss:Style
.. s of 23 November 2010</Data></Cell></Row><Row></Row><Row><Cell ss:MergeAcross="4" .. ss:StyleID="BoldColumn_Left" ><Data ss:Type="String">2. Foreign Exchange Rates (THOMSON REUTE
.. ><Data ss:Type="String">ZAR</Data></Cell><Cell ss:StyleID="Decimal"><Data ss:Type="Number">4.2735</Data></Cell>.. <Cell ss:StyleID="Decimal"><Data ss:Type="Number">4.3125</Data></
.. ="Decimal"><Data ss:Type="Number">106.5459</Data></Cell><Cell ss:StyleID="Decimal"><Data .. ss:Type="Number">107.5164</Data></Cell></Row><Row><Cell ss:StyleID="StringLiteral" ><Da
.. a></Cell><Cell ss:StyleID="Decimal"><Data ss:Type="Number">4.6916</Data></Cell></Row><Row><Cell .. ss:StyleID="StringLiteral" ><Data ss:Type="String">BANGLADESH</Data></Cell><Cell
.. r">0.0074</Data></Cell></Row><Row><Cell ss:StyleID="StringLiteral" ><Data ss:Type="String">KENYA</Data></Cell><Cell .. ss:StyleID="StringLiteralCenter" ><Data ss:Type="String">KE
.. ><Cell ss:StyleID="StringLiteral" ><Data ss:Type="String">VIET NAM</Data></Cell><Cell ss:StyleID="StringLiteralCenter" >.. <Data ss:Type="String">VND</Data></Cell><Cell ss:StyleI
.. A</Data></Cell><Cell ss:StyleID="StringLiteralCenter" ><Data ss:Type="String">LKR</Data></Cell><Cell .. .. ss:StyleID="Decimal"><Data ss:Type="Number">0.2686</Data></Cell><Cell ss:St
.. String">OMR</Data></Cell><Cell ss:StyleID="Decimal"><Data ss:Type="Number">77.7094</Data></Cell><Cell
Please help me to translate my XML file into SAP format...i need it fixed urgently..
Edited by: Guest101 on Dec 28, 2010 12:11 PMIt has 2 part one is source code and another is the XML file
create an XML file with the data provided in the last 2.
then place it in a path mention the path in the below source.
1. Complete code for converting XML to internal table in SAP.
*& Report ZTST_PGM02
REPORT ZTST_PGM02.
Load iXML Lib.
type-pools: ixml.
class cl_ixml definition load.
data: G_IXML type ref to if_ixml.
data: STREAMFACTORY type ref to if_ixml_stream_factory.
data: ISTREAM type ref to if_ixml_istream.
data: DOCUMENT type ref to if_ixml_document.
data: PARSER type ref to if_ixml_parser.
data: LV_FILE_URL type rlgrap-filename.
You should provide the parameter for file name
LV_FILE_URL = 'D:\navps\input_xml.xml'.
types: begin of XML_LINE,
DATA(256) type x,
end of XML_LINE.
types: begin of TY_HEADER,
CUST_NAME(20) type c,
CARD_NO(20) type c,
TAX_AMOUNT(10) type c,
TOTAL_AMOUNT(10) type c,
end of TY_HEADER.
types: begin of TY_ITEM,
ITEM_NO(4) type n,
ITEM_ID(20) type c,
ITEM_TITLE(50) type c,
ITEM_QTY(10) type c,
ITEM_UPRICE(10) type c,
end of TY_ITEM.
data: GV_HEADER type TY_HEADER.
data: GT_ITEM type standard table of TY_ITEM with header line.
data: XML_TABLE type table of XML_LINE,
XML_TABLE_SIZE type i.
The next step is creating the main factory for the iXML library:
G_IXML = cl_ixml=>create( ).
Now Create Stream Factory
STREAMFACTORY = G_IXML->create_stream_factory( ).
upload a file from the client's workstation
call function 'WS_UPLOAD'
exporting
filename = LV_FILE_URL
filetype = 'BIN'
importing
filelength = XML_TABLE_SIZE
tables
data_tab = XML_TABLE
exceptions
others = 11.
wrap the table containing the file into a stream
ISTREAM = STREAMFACTORY->create_istream_itable( table = XML_TABLE
size = XML_TABLE_SIZE )
Get the file data as Stream
*istream = streamfactory->create_istream_uri( public_id = lv_file_url
system_id = lv_file_url ).
Create XML Document instance
DOCUMENT = G_IXML->create_document( ).
Create parser Object
PARSER = G_IXML->create_parser( stream_factory = STREAMFACTORY
ISTREAM = istream
DOCUMENT = document ).
Parse an XML document into a DOM tree
*parser->parse( ).
Parsing Error Processing
if PARSER->parse( ) ne 0.
if PARSER->num_errors( ) ne 0.
data: PARSEERROR type ref to if_ixml_parse_error,
STR type STRING,
I type i,
COUNT type I,
INDEX type i.
COUNT = PARSER->num_errors( ).
write: COUNT, ' parse errors have occured:'.
INDEX = 0.
while INDEX < COUNT.
PARSEERROR = PARSER->get_error( INDEX = index ).
I = PARSEERROR->get_line( ).
write: 'line: ', i.
I = PARSEERROR->get_column( ).
write: 'column: ', i.
STR = PARSEERROR->get_reason( ).
write: STR.
INDEX = index + 1.
endwhile.
endif.
endif.
Close the stream since it #s not needed anymore
call method ISTREAM->close( ).
clear ISTREAM.
Now try to make it look good
data : lv_size type sytabix,
lv_ret_code type sysubrc.
data: lo_xml_document type ref to cl_xml_document.
field-symbols: <fs_xml_data> type any table.
lo_xml_document = document.
call method lo_xml_document->get_as_table
importing
table = <fs_xml_data>
size = lv_size
retcode = lv_ret_code
*data: items type ref to if_ixml_node_collection.
*items = document->get_elements_by_tag_name( name = 'Item' ).
*data: iterator type ref to if_ixml_node_iterator,
node type ref to if_ixml_node.
*iterator = document->create_iterator( ).
*node = iterator->get_next( ).
*while not node is initial.
do something with the node
node = iterator->get_next( ).
*endwhile.
DATA : GV_NODE type ref to if_ixml_node.
DATA : GV_NODETEXT type STRING.
data: GV_FIRST_TIME.
GV_FIRST_TIME = 'X'.
GV_NODE = DOCUMENT.
GT_ITEM-item_no = 1.
perform GET_DATA tables GT_ITEM
using GV_NODE
changing GV_HEADER.
Last item is still not added.
append GT_ITEM.
write : GV_HEADER-cust_name,
GV_HEADER-card_no,
GV_HEADER-tax_amount,
GV_HEADER-total_amount.
loop at GT_ITEM.
write /:.
write : GT_ITEM-item_no,
GT_ITEM-item_id,
GT_ITEM-item_title,
GT_ITEM-item_qty,
GT_ITEM-item_uprice.
endloop.
FORM Get_data *
form get_data tables YT_ITEM structure GT_ITEM
using value(x_node) type ref to if_ixml_node
changing Y_HEADER type TY_HEADER.
data: INDENT type i.
data: PTEXT type ref to if_ixml_text.
data: STRING type string.
data: TEMP_STRING(100).
case X_NODE->get_type( ).
when if_ixml_node=>co_node_element.
STRING = X_NODE->get_name( ).
GV_NODETEXT = STRING.
when if_ixml_node=>co_node_text.
PTEXT ?= X_NODE->query_interface( IXML_IID_TEXT ).
if PTEXT->ws_only( ) is initial.
STRING = X_NODE->get_value( ).
case GV_NODETEXT.
when 'Customer'.
clear GV_HEADER.
when 'Name'.
move STRING to GV_HEADER-cust_name.
when 'Cardnum'.
move STRING to GV_HEADER-card_no.
when 'Tax'.
move STRING to GV_HEADER-tax_amount.
when 'Total'.
move STRING to GV_HEADER-total_amount.
Iteam details
when 'ID'.
move STRING to GT_ITEM-item_id.
when 'Title'.
move STRING to TEMP_STRING.
move TEMP_STRING to GT_ITEM-item_title.
when 'Quantity'.
move STRING to GT_ITEM-item_qty.
when 'UnitPrice'.
move STRING to GT_ITEM-item_uprice.
endcase.
endif.
endcase.
if GV_NODETEXT = 'Customer'.
clear GV_HEADER.
elseif GV_NODETEXT = 'Item'.
if GV_FIRST_TIME ne 'X'.
append GT_ITEM.
clear : gt_item.
GT_ITEM-item_no = gt_item-item_no + 1.
endif.
GV_FIRST_TIME = ' '.
endif.
Get the next child
X_NODE = x_node->get_first_child( ).
Recurse
while not X_NODE is initial.
perform GET_DATA tables GT_ITEM
using X_NODE
changing GV_HEADER.
X_NODE = x_node->get_next( ).
endwhile.
endform.
Create an XML file with the following DATA given below and place it in the path mentioned above source code.
2. XML File DATA. You create an XML File in this format to test the same.
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
- <Order>
- <Customer>
<Name>Bill Buckram</Name>
<Cardnum>234 234 234 234</Cardnum>
</Customer>
- <Manifest>
- <Item>
<ID>209</ID>
<Title>Duke: A Biography of the Java Evangelist</Title>
<Quantity>1</Quantity>
<UnitPrice>$10.75</UnitPrice>
</Item>
- <Item>
<ID>208</ID>
<Title>100% Pure: Making Cross Platform Deployment a Reality</Title>
<Quantity>1</Quantity>
<UnitPrice>$10.75</UnitPrice>
</Item>
- <Item>
<ID>204</ID>
<Title>Making the Transition from C++ to the Java(tm) Language</Title>
<Quantity>1</Quantity>
<UnitPrice>$10.75</UnitPrice>
</Item>
- <Item>
<ID>202</ID>
<Title>Web Servers for Fun and Profit</Title>
<Quantity>1</Quantity>
<UnitPrice>$10.75</UnitPrice>
</Item>
- <Item>
<ID>210</ID>
<Title>I Think Not: Dukes Likeness to the Federation Insignia</Title>
<Quantity>1</Quantity>
<UnitPrice>$10.75</UnitPrice>
</Item>
</Manifest>
- <Receipt>
<Subtotal>$53.75</Subtotal>
<Tax>$4.43</Tax>
<Total>$58.18</Total>
</Receipt>
</Order> -
Dear friends
For converting XML file to SAP, I used TEXT_CONVERT_XML_TO_SAP function module. In this I have some doubt. Pls clarify this.
1. I am getting run time error with type h.
2 I_FIELD_SEPERATOR = ';'
I_LINE_HEADER =
I_TAB_RAW_DATA =
I_FILENAME =
I_TOTALSIZE =
for the above parameter what are the value has to passed.
Thanks.Hi,
Take a look in this code:
*& Report z_xit_xml_check
REPORT z_xit_xml_check.
TYPE-POOLS: ixml.
DATA: BEGIN OF t_cabec OCCURS 0.
INCLUDE STRUCTURE zmmt2010.
DATA END OF t_cabec.
DATA: BEGIN OF t_item OCCURS 0.
INCLUDE STRUCTURE zmmt2011.
DATA END OF t_item.
DATA: BEGIN OF t_itemt OCCURS 0.
INCLUDE STRUCTURE zmmt2012.
DATA END OF t_itemt.
TYPES: BEGIN OF t_xml_line,
data(256) TYPE x,
END OF t_xml_line.
DATA check_item(1).
DATA check_itemt(1).
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory,
l_parser TYPE REF TO if_ixml_parser,
l_istream TYPE REF TO if_ixml_istream,
l_document TYPE REF TO if_ixml_document,
l_node TYPE REF TO if_ixml_node,
l_xmldata TYPE string.
DATA: l_elem TYPE REF TO if_ixml_element,
l_root_node TYPE REF TO if_ixml_node,
l_next_node TYPE REF TO if_ixml_node,
l_name TYPE string,
l_iterator TYPE REF TO if_ixml_node_iterator.
DATA: l_xml_table TYPE TABLE OF t_xml_line,
l_xml_line TYPE t_xml_line,
l_xml_table_size TYPE i.
DATA: l_filename TYPE string.
PARAMETERS: pa_file TYPE char1024 DEFAULT 'c:\xml.xml'.
START-OF-SELECTION.
PERFORM busca_xml.
PERFORM carrega_tabela.
*& Form get_xml_table
FORM get_xml_table CHANGING l_xml_table_size TYPE i
l_xml_table TYPE STANDARD TABLE.
Local variable declaration
DATA: l_len TYPE i,
l_len2 TYPE i,
l_tab TYPE tsfixml,
l_content TYPE string,
l_str1 TYPE string,
c_conv TYPE REF TO cl_abap_conv_in_ce,
l_itab TYPE TABLE OF string.
l_filename = pa_file.
upload a file from the client's workstation
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_filename
filetype = 'BIN'
IMPORTING
filelength = l_xml_table_size
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. "get_xml_table
*& Form process_dom
FORM process_dom USING document TYPE REF TO if_ixml_document.
DATA: node TYPE REF TO if_ixml_node,
iterator TYPE REF TO if_ixml_node_iterator,
nodemap TYPE REF TO if_ixml_named_node_map,
attr TYPE REF TO if_ixml_node,
name TYPE string,
prefix TYPE string,
value TYPE string,
indent TYPE i,
count TYPE i,
index TYPE i.
DATA v_codcat TYPE zmmt2011-codcat.
DATA v_master_for TYPE zmmt2011-master_for.
node ?= document.
CHECK NOT node IS INITIAL.
IF node IS INITIAL. EXIT. ENDIF.
create a node iterator
iterator = node->create_iterator( ).
get current node
node = iterator->get_next( ).
loop over all nodes
WHILE NOT node IS INITIAL.
indent = node->get_height( ) * 2.
indent = indent + 20.
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
element node
name = node->get_name( ).
TRANSLATE name TO LOWER CASE.
IF name = 'iten'.
MOVE 'I' TO check_item.
ENDIF.
IF name = 'cabec'.
MOVE 'C' TO check_item.
ENDIF.
IF name = 'iten_texto'.
MOVE 'T' TO check_item.
ENDIF.
nodemap = node->get_attributes( ).
IF NOT nodemap IS INITIAL.
attributes
count = nodemap->get_length( ).
DO count TIMES.
index = sy-index - 1.
attr = nodemap->get_item( index ).
name = attr->get_name( ).
prefix = attr->get_namespace_prefix( ).
value = attr->get_value( ).
ENDDO.
ENDIF.
WHEN if_ixml_node=>co_node_text OR
if_ixml_node=>co_node_cdata_section.
text node
value = node->get_value( ).
IF check_item = 'C'.
TRANSLATE name TO LOWER CASE.
CASE name.
WHEN 'lifnr'. MOVE value TO t_cabec-lifnr.
WHEN 'codcat'.
MOVE value TO t_cabec-codcat.
MOVE value TO v_codcat.
WHEN 'bukrs'. MOVE value TO t_cabec-bukrs.
WHEN 'zterm'. MOVE value TO t_cabec-zterm.
WHEN 'waers'. MOVE value TO t_cabec-waers.
WHEN 'inco1'. MOVE value TO t_cabec-inco1.
WHEN 'inco2'. MOVE value TO t_cabec-inco2.
WHEN 'telf1'. MOVE value TO t_cabec-telf1.
WHEN 'verkf'. MOVE value TO t_cabec-verkf.
WHEN 'datav'.
MOVE value TO t_cabec-datav.
APPEND t_cabec.
ENDCASE.
ENDIF.
IF check_item = 'I'.
TRANSLATE name TO LOWER CASE.
CASE name.
WHEN 'master_for'.
MOVE value TO t_item-master_for.
MOVE value TO v_master_for.
WHEN 'werks'. MOVE value TO t_item-werks.
WHEN 'versao'. MOVE value TO t_item-versao.
WHEN 'matkl'. MOVE value TO t_item-matkl.
WHEN 'j_1bindus3'. MOVE value TO t_item-j_1bindus3.
WHEN 'j_1bmatuse'. MOVE value TO t_item-j_1bmatuse.
WHEN 'j_1bmatorg'. MOVE value TO t_item-j_1bmatorg.
WHEN 'j_1bnbmco1'. MOVE value TO t_item-j_1bnbmco1.
WHEN 'bsgru'. MOVE value TO t_item-bsgru.
WHEN 'ekgrp'. MOVE value TO t_item-ekgrp.
WHEN 'txz01'. MOVE value TO t_item-txz01.
WHEN 'epstp'. MOVE value TO t_item-epstp.
WHEN 'netpr'. MOVE value TO t_item-netpr.
WHEN 'peinh'. MOVE value TO t_item-peinh.
WHEN 'meins'. MOVE value TO t_item-meins.
WHEN 'plifz'. MOVE value TO t_item-plifz.
WHEN 'mwskz'. MOVE value TO t_item-mwskz.
WHEN 'steuc'.
MOVE value TO t_item-steuc.
MOVE v_codcat TO t_item-codcat.
APPEND t_item.
ENDCASE.
ENDIF.
IF check_item = 'T'.
TRANSLATE name TO LOWER CASE.
CASE name.
WHEN 'linha'. MOVE value TO t_itemt-linha.
WHEN 'txlng'. MOVE value TO t_itemt-txlng.
MOVE v_master_for TO t_itemt-master_for.
MOVE v_codcat TO t_itemt-codcat.
append t_itemt.
ENDCASE.
ENDIF.
ENDCASE.
advance to next node
node = iterator->get_next( ).
ENDWHILE.
ENDFORM. "process_dom
*& Form Busca_XML
text
--> p1 text
<-- p2 text
FORM busca_xml .
DATA: lc_mess(70) TYPE c,lv_tab.
TYPES: BEGIN OF ty_zvmsgorgtr.
INCLUDE STRUCTURE zmmt2011.
TYPES END OF ty_zvmsgorgtr.
Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
wrap the table containing the file into a stream
l_istream = l_streamfactory->create_istream_itable( table =
l_xml_table size = l_xml_table_size ).
Creating a document
l_document = l_ixml->create_document( ).
Create a Parser
l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
istream = l_istream
document = l_document ).
Parse the stream
IF l_parser->parse( ) NE 0.
IF l_parser->num_errors( ) NE 0.
DATA: parseerror TYPE REF TO if_ixml_parse_error,
str TYPE string,
i TYPE i,
count TYPE i,
index TYPE i.
count = l_parser->num_errors( ).
WRITE: count, ' parse errors have occured:'.
index = 0.
WHILE index < count.
parseerror = l_parser->get_error( index = index ).
i = parseerror->get_line( ).
WRITE: 'line: ', i.
i = parseerror->get_column( ).
WRITE: 'column: ', i.
str = parseerror->get_reason( ).
WRITE: str.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
ENDFORM. " Busca_XML
*& Form Carrega_Tabela
text
--> p1 text
<-- p2 text
FORM carrega_tabela .
Process the document
IF l_parser->is_dom_generating( ) EQ 'X'.
PERFORM process_dom USING l_document.
ENDIF.
ENDFORM. " Carrega_Tabela -
Custom panels for File Info.
Hi, everydoby.
This is my first post to this group and I wanted to say hello to everybody. Hello !!!
While doing some reading on Adobe's site I came across an application named Configurator 1.0. This application allows users to develop custom panels for Photoshop and it seems to design custom menus for the interface. I am interested in finding out if it can be used to design custom File Info panels for Photoshop. In case it can't is there another application that can do it and has a GUI that makes it easy to use and simple for someone with little programming experience ?
Thank you,
JoeHello, Michael.
I think you are right.
I've looked at the Adobe's website for information on how to build these panels and it seems far more complicated then it should be. Unfortunately Adobe doesn't seem to get that most users are NOT programmers. The information is complex and extensive, far more than it should be for someone who just wants to add a little amount of customization to his/her applications.
My idea was to find a simple GUI application that would allow the average user (myself) to create custom panels for the File Info menu option but one such application doesn't seem to be available. The options are to either immerse myself in the time-consuming, technically-demanding documentation available in the company's website or give up the project entirely.
Thanks again for your help.
Joe Caldwell. -
Converting XML to String in OSB
Hi All,
Is there any function (apart from fn-bea:serialize function) for converting XML payload to a String in OSB. Please let me know.
Thanks,
BpeltechieThat's how it's worded by W3C
http://www.w3.org/TR/REC-xml/#syntax
The ampersand character (&) and the left angle bracket (<) must not appear in their literal form, except when used as markup delimiters, or within a comment,
a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the
strings " & " and " & lt; " respectively. The right angle bracket (>) may be represented using the string " & gt; ", and must, for compatibility, be
escaped using either " & gt; " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end
of a CDATA section.Note that it says left angle bracket must not appear in their literal form, but the right angle bracket may be represented using the string " &gt; "
Cheers,
Vlad -
Special charecters handling while Converting XML string to DOM
Hi,
I am using the following approach for converting XML string to DOM, but due to Special characters like "&", I am getting Exceptions:
String xmlString;
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xmlString)));
Can anyone please help me out on how to handle the Special characters in the above code.If the XML doesn't parse, then the XML must be invalid. Show a sample of such a special character in the XML data. Please use \ tags to post the actual XML content and any other code.
-
Hi All,
Can you please let me know for any sample code in xslt/java mapping for converting XML string into XML. We use SAP Pi 7.0
My XML string starts like this
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_ReceiverFileStructure <namespace>"><Output><?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<xsl>"?><Tarih_Date Tarih="11.09.2014" Date="09/11/2014>
Thanks,
PavithraThanks Praveen. It worked.
However, the xml i have is an extract from a exchange rate URL and it has the reference to a xsl in it as below
<?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<ABC.xsl>"?>.
So there is an error in sxmb_moni. Is it possible to remove this.
Maybe you are looking for
-
Hi, I have mirrored build of two identical 1TB HDD in my Xserve Late 2006 (RAID 1) in Bay 2 and Bay3. When I took one HDD out and connected it as an external drive to my MacBook Pro, only the first partition appeared. That is, for instance, I have RA
-
How do I get a document from pages on my iPad off my MAC
I have just taken on icloud. how do I get a pages document off my ipad and put it on my MAC? Do I still need to connect the two devices?
-
Delete Workitems in PI 7.1 at Transaction SXMB_MONI_BPE
Hello, I am new here and working at an integration process at PI 7.1. While testing it, only one process instance produced many many workitems with status completed. I recognized that all trials to start a new process instance failed, because the pro
-
HT1918 'Payment processing is temporarily unavailable. Please try again later'
Does anyone know how this can be fixed. Desperate to download and use a specific app.
-
My wife has an Ipad 2 and I recently purchased a new Ipad; she now wants to swap Ipads! If we do swap how to we change the account details on each Ipad?