tag:blogger.com,1999:blog-2969448813572355764.post6718667228295225889..comments2023-12-07T16:22:19.851+00:00Comments on Archived : Passionate about SAP - A Blog: Generate Simple Transformation for XML in ABAP - Part IIRamhttp://www.blogger.com/profile/07793995838001318320noreply@blogger.comBlogger29125tag:blogger.com,1999:blog-2969448813572355764.post-34763829070627792702017-09-27T13:52:08.966+01:002017-09-27T13:52:08.966+01:00First link needs authentification user/pw (for wha...First link needs authentification user/pw (for what?)<br />Second link is broken (as so often with sap.com)Clemenshttps://www.blogger.com/profile/14282458898188590486noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-79583126752996748262016-08-26T10:20:38.263+01:002016-08-26T10:20:38.263+01:00Hi,
I am trying to generate a ST for converting X...Hi,<br /><br />I am trying to generate a ST for converting XML data into ABAP. For simple data, we are able to create the ST and use it for XML to ABAP and vice versa. But in case the XML has 1000 tags and we need just 300 tags out of it, is it possible to create an ST for this transformation. <br />Currently when we try to create an ST for a smaller XML and if we miss out any fields in it, the transformation gives an error during processing with the message expecting 'xxxxx' field. <br />Is there a way to avoid having to create a complex hierarchical ABAP Structure with 1000 fields when we need only 300 fields out of the xml?VKhttps://www.blogger.com/profile/01315511632734484461noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-53728596863161618232014-02-26T14:22:57.528+00:002014-02-26T14:22:57.528+00:00XML code did not come through in the comment so n...XML code did not come through in the comment so not really sure but ..as mentioned in my previous comment :<br />-------------------<br />See this post as an example for generating simple transformation for a complex structure : <a href="http://sapblog.rmtiwari.com/2014/01/prototyping-abap-odata-entity-data.html" rel="nofollow">Prototyping an ABAP OData Entity Data Model Generator </a> . Basically you'll need to create the ABAP deep-structure as per the XML hierarchy that you want to generate.<br /><br />You can remove the additional name of the table-type ( that is not required ), by dragging table icon ( just below the table-type-name ) on the table-type-name and then delete the table-type-name node. also it should be easy to just remove not-required table-type/structure-names manually from the generated code.Ramhttps://www.blogger.com/profile/07793995838001318320noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-47940006782531008602014-02-26T14:05:22.994+00:002014-02-26T14:05:22.994+00:00Hello,
Thanks for this blog; very useful and hand...Hello,<br /><br />Thanks for this blog; very useful and handy<br /><br />I need to produce an XML for a vendor that has many invoices with many items. The xml should be like this:<br /><br /><br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /><br />How should I proceed. I have been able to get the following. I am unable to group the items under the same invoice. Thanks for your helps.<br /><br />- <br />- <br /> 10001 <br />- <br /> 001 <br /> 000010 <br /> <br /> <br /> <br />- <br />- <br /> 10001 <br />- <br /> 001 <br /> 000020 <br /> <br /> <br /> Anonymoushttps://www.blogger.com/profile/11085372088395674895noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-14591892710749505842014-01-11T23:45:16.737+00:002014-01-11T23:45:16.737+00:00See this post as an example for generating simple ...See this post as an example for generating simple transformation from a very complex structure : <a href="http://sapblog.rmtiwari.com/2014/01/prototyping-abap-odata-entity-data.html" rel="nofollow"> Prototyping an ABAP OData Entity Data Model Generator </a>Ramhttps://www.blogger.com/profile/07793995838001318320noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-1975665955588743652013-11-23T09:56:49.725+00:002013-11-23T09:56:49.725+00:00Did you get any solution,I have the same requireme...Did you get any solution,I have the same requirement.<br />Thanks in advance.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-57888656730823230242013-10-31T11:53:58.260+00:002013-10-31T11:53:58.260+00:00Hello Ram,
The example is very informative , than...Hello Ram,<br /><br />The example is very informative , thanks for such a nice documentation. But in the report program the function 'SCOL_TRACE_SHOW_XML' is not described any where . Could you plesas describe the function.<br /><br />With Regards,<br />Jawahir Kashimcreativehttps://www.blogger.com/profile/13383422796393771913noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-3141341087923941672013-10-02T21:40:12.383+01:002013-10-02T21:40:12.383+01:00Do you know if we can customize the format of the ...Do you know if we can customize the format of the date/time? My requirement is not YYYY-MM-DD and DD/MM/YYYY.<br />Thank you in advance.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-34008415949978370592013-08-18T11:49:05.502+01:002013-08-18T11:49:05.502+01:00Great work, thank youGreat work, thank youAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-52468961791600117232013-05-08T21:29:03.072+01:002013-05-08T21:29:03.072+01:00Hi to everyone.
We have an implementation in my j...Hi to everyone.<br /><br />We have an implementation in my job that needs to hide fields on an xml transformation.<br />Is there any way to change an additional attribute of a field to hide it?<br /><br />Regards<br />Matías<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-517123656502389162013-03-08T10:45:44.456+00:002013-03-08T10:45:44.456+00:00Hi Ram,
Is their a way we can have these xml tags ...Hi Ram,<br />Is their a way we can have these xml tags generated as a mix and match of upper case and lower case when downloaded from SAP..To give you an example :<br /><br />Addtional attributes<br /><br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-62055138361204378872012-10-14T17:57:29.410+01:002012-10-14T17:57:29.410+01:00See latest post on how to automatically generate S...See latest post on how to automatically generate Simple Transformation for a given XML/XSD. <a href="http://sapblog.rmtiwari.com/2012/10/power-of-core-using-xsd-for-xml.html" rel="nofollow">Power of the Core : Using XSD for XML Transformation in ABAP</a>Ramhttps://www.blogger.com/profile/07793995838001318320noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-9072624394346451842012-06-20T09:46:07.183+01:002012-06-20T09:46:07.183+01:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/10798827096064117414noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-79221839266844641902012-05-15T08:25:13.207+01:002012-05-15T08:25:13.207+01:00Very useful blog. I want to remove the header . I...Very useful blog. I want to remove the header . Is it possible through IXML way?Madhurihttps://www.blogger.com/profile/12211587692972509323noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-45679271315844109372012-05-10T06:16:55.010+01:002012-05-10T06:16:55.010+01:00Hi,
I need to generate an XML of format .
A 1 2 ...Hi,<br /><br />I need to generate an XML of format .<br /><br />A 1 2 3<br /> 2 2 2<br /> 3 3 3<br />B 1 1 1<br /> 2 2 2<br />C 3 3 3<br /><br />So I created a Deep Structure Table type with table type Inside.<br /><br />But when i am Calling the transformation in program it throwing an error in german.<br />Simple Transformations transformieren nur von ABAP nach XML und umgekehrt. <br /><br />Kindly helpDwityhttps://www.blogger.com/profile/11431676293024074442noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-88630398929881841492012-04-18T21:09:48.877+01:002012-04-18T21:09:48.877+01:00Seems like your xml code did not come through in t...Seems like your xml code did not come through in the comment as it does not accept the code..in any case, please check the 2nd example in sap help link regarding namespace in ST.<br /><br /><tt:namespace name="abc" /><br /><br />http://help.sap.com/saphelp_nwpi71/helpdata/en/63/6a20401fe52402e10000000a1550b0/content.htmRamhttps://www.blogger.com/profile/07793995838001318320noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-79024590638981780182012-04-18T16:55:38.266+01:002012-04-18T16:55:38.266+01:00Hi,
I would like to keep in my defined namespaces...Hi,<br /><br />I would like to keep in my defined namespaces such as in my output file:<br /><br /><br /><br />But when I call transformation xml output doesn't have any defined namespace. For example:<br /><br /><br />This is the output:<br /><br /> <br /> <br /> <br /> 12345678 <br /> <br /> WARWICK <br /> <br /> cccc <br /> xxxxxxx <br /> <br /> <br /> 99999999 <br /> <br /> PACO <br /> <br /> DDDD <br /> AAAA <br /> <br /> <br /><br />And I would like to have something like:<br /><br /> <br /> <br /> <br /> 12345678 <br /> <br /> WARWICK <br /> <br /> cccc <br /> xxxxxxx <br /> <br /> <br /> 99999999 <br /> <br /> PACO <br /> <br /> DDDD <br /> AAAA <br /> <br /> <br /><br />Where node defined namespace is still in the xml file. How can I get this?<br /><br />Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-7782643920405523052012-03-22T21:50:46.492+00:002012-03-22T21:50:46.492+00:00For changing XML encoding, try this one below :
...For changing XML encoding, try this one below : <br /><br />It's using xstream so I guess we don't need to change the content encoding. Only the XML header encoding change is required. <br />Now ST seems to output UTF-8 encoding only. Hence I am cheating a bit by using standard XSLT ID to convert XML to XML as post-processing & in the process setting the encoding as required.<br /><br />REPORT z_test_ram_xml.<br /><br />* complex structure example<br />DATA : lt_itab TYPE ldapaltab,<br /> wa_itab LIKE LINE OF lt_itab ,<br /> lt_val TYPE valtabc,<br /> wa_val LIKE LINE OF lt_val .<br /><br />DATA: gv_xml_xstring TYPE xstring.<br />DATA: gv_final_xml_xstring TYPE xstring.<br /><br />* <<< Populate Example data in complex struture itab<br /> wa_itab-name = 'header1'.<br /> wa_itab-typ = 'header2'.<br /> wa_itab-operation = 'header3'.<br /><br /> wa_val-val = 'Hi'.<br /> APPEND wa_val TO wa_itab-vals.<br /> wa_val-val = 'How r you'.<br /> APPEND wa_val TO wa_itab-vals.<br /><br /> APPEND wa_itab TO lt_itab.<br />*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><br />* This is the main ST call.<br /> CALL TRANSFORMATION z_test_ram<br /> SOURCE ldap_table = lt_itab[]<br /> RESULT XML gv_xml_xstring.<br />*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><br />* Now a Bit of cheating - to get the encoding we'll use standard XSLT ID<br />* rather than ST - not required if you need Default UTF-8 from ST<br /><br /> DATA :go_ixml TYPE REF TO if_ixml,<br /> go_stream_factory TYPE REF TO if_ixml_stream_factory,<br /> go_encoding TYPE REF TO if_ixml_encoding,<br /> go_resstream TYPE REF TO if_ixml_ostream.<br /><br /> CONSTANTS: gc_encoding TYPE string VALUE 'UTF-16'. "or UTF-8 etc.<br /><br /> go_ixml = cl_ixml=>create( ).<br /> go_stream_factory = go_ixml->create_stream_factory( ).<br /> go_encoding = go_ixml->create_encoding( character_set = gc_encoding byte_order = 0 ).<br /> go_resstream = go_stream_factory->create_ostream_XSTRING( gv_final_xml_xstring ).<br /><br /> CALL METHOD go_resstream->set_encoding( go_encoding ).<br /><br /> CALL TRANSFORMATION ID<br /> SOURCE XML gv_xml_xstring<br /> RESULT XML go_resstream.<br /><br /> cl_salv_data_services=>download_xml_to_file(<br /> filename = 'C:\z_test_ram_xml_file.xml'<br /> xcontent = gv_final_xml_xstring ).<br /><br /><br />*-----------------------<br />If you need the ST Z_TEST_RAM is again generated through the tool as below:Ramhttps://www.blogger.com/profile/07793995838001318320noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-48043438414420054132012-03-20T08:55:35.789+00:002012-03-20T08:55:35.789+00:00Hi,
how can you set or change the encoding?Hi, <br />how can you set or change the encoding?Claudiohttps://www.blogger.com/profile/13219782314872514337noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-79290459408887828632011-09-29T15:54:05.776+01:002011-09-29T15:54:05.776+01:00Thanks for this step by step explanation on how to...Thanks for this step by step explanation on how to generate simple transformation for xml in ABAP. It helped me a lotSAP jobshttp://www.sapjobfinder.comnoreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-51872957256815059562011-09-19T13:54:44.701+01:002011-09-19T13:54:44.701+01:00How to change the tag, mean to say suppose i want ...How to change the tag, mean to say suppose i want to have the tag like ".Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-42522519393153250152011-07-03T23:19:14.939+01:002011-07-03T23:19:14.939+01:00In 4.7, you can use XSLT or iXML library instead o...In 4.7, you can use XSLT or iXML library instead of ST ( simple transformation). <br /><br />- iXML example http://passionateaboutsap.com/rmtiwari/Resources/MySolutions/Dev/UtilityCode.html#7<br /><br />- XSLT [ http://help.sap.com/saphelp_nw04/helpdata/en/a8/824c3c66177414e10000000a114084/frameset.htm ]<br /><br />If you need quick response, I would suggest to ask such questions in forums like http://sdn.sap.com .<br /><br />Thanks,<br />RamRamhttps://www.blogger.com/profile/07793995838001318320noreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-38021987471537955052011-06-29T02:58:38.977+01:002011-06-29T02:58:38.977+01:00Can this be done in SAP 4.7? If not, any manual me...Can this be done in SAP 4.7? If not, any manual methods to go around with the steps?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-70851902359186863172011-04-07T09:28:56.655+01:002011-04-07T09:28:56.655+01:00Génial ! Even for a french developper !Génial ! Even for a french developper !Finjissenoreply@blogger.comtag:blogger.com,1999:blog-2969448813572355764.post-74850669613453065662010-07-17T05:26:04.140+01:002010-07-17T05:26:04.140+01:00It Is A Great WorkIt Is A Great WorkAnonymousnoreply@blogger.com