Group columns in Excel using XSLT simple transformation
Hi All,
I have to group a few columns in the excel so that they can be expanded or collapsed. I am transforming an internal table into XML using Simple transformation. In this XSLT, I need to add the code to group the particular columns together in the final excel.
Can any one please help me in acheiving the columns grouped together.
Thanks and Regards,
Vishnu.
Edited by: Vishnu Kare on Mar 24, 2011 7:22 AM
Hi Vishnu, I am also using simple transformations (not XSLT) to create XML excel from SAP data. I always create a template excel workbook from excel by saving it as XML file. This XML can be pasted into the SAP transformation without completely understanding the Microsoft excel syntax. The dynamic SAP data then can be included to the XML in the transformation.
Regards Jack
Similar Messages
-
Auto fit columns in excel using open xml
I have generate excel using open xml and it contain auto fit property for columns. my problem is that the excel is opening very well in kingsoft spreadsheets
and other tools, but not opening in microsoft excel 2013 and older version. Is there any solution for auto fit columns in excel using open xml and should open in Microsoft excel all versionHi Raj12345,
>> I have generate excel using open xml and it contain auto fit property for columns. my problem is that the excel is opening very well in kingsoft spreadsheets and other tools, but not opening in microsoft excel 2013 and older version
I assume you was using OpenXML SDK and I'm afraid we are not able to find the root cause according to your description, would you mind sharing us some code sample to reproduce this issue.
>> Is there any solution for auto fit columns in excel using open xml and should open in Microsoft excel all version
As far as I know, there is no auto fit property for columns in excel with openxml. I am afraid that you need to calculate the column width depending on the cell contents, and then set the column width. The link below shows more details:
# Solution: How to AutoFit Excel Content
https://social.msdn.microsoft.com/Forums/office/en-US/28aae308-55cb-479f-9b58-d1797ed46a73/solution-how-to-autofit-excel-content?forum=oxmlsdk
Best Regards,
Edward
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. -
How do I autosize columns in Excel using ActiveX in Labview
I found the ExcelExamples.llb but nothing that describes this. My data is sometimes bigger than the default column width.
thanksHow about using a macro to run the column autosize function?
I cheated, and recorded an autosize operation on a column, and then looked at the vb code behind the macro...
Columns("D").EntireColumn.AutoFit
should do the trick.
In the excelexamples.llb, they seem to use macros to perform other functions, so maybe this is a way to achieve the autosize function that you require.
Hope this helps...
JB -
Simple Transformation for XML created by Excel
Hello,
Excel can produce XML files quite easily in this documented format:
http://msdn.microsoft.com/en-us/library/aa140062(office.10).aspx
(in excel: file --> save as and choose XML)
Does someone has an idea of how I can read this XML using a Simple Transformation in ABAP?
Example: if this is an excel sheet with 3 columns and 3 lines
¦----
¦
¦ PERNR ¦ BEGDA ¦ ANZHL ¦
¦----
¦
¦ 12346 ¦ 20.02.2009 ¦15 ¦
¦----
¦
¦ 2356 ¦ 25.02.2009 ¦12 ¦
¦----
¦
this is the XML
The goal would be to transform this XML into an internal table. Any idea is appreciated.
Koen Van LoockeHi Keon,
Please find the below link
[Help|http://help.sap.com/abapdocu/en/ABAPCALL_TRANSFORMATION.htm]
[Help|http://help.sap.com/abapdocu/en/ABENABAP_ST.htm]
Please find the code below
[Code|https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/exportingdatatoExcel-XMLtotherescue]
Thanks
Kalyan -
Simple Transformation from ABAP to XML and back
Hi experts,
Can anyone provide me a simple example of a 'simple transformation' that will convert and internal table with more than one column into XML via a simple transformation.
I've spend days now reading SAP help and e-learning examples, but this just won't work and I am getting short dumps saying 'The goal was to access variable "ROOT". However, this access was notv possible.'
Here is my ABAP:
data: begin of struc,
counter type i,
aname type string,
aname2 type string,
end of struc.
data: cnt_c type c.
data: itab like table of struc with HEADER LINE,
xml_string type xstring.
do 3 times.
move sy-index to: itab-counter, cnt_c.
concatenate 'nameA' cnt_c into itab-aname.
concatenate 'nameB' cnt_c into itab-aname2.
append itab.
enddo.
CALL TRANSFORMATION Z_ST_TEST5
SOURCE ROOT = itab
RESULT XML xml_string.
CALL FUNCTION 'DISPLAY_XML_STRING'
EXPORTING
XML_STRING = xml_string.
skip 1.
and here is my ST:
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="ROOT"/>
<tt:template>
<TABLE>
<tt:loop ref=".ROOT" name="line">
<ITEM>
<counter>
<tt:value ref="$line.aname" />
</counter>
<name>
<tt:value ref="$line.aname" />
</name>
<name2>
<tt:value ref="$line.aname2" />
</name2>
</ITEM>
</tt:loop>
</TABLE>
</tt:template>
</tt:transform>Figured it out. The interla tables used in teh call transformation statement can never have a header line.
-
Export to excel using MDM WebDynPro Configurator
Hi,
I am developing an application using MDM WDC and need to display Export to excel button with corresponding functionality.Is there an API available to do the same? Is it possible to get the search results details in the excel sheet while using MDM WDC?
version used is MDM 7.1 SP06 and NWCE 7.2 .
Regards,
Apoorva Daveit is standard function of mdm wd component.
we are in MDM 7.1 SP5, the api only gives you the string of the selected record in xml format.
i am using xslt to transform the xml as user are not happy with the standard export. -
How can I show groupped columns inisde Diadem report ?
Hi,
I am trying to show some values inside a Diadem report. I must show then in a similar way as "groupped columns" inside Excel, comparing different values in columns, just one columns next to the other one, but I do not know how I can manage it inside Diadem. With "bar" and outlined bars, all the columns are located at the same X point, so it is not the same as in Excel. How could I compare values of differet columns?
Thanks for your collaborationHi koniker,
Do you mean Y offset? If so, you can do it, but it's not a built-in feature, so again, you would have to shift the Y values up or down by Delta with the FormulaCalculator prior to graphing.
Normally multiple values occurring at the same X axis point are displayed either as lines and/or symbols. Bar graphs come up occasionally in DIAdem, but they're much more important for business graphing needs, thus the strong support of them in Excel.
What's your use-case? Are bar graphs the only acceptable choice? I can create and send you VBScript code to shift the bars either in the X direction or the Y direction, as you wish, if that's the optimal diplay. It just won't be a built-in feature.
Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments -
Simple Transformation with very long XML element names
I am trying to write a program to deserialize XML documents using the Simple Transformation technique. There are many optional elements in the XML document, so I need to have conditional statements statements to avoid trying to process elements that are not in the document. The XML document, however, has several Element Names that are greater than 30 characters in length. The Simple Transformation technique seems to require ABAP data dictionary structures that mirror the schema of the XML document. But one cannot create structure component names that are greater than 30 characters in length. We don't have any control over the XML schema as the XML documents come from the US government. The ST fragment below shows the statement that I want to write, but since the ABAP Structure PlasticCardInformationGroup cannot have a component AuthorizationResponseInformation, the ST syntax checker yields an "Illegal Reference ADDITIONALPLASTICCARDINFORMATION" error message.
Does anyone know a way to avoid this error?
<tt:d-cond check="exist(TRS_TradingPartner_Agreement.TRS_FinancialTransaction.PlasticCardInformationGroup.AdditionalPlasticCardInformation)">
<ns2:AdditionalPlasticCardInformation>
<tt:attribute name="CardNetworkType" value-ref="TRS_TRADINGPARTNER_AGREEMENT.TRS_FINANCIALTRANSACTION.PLASTICCARDINFORMATIONGROUP.ADDITIONALPLASTICCARDINFORMATI.CARDNETWORKTYPE"/>
<tt:attribute name="DraftLocatorNumber" value-ref="TRS_TRADINGPARTNER_AGREEMENT.TRS_FINANCIALTRANSACTION.PLASTICCARDINFORMATIONGROUP.ADDITIONALPLASTICCARDINFORMATI.DRAFTLOCATORNUMBER"/>
</ns2:AdditionalPlasticCardInformation>could anyone help me?
-
Alignment of Columns in Excel when sent as an attachement
Hi,
I am using below code to send the output of ALV via email as an attachment.
data : lv_variant type sy-slset value 'VARIANT',
lt_list type table of abaplist,
lt_0167_body type standard table of soli,
ls_body_raw type soli,
lt_txt type soli_tab.
data: ls_string type text2048,
lt_objbin type soli_tab,"Attachment of EMail
lt_objbinx type solix_tab,"Attachment of EMail
lv_dlist type so_obj_nam,
lv_bdate type char10,
lv_edate type char10,
lv_title type char40.
submit ztest using selection-set lv_variant exporting list to memory and return.
call function 'LIST_FROM_MEMORY'
tables
listobject = lt_list "Binary data
exceptions
not_found = 1.
call function 'LIST_TO_TXT'
tables
listtxt = lt_txt
listobject = lt_list
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
move 'test' to ls_body_raw.
append ls_body_raw to lt_0167_body.
lt_0167_body[] = lt_0167_body[].
data :
l_hex type solix,
conv type ref to cl_abap_conv_out_ce,
l_buffer type xstring,
l_hexa(510) type x.
loop at lt_txt into ls_string.
conv = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' endian = 'B').
call method conv->write( data = ls_string ).
l_buffer = conv->get_buffer( ).
move l_buffer to l_hexa.
move l_hexa to l_hex-line.
append l_hex to lt_objbinx.
endloop.
call method ztest=>send_mail
exporting
it_errormessages = lt_0167_body
iv_type = 'RAW'
iv_dist_list = 'DLIST' "distribution list
iv_subject = 'test'
lv_attachment_type = 'XLS'
lv_attachment = lt_objbinx
lv_attachment_name = 'Test'
exceptions
bcs_fault = 1
tvarv_not_maintained = 2
others = 3
here my custom method send_mail is working properly it is sending whatever is coming in lt_objbinx as excel, only problem in the excel columns and column values are not aligned properly.
please suggest how can i align columns inside excel using abap code, send mail is actaully using cl_bcs and related classes for sending e-mail.
Thanks,
kranthi.Hi change the below sample as per your requirement.
<unreadable code removed by moderator>
Regards
chitra
Moderator message: please post only relevant code parts, your posts must contain less than 5000 characters to preserve readable formatting.
Edited by: Thomas Zloch on Nov 15, 2011 1:03 PM -
Person or Group column problem
Hi, I have quite tricky problem with Person or Group column. We use that column in quite many places. When I create new item or edit list item properties I can find person just fine for example with lastname and choose it but when I save that
item the persons name changes to someone else of our users.
What I noticed is that if I search person with beginning of their email address (firstname.lastname) everything is good even after I save the item. With some persons it works even if I find them with lastname.
Is there something to do with users ID in Site Collection hidden user information list vs User Profile Database?
Any ideas. Thank you.
MiikkaHi Miikka,
can you try cleaning up the user information list via powershell and reconfigure the userprofile sync. following url contains the powershell script for user information clean up
http://blog.fpweb.net/how-to-clean-up-sharepoint-user-information-list-with-powershell/#.VPrbn_mUeSo
Regards Roy Joyson
Please remember to mark your question as "answered"/"Vote helpful" if this solves/helps your problem.
Roy Joyson -
Delete a column in excel sheet through POI?
hi
Can anyone help me out on physically deleting a column in Excel using POI framework?
Though I am able to remove indidual cells,the cells remain blank. I want them be completly removed from the sheet.
pls helpSoph wrote:
hi
Can anyone help me out on physically deleting a column in Excel using POI framework?
Though I am able to remove indidual cells,the cells remain blank. I want them be completly removed from the sheet.
pls helpCan you do it in the Excel in your PC? I bet not
Then you are able to help me how to generate a chart in Excel using POI :D :D
But first, where to download POI library, Thanks
{EDIT} found it never mind
Edited by: mycoffee on Jul 1, 2010 12:15 PM -
Fieldcatalog to Excel using Simple transformation
Hi guys.
I have tried to sort out how to write own simple transormations but i've got problems along before i had expected.
The task is to make an XML file, that can be opened with Excel and it must contain row with column names of some dictionary table. The code is pretty simple:
REPORT ZJDTEST33.
parameters: p_tabnam type tabname matchcode object DD_DBTB,
p_file type string default 'C:\data\test.xls'.
data: gt_fcat type lvc_t_fcat,
gd_xml type string,
gt_xml type table of string.
start-of-selection.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = p_tabnam
CHANGING
ct_fieldcat = gt_fcat.
end-of-selection.
call transformation ztest_simple
SOURCE fieldcat = gt_fcat
RESULT XML gd_xml.
refresh gt_xml.
APPEND gd_xml TO gt_xml.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = p_file
filetype = 'ASC'
changing
data_tab = gt_xml.
This is transformation itself:
<?sap.transform simple?>
<?mso-application progid="Excel.Sheet"?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates"
xmlns:ddic="http://www.sap.com/abapxml/types/dictionary">
<tt:root name="fieldcat" line-type="ddic:LVC_S_FCAT"/>
<tt:template>
<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"
xmlns:html="http://www.w3.org/TR/REC-html40">
<Worksheet ss:Name="Sheet1">
<Table>
<Row>
<tt:loop ref=".fieldcat">
<Cell>
<Data ss:Type="String">
<tt:value ref="SCRTEXT_M"/>
</Data>
</Cell>
</tt:loop>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<Selected/>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>
</tt:template>
</tt:transform>
Edited by: Petr.Plenkov on Nov 3, 2009 9:07 AMFinally, i've got the reason. If somebody has the same problem, just change the encoding manually into a string.
replace first occurrence of 'utf-16' in ld_xmlstr with 'windows-1251'.
Edited by: Petr.Plenkov on Nov 3, 2009 12:37 PM -
XML to Nested Itab using Simple Transformation
Hi there is there any experts there who can show me an example of Transforming a XML to a Nested Internal Table using Simple Transformation?
I have tried this the program from the blog by
Tobias Trapp
<a href="/people/tobias.trapp/blog/2005/05/04/xml-processing-in-abap-part-1:///people/tobias.trapp/blog/2005/05/04/xml-processing-in-abap-part-1
but I have encountered this error
Runtime Errors ST_REF_ACCESS
Exception CX_ST_REF_ACCESS
1 <?sap.transform simple?>
2 <tt:transform template="temp1"
3 xmlns:tt="http://www.sap.com/transformation-templates">
4 <tt:root name="ROOT"/>
5 <tt:template name="temp1">
>>>> <tt:loop ref=".ROOT" name="a">
7 <A>
8 <name>
9 <tt:value ref="$a.name" />
10 </name>
11 <ZLS>
12 <tt:loop ref="$a.zls" name="z">
13 <Z>
14 <tt:value ref="$z.nummer" />
15 </Z>
16 </tt:loop>
17 </ZLS>
18 </A>
19 </tt:loop>
20 </tt:template>
21 </tt:transform>
Anyone knows whats wrong?I had to pass an XSLT program in the transformation statement.
-
Creation of Excel files using XSLT
Hi frnds,
From the blog provided by the Michal
/people/michal.krawczyk2/blog/2005/12/10/xi-generating-excel-files-without-the-java-nor-the-conversion-agent-not-possible
I came to know that we can create excel files using XSLT mapping but here inthis blog the example provides creation of only one column but I have a scenario where in I want 3 columns ex:Name,Age,***
Shiva 26 Male
Ravi 25 Male
Rani 24 Female
but using the code provided in Michal blog Im getting the output as
Shiva
26
Male
Ravi
25
Male
Rani
24
Female
Can anyone help me in modifying the code given in Michal blog to get the output as required.
Please share your ideas or suggestion onthis...
Thanks in advance,
Shiva.Please change the code as
<xsl:template match="file_SDN/recordset/data/*">
<Row>
<Cell>
<Name ss:Type="String">
<xsl:apply-templates/>
</Name>
<Age ss:Type="Integer">
<xsl:apply-templates/>
</Age>
<*** ss:Type="String">
<xsl:apply-templates/>
</***>
</Cell>
</Row>
</xsl:template> -
HI Experts,
I have a scenario. Import IDOC into PI and PI transform IDOC to Excel. Using mail adapter attach that Excel using pi and send to vendor. Can you please help me on the same?
Thanks
SaiSreevastavHi Sai,
you can use XSLT or java mapping or adapter module to convert IDOC xml to XLS. Please refer the below blog
Convert incoming XML to Excel or Excel XML – Part 1 - XSLT Way
Convert incoming XML to Excel Sheet Part 2 – Adapter Module way
Convert incoming XML to Excel Sheet
then after converting to Excel, you can use the payloadswap bean in mail adapter
XI: Sender mail adapter - PayloadSwapBean - Step by step
regards,
Harish
Maybe you are looking for
-
Payment Posting - Replacing a direct deposit with a check
Dear Experts, I need your advise on the following: Running SAP ECC 6.0 and gross to net payroll. The net pay wage type is posted to different account based on payment method (Direct deposit or check). In instances where the employee has provided a wr
-
Templates: created pages have different html
I'm using Dreamweaver MX04 (7). I have created a template from an HTML page. When I go to apply that template to a new HTML page, the resulting templated page has goofs in the HTML that were not existing in the template's html. For example, sections
-
Hi Need clarification Difference between VTTK -TDLNR ( Forwading Agent/Vendor ) and VBPA -LIFNR Rohit
-
HAL seems to have broken after update. (SOLVED)
I'm not sure what happened, but after updating arch recently CD's, DVD's, and USB drives/sticks are not available. They "seem" to mount themselves as before, as they show up in gnome, but they are inacessible, clicking on any icon for them brings not
-
Allow VPN client to connect from the inside to another remote network
Hi, if I have a Cisco VPN client software on the inside of network and client is to connect to a remote network, over the internet. What ports need to be opened and on the outside interface/inside/both? Thanks.