<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem in Allignment in .XLS sheet in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089201#M1507022</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am downloading one Report in ALV. It is coming perfect but at the same time I am supposed to send the same report in .XLS format to send mail for User when the program runs in Background. When the program is in Foreground o/p is in ALV and in Back ground it is in .XLS.&lt;/P&gt;&lt;P&gt;For this purpose I have used following FM's &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) EFG_GEN_GET_USER_EMAIL - To validate Recepient&lt;/P&gt;&lt;P&gt;2) SO_DOCUMENT_SEND_API1 - To send mail.&lt;/P&gt;&lt;P&gt;.XLS data is Concatenated in internal table. The o/p in ALV is coming perfect but in .XLS it is wrong in allignment.&lt;/P&gt;&lt;P&gt;First Field 'Price group' is displayed in Zigzag manner. It means, Line is not ended perfectly.Other fields are displayed perfectly.&lt;/P&gt;&lt;P&gt;Can you please guide me in this I am writing code here used for concatatenation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE t_final-konda&lt;/P&gt;&lt;P&gt;                t_final-kondm&lt;/P&gt;&lt;P&gt;                t_final-matnr&lt;/P&gt;&lt;P&gt;                t_final-maktx&lt;/P&gt;&lt;P&gt;                w_tmp_atinn&lt;/P&gt;&lt;P&gt;                t_final-atnam&lt;/P&gt;&lt;P&gt;                t_final-carpo&lt;/P&gt;&lt;P&gt;                t_final-atwrt&lt;/P&gt;&lt;P&gt;                t_final-atwtb&lt;/P&gt;&lt;P&gt;                w_tmp_kbetr&lt;/P&gt;&lt;P&gt;                w_tmp_konwa&lt;/P&gt;&lt;P&gt;                t_final-cltyp&lt;/P&gt;&lt;P&gt;                w_tmp_kmein&lt;/P&gt;&lt;P&gt;      INTO      t_attach SEPARATED BY c_tab.&lt;/P&gt;&lt;P&gt;    CONCATENATE t_attach c_cret&lt;/P&gt;&lt;P&gt;        INTO    t_attach.&lt;/P&gt;&lt;P&gt;    APPEND t_attach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Harish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Jul 2010 10:36:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-29T10:36:09Z</dc:date>
    <item>
      <title>Problem in Allignment in .XLS sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089201#M1507022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am downloading one Report in ALV. It is coming perfect but at the same time I am supposed to send the same report in .XLS format to send mail for User when the program runs in Background. When the program is in Foreground o/p is in ALV and in Back ground it is in .XLS.&lt;/P&gt;&lt;P&gt;For this purpose I have used following FM's &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) EFG_GEN_GET_USER_EMAIL - To validate Recepient&lt;/P&gt;&lt;P&gt;2) SO_DOCUMENT_SEND_API1 - To send mail.&lt;/P&gt;&lt;P&gt;.XLS data is Concatenated in internal table. The o/p in ALV is coming perfect but in .XLS it is wrong in allignment.&lt;/P&gt;&lt;P&gt;First Field 'Price group' is displayed in Zigzag manner. It means, Line is not ended perfectly.Other fields are displayed perfectly.&lt;/P&gt;&lt;P&gt;Can you please guide me in this I am writing code here used for concatatenation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE t_final-konda&lt;/P&gt;&lt;P&gt;                t_final-kondm&lt;/P&gt;&lt;P&gt;                t_final-matnr&lt;/P&gt;&lt;P&gt;                t_final-maktx&lt;/P&gt;&lt;P&gt;                w_tmp_atinn&lt;/P&gt;&lt;P&gt;                t_final-atnam&lt;/P&gt;&lt;P&gt;                t_final-carpo&lt;/P&gt;&lt;P&gt;                t_final-atwrt&lt;/P&gt;&lt;P&gt;                t_final-atwtb&lt;/P&gt;&lt;P&gt;                w_tmp_kbetr&lt;/P&gt;&lt;P&gt;                w_tmp_konwa&lt;/P&gt;&lt;P&gt;                t_final-cltyp&lt;/P&gt;&lt;P&gt;                w_tmp_kmein&lt;/P&gt;&lt;P&gt;      INTO      t_attach SEPARATED BY c_tab.&lt;/P&gt;&lt;P&gt;    CONCATENATE t_attach c_cret&lt;/P&gt;&lt;P&gt;        INTO    t_attach.&lt;/P&gt;&lt;P&gt;    APPEND t_attach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Harish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jul 2010 10:36:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089201#M1507022</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-29T10:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Allignment in .XLS sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089202#M1507023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try to use OLE objects OLE2_OBJECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jul 2010 11:15:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089202#M1507023</guid>
      <dc:creator>Madhurivs23</dc:creator>
      <dc:date>2010-07-29T11:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Allignment in .XLS sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089203#M1507024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Madhuri,&lt;/P&gt;&lt;P&gt;Can you please explain me how to do it in detail?&lt;/P&gt;&lt;P&gt;Harish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jul 2010 11:35:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089203#M1507024</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-29T11:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Allignment in .XLS sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089204#M1507025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
* handles for OLE objects
data: H_EXCEL type OLE2_OBJECT,        " Excel object
      H_MAPL  type OLE2_OBJECT,         " list of workbooks
      H_MAP   type OLE2_OBJECT,          " workbook
      H_ZL    type OLE2_OBJECT,           " cell
      H_F     type OLE2_OBJECT,            " font
      H_C     type OLE2_OBJECT,            " color
      H_N     type OLE2_OBJECT.             "numeric


data: FILENAME like RLGRAP-FILENAME.
data:  H type I, I type I.

data : W_LINE1 type STRING,
       W_LINE2 type STRING,
       W_LINE3 type STRING,
       W_LINE4 type STRING,
         call function 'XXL_SIMPLE_API'
    exporting
      N_KEY_COLS        = 4
      FILENAME          = 'ZPPR035'
      HEADER            = XMPL_HEADER
    tables
      DATA              = &amp;lt;DYN_TABLE_OLE&amp;gt;
      ONLINE_TEXT       = XMPLT_O
      PRINT_TEXT        = XMPLT_P
      COL_TEXT          = XMPLT_V
    exceptions
      DIM_MISMATCH_DATA = 71
      FILE_OPEN_ERROR   = 72
      FILE_WRITE_ERROR  = 73
      INV_WINSYS        = 74
      INV_XXL           = 75.W_LINE5 type STRING,
       W_LINE6 type STRING.

  data begin of XMPLT_O occurs 1.      " For further explanation, please
          include structure GXXLT_O.   " \ refer to report XXLFTEST.
  data end of XMPLT_O.                 " \ This report is similar in
  " \ structure to XXLFTEST, but
  data begin of XMPLT_P occurs 1.      " \ avoids any special features in
          include structure GXXLT_P.   " \ order to demonstrate the
  data end of XMPLT_P.                 " \ applicability of XXL_SIMPLE_API
  " \ in straight-forward situations.
  data begin of XMPLT_V occurs 1.
          include structure GXXLT_V.
  data end of XMPLT_V.

  data: XMPL_HEADER like GXXLT_P-TEXT value 'Gross Net Production Report'.
*    DATA: fullpath      TYPE String,
*         w_filename      TYPE String,
*         path          TYPE String,
*         user_action   TYPE I,
*         encoding      TYPE ABAP_ENCODING.


*      accessing the alv settings at run time
      data : REF_GRID type ref to CL_GUI_ALV_GRID. "new
      if REF_GRID is initial.
        call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          importing
            E_GRID = REF_GRID.
      endif.

      if not REF_GRID is initial.
        call method REF_GRID-&amp;gt;GET_FRONTEND_FIELDCATALOG
          importing
            ET_FIELDCATALOG = IT_FLDCAT_OLE.
      endif.


    loop at IT_FLDCAT_OLE into WA_FLDCAT_OLE.
        if WA_FLDCAT_OLE-DATATYPE eq 'DEC' or WA_FLDCAT_OLE-DATATYPE eq 'QUAN' or
           WA_FLDCAT_OLE-INTTYPE    = 'P'.
          WA_FLDCAT_OLE-DATATYPE    = 'QUAN'.
          WA_FLDCAT_OLE-DECIMALS_O  = '3'.
          WA_FLDCAT_OLE-DOMNAME     = 'MENG13'.
          WA_FLDCAT_OLE-DO_SUM      = 'X'.
          WA_FLDCAT_OLE-INTLEN      = '17'.
          WA_FLDCAT_OLE-REF_TABLE   = 'MSEG'.
          WA_FLDCAT_OLE-REF_FIELD   = 'ERFMG'.
          modify IT_FLDCAT_OLE from WA_FLDCAT_OLE
                               transporting DATATYPE DECIMALS_O DOMNAME DOMNAME
                                            DO_SUM INTLEN REF_TABLE REF_FIELD .
        endif.
      endloop.


* build dyn_table_ole
      data: NEW_TABLE type ref to DATA,
            NEW_LINE type ref to DATA.
*    CREATE DYNAMIC INTERNAL TABLE AND ASSIGN TO FS
      call method CL_ALV_TABLE_CREATE=&amp;gt;CREATE_DYNAMIC_TABLE
        exporting
          IT_FIELDCATALOG = IT_FLDCAT_OLE
        importing
          EP_TABLE        = NEW_TABLE.

      assign NEW_TABLE-&amp;gt;* to &amp;lt;DYN_TABLE_OLE&amp;gt;.

*    CREATE DYNAMIC WORK AREA AND ASSIGN TO FS
      create data NEW_LINE like line of &amp;lt;DYN_TABLE_OLE&amp;gt;.
      assign NEW_LINE-&amp;gt;* to &amp;lt;DYN_WA_OLE&amp;gt;.


*       Fill_dync_table_ole.
        loop at &amp;lt;DYN_TABLE&amp;gt; into &amp;lt;DYN_WA&amp;gt;.
          loop at IT_FLDCAT_OLE into WA_FLDCAT_OLE.
            assign component  WA_FLDCAT_OLE-FIELDNAME of structure &amp;lt;DYN_WA_OLE&amp;gt; to &amp;lt;FS1&amp;gt;.
            assign component  WA_FLDCAT_OLE-FIELDNAME of structure &amp;lt;DYN_WA&amp;gt; to &amp;lt;FS2&amp;gt;.
            &amp;lt;FS1&amp;gt; = &amp;lt;FS2&amp;gt;.
          endloop.
          append &amp;lt;DYN_WA_OLE&amp;gt; to &amp;lt;DYN_TABLE_OLE&amp;gt;.
        endloop.
  H = 1.
  XMPLT_O-LINE_NO    = H.
  XMPLT_O-INFO_NAME  = 'Report-Type'.
  XMPLT_O-INFO_VALUE = 'Central'.
  append XMPLT_O.
  H = H + 1.
  XMPLT_O-LINE_NO    = H.
  XMPLT_O-INFO_NAME  = 'Responsible'.
  XMPLT_O-INFO_VALUE = 'Craig Young, DP/III'.
  append XMPLT_O.
  H = H + 1.
  XMPLT_O-LINE_NO    = H.
  XMPLT_O-INFO_NAME  = 'Checks'.
  XMPLT_O-INFO_VALUE = 'OK'.
  append XMPLT_O.
  H = H + 1.
  XMPLT_P-HF         = 'H'.
  XMPLT_P-LCR        = 'C'.
  XMPLT_P-LINE_NO    = H.
  XMPLT_P-TEXT       = 'Periodical Report:'.
  append XMPLT_P.
  H = H + 1.
  XMPLT_P-LINE_NO    = H.
  XMPLT_P-TEXT       = 'Performance per Year'.
  append XMPLT_P.
  H = H + 1.
  XMPLT_P-HF         = 'F'.
  XMPLT_P-LCR        = 'R'.
  XMPLT_P-LINE_NO    = H.
  XMPLT_P-TEXT       = 'Distribution:'.
  append XMPLT_P.
  H = H + 1.
  XMPLT_P-LINE_NO    = H.
  XMPLT_P-TEXT       = 'all Sales Accountants'.
  append XMPLT_P.

  H = H + 1. I = 1.
  loop at IT_FLDCAT_OLE into WA_FLDCAT_OLE.
    XMPLT_V-COL_NO     = I .
    XMPLT_V-COL_NAME   = WA_FLDCAT_OLE-SELTEXT.
    I = I + 1.
    append XMPLT_V.
  endloop.
  H = H + 1.


  call function 'XXL_SIMPLE_API'
    exporting
      N_KEY_COLS        = 4
      FILENAME          = 'ZPPR035'
      HEADER            = XMPL_HEADER
    tables
      DATA              = &amp;lt;DYN_TABLE_OLE&amp;gt;
      ONLINE_TEXT       = XMPLT_O
      PRINT_TEXT        = XMPLT_P
      COL_TEXT          = XMPLT_V
    exceptions
      DIM_MISMATCH_DATA = 71
      FILE_OPEN_ERROR   = 72
      FILE_WRITE_ERROR  = 73
      INV_WINSYS        = 74
      INV_XXL           = 75.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jul 2010 11:57:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089204#M1507025</guid>
      <dc:creator>Madhurivs23</dc:creator>
      <dc:date>2010-07-29T11:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Allignment in .XLS sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089205#M1507026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Madhuri,&lt;/P&gt;&lt;P&gt;Thanks for the reply but code is not at all visible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Harish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jul 2010 14:18:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089205#M1507026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-29T14:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Allignment in .XLS sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089206#M1507027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please refer following link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm" target="test_blank"&gt;http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 04:19:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089206#M1507027</guid>
      <dc:creator>Madhurivs23</dc:creator>
      <dc:date>2010-07-30T04:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in Allignment in .XLS sheet</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089207#M1507028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Madhuri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for the link.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Harish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jul 2010 05:59:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-allignment-in-xls-sheet/m-p/7089207#M1507028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-30T05:59:38Z</dc:date>
    </item>
  </channel>
</rss>

