<?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 Re: Function module to handle amounts from ITAB to Excel sheet. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290967#M1023600</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or is there any problem with my declaration in TYPES??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Aug 2008 12:30:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-06T12:30:42Z</dc:date>
    <item>
      <title>Function module to handle amounts from ITAB to Excel sheet.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290966#M1023599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I  have written a simple program to transfer contents to an excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is my code......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ty_pa0014,&lt;/P&gt;&lt;P&gt;                 pernr(8) TYPE c,&lt;/P&gt;&lt;P&gt;                 betrg TYPE pad_amt7s, " I have also tried betrg   itself in type.&lt;/P&gt;&lt;P&gt;            END OF ty_pa0014.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_pa0014 TYPE STANDARD TABLE OF ty_pa0014 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my select satement---&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT pernr&lt;/P&gt;&lt;P&gt;         betrg&lt;/P&gt;&lt;P&gt;         INTO (it_pa0014-pernr, it_pa0014-betrg)&lt;/P&gt;&lt;P&gt;         FROM pa0014&lt;/P&gt;&lt;P&gt;         WHERE uname = s_uname&lt;/P&gt;&lt;P&gt;         AND aedtm = s_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    COLLECT  it_pa0014.&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT it_pa0014 BY pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT it_pa0014 IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" I have gone into debugging mode. The internal table is getting filled with contents. when I write a write statement, it displays the contents properly. I mean the PERNR and BETRG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I transfer the contents using the below function module, the value for BETRG is coming as 0.00 or 0 in the excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do understand that there is some conversion problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a better function module to handle amounts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    I_FIELD_SEPERATOR          =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    I_LINE_HEADER              =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        i_filename                 = p_file&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    I_APPL_KEEP                = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        i_tab_sap_data             = it_pa0014&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  CHANGING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    I_TAB_CONVERTED_DATA       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    CONVERSION_FAILED          = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    OTHERS                     = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;              .&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hari Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2008 12:26:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290966#M1023599</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-06T12:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to handle amounts from ITAB to Excel sheet.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290967#M1023600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or is there any problem with my declaration in TYPES??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2008 12:30:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290967#M1023600</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-06T12:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to handle amounts from ITAB to Excel sheet.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290968#M1023601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WHERE uname &lt;STRONG&gt;in&lt;/STRONG&gt; s_uname&lt;/P&gt;&lt;P&gt;AND aedtm &lt;STRONG&gt;in&lt;/STRONG&gt; s_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here use in instead of = ......do it and let me know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2008 12:34:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290968#M1023601</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-06T12:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to handle amounts from ITAB to Excel sheet.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290969#M1023602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi pandu,&lt;/P&gt;&lt;P&gt;I will make that change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, I dont think that's the problem&lt;/P&gt;&lt;P&gt;because I wrote a write statement after populationg the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the values came out perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for replying.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2008 12:37:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290969#M1023602</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-06T12:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to handle amounts from ITAB to Excel sheet.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290970#M1023603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can u pl. check what value u r getting in I_TAB_CONVERTED_DATA parameter? &lt;/P&gt;&lt;P&gt; CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_FIELD_SEPERATOR =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_LINE_HEADER =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_filename = p_file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_APPL_KEEP = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;i_tab_sap_data = it_pa0014&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;CHANGING&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;     &lt;STRONG&gt;I_TAB_CONVERTED_DATA =&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CONVERSION_FAILED = 1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also instead of using curr data type use char data type for betrg.&lt;/P&gt;&lt;P&gt;like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tYPES: BEGIN OF ty_pa0014_1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pernr(8) TYPE c,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;betrg(25) TYPE c, " I have also tried betrg itself in type.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;END OF ty_pa0014_1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA: it_pa0014_1 TYPE STANDARD TABLE OF ty_pa0014_1 WITH HEADER LINE.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YPES: BEGIN OF ty_pa0014,&lt;/P&gt;&lt;P&gt;pernr(8) TYPE c,&lt;/P&gt;&lt;P&gt;betrg TYPE pad_amt7s, " I have also tried betrg itself in type.&lt;/P&gt;&lt;P&gt;END OF ty_pa0014.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_pa0014 TYPE STANDARD TABLE OF ty_pa0014 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT pernr&lt;/P&gt;&lt;P&gt;betrg&lt;/P&gt;&lt;P&gt;INTO (it_pa0014-pernr, it_pa0014-betrg)&lt;/P&gt;&lt;P&gt;FROM pa0014&lt;/P&gt;&lt;P&gt;WHERE uname = s_uname&lt;/P&gt;&lt;P&gt;AND aedtm = s_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT it_pa0014.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT it_pa0014 BY pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;loop at it_pa0014.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;it_pa0014_1-pernr = t_pa0014-pernr.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;it_pa0014_1-betrg = it_pa0014-betrg.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;append it_pa0014_1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endloop.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF NOT it_pa0014_1 IS INITIAL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_FIELD_SEPERATOR =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_LINE_HEADER =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_filename = p_file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_APPL_KEEP = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;i_tab_sap_data = it_pa0014_1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_TAB_CONVERTED_DATA =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CONVERSION_FAILED = 1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Joyjit Ghosh on Aug 6, 2008 2:47 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2008 12:46:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290970#M1023603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-06T12:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to handle amounts from ITAB to Excel sheet.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290971#M1023604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;It has resolved the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BETRG is getting populated properly in the excel sheet.&lt;/P&gt;&lt;P&gt;for example--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10007	162.16--&amp;gt; BETRG Value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have taken the following for BETRG--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" betrg TYPE pad_amt7s,   "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try out what Ghosh has said and get back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2008 12:59:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-handle-amounts-from-itab-to-excel-sheet/m-p/4290971#M1023604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-06T12:59:36Z</dc:date>
    </item>
  </channel>
</rss>

