<?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: Regarding Transfer Dataset in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822161#M1128440</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Pass your internal table to this function module and check output of ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : IT_PA0002  TYPE TABLE OF PA0002,
       ITAB(4096) TYPE C occurs 0.

SELECT * FROM PA0002
INTO TABLE IT_PA0002 UP TO 15 ROWS.

CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
  EXPORTING
    i_field_seperator          = ','
*   I_LINE_HEADER              =
*    I_FILENAME                 =
*   I_APPL_KEEP                = ' '
  tables
    i_tab_sap_data             = IT_PA0002
 CHANGING
   I_TAB_CONVERTED_DATA       = ITAB
* EXCEPTIONS
*   CONVERSION_FAILED          = 1
*   OTHERS                     = 2
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

WRITE 'HAI'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Nov 2008 06:54:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-20T06:54:08Z</dc:date>
    <item>
      <title>Regarding Transfer Dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822152#M1128431</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 my data in my final internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to transfer this data to a text file on the application server&lt;/P&gt;&lt;P&gt;using the transfer dataset command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, what I want to learn is .... how to add a separator like a comma between each field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that when I open my text file, each field value will be separated by a comma.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inputs Please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking you all in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hari KIran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2008 05:54:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822152#M1128431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-20T05:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Transfer Dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822153#M1128432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Before the transfering data to Application server...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; loop thorugh the internal table and take the data into string by cancatenatind all the field values seperated by comma and then pass the string to application server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2008 06:01:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822153#M1128432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-20T06:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Transfer Dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822154#M1128433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for replying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try that out&lt;/P&gt;&lt;P&gt; and get back.&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>Thu, 20 Nov 2008 06:04:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822154#M1128433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-20T06:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Transfer Dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822155#M1128434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data : Begin of ig_final Occurs 0,&lt;/P&gt;&lt;P&gt;          txt(512),&lt;/P&gt;&lt;P&gt;          end of ig_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT ig_tab INTO wg_tab.&lt;/P&gt;&lt;P&gt;     concatenate wg_tab-f1 wg_tab-f2 ...... into ig_final-txt separated by ','. "concatenate all the fields of u r table &lt;/P&gt;&lt;P&gt;    APPEND ig_final.&lt;/P&gt;&lt;P&gt;    CLEAR : wg_tab, ig_final.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET f_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE a398(00) WITH text-019 f_file2&lt;/P&gt;&lt;P&gt;                          text-020 sy-subrc.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;LOOP AT ig_final.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;TRANSFER ig_final TO f_file LENGTH 512.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;ENDLOOP.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLOSE DATASET f_file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2008 06:09:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822155#M1128434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-20T06:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Transfer Dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822156#M1128435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Try using this function module. It can add separators.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SAP_CONVERT_TO_TEX_FORMAT&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2008 06:09:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822156#M1128435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-20T06:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Transfer Dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822157#M1128436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Hi,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;You can do like below.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET PATH                                          &lt;/P&gt;&lt;P&gt;                  FOR APPENDING&lt;/P&gt;&lt;P&gt;                  IN TEXT MODE&lt;/P&gt;&lt;P&gt;                  ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;LOOP AT IT_FINAL.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  CONCATENATE IT_FINAL-FIELD1 IT_FINAL-FIELD2  ETC INTO T_STRING SEPARATED BY ','. &lt;/P&gt;&lt;P&gt;  TRANSFER T_STRING TO PATH.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;ENDLOOP.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE DATASET PATH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Regards,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Mithilesh Gor&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2008 06:11:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822157#M1128436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-20T06:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Transfer Dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822158#M1128437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hari Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the below Logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data: w_var(50) TYPE C.&lt;/P&gt;&lt;P&gt; Constants: con_comma VALUE '#'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Open data set to write field on the application server&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  OPEN DATASET w_filename FOR OUTPUT&lt;/P&gt;&lt;P&gt;                     IN TEXT MODE&lt;/P&gt;&lt;P&gt;                     ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT it_data INTO wa_data.&lt;/P&gt;&lt;P&gt;    clear w_var.&lt;/P&gt;&lt;P&gt;    w_var(10) = wa_data-XBLNR.&lt;/P&gt;&lt;P&gt;    w_var+10(1) = con_comma.&lt;/P&gt;&lt;P&gt;    write wa_data-augdt to w_var+11(10).&lt;/P&gt;&lt;P&gt;    w_var+21(1) = con_comma.&lt;/P&gt;&lt;P&gt;    write wa_data-wrbtr to w_var+22(20).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TRANSFER w_var TO w_filename.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Close the file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CLOSE DATASET w_filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here Suppose your data is in it_data.&lt;/P&gt;&lt;P&gt;then change your code like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2008 06:22:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822158#M1128437</guid>
      <dc:creator>SujeetMishra</dc:creator>
      <dc:date>2008-11-20T06:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Transfer Dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822159#M1128438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Avinash,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked like magic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to place data in the notepad separated by comma.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am assigning you points. I don't wamt to close this thread just yet because there is one more slight problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of my fields is PA0002-ANZKD. Datatype is DEC 3 [No. of children]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was getting the message that the data type of this field has to be of type C, D , N or string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I made the necessary change to the datatype and tried to execute, I was getting short dump saying data could not be inserted  as field type mismatch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I commented this field and executed and the program worked. &lt;/P&gt;&lt;P&gt; I got the results I wanted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, I need to include this field in my text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you/ anyone can enlighten me more on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;Hari Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2008 06:25:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822159#M1128438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-20T06:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Transfer Dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822160#M1128439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Move this field PA0002-ANZKD content to a character variable and pass this character variable to concatenate statement&lt;/P&gt;&lt;P&gt;eg,&lt;/P&gt;&lt;P&gt;data : l_anzkd(4).&lt;/P&gt;&lt;P&gt;move PA0002-ANZKD to l_anzkd.&lt;/P&gt;&lt;P&gt;concatenate ........... l_anzkd ...... into ...... separated by ','.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2008 06:49:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822160#M1128439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-20T06:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Transfer Dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822161#M1128440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Pass your internal table to this function module and check output of ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : IT_PA0002  TYPE TABLE OF PA0002,
       ITAB(4096) TYPE C occurs 0.

SELECT * FROM PA0002
INTO TABLE IT_PA0002 UP TO 15 ROWS.

CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
  EXPORTING
    i_field_seperator          = ','
*   I_LINE_HEADER              =
*    I_FILENAME                 =
*   I_APPL_KEEP                = ' '
  tables
    i_tab_sap_data             = IT_PA0002
 CHANGING
   I_TAB_CONVERTED_DATA       = ITAB
* EXCEPTIONS
*   CONVERSION_FAILED          = 1
*   OTHERS                     = 2
          .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

WRITE 'HAI'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2008 06:54:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822161#M1128440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-20T06:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Transfer Dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822162#M1128441</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; I was able to solve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was having 2 internal tables .&lt;/P&gt;&lt;P&gt;One was to pull data from PA0002 table.&lt;/P&gt;&lt;P&gt; and then there was the final Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I kept the data type of ANZKD  as it is in PA0002 internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I changed the data type of ANZKD to ....ANZKD(3) type N in the final&lt;/P&gt;&lt;P&gt;internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, first the data was pulled from the PA0002 table and placed in its internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Then I moved it to the final internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No issues got raised and data got placed in the flat file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all,&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>Thu, 20 Nov 2008 06:56:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-transfer-dataset/m-p/4822162#M1128441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-20T06:56:18Z</dc:date>
    </item>
  </channel>
</rss>

