<?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: Runtime Error in OPEN DATASET in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645931#M1572667</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;DATA : BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;       mblnr TYPE mseg-mblnr,&lt;/P&gt;&lt;P&gt;       mjahr TYPE mseg-mjahr,&lt;/P&gt;&lt;P&gt;       matnr TYPE mseg-matnr,&lt;/P&gt;&lt;P&gt;       erfmg(17) TYPE  C,            -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;&amp;gt; declare this field as Char field&lt;/P&gt;&lt;P&gt;       werks TYPE mseg-werks,&lt;/P&gt;&lt;P&gt;       lgort TYPE mseg-lgort,&lt;/P&gt;&lt;P&gt;       END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare this field as Char field and move the value into this field using Write statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Feb 2011 11:51:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-02-09T11:51:40Z</dc:date>
    <item>
      <title>Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645926#M1572662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to upload a text file in application server. But I am getting the run time error which says- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" For the statement&lt;/P&gt;&lt;P&gt;    "TRANSFER f TO ..."&lt;/P&gt;&lt;P&gt; only character-type data objects are supported at the argument position&lt;/P&gt;&lt;P&gt; "f".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In this case. the operand "f" has the non-character-type "u". The&lt;/P&gt;&lt;P&gt; current program is a Unicode program. In the Unicode context, the type&lt;/P&gt;&lt;P&gt; 'X' or structures containing not only character-type components are&lt;/P&gt;&lt;P&gt; regarded as non-character-type."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I remove the quantity fields then the error does not happen. But I have to take quantity fields also. Plz tell me what to do. My code is, &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA FILENAME like rlgrap-filename VALUE 'MIGO_VALUE.txt'.
TABLES VBAK.

DATA D_MSG_TEXT(50).

DATA : BEGIN OF it_mseg OCCURS 0,
       mblnr TYPE mseg-mblnr,
       mjahr TYPE mseg-mjahr,
       matnr TYPE mseg-matnr,
*       erfmg TYPE mseg-erfmg,
       werks TYPE mseg-werks,
       lgort TYPE mseg-lgort,
       END OF it_mseg.
DATA wa LIKE it_mseg.

SELECT mblnr mjahr matnr werks lgort FROM mseg INTO CORRESPONDING FIELDS OF TABLE it_mseg WHERE bwart = '101'.
SORT it_mseg BY mblnr.
OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
                      MESSAGE D_MSG_TEXT.
if sy-subrc eq 0.
message 'File created succesfully in SAP System'(002) type 'S'.
endif.

IF SY-SUBRC NE 0.
  WRITE: 'File cannot be opened. Reason:', D_MSG_TEXT.
  EXIT.
ENDIF.
* Transferring Data
LOOP AT it_mseg INTO wa.
TRANSFER wa to filename.
ENDLOOP.
* Closing the File
CLOSE DATASET FILENAME.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tripod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 09:51:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645926#M1572662</guid>
      <dc:creator>former_member308418</dc:creator>
      <dc:date>2011-02-09T09:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645927#M1572663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;send the whole thing in string .. that will solve the problem..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make all the itab fields as char&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;concatenate f1 f2 f3... into string by space &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;transfer..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br, &lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 09:54:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645927#M1572663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-09T09:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645928#M1572664</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;In this case please &lt;STRONG&gt;concatenate&lt;/STRONG&gt; the fields of the WA to a variable (Type C may be some 100 length) inside the LOOP of IT_MSEG then use the TRANSFER for this variable to filename. Like TRANSFER V_DATA (Type c) to filename. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please implement this logic and let me know in case of any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SRinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 09:56:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645928#M1572664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-09T09:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645929#M1572665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sri for your help. I tried to apply the logic, but the  error i am getting here is - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"IT_MSEG-ERFMG" must be a character-like data object (data type C, N,D, T, or STRING) STRING).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same case here, if I remove ERFMG field, i do not get such error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data ld_string type string.

LOOP AT it_mseg INTO wa.
  CONCATENATE it_mseg-mblnr it_mseg-mjahr it_mseg-matnr it_mseg-erfmg it_mseg-werks it_mseg-lgort INTO ld_string. 
     endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regards,&lt;/P&gt;&lt;P&gt;Tripod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 11:39:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645929#M1572665</guid>
      <dc:creator>former_member308418</dc:creator>
      <dc:date>2011-02-09T11:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645930#M1572666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are in the correct way. Before to concatenate copy the amount field into another field with type C or string and then do the concatenate with all the other felds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 11:44:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645930#M1572666</guid>
      <dc:creator>former_member582701</dc:creator>
      <dc:date>2011-02-09T11:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645931#M1572667</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;DATA : BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;       mblnr TYPE mseg-mblnr,&lt;/P&gt;&lt;P&gt;       mjahr TYPE mseg-mjahr,&lt;/P&gt;&lt;P&gt;       matnr TYPE mseg-matnr,&lt;/P&gt;&lt;P&gt;       erfmg(17) TYPE  C,            -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;&amp;gt; declare this field as Char field&lt;/P&gt;&lt;P&gt;       werks TYPE mseg-werks,&lt;/P&gt;&lt;P&gt;       lgort TYPE mseg-lgort,&lt;/P&gt;&lt;P&gt;       END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare this field as Char field and move the value into this field using Write statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 11:51:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645931#M1572667</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-09T11:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645932#M1572668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, In this case this field is showing 0. I mean value shows 0.00  here if i use data type C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tripod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 12:00:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645932#M1572668</guid>
      <dc:creator>former_member308418</dc:creator>
      <dc:date>2011-02-09T12:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645933#M1572669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not possible. Maybe the value for MSEG-EFMG = 0? &lt;/P&gt;&lt;P&gt;It is usually when you have to copy a value into a char. Check that because it has to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP table.&lt;/P&gt;&lt;P&gt;Copy EFMG into a new char.&lt;/P&gt;&lt;P&gt;Concatenate.&lt;/P&gt;&lt;P&gt;Transfer.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Manel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 12:05:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645933#M1572669</guid>
      <dc:creator>former_member582701</dc:creator>
      <dc:date>2011-02-09T12:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645934#M1572670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you did do itab-erfmg = sometable-erfmg? Or something similar?  &lt;STRONG&gt;DEBUG&lt;/STRONG&gt; and see what you're doing wrong....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 12:09:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645934#M1572670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-09T12:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645935#M1572671</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;As Manel said you need to move that Quantity field to a variable of type C using WRITE TO statement. Then concatenate this variable value along with the other variables. In this way the error can be rectified. As in you post you have commented the quantity so I have not given this solution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please implement this and let me know in case of any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SRinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 12:27:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645935#M1572671</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-09T12:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645936#M1572672</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;For transferring the data to application server you can use only the data types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C, N, D, T, S.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from this it will give the dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please correct the field in your internal table as per the above mentioned data types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Regards,&lt;/P&gt;&lt;P&gt;Vimal Khare.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 12:31:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645936#M1572672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-09T12:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645937#M1572673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Create a new workarea in which the quantity field is decalred as character type.&lt;/P&gt;&lt;P&gt;while transferring the data, assign the internal table quantity field to this work area character field and then transfer the wa to the file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 13:29:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645937#M1572673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-09T13:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645938#M1572674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Manel. My problem is solved now. I used your logic and getting value now. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now a file is saved in SAP directory. But I dont know the next process how this file will be transferred to other system. For that purpose should I have to do some more ABAP or my task has finished ? As I have no idea how other system will retrieve data from this file, I am confused about this. Plz give me some idea if have any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;With regards,&lt;/P&gt;&lt;P&gt;Tripod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 03:49:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645938#M1572674</guid>
      <dc:creator>former_member308418</dc:creator>
      <dc:date>2011-02-10T03:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in OPEN DATASET</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645939#M1572675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I am double clicking my file on application server using tcode- All01, all fields are showing 0 or empty. But the length of the file is showing 70824 byte. Can you plz tell me why it is happening  so?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;With regards,&lt;/P&gt;&lt;P&gt;Tripod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 05:42:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/runtime-error-in-open-dataset/m-p/7645939#M1572675</guid>
      <dc:creator>former_member308418</dc:creator>
      <dc:date>2011-02-10T05:42:17Z</dc:date>
    </item>
  </channel>
</rss>

