<?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: open data set in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-data-set/m-p/2638825#M607366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jai,&lt;/P&gt;&lt;P&gt;Pls chk this program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report ZBDC_PRIC no standard page heading&lt;/P&gt;&lt;P&gt;line-size 255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include zbdcrecx1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Internal Table To hold condition records data from flat file.&lt;/P&gt;&lt;P&gt;Data: begin of it_pricing occurs 0,&lt;/P&gt;&lt;P&gt;key(4),&lt;/P&gt;&lt;P&gt;f1(4),&lt;/P&gt;&lt;P&gt;f2(4),&lt;/P&gt;&lt;P&gt;f3(2),&lt;/P&gt;&lt;P&gt;f4(18),&lt;/P&gt;&lt;P&gt;f5(16),&lt;/P&gt;&lt;P&gt;end of it_pricing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Internal Table To hold condition records header .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of it_header occurs 0,&lt;/P&gt;&lt;P&gt;key(4),&lt;/P&gt;&lt;P&gt;f1(4),&lt;/P&gt;&lt;P&gt;f2(4),&lt;/P&gt;&lt;P&gt;f3(2),&lt;/P&gt;&lt;P&gt;end of it_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Internal Table To hold condition records details .&lt;/P&gt;&lt;P&gt;data : begin of it_details occurs 0,&lt;/P&gt;&lt;P&gt;key(4),&lt;/P&gt;&lt;P&gt;f4(18),&lt;/P&gt;&lt;P&gt;f5(16),&lt;/P&gt;&lt;P&gt;end of it_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : v_sno(2),&lt;/P&gt;&lt;P&gt;v_rows type i,&lt;/P&gt;&lt;P&gt;v_fname(40).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;refresh : it_pricing,it_header,it_details.&lt;/P&gt;&lt;P&gt;clear : it_pricing,it_header,it_details.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL FUNCTION 'UPLOAD'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILENAME = 'C:\WINDOWS\Desktop\pricing.txt'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILETYPE = 'DAT'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA_TAB = it_pricing&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_ERROR = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INVALID_TABLE_WIDTH = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INVALID_TYPE = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_BATCH = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNKNOWN_ERROR = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GUI_REFUSE_FILETRANSFER = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 7.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;WRITE : / 'Condition Records ', P_FNAME, ' on ', SY-DATUM.&lt;/P&gt;&lt;P&gt;OPEN DATASET P_FNAME FOR INPUT IN TEXT MODE.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;write : / 'File could not be uploaded.. Check file name.'.&lt;/P&gt;&lt;P&gt;stop.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;CLEAR : it_pricing[], it_pricing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;READ DATASET P_FNAME INTO V_STR.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;write v_str.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;translate v_str using '#/'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SPLIT V_STR AT ',' INTO it_pricing-key&lt;/P&gt;&lt;P&gt;it_pricing-F1 it_pricing-F2 it_pricing-F3&lt;/P&gt;&lt;P&gt;it_pricing-F4 it_pricing-F5 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND it_pricing.&lt;/P&gt;&lt;P&gt;CLEAR it_pricing.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_pricing[] IS INITIAL.&lt;/P&gt;&lt;P&gt;WRITE : / 'No data found to upload'.&lt;/P&gt;&lt;P&gt;STOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_pricing.&lt;/P&gt;&lt;P&gt;At new key.&lt;/P&gt;&lt;P&gt;read table it_pricing index sy-tabix.&lt;/P&gt;&lt;P&gt;move-corresponding it_pricing to it_header.&lt;/P&gt;&lt;P&gt;append it_header.&lt;/P&gt;&lt;P&gt;clear it_header.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;move-corresponding it_pricing to it_details.&lt;/P&gt;&lt;P&gt;append it_details.&lt;/P&gt;&lt;P&gt;clear it_details.&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;perform open_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_rows = sy-srows - 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPMV13A' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'RV13A-KSCHL'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RV13A-KSCHL'&lt;/P&gt;&lt;P&gt;it_header-f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPMV13A' '1004'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'KONP-KBETR(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_field using 'KOMG-VKORG'&lt;/P&gt;&lt;P&gt;it_header-f2.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'KOMG-VTWEG'&lt;/P&gt;&lt;P&gt;it_header-f3.&lt;/P&gt;&lt;P&gt;**Table Control&lt;/P&gt;&lt;P&gt;v_sno = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_details where key eq it_header-key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_sno = v_sno + 1.&lt;/P&gt;&lt;P&gt;clear v_fname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE 'KOMG-MATNR(' V_SNO ')' INTO V_FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_field using v_fname&lt;/P&gt;&lt;P&gt;it_details-f4.&lt;/P&gt;&lt;P&gt;clear v_fname.&lt;/P&gt;&lt;P&gt;CONCATENATE 'KONP-KBETR(' V_SNO ')' INTO V_FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_field using v_fname&lt;/P&gt;&lt;P&gt;it_details-f5.&lt;/P&gt;&lt;P&gt;if v_sno eq v_rows.&lt;/P&gt;&lt;P&gt;v_sno = 0.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPMV13A' '1004'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=P+'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPMV13A' '1004'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;endif.&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;*--Save&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPMV13A' '1004'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=SICH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_transaction using 'VK11'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;perform close_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward Points if useful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gokul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Aug 2007 05:29:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-03T05:29:52Z</dc:date>
    <item>
      <title>open data set</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-data-set/m-p/2638822#M607363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi how to use open data set and close data set to download in my network system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please give example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;jai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 05:24:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-data-set/m-p/2638822#M607363</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T05:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: open data set</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-data-set/m-p/2638823#M607364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: outfile(512) TYPE c.

" open
  OPEN DATASET outfile FOR APPENDING IN TEXT MODE ENCODING DEFAULT.

" transferring data to the file
loop at itab into wa_itab.
  TRANSFER wa_itab TO outfile.
endloop.

" close
  CLOSE DATASET outfile.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Kris Donald&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 05:28:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-data-set/m-p/2638823#M607364</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2007-08-03T05:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: open data set</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-data-set/m-p/2638824#M607365</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 ABAP, there is a range of statements for processing data that is stored in sequential files on the application server instead of the database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        OPEN DATASET opens a file for a particular type of access and storage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        TRANSFER transfers the contents of a data object to a file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        READ DATASET transfers data from a file to a data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        GET DATASET using the addition POSITION the current position of the file pointer in a file is ascertained. Using the addition ATTRIBUTES further characteristics of the file are obtained.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        SET DATASET using the addition POSITION the position of the file pointer is specified. Using the addition ATTRIBUTES further characteristics of the file can be specified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        TRUNCATE DATASET sets the end of a file to a specified value, thereby changing the size of the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        CLOSE DATASET closes a file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        DELETE DATASET deletes a file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the Example program &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code is base on uploading a simple txt file.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZUPLOADTAB                                                  *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*&amp;amp; Example of Uploading tab delimited file                             *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;REPORT  zuploadtab                    .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_infile  LIKE rlgrap-filename&lt;/P&gt;&lt;P&gt;                        OBLIGATORY DEFAULT  '/usr/sap/'..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ld_file LIKE rlgrap-filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Internal tabe to store upload data&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF t_record,&lt;/P&gt;&lt;P&gt;    name1 like pa0002-VORNA,&lt;/P&gt;&lt;P&gt;    name2 like pa0002-name2,&lt;/P&gt;&lt;P&gt;    age   type i,&lt;/P&gt;&lt;P&gt;    END OF t_record.&lt;/P&gt;&lt;P&gt;DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;      wa_record TYPE t_record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Text version of data table&lt;/P&gt;&lt;P&gt;TYPES: begin of t_uploadtxt,&lt;/P&gt;&lt;P&gt;  name1(10) type c,&lt;/P&gt;&lt;P&gt;  name2(15) type c,&lt;/P&gt;&lt;P&gt;  age(5)  type c,&lt;/P&gt;&lt;P&gt; end of t_uploadtxt.&lt;/P&gt;&lt;P&gt;DATA: wa_uploadtxt TYPE t_uploadtxt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*String value to data in initially.&lt;/P&gt;&lt;P&gt;DATA: wa_string(255) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;constants: con_tab TYPE x VALUE '09'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*If you have Unicode check active in program attributes then you will&lt;/P&gt;&lt;P&gt;*need to declare constants as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*class cl_abap_char_utilities definition load.&lt;/P&gt;&lt;P&gt;*constants:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   con_tab  type c value cl_abap_char_utilities=&amp;gt;HORIZONTAL_TAB.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*START-OF-SELECTION&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;ld_file = p_infile.&lt;/P&gt;&lt;P&gt;OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    CLEAR: wa_string, wa_uploadtxt.&lt;/P&gt;&lt;P&gt;    READ DATASET ld_file INTO wa_string.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1&lt;/P&gt;&lt;P&gt;                                      wa_uploadtxt-name2&lt;/P&gt;&lt;P&gt;                                      wa_uploadtxt-age.&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.&lt;/P&gt;&lt;P&gt;      APPEND wa_upload TO it_record.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;  CLOSE DATASET ld_file.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*END-OF-SELECTION&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*!! Text data is now contained within the internal table IT_RECORD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display report data for illustration purposes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  loop at it_record into wa_record.&lt;/P&gt;&lt;P&gt;    write:/     sy-vline,&lt;/P&gt;&lt;P&gt;           (10) wa_record-name1, sy-vline,&lt;/P&gt;&lt;P&gt;           (10) wa_record-name2, sy-vline,&lt;/P&gt;&lt;P&gt;           (10) wa_record-age, sy-vline.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &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; Sudheer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 05:29:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-data-set/m-p/2638824#M607365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T05:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: open data set</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-data-set/m-p/2638825#M607366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jai,&lt;/P&gt;&lt;P&gt;Pls chk this program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report ZBDC_PRIC no standard page heading&lt;/P&gt;&lt;P&gt;line-size 255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include zbdcrecx1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Internal Table To hold condition records data from flat file.&lt;/P&gt;&lt;P&gt;Data: begin of it_pricing occurs 0,&lt;/P&gt;&lt;P&gt;key(4),&lt;/P&gt;&lt;P&gt;f1(4),&lt;/P&gt;&lt;P&gt;f2(4),&lt;/P&gt;&lt;P&gt;f3(2),&lt;/P&gt;&lt;P&gt;f4(18),&lt;/P&gt;&lt;P&gt;f5(16),&lt;/P&gt;&lt;P&gt;end of it_pricing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Internal Table To hold condition records header .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of it_header occurs 0,&lt;/P&gt;&lt;P&gt;key(4),&lt;/P&gt;&lt;P&gt;f1(4),&lt;/P&gt;&lt;P&gt;f2(4),&lt;/P&gt;&lt;P&gt;f3(2),&lt;/P&gt;&lt;P&gt;end of it_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Internal Table To hold condition records details .&lt;/P&gt;&lt;P&gt;data : begin of it_details occurs 0,&lt;/P&gt;&lt;P&gt;key(4),&lt;/P&gt;&lt;P&gt;f4(18),&lt;/P&gt;&lt;P&gt;f5(16),&lt;/P&gt;&lt;P&gt;end of it_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : v_sno(2),&lt;/P&gt;&lt;P&gt;v_rows type i,&lt;/P&gt;&lt;P&gt;v_fname(40).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;refresh : it_pricing,it_header,it_details.&lt;/P&gt;&lt;P&gt;clear : it_pricing,it_header,it_details.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL FUNCTION 'UPLOAD'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILENAME = 'C:\WINDOWS\Desktop\pricing.txt'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILETYPE = 'DAT'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA_TAB = it_pricing&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_ERROR = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INVALID_TABLE_WIDTH = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INVALID_TYPE = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_BATCH = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNKNOWN_ERROR = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GUI_REFUSE_FILETRANSFER = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 7.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;WRITE : / 'Condition Records ', P_FNAME, ' on ', SY-DATUM.&lt;/P&gt;&lt;P&gt;OPEN DATASET P_FNAME FOR INPUT IN TEXT MODE.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;write : / 'File could not be uploaded.. Check file name.'.&lt;/P&gt;&lt;P&gt;stop.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;CLEAR : it_pricing[], it_pricing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;READ DATASET P_FNAME INTO V_STR.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;write v_str.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;translate v_str using '#/'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SPLIT V_STR AT ',' INTO it_pricing-key&lt;/P&gt;&lt;P&gt;it_pricing-F1 it_pricing-F2 it_pricing-F3&lt;/P&gt;&lt;P&gt;it_pricing-F4 it_pricing-F5 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND it_pricing.&lt;/P&gt;&lt;P&gt;CLEAR it_pricing.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_pricing[] IS INITIAL.&lt;/P&gt;&lt;P&gt;WRITE : / 'No data found to upload'.&lt;/P&gt;&lt;P&gt;STOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_pricing.&lt;/P&gt;&lt;P&gt;At new key.&lt;/P&gt;&lt;P&gt;read table it_pricing index sy-tabix.&lt;/P&gt;&lt;P&gt;move-corresponding it_pricing to it_header.&lt;/P&gt;&lt;P&gt;append it_header.&lt;/P&gt;&lt;P&gt;clear it_header.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;move-corresponding it_pricing to it_details.&lt;/P&gt;&lt;P&gt;append it_details.&lt;/P&gt;&lt;P&gt;clear it_details.&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;perform open_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_rows = sy-srows - 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPMV13A' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'RV13A-KSCHL'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RV13A-KSCHL'&lt;/P&gt;&lt;P&gt;it_header-f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPMV13A' '1004'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'KONP-KBETR(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_field using 'KOMG-VKORG'&lt;/P&gt;&lt;P&gt;it_header-f2.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'KOMG-VTWEG'&lt;/P&gt;&lt;P&gt;it_header-f3.&lt;/P&gt;&lt;P&gt;**Table Control&lt;/P&gt;&lt;P&gt;v_sno = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_details where key eq it_header-key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_sno = v_sno + 1.&lt;/P&gt;&lt;P&gt;clear v_fname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE 'KOMG-MATNR(' V_SNO ')' INTO V_FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_field using v_fname&lt;/P&gt;&lt;P&gt;it_details-f4.&lt;/P&gt;&lt;P&gt;clear v_fname.&lt;/P&gt;&lt;P&gt;CONCATENATE 'KONP-KBETR(' V_SNO ')' INTO V_FNAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_field using v_fname&lt;/P&gt;&lt;P&gt;it_details-f5.&lt;/P&gt;&lt;P&gt;if v_sno eq v_rows.&lt;/P&gt;&lt;P&gt;v_sno = 0.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPMV13A' '1004'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=P+'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPMV13A' '1004'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;endif.&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;*--Save&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPMV13A' '1004'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=SICH'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_transaction using 'VK11'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;perform close_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward Points if useful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gokul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 05:29:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-data-set/m-p/2638825#M607366</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T05:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: open data set</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-data-set/m-p/2638826#M607367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;data : begin of l_fname occurs 30,&lt;/P&gt;&lt;P&gt;          name(300) type c,&lt;/P&gt;&lt;P&gt;          end of l_fname,&lt;/P&gt;&lt;P&gt;         begin ofi_dline  occurs 0 ,&lt;/P&gt;&lt;P&gt;         line(300) type  c,&lt;/P&gt;&lt;P&gt;        end of l_dline,&lt;/P&gt;&lt;P&gt;         i_tab value '|',&lt;/P&gt;&lt;P&gt;        l_fname1 type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now concatenate all the output fields into l_fname in the o/p format.&lt;/P&gt;&lt;P&gt;concatenate f1 f2 f3 into l_fname separated by i_tab.&lt;/P&gt;&lt;P&gt;append l_fname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at ur final table.&lt;/P&gt;&lt;P&gt;now concatenate all the values into that i_dline separated by i_tab.&lt;/P&gt;&lt;P&gt;append i_dline.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now move the entered file path to l_fname1.&lt;/P&gt;&lt;P&gt;OPEN DATASET l_fname FOR OUTPUT IN LEGACY TEXT MODE.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt;0.&lt;/P&gt;&lt;P&gt;"error msg ,if fails to open the file ".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;TRANSFER l_fname to  l_fname1.&lt;/P&gt;&lt;P&gt;LOOP AT i_dline.&lt;/P&gt;&lt;P&gt;TRANSFER i_dline-line to l_fname1.&lt;/P&gt;&lt;P&gt;clear i_dline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;msg download comeplete.&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;download fail.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt; CLOSE DATASET l_fname1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it helps dont forget REWARD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;harris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 05:41:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-data-set/m-p/2638826#M607367</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-03T05:41:43Z</dc:date>
    </item>
  </channel>
</rss>

