Data from itab to be store in text file in desktop

hi
i am tyring to store the data from itab into a text file in desktop,but its now owrking.
i am using open dataset statment,but no where data is storing.My code:
TYPES : BEGIN OF ST_DEMO,
REG_NO(10) TYPE C,
NAME(20)   TYPE C,
ADDR(20)   TYPE C,
END OF ST_DEMO.
DATA : WA_DEMO TYPE ST_DEMO,
IT_DEMO TYPE TABLE OF ST_DEMO,
L_FNAME TYPE dxfile-filename .
PARAMETERS: P_FNAME(128) TYPE C DEFAULT '\usr\sap\put\vipin.txt' OBLIGATORY.
L_FNAME = P_FNAME.
WA_DEMO-REG_NO = '100001'.
WA_DEMO-NAME = 'ANAND'.
WA_DEMO-ADDR = 'NAGARKOVIL'.
APPEND WA_DEMO TO IT_DEMO.
OPEN DATASET L_FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
WRITE :5 'REG NUM',16 'NAME',37 'ADDRESS' .
LOOP AT IT_DEMO INTO WA_DEMO.
  IF SY-SUBRC = 0.
    TRANSFER WA_DEMO TO L_FNAME.
    WRITE :/5 WA_DEMO-REG_NO,16 WA_DEMO-NAME,37 WA_DEMO-ADDR.
  ENDIF.
ENDLOOP.
close DATASET L_FNAME.
please tell me where is the prob?I wan to schedule it for background job.
regds
vipin

hi
here is the code for :  "data from itab to be store in text file in desktop"
TABLES: vbak.    " standard table
*                           Type Pools                                 *
TYPE-POOLS: slis.
*                     Global Structure Definitions                     *
*-- Structure to hold data from table CE1MCK2
TYPES: BEGIN OF tp_itab1,
       vbeln LIKE vbap-vbeln,
       posnr LIKE vbap-posnr,
       werks LIKE vbap-werks,
       lgort LIKE vbap-lgort,
       END OF tp_itab1.
*-- Data Declaration
DATA: t_itab1 TYPE TABLE OF tp_itab1.
DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
*                    Selection  Screen                                 *
*--Sales document-block
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
SELECTION-SCREEN END OF  BLOCK b1.
*--Display option - block
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
PARAMETERS: alv_list RADIOBUTTON GROUP g1,
            alv_grid RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF  BLOCK b2.
*file download - block
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
PARAMETERS: topc AS CHECKBOX,
            p_file TYPE rlgrap-filename.
SELECTION-SCREEN END OF  BLOCK b3.
*                      Initialization.                                *
*                      At Selection Screen                            *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
    EXPORTING
      dynpfield_filename = 'P_FILE'
      dyname             = sy-cprog
      dynumb             = sy-dynnr
      filetype           = 'P'      "P-->Physical
      location           = 'P'     "P Presentation Srever
      server             = space.
AT SELECTION-SCREEN ON s_vbeln.
  PERFORM vbeln_validate.
*                           Start Of Selection                         *
START-OF-SELECTION.
*-- Fetching all the required data into the internal table
  PERFORM select_data.
*                           End Of Selection                           *
END-OF-SELECTION.
  IF t_itab1[] IS NOT INITIAL.
    IF topc IS NOT INITIAL.
      PERFORM download.
      MESSAGE 'Data Download Completed' TYPE 'S'.
    ENDIF.
    PERFORM display.
  ELSE.
    MESSAGE 'No Records Found' TYPE 'I'.
  ENDIF.
*                           Top Of Page Event                          *
TOP-OF-PAGE.
*& Form           :      select_data
* Description     : Fetching all the data into the internal tables
*  parameters    :  none
FORM select_data .
  SELECT vbeln
     posnr
     werks
     lgort
     INTO CORRESPONDING  FIELDS OF TABLE t_itab1
     FROM vbap
     WHERE  vbeln IN s_vbeln.
  IF sy-subrc <> 0.
    MESSAGE 'Enter The Valid Sales Document Number'(t04) TYPE 'I'.
    EXIT.
  ENDIF.
ENDFORM.                    " select_data
*& Form        : display
*  decription  : to display data in given format
* parameters   :  none
FORM display .
  IF alv_list = 'X'.
    PERFORM build_fieldcat TABLES i_fieldcat[]
                           USING :
*-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
   'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
   'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
   'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
   'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program       = sy-repid
*        i_callback_pf_status_set = c_pf_status
        i_callback_user_command  = 'USER_COMMAND '
*        it_events                = t_alv_events[]
        it_fieldcat              = i_fieldcat[]
      TABLES
        t_outtab                 = t_itab1[]
      EXCEPTIONS
        program_error            = 1
        OTHERS                   = 2.
    IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ENDIF.
  IF alv_grid = 'X'.
    PERFORM build_fieldcat TABLES i_fieldcat[]
                             USING :
*-Output-field Table      Len  Ref fld Ref tab Heading    Col_pos
     'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'    ''            1,
     'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'    ''            2,
     'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'    ''            3,
     'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'    ''            4.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program       = sy-repid
*        i_callback_pf_status_set = c_pf_status
        i_callback_user_command  = 'USER_COMMAND '
        it_fieldcat              = i_fieldcat
      TABLES
        t_outtab                 = t_itab1[]
    EXCEPTIONS
   program_error                     = 1
   OTHERS                            = 2.
    IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ENDIF.
ENDFORM.                    " display
*& Form        : vbeln_validate
*  description : to validate sales document number
* parameters   :  none
FORM vbeln_validate .
  DATA: l_vbeln TYPE vbak-vbeln.
  SELECT SINGLE vbeln
    FROM vbak
    INTO l_vbeln
    WHERE vbeln IN s_vbeln.
  IF sy-subrc NE 0.
    MESSAGE 'ENTER THE VALID SALES DOCUMENT NO:' TYPE 'I'.
    EXIT.
  ENDIF.
ENDFORM.                    " vbeln_validate
*& Form       :build_fieldcat
* Description : This routine fills field-catalogue
*  Prameters  : none
FORM build_fieldcat TABLES  fpt_fieldcat TYPE slis_t_fieldcat_alv
                    USING   fp_field     TYPE slis_fieldname
                            fp_table     TYPE slis_tabname
                            fp_length    TYPE dd03p-outputlen
                            fp_ref_tab   TYPE dd03p-tabname
                            fp_ref_fld   TYPE dd03p-fieldname
                            fp_seltext   TYPE dd03p-scrtext_l
                            fp_col_pos   TYPE sy-cucol.
*-- Local data declaration
  DATA:   wl_fieldcat TYPE slis_fieldcat_alv.
*-- Clear WorkArea
  wl_fieldcat-fieldname       = fp_field.
  wl_fieldcat-tabname         = fp_table.
  wl_fieldcat-outputlen       = fp_length.
  wl_fieldcat-ref_tabname     = fp_ref_tab.
  wl_fieldcat-ref_fieldname   = fp_ref_fld.
  wl_fieldcat-seltext_l       = fp_seltext.
  wl_fieldcat-col_pos         = fp_col_pos.
*-- Update Field Catalog Table
  APPEND wl_fieldcat  TO  fpt_fieldcat.
ENDFORM.                    "build_fieldcat
*& Form        : download
*  description : To Download The Data
*  Parameters  :  none
FORM download .
  DATA: l_file TYPE string.
  l_file = p_file.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = l_file
      filetype                = 'ASC'
    TABLES
      data_tab                = t_itab1
    EXCEPTIONS
      file_write_error        = 1
      no_batch                = 2
      gui_refuse_filetransfer = 3
      invalid_type            = 4
      no_authority            = 5
      unknown_error           = 6.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " download
hope it will help you
regards
rahul

Similar Messages

  • How to download data from an internal table to a text

    Hi All,
    I want to download data  from an internal table to a text file.
    The fields should be pipe(|) separated. I have tried GUI_DOWNLOAD but it is not taking the field separator.
    The sample of the desired data that i require should be this way:-
    13456TR|M|COUP|MATERIAL|KGS
    Thanks in advance.
    Regards
    Satish.

    Hi,
    Try this..
    REPORT  zc1download message-id zc1dwnmsg.
    *& Declaration Section for the Tables *
    TABLES: makt.
    *& Declaration Section for the Internal Tables
    DATA: intab TYPE TABLE OF makt,
          wa_intab LIKE LINE OF intab,
          no_of_rec TYPE i,
          count TYPE i.
    DATA: BEGIN OF f_intab,
            str(255) TYPE c,
          END OF f_intab.
    DATA: t_intab LIKE TABLE OF f_intab,
          w_intab LIKE LINE OF t_intab,
          temp(255) TYPE c.
    FIELD-SYMBOLS: <f> TYPE ANY.
    *& Selection ScreenSection for the file download
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: file TYPE rlgrap-filename MEMORY ID file,
                tab RADIOBUTTON GROUP rad1 DEFAULT 'X',
                others RADIOBUTTON GROUP rad1,
                delimit TYPE c.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      IF file IS INITIAL. " check to ensure file.
        MESSAGE i001.
        EXIT.
      ENDIF.
      IF others = 'X'.    " check to ensure delimiter.
        IF delimit = ' '.
          MESSAGE i002.
          EXIT.
        ENDIF.
      ENDIF.
      SELECT * FROM makt INTO TABLE intab.
      IF tab = 'X'.       " default delimiter tab is used
          CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
            filename                = file
            filetype                = 'DAT'
            mode                    = 'A'
          TABLES
            data_tab                = intab
          EXCEPTIONS
            file_open_error         = 1
            file_write_error        = 2
            invalid_filesize        = 3
            invalid_type            = 4
            no_batch                = 5
            unknown_error           = 6
            invalid_table_width     = 7
            gui_refuse_filetransfer = 8
            customer_error          = 9
            no_authority            = 10
            OTHERS                  = 11.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ELSE.             " If user defind delimiter is to be used
                  Counts the number of fields                *
        DO.
          ASSIGN COMPONENT sy-index OF STRUCTURE wa_intab TO <f>.
          IF sy-subrc <> 0.
            EXIT.
          ELSE.
            count = count + 1.
          ENDIF.
        ENDDO.
        LOOP AT intab INTO wa_intab.
          DO count TIMES. " Adding the delimiter in required places
            ASSIGN COMPONENT sy-index OF STRUCTURE wa_intab TO <f>.
            CONCATENATE temp delimit <f> INTO temp.
          ENDDO.
          SHIFT temp.
          APPEND temp TO t_intab.
          CLEAR temp.
        ENDLOOP.
        CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
            filename                = file
            filetype                = 'ASC'
            mode                    = 'A'
          TABLES
            data_tab                = t_intab
          EXCEPTIONS
            file_open_error         = 1
            file_write_error        = 2
            invalid_filesize        = 3
            invalid_type            = 4
            no_batch                = 5
            unknown_error           = 6
            invalid_table_width     = 7
            gui_refuse_filetransfer = 8
            customer_error          = 9
            no_authority            = 10
            OTHERS                  = 11.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
      WRITE:/ 'The Data has been tranfered to :', file.
    Cheers
    Kathir!~

  • How to download data from itab to Excel sheet..

    Hi sap Experts,
    I develop one report to download data from itab to excel sheet.I done it perfectly.
    My doubt is in the excel sheet i need to put headings. and also at last i need to display total no.of Records.
    Please help me how to do this.
         Thanks in Advance....
    Thanks and Regards
    Siri.......................

    u can either use GUI_DOWNLOAD or the method below...just give a try
    DATA:WK_string TYPE STRING.
    DATA:Wk_EXT(4) TYPE C value '.xls'.
    DATA:WK_path TYPE STRING.
    DATA:wk_file_name type string.
    data:wk_records type sy-tfill.
    wk_file_name = 'Downloaded'.
    describe table itab lines wk_records.
    LOOP AT ITAB.
    at first.
    **Provide path
    concatenate 'C:\' wk_file_name Wk_EXT into wk_path.
    open dataset WK_path for output in text mode encoding default.
    if sy-subrc  0.
    write:'ERROR while opening dataset !!!!!!'.
    EXIT.
    endif.
    CONDENSE wk_path.
    **Heading Part
    concatenate 'Part No' 'Description'
         into wk_string separated by cl_abap_char_utilities=>horizontal_tab.
    endat.
    **Data ITAB
    CONCATENATE ITAB-MATNR itab-maktx into wk_string
         separated by cl_abap_char_utilities=>horizontal_tab.
    transfer wk_string to WK_path.
    at last.
    clear wk_string.
    Concatenate  'Records Passed:' wk_string into wk_string.
    transfer wk_string to WK_path.
    close dataset WK_path.
    endat.
    endloop.

  • How to store a text file in a hash table in C#?

    I am fairly new to c#. I am creating a console application project for practice. I am supposed to create a program that reads a text file (it's a poem), store it in a hash table, have two different sorts, and unhash the table. I managed to get the poem read
    by using streamwriter, but now I am not sure how to store it in a hash table. 
    I'm not sure if I am doing this hash table correct, but I made my hash table like this to store the text file: 
          Hashtable hashtable = new Hashtable();
                hashtable[1] = (@"C:\\Documents\\Datastructures\\Input\\Poem");

    Hi,
    Hashtable in C# represents a collection of key/value pairs which maps keys to value. Any non-null object can be used as a key but a value can. We can retrieve  items from hashTable to provide the key . Both keys and values are Objects.
    Here is a sample about Hashtable,
    Hashtable weeks = new Hashtable();
    weeks.Add("1", "SunDay");
    weeks.Add("2", "MonDay");
    weeks.Add("3", "TueDay");
    weeks.Add("4", "WedDay");
    weeks.Add("5", "ThuDay");
    weeks.Add("6", "FriDay");
    weeks.Add("7", "SatDay");
    //Display a single Item
    MessageBox.Show(weeks["5"].ToString());
    //Search an Item
    if (weeks.ContainsValue("TueDay"))
    MessageBox.Show("Find");
    else
    MessageBox.Show("Not find");
    //remove an Item
    weeks.Remove("3");
    //Display all key value pairs
    foreach (DictionaryEntry day in weeks)
    MessageBox.Show(day.Key + " - " + day.Value);
    >>I managed to get the poem read by using streamwriter, but now I am not sure how to store it in a hash table
    Hashtable hashtable = new Hashtable();
    hashtable[1] = (@"C:\\Documents\\Datastructures\\Input\\Poem");
    But follow your scenario above, you just store a string path to hashtable not a file.
    About saving data to a file, you can use the following code.
    // Write the string to a file.
    System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\test.txt");
    file.WriteLine(lines);
    file.Close();
    Best wishes!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I copy records from a Table to a ASCII/ Text file.?

    Hi
    Can you help me with code for copying the records from an oracle table to a Text file,? I like to copy the 1200 records from a 7 field table to a .txt file and print out the out put.
    earliest reply is deeply appreciated.
    regrds
    Saj

    All I would do is, in SQL*Plus, spool your output to a file and change the pagesize to however many lines you want before the next header break.
    For example:
    SET PAGESIZE 79
    SPOOL OUTPUT.TXT
    Would create an output file called OUTPUT.TXT with header rows produced after every 79 rows of data.

  • Copyig Data from a TABLE MODEL (TABLE) TO A FILE

    Hi guys,
    I wont to copy data from a Default Table Model to a File can someone write a pease of code that will do that for me.
    DefaultTableModel model = new DefaultTableModel();
    JTable table;
    public basic()
              super();
                  model.addColumn("Full Name");
                  model.addColumn("House No");
                  model.addColumn("Address");
                  model.addColumn("Town/County");
                  model.addColumn("Postcode");
                  model.addColumn("Telephone Number");
                  model.addColumn("Email Address");             
                  String[] socrates = { "Example", "33", "York RD", "Poole", "BH18 9RE", "01202776655", "[email protected]" };
                  model.addRow(socrates);
              /**This is the main setup for the Address Book
              *This has the main settings for the size, title
              *And main features of the Address book.
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              this.setSize(new Dimension(800, 600));
              this.setTitle("Large Print Address Book");
              this.setLayout(new FlowLayout ());
              //Main Application Parts
              JLabel welcome = new JLabel("Welcome to Thomas's Address Book v2.0.1");
              welcome.setFont(arial20);
              this.add(welcome);
              //Menu Bar
              JMenuBar mb = new JMenuBar();
              this.setJMenuBar(mb);
              //Table
              table = new JTable(model);
              this.add(table);
              JMenu fm = new JMenu("File");
              fm.setFont(arial20);
              mb.add(fm);
              //Menu Items          
              JMenuItem Add = new JMenuItem("Add Record");
              Add.setFont(arial20);
              Add.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e) 
                        addw a = new addw();                    
              fm.add(Add);
              //Import from a file
              JMenuItem inp = new JMenuItem("Import Records");
              inp.setFont(arial20);
              inp.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e) 
                        //Opens Import Window.
                        inportw i = new inportw();                    
              fm.add(inp);
              JMenuItem quit = new JMenuItem("Exit");
              quit.setFont(arial20);
              fm.add(quit);
              quit.addActionListener(this);
    class inportw extends JFrame
              //*Add Window Properties and Settings
              public inportw ()
                   this.setSize(new Dimension(400, 150));
                   this.setTitle("Inport Records");
                   this.setLayout(new FlowLayout ());
                   this.setVisible(true);
                   //Nmae
                   JLabel error_note = new JLabel("Error Here - Need to make table final!?");
                   error_note.setFont(arial20);
                   this.add(error_note);
                   //Add Button
                   JButton binport = new JButton("Inport");
                   binport.addActionListener(new ActionListener()
                        public void actionPerformed(ActionEvent e) 
                             ArrayList data = new ArrayList();          
                   this.add(binport);
         public void actionPerformed(ActionEvent e)
              System.out.println("Application Exit");
              System.exit(0);
         public static void main(String[] args)
              basic b = new basic();
              The information from the atable needs to go into a .txt file with each row on a new line. It also needs to be in the inport/export window that is in a class on its own when someone clicks export.
    A complete peace of code would be helpfull that would do this for me. Thankyou guys.

    Rite then,
    In answer to both post yes i have done my own homework if thats what you wont to call it.
    And to the second post yes i have put in a File to export to. the code has not be pasted on my origanal post.
    //Export Button - Export Window
                   JButton bexport = new JButton("Export (BUAB)");
                   bexport.addActionListener(new ActionListener()
                        public void actionPerformed(ActionEvent e) 
                             System.out.println("Export Pressed ");
                             try
                                 FileWriter file = new FileWriter("AddressData.txt");
                                BufferedWriter out = new BufferedWriter(file);
                                 out.write("AddressBook data File");
                                out.close();
                             catch (Exception ei)
                             System.err.println("Error: " + ei.getMessage());
                   this.add(bexport);This is the export button,
    I think the code for the table model should be something like this:
    I wont to do something like this
    model.getModel().getValueAt(0, 0);
    Arrylist data = new arrylist();
    try
                                 FileWriter ffile = new FileWriter("AddressData.txt");
                                BufferedWriter out = new BufferedWriter(file);
                                 out.write(data);
                                out.close();
                             catch (Exception ei)
                             System.err.println("Error: " + ei.getMessage());
                                 }          Im not 100% sure how to get the information from the model into the arrylist, though a loop.
    If there is a section of a webpage that may help could someone please post it for me.
    Unfortunatly for me Im visualy impaired and find some of this hard. I learn though looking at examples and creating my own programs that do something similar.
    If no one wonts to help then that fine with me !

  • How to export data from a Oracle table to a delimited file?

    I know how to load delimited file into a table, but how to export
    data from a Oracle table to a delimited file?
    Thanks in advance.

    Try looking at this link, it's long but there's three different solutions discussed in it. If you look at Barbara Boehmer's
    solution in her posts in the link below you'll see that she's addressed your concerns with spool files.
    Re: utl_smtp and triggers

  • I have to average data of 1min and then log into text file

    For my application i have to average data of 1min and then log into text file. please guide me on this . To transfer the data i am using notifier.
    Prashant Soni
    LabVIEW Engineer

    hi prashant,
      Check this attachment..I just implemented my idea    in this one.
    Thanks and regards,
    srikrishnaNF
    Attachments:
    Example_VI_BD.png ‏12 KB

  • ABAP program to output data from SAP table to an XML format file?

    hello ABAP experts,
    Does anyone know how to output data from SAP table to an XML format file?  Would be appreciated if someone show the detailed sample codes and we will give you reward points!
    Thanks!

    Edited by: Jose Hugo De la cruz on Aug 19, 2009 8:23 PM

  • Is that possible to get data from the red trace in this BMP file

    I have an instrument, which only export image file. I want use labview to replot it and do some analysis. The image file is like attachment. Is that possible to get data from the red  trace in this BMP file via labview vis?
    Attachments:
    coax312.bmp ‏4741 KB

    I looks to me that 515 pixels represents 200 meters, so multiply the
    x-values by 0.3885 meters/pixel to get the true x-values.  I don't
    have enough information to scale the y-axis.
    Randall Pursley
    Attachments:
    Compute from BMP.vi ‏66 KB

  • Get information from an array saved into a text file

    I am trying to get information from an array saved as a text file to extract the information to build an string. This string will go out from the serial port to a device which will listen this message and it will answer the question. All the information sended sequencially it has to be obtained from that array. Every row contain one instruction and this has to be sended one after one.
    Could you tell me if is possible to make this driver? And if you have a similar driver, Where can I get it from?

    The VIs that I would suggest using are found in the String Function Pallet:
    Spreadsheet String To Array
    Array To Spreadsheet String
    The delimiter should be the termination character. These VIs will adapt to a string array.
    For the Spreadsheet String To Array wire an empty string array and use %s as the format. The delimiter should be the termination character of the text file, most likely a end of line (\r\n).
    For the Array To Spreadsheet String the delimiter should be the termination required for your serial device.
    Using a combination of these two VIs should provide you the functions required to make the driver.

  • Upload data from excel where one column has text of 3000 characters

    Guyz,
    I have a query. One of my requirments is to upload data from excel sheet & create a material. In the excel sheet one of the columns has text for BASIC DATA TEXT under ADDITIONAL DATA of a Material. This is a text of running length.
    the selection screen has feature of file upload & the users will upload excel files from their respective presentation servers.
    Now my problem is that I need a function module which can convert this column in excel sheet into an internal table & later call the BAPI for MM creation.
    I have used TEXT_CONVERT_XLS_TO_SAP & when i read my internal table to check this column length, it shows only 255 characters where as data in the excel sheet has 3000 characters (say for eg.)
    Can anybody throw some light on this.
    Thanks in advance
    GPK

    Hi,
    You can try using this function module and see that whether all your data is coming into the internal table properly.
    MS_EXCEL_OLE_STANDARD_DAT
    For the other part you needed to convert the internal table data into the structure as need by the BAPI and then call the create BAPI to create the materials in the SAP System.
    Hope this helps.
    Thanks,
    Samantak.

  • Populate a drop down list with data from Excel and fill in a text field, based on drop down selectio

    Hi!
    I have a problem with a PDF form: There's a drop down list that I populate with Excel data that I've put in an XML file through an XSD file -- no problem here. The drop down list has a data binding to the XML file, so that a choice in the drop down list can be associated with an object in the XML file. So, when I make a choice in the drop down list, a corresponding object value is fetched from the XML file and put in a text field on the form.
    How to do this is described by Stefan Cameron here:
    http://forms.stefcameron.com/2006/07/29/dynamic-properties/
    There's a snag, though, and to describe it more clearly:
    The XML file contains three types of objects: role, role number, and role cost center. Of these I use the first and the third, i.e. the role and the role cost center. The drop down list contains the roles, and when I select a role, the corresponding cost center is filled out in the text field. So far, so good!
    But -- if the cost center has the same value for two or more roles, all of these roles "bounce back" into the drop down list, that is, they are all selected in the drop down list. How many of these you can see depend on the height of the drop down list -- if it's low you'll only see the first one.
    If I modify Stefan Cameron's data in his example I get the same behavior, so the problem seems to have to do with how XML data are fetched.
    I'm sure there's a workaround, but I can't find it! I've spent many hours browsing the web without finding anyone with a similar problem.
    Any suggestions appreciated!

    Although your issue is far beyond mine, I was hoping you can help me out.....
    I need to create a drop down list of names which I wish to somehow link to an Excel spreadsheet.
    Please let me know the steps I need to do.  I've tried several things, but nothing seems to work and I'm not sure what I am doing wrong.
    Thank you

  • Issue for retrive data from ITAB

    Case:HOW CAN WE FETCH DATA FROM TRANSPARENT TABLE
    scenario:calculating net price for material on sales order
    (on the basis of material number,sales organization,distribution channel,division,sale to partY ,sales office)
    For this 5 prices are calculated :
    a)zmrp
    b)zlbj
    c)zmlb
    d)zdij
    e)mwst
    A bapi is developed through which all these data are fetched using joins on transparent and pooled tables.
    Bapi is properly working in Sap Environment.But when fetching data from non sap environment(.NET) only pooled tables are returning data.
    Transparent tables are returning blank data.
    And also if in query of transprent table if  in " where Clause " all parameters are hard codded then transparent table also return data in non sap envirnment.
    for eg...
    instead of writing ---
    select data from tranparent table where matnr= (matnr variable made in bapi entered by user) and vkorg=(sales org  variable made in bapi) ....same with all conditions
    if we write(returing data)----
    select data from tranparent table where matnr='5476665987' and vkorg='1400' ....same with all conditions
                                                                                    FUNCTION ZBAPI_BAR3.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(MATNR) TYPE  ZBAPI_IMPORT2-MATNR
    *"     VALUE(VKORG) TYPE  ZBAPI_IMPORT2-VKORG
    *"     VALUE(VTWEG) TYPE  ZBAPI_IMPORT2-VTWEG
    *"     VALUE(KUNNR) TYPE  ZBAPI_IMPORT2-KUNNR
    *"     VALUE(SPART) TYPE  ZBAPI_IMPORT2-SPART
    *"     VALUE(AUART) TYPE  ZBAPI_IMPORT2-AUART
    *"     VALUE(VKBUR) TYPE  ZBAPI_IMPORT2-VKBUR
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  BAPIRETURN
    *"  TABLES
    *"      ITAB STRUCTURE  ZBAPI_TABLE3
      DATA: LAND1  LIKE KNA1-LAND1  ,
            REGIO  LIKE KNA1-REGIO  ,
            WERKS  LIKE VBAP-WERKS  ,
           KNUMH  LIKE A004-KNUMH  ,
                   KNUMH LIKE ZBAPI_TABLE3-Knumh  ,
            KBETR   LIKE  COND_KONW-Kbetr ,
           LIKE ZBAPI_TABLE3-KBETR  ,
          KNUMH1(10) TYPE C ,
                KNUMH2(10) TYPE C ,
                KNUMH3(6) TYPE C ,
         KNUMH2 LIKE ZBAPI_TABLE3-KNUMH  ,
         KNUMH3 LIKE ZBAPI_TABLE3-KNUMH  ,
         KNUMV LIKE  ZBAPI_TABLE3-KNUMV  ,
            KDGRP  LIKE KNVV-KDGRP  ,
            TAXKD  LIKE KNVI-TAXKD  ,
            TAXM1  LIKE MLAN-TAXM1  ,
            ADRNR  LIKE TVBUR-ADRNR ,
            REGION LIKE ADRC-REGION ,
            DATE  TYPE A503-DATAB .
      SELECT SINGLE KDGRP FROM KNVV INTO KDGRP WHERE KUNNR  = KUNNR AND VKORG = VKORG AND VTWEG = VTWEG AND SPART = SPART   .
      SELECT SINGLE LAND1 REGIO  FROM KNA1 INTO (LAND1,REGIO)  WHERE KUNNR  = KUNNR .
      SELECT SINGLE WERKS FROM VBAP INNER JOIN VBAK ON VBAPVBELN = VBAKVBELN  INTO WERKS  WHERE AUART = AUART  .
      SELECT SINGLE TAXKD FROM KNVI INTO TAXKD WHERE KUNNR = KUNNR AND ALAND = LAND1 AND TATYP = 'MWST' .
      SELECT SINGLE TAXM1 FROM MLAN INTO TAXM1 WHERE MATNR = MATNR AND ALAND = LAND1  .
      SELECT SINGLE ADRNR FROM TVBUR INTO ADRNR WHERE VKBUR = VKBUR  .
      SELECT SINGLE REGION FROM ADRC INTO REGION WHERE ADDRNUMBER = ADRNR   .
      DATE = SY-DATUM .
      SELECT SINGLE KNUMH FROM A931 INTO KNUMH1 WHERE KAPPL = 'V' AND KSCHL = 'ZMRP' AND VKORG = VKORG AND VTWEG = VTWEG AND WERKS = '1410' AND KUNNR = KUNNR AND MATNR = MATNR AND KFRST = SPACE AND DATAB LE DATE AND DATBI GE DATE  .
    SELECT SINGLE KNUMH FROM A931 INTO KNUMH1 WHERE KAPPL = 'V' AND KSCHL = 'ZMRP' AND VKORG = '1400' AND VTWEG = '10' AND WERKS = '1410' AND KUNNR = '0000100163' AND MATNR = 'A10AN027PNSL' AND KFRST = SPACE AND DATAB LE DATE AND DATBI GE DATE  .
      SELECT SINGLE zkarigar FROM zkari INTO KNUMH1 WHERE erdat = '20070410' .
    SELECT SINGLE KNUMH FROM A004 INTO KNUMH1 WHERE KAPPL = 'V' AND KSCHL = 'ZMRP' AND VKORG = VKORG AND VTWEG = VTWEG AND MATNR = MATNR  AND DATAB LE DATE AND DATBI GE DATE  .
    *'0000280050'
    CLEAR KNUMH .
    CLEAR KBETR .
    SELECT SINGLE KNUMH FROM A503 INTO KNUMH1 WHERE KAPPL = 'V' AND KSCHL = 'MWST' AND ALAND = LAND1 AND WKREG = REGION AND REGIO = REGIO
    AND TAXK1 = TAXKD  AND TAXM1 = TAXM1 AND KFRST = SPACE  AND DATAB LE DATE AND DATBI GE DATE and knumh = '0000279708'.
    concatenate '0000' KNUMH into knumh1 .
    **KNUMH1 = KNUMH .
    **select single kbetr from konp into kbetr where knumh = knumh1 .
    **knumh3 = knumh1+4(6) .
    ***itab-kbetr = kbetr .
    **concatenate '0000' knumh3 into knumh2 .
    **write:/ knumh2 .
    ITAB-KNUMH1 =  KNUMH2 .
    ITAB-KNUMH1 = KNUMH1 .
      APPEND ITAB .
    *loop at itab .
    *write:/ itab-knumh1 .
    *endloop .
    CLEAR KNUMH .
    CLEAR KBETR .
      SELECT SINGLE KNUMH FROM A940 INTO KNUMH WHERE KAPPL = 'V' AND KSCHL = 'ZDIJ' AND VKORG = VKORG AND VTWEG = VTWEG AND KDGRP = KDGRP AND MATNR = MATNR AND KFRST = SPACE AND DATAB LE DATE AND DATBI GE DATE .
      SELECT SINGLE KNUMH FROM A931 INTO KNUMH WHERE KAPPL = 'V' AND KSCHL = 'ZDIJ' AND VKORG = VKORG AND VTWEG = VTWEG AND WERKS = WERKS AND KUNNR = KUNNR AND MATNR = MATNR AND KFRST = SPACE AND DATAB LE DATE AND DATBI GE DATE  .
    ITAB-KNUMH =  KNUMH.
    APPEND ITAB .
    CLEAR KNUMH .
    CLEAR KBETR .
    ITAB-KNUMH =  KNUMH .
    APPEND ITAB .
    COMMIT WORK AND WAIT.
    ENDFUNCTION.
    Thanks & Regards
    Amrish

    Hi,
    Please Check this => The specified item was not found.
    How to post code in SCN, and some things NOT to do...
    Faisal

  • Download data from itab to excel in background (POINTS WILL BE REWARDED )

    Hi Guys...
    Is it possible to transfer data from an internal table to excel through a report which runs in background...???
    thnx in advance...

    Please refer following code.
    LOOP AT IT_EXCEL_LAYOUT.
      CONCATENATE: IT_EXCEL_LAYOUT-SLNO             ','
                   IT_EXCEL_LAYOUT-HERST            ','
                   IT_EXCEL_LAYOUT-QMNUM            ','
                   IT_EXCEL_LAYOUT-QERDAT           ','
                   IT_EXCEL_LAYOUT-AUFNR            ','
                   IT_EXCEL_LAYOUT-ERDAT            ','
                   IT_EXCEL_LAYOUT-EBELN            ','
                   IT_EXCEL_LAYOUT-AEDAT            ','
                   IT_EXCEL_LAYOUT-BELNR_M          ','
                   IT_EXCEL_LAYOUT-BSART            ','
                   IT_EXCEL_LAYOUT-MATNR            ','
                   IT_EXCEL_LAYOUT-TXZ01            ','
                   IT_EXCEL_LAYOUT-MTART            ','
                   IT_EXCEL_LAYOUT-MENGE            ','
                   IT_EXCEL_LAYOUT-CBAMT            ','
                   IT_EXCEL_LAYOUT-MMCRAMT          ','
                   IT_EXCEL_LAYOUT-CRN_NO           ','
                   IT_EXCEL_LAYOUT-MMDBAMT          ','
                   IT_EXCEL_LAYOUT-DBN_NO           ','
                   IT_EXCEL_LAYOUT-REJAMOUNT        ','
                   IT_EXCEL_LAYOUT-DBN_REJ_CODE_TEXT','
                   IT_EXCEL_LAYOUT-STAMT            ','
                   IT_EXCEL_LAYOUT-STXCAMT          ','
                   IT_EXCEL_LAYOUT-CRNNO            ','
                   IT_EXCEL_LAYOUT-LRNO             ','
                   IT_EXCEL_LAYOUT-LRDATE           ','
                   IT_EXCEL_LAYOUT-TRANSPORTERNAME
            INTO   IT_EXCEL-FLD.
          APPEND   IT_EXCEL.
    ENDLOOP.
    DATA:w_filename LIKE  CFFILE-FILENAME.
    CONCATENATE '/usr/sap/EC2/SYS/global/backup/'SY-UNAME '.csv' INTO w_filename.
    OPEN DATASET w_filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    IF SY-SUBRC = 0.
      LOOP AT IT_EXCEL.
         TRANSFER IT_EXCEL TO w_filename.
      ENDLOOP.
    ENDIF.
    CLOSE DATASET w_filename.
    It will help u to download data on to application server in csv format
    Regards,
    Swarup

Maybe you are looking for

  • Shutdown Problem with KT4AV MS6712

    Here is the problem. I am running XP service pack 1, XP2600 processor FSB 333, 512 mb mem, 40 gig hard drive, dvd rom and cd burner. If I use XP to power down system (shutdown) it actually performs a soft reboot (restart). I have checked to make sure

  • Should i use cache group or a direct connection to oralce database?

    I have a lot of data needs to be inserted into the ORACLE database in a short period of time ,the corresponding table with massive data, whether it can be used to achieve storage of high-speed TIMESTEN the high efficiency?

  • Using CASE in ORDER BY

    Hi. I have a select statement that returns a ref cursor for a report I'm working on. My predicament is the order by depends on a parameter provided by the user. If you have any suggestions or related experience, please let me know...I would greatly a

  • Blocking User to change the "Configure Columns"

    Hi, I have a folder which is "Files" views Is there any to block User to change "Configure Columns" in folder option? Thanks

  • ABC Indicator Update Using MIBC (RMCBIN00)

    Hi, I need a help investigating what's going on with MIBC update. Here is what happened. We run MIBC yearly to reset the ABC indicator based on consumption in material master (MARC-ABCIN). I ran MIBC with 'Display' option first and download the resul