Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

friends probelm in bdc..any one help..plz..

Former Member
0 Kudos

friends i want to upload data using one tool which it accepts only .txt files..but on the presentation server i have only .csv...microsoft excel files...

so can u plz tell me how to convert .csv into .txt files after uploading..or how top upload and conver them..plz..any one..?

3 REPLIES 3

Former Member
0 Kudos

hi satish,

before uploading it do convrsion.

steps to convert csv file to txt file:

-> open excel file.

-> goto file menu-> select save as option .

-> save that csv file as tab delimited file with .txt extention.

-> now use that file in uploading.

<b><i>Reward points if useful</i></b>

Chandra

Former Member
0 Kudos

Hi,

ALSM_EXCEL_TO_INTERNAL_TABLE- try this func. module to upload values from excel file. Now we have values in internal table it_table

so at every new value of row move the values into an internal table with each value separated by tab( c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab)

Now u have an internal table with the records tablimited..

Reward if helpful.

Regards,

Karthick.

Former Member
0 Kudos

Hi

The CSV is a text file, so I believe your problem can be on how the information are written in the file:

DATA: W_RECORD TYPE STRING,
           T_FILE          LIKE STANDARD TABLE OF W_RECORD.

DATA: BEGIN OF ST_RECORD,
              FIELD1,
              FIELD2,
              FIELD3,
              ...........
              FIELDN, 
           END   OF ST_RECORD.

DATA: BEGIN OF T_VALUE OCCURS 0,
              FIELD(100),
           END   OF T_VALUE.

FIELD-SYMBOLS: <FIELD> TYPE ANY.

* By FM GUI_UPOLAD import the file to T_FILE table:

LOOP AT T_FILE INTO W_RECORD.

* ; should be the symbol used as separator
   SPLIT W_RECORD AT ';' INTO TABLE T_VALUE.
* Move the data from line of csv file to your structure
  LOOP AT T_VALUE.
     ASSIGN COMPONENT SY-TABIX OF STRUCTURE ST_RECORD TO <FIELD>.
     IF SY-SUBRC = 0.
        MOVE T_VALUE-FIELD TO <FIELD>.
     ENDIF.
  ENDLOOP.

Max