Application Development and Automation 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: 
Read only

open data set

Former Member
0 Likes
614

hi i have file on appl server and i have opended it using open data set

used do and read it. i have sent the data into an internal table. now how can i upload it to sap can i use normal call transaction or bdc session method on this data.

pl clarify.

thanks

Quavi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
582

Hi,

You can use any one of them. No problem.

Regards,

Atish

4 REPLIES 4
Read only

Former Member
0 Likes
583

Hi,

You can use any one of them. No problem.

Regards,

Atish

Read only

former_member404244
Active Contributor
0 Likes
582

Hi,

u can use either session or call transaction to upload the data..

Regards,

Nagaraj

Read only

Former Member
0 Likes
582

hi

good

go through this link

http://www.kabai.com/abaps/z04.htm

READ DATASET <dsn> INTO <f> [LENGTH <len>].

This statement reads data from the file <dsn> into the variable <f>. In order to determine into which variable you should read data from a file, you need to know the structure of the file.

You can specify the transfer mode in the OPEN DATASET statement. If you have not already opened the file for reading, the system tries to open it either in binary mode, or using the additions from the last OPEN DATASET statement. However, it is good practice only to open files using the OPEN DATASET statement. For further information about the OPEN DATASET statement and the naming conventions for files, refer to Opening a File.

If the system was able to read data successfully, SY-SUBRC is set to 0. When the end of the file is reached, SY-SUBRC is set to 4. If the file could not be opened, SY-SUBRC is set to 8.

If you are working in binary mode, you can use the LENGTH addition to find out the length of the data transferred to <f>. The system sets the value of the variable <len> to this length.

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3d42358411d1829f0000e829fbfe/content.htm

thanks

mrutyun^

Read only

former_member194152
Contributor
0 Likes
582

hi,

I am sending one routine in which i am reading file from application server and populating that into an internal table.

form download_data .

clear mtab_data.

refresh mtab_data.

clear ctab.

refresh ctab.

clear itab.

refresh itab.

OPEN DATASET phy_name_out FOR INPUT IN TEXT MODE ENCODING DEFAULT

MESSAGE lv_file_error.

IF sy-subrc NE 0.

CLOSE DATASET phy_name_out.

FORMAT COLOR COL_NEGATIVE ON.

WRITE : / 'MESSAGE :',LV_FILE_ERROR.

  • flag = 'X'.

  • STOP.

FORMAT COLOR OFF.

ENDIF.

DO.

CLEAR lv_file_line.

READ DATASET phy_name_out INTO lv_file_line.

IF sy-subrc EQ 0.

lv_file_line+0(1) = ' '.

SHIFT lv_file_line LEFT DELETING LEADING space.

SPLIT lv_file_line AT '~' INTO

wa_ctab-bukrs

wa_ctab-fkdat

wa_ctab-vbeln

wa_ctab-posnr

wa_ctab-kunag

wa_ctab-zterm

wa_ctab-inco1

wa_ctab-inco2

wa_ctab-matnr

wa_ctab-fkimg

wa_ctab-vrkme

wa_ctab-bpric

wa_ctab-fpric

wa_ctab-netwr

wa_ctab-waerk

wa_ctab-fkart

wa_ctab-lgort

wa_ctab-charg

wa_ctab-vkorg

wa_ctab-vtweg

wa_ctab-spart

wa_ctab-kunnr

wa_ctab-gjahr

wa_ctab-maktx.

APPEND wa_ctab TO ctab.

ELSE.

CLOSE DATASET phy_name_out.

EXIT.

ENDIF.

ENDDO.

endform. " download_data

Note : phy_name_out is varriable which hold full path of application server's file.

Reward if helpful.

Regards

Gagan