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

datasets

Former Member
0 Likes
635

hi mates

i used open dataset file <file name> ,now is there any need to use call funcation upload for data migration to application server r the above syntax is enough.

5 REPLIES 5
Read only

Former Member
0 Likes
602

Hi Devan,

Then DataSet Syntax is used only to open and read the File. you can pass these value to an internal table and use Call Transaction or use Direct insert statement or BAPI specific for inserting into the Target Database.

Thanks,

Prashanth

Read only

naimesh_patel
Active Contributor
0 Likes
602

hello,

*To open the data set

OPEN DATASET P_SFILE FOR OUTPUT IN TEXT MODE

*Move data to dataset

Loop at itab.

transfer itab to p_sfile.

endloop.

*Close Dataset

CLOSE DATASET P_SFILE .

Regards,

Naimesh

Read only

Former Member
0 Likes
602

Hi,

Use the following code.

OPEN DATASET FILE1 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORS.

IF SY-SUBRC EQ 0.

  • Transfer File to Application Server

LOOP AT ITAB.

TRANSFER ITAB TO FILE1.

ENDLOOP.

ELSE.

MESSAGE I000(VZ) WITH 'Exception'.

ENDIF.

CLOSE DATASET FILE1.

Regards,

Viven

Read only

Former Member
0 Likes
602

for uploading you have to use TRANSFER command

DAta FNAME(20) value 'AMIT'

TYPES: Begin of line,

col1 type I,

col2 type I,

end of line.

TYpES ITAB type LIN occurs 10.

DAta: lin type line,

tab type itab.

OPEN DATASET FNAME FOR OUTPUT.

LOOP AT ITAB.

TRNASFER LIN TO FNAME.

ENDLoop.

OPEN DATASET FNAME for Input.

DO.

READ DATASET FNAME into LIN.

if sy-subrc <> o.

exit.

endif.

write: / lin-col1, lin-col2.

enddo.

close dataset FNAME.

Message was edited by: amit bhadauria

Message was edited by: amit bhadauria

Read only

Former Member
0 Likes
602

Hi Devan,

The upload FM is used only to upload data from ur presentation server(desktop) to internal table.

Once internal table is ready, un can upload it to application server using dataset syntax.

Sreedhar