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

uploading data into application server

Former Member
0 Likes
648

Hi all,

I want to pass the data into application server from an internal table in a fixed text format. Kindly help me.

Thanks in advance,

praveena

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
627

You will have to use OPEN DATASET command for the same.

DATA FNAME(60).

FNAME = '/tmp/myfile'.

OPEN DATASET 'myfile'.

OPEN DATASET FNAME.

loop at itab.

transfer itab to fname.

endloop.

CLOSE DATA FNAME.

Thanks

Aneesh.

4 REPLIES 4
Read only

Former Member
0 Likes
627

Hi,

Go through the following code

DATA FNAME(60) VALUE 'myfile'. " File name of applicationserver

TYPES: BEGIN OF TY_ITAB,

matnr TYPE matnr.

TYPES: END OF OF TY_ITAB

DATA : ITAB TYPE TABLE OF TY_ITAB.

DATA : WA LIKE LINE OF ITAB.

*Populate ITAB as per ur requirement

OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE.

LOOP AT ITAB INTO WA.

TRANSFER WA TO FNAME.

ENDLOOP.

CLOSE DATASET FNAME.

Regards,

Ranjit Thakur.

<b>Please Mark The Helpful Answer.</b>

Read only

amit_khare
Active Contributor
0 Likes
627

cHECK THIS CODE -

REPORT ZUPLOAD.

tables : pernr.

infotypes : 0002.

data : begin of t_0002 occurs 0,

vorna(20),

nachn(20),

end of t_0002.

parameters : p_file type rlgrap-filename .

start-of-selection.

get pernr.

rp-provide-from-last p0002 space pn-begda pn-endda.

move p0002-vorna to t_0002-vorna.

move p0002-nachn to t_0002-nachn.

append t_0002.

clear t_0002.

end-of-selection.

loop at t_0002.

write : / t_0002.

endloop.

open dataset p_file for output in text mode.

if sy-subrc ne 0.

write : / 'not op'.

endif.

loop at t_0002.

transfer t_0002 to p_file.

endloop.

close dataset p_file.

Regards,

Amit

reward all helpful replies.

Read only

Former Member
0 Likes
628

You will have to use OPEN DATASET command for the same.

DATA FNAME(60).

FNAME = '/tmp/myfile'.

OPEN DATASET 'myfile'.

OPEN DATASET FNAME.

loop at itab.

transfer itab to fname.

endloop.

CLOSE DATA FNAME.

Thanks

Aneesh.

Read only

Former Member
0 Likes
627

Hi,

Check the following link:

http://sap-img.com/abap/download-and-upload-your-abap-program.htm

Hope this helps.

Reward if helpful.

Regards,

Sipra