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: 

How to transfer the output of this program into file in Application Server

Former Member
0 Kudos

Dear all,

I have created program which the output to be stored in Application server using DATASET.

But Unfortunately the file was stored but not stored full output.of the program in Application server

send me a sample program

With Regards,

Baskaran.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

example:

select matnr spart from mara into table itab

where matnr = 'ABC'.

gv_intfile = fath + file name.

OPEN DATASET gv_intfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc NE 0.

MESSAGE 'Could not open the file'

ENDIF.

LOOP AT itab into wa_itab.

TRANSFER wa_itab TO gv_intfile.

ENDLOOP.

CLOSE DATASET gv_intfile.

According to your requirements format the data of itab then transfer to gv_intfile.

Hope this will help you.

2 REPLIES 2

Former Member
0 Kudos

example:

select matnr spart from mara into table itab

where matnr = 'ABC'.

gv_intfile = fath + file name.

OPEN DATASET gv_intfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc NE 0.

MESSAGE 'Could not open the file'

ENDIF.

LOOP AT itab into wa_itab.

TRANSFER wa_itab TO gv_intfile.

ENDLOOP.

CLOSE DATASET gv_intfile.

According to your requirements format the data of itab then transfer to gv_intfile.

Hope this will help you.

Former Member
0 Kudos

Thanks