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

How to TRANSFER a variable length table to application server ?

Former Member
0 Likes
770

TYPES : BEGIN OF type_outerface_tbl,

text TYPE string,

END OF type_outerface_tbl.

DATA: gw_outerface_tbl TYPE type_outerface_tbl,

gi_outerface_tbl TYPE STANDARD TABLE OF type_outerface_tbl.

-


FORM 9200_write_to_server.

LOOP AT gi_outerface_tbl INTO gw_outerface_tbl.

TRANSFER gw_outerface_tbl TO fully_qualified_filename.

ENDLOOP.

ENDFORM. " 9200_write_to_server

-


Error message:

'GW_OUTERFACE_TBL' cannot be a table, a reference, a string, or contain any of thesse objects.

-


Please advise.

Thank you very much!

Helen

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
695

Hi,

You need to use Open dataset if you want to transfer files to application server.

use the below sample code in your form and endform.

FORM 9200_write_to_server.

open dataset 'file.txt' for output in text mode encoding default.

if sy-subrc ne 0.

message e001. "error in opening file

endif.

loop at gi_outerface_tbl INTO gw_outerface_tbl.

transfer gw_outerface_tbl to 'file.txt'.

endloop.

close dataset 'file.txt'.

ENDFORM. " 9200_write_to_server

Thanks,

Sree.

Edited by: t sree on Nov 22, 2008 5:39 PM

Hi,

You need to use Open dataset if you want to transfer files to application server.

use the below sample code in your form and endform.

FORM 9200_write_to_server.

open dataset 'file.txt' for output in text mode encoding default.

if sy-subrc ne 0.

message e001. "error in opening file

endif.

loop at gi_outerface_tbl INTO gw_outerface_tbl.

transfer gw_outerface_tbl to 'file.txt'.

endloop.

close dataset 'file.txt'.

ENDFORM. " 9200_write_to_server

Thanks,

Sree.

Edited by: t sree on Nov 22, 2008 5:39 PM

4 REPLIES 4
Read only

Former Member
0 Likes
696

Hi,

You need to use Open dataset if you want to transfer files to application server.

use the below sample code in your form and endform.

FORM 9200_write_to_server.

open dataset 'file.txt' for output in text mode encoding default.

if sy-subrc ne 0.

message e001. "error in opening file

endif.

loop at gi_outerface_tbl INTO gw_outerface_tbl.

transfer gw_outerface_tbl to 'file.txt'.

endloop.

close dataset 'file.txt'.

ENDFORM. " 9200_write_to_server

Thanks,

Sree.

Edited by: t sree on Nov 22, 2008 5:39 PM

Read only

0 Likes
695

Sorry that I did not show my open file paragraph in my prev email post.

I did open the file before TRANSFER paragraph.

-


FORM 9000_write_to_ouput.

IF pa_down2 = 'X' AND radio1 = 'X'. "User selected Unix file

PERFORM 9200_open_output_file USING pa_path pa_file2.

PERFORM 9200_write_to_server. "Close UNIX file and unlock it

ENDIF.

ENDFORM. "9000_write_to_ouput

-


FORM 9200_write_to_server.

LOOP AT gi_outerface_tbl INTO gw_outerface_tbl.

TRANSFER gw_outerface_tbl TO fully_qualified_filename.

ENDLOOP.

CALL FUNCTION 'Z_FILE_CLOSE'

EXPORTING

unix_file = fully_qualified_filename.

ENDFORM. " 9200_write_to_server

-


Can we TRANSFER 'STRING' type file to server?

Thank you very much!

Helen

Read only

0 Likes
695

Hi,

TRANSFER gw_outerface_tbl-text TO fully_qualified_filename. <----


try with this

Thanks,

Sree.

Read only

0 Likes
695

You solved my problem!

Thank you very much!

Helen