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: 

file to AS400

Former Member
0 Kudos

Hi people.

I need to send an ASCII file to AS400. Somebody has idea of like being able to do it.

Thanks in advance.

Jorge.

1 ACCEPTED SOLUTION

former_member182371
Active Contributor
0 Kudos

Hi,

you could call fm

CALL FUNCTION 'GUI_EXEC'

EXPORTING

command = p_command

  • PARAMETER =

  • IMPORTING

  • RETURNCODE =

.

Best regards.

8 REPLIES 8

former_member182371
Active Contributor
0 Kudos

Hi,

first do a download to your application server and ftp this file to your AS400.

Best regards.

0 Kudos

you know some form to send it without having to do download?

Regards.

former_member182371
Active Contributor
0 Kudos

Hi,

<u>for the download</u> use either: (<b>foreground</b>)

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = g_filename

  • write_field_separator = 'X'

CHANGING

data_tab = i_cuerpos2.

or: (<b>background</b>)

OPEN DATASET g_filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT i_cuerpos1 INTO wa_stock1.

TRANSFER wa_stock1 TO g_filename.

ENDLOOP.

CLOSE DATASET g_filename.

<u>for the FTP</u> have a look at SAP standard program <b>RSFTP002</b>.

Best regards.

former_member182371
Active Contributor
0 Kudos

Hi,

you could call fm

CALL FUNCTION 'GUI_EXEC'

EXPORTING

command = p_command

  • PARAMETER =

  • IMPORTING

  • RETURNCODE =

.

Best regards.

0 Kudos

Ok Saladillo.

Muchas Gracias por tu ayuda.

Jorge.

0 Kudos

Hi Jorge,

I'm have to send file to as400, but FTP_CONNECT doesn't work for me. Please, would you tell me what can I do?

thanks,

Jennie

former_member182371
Active Contributor
0 Kudos

Hi Jorge,

if the answers have been helpful please don´t forgetto reward them

Best regards.

Former Member
0 Kudos

Jorge,

Utilizaste por casualidad PI para trasnferir el archivo al AS400???. Estoy en eso y quisiera comentar algunas dificultades.

Saludos