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

Loading files from presentation server

Former Member
0 Likes
4,090

Hello folks,

Is there any standard abap program used for loading a file from presentation server to an SAP directory.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,005

Hi Naren,

You can write your own program to upload file from Presentation server (using GUI_UPLOAD) and then use 'open dataset' , 'transfer' and 'close dataset' statements for writing the same to application server (SAP directory).

Regards,

Raj

10 REPLIES 10
Read only

Former Member
0 Likes
2,006

Hi Naren,

You can write your own program to upload file from Presentation server (using GUI_UPLOAD) and then use 'open dataset' , 'transfer' and 'close dataset' statements for writing the same to application server (SAP directory).

Regards,

Raj

Read only

0 Likes
2,005

This is not exactly meant for the purpose of transferring files from server to desktop and desktop to server, but it will serve the purpose.

Go to SXDB. Pick up any object and go to next screen. Here, under the "File access" section, enter the file name, path and in the appropriate place(Application Server or Presentation Server). In the application toolbar, select the button for 'Copy'. This will take you to another screen. Specify the 'From' and 'To' appropriately and click 'Copy' again. A decision pop-up will come asking "File contains lines with an unknown structure. Should these lines also be copied?". Click 'Yes' and your file will now be copied to the destination folder.

You need the necessary access to your unix box though.

Srinivas

Read only

Former Member
0 Likes
2,005

From Presentation server use function:

GUI_UPLOAD or OPEN DATASET

Read only

Former Member
0 Likes
2,005

Hi Naren

I think this Standard program can serve the purpose RPCIFU04

Regards

Neelima.

Read only

Former Member
0 Likes
2,005

u may try LSPCAU01 program for doing this. or else u can copy it & enhance according to ur requirements.

Pl. award appropriate points.

Read only

Former Member
0 Likes
2,005

Use

Call method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

   CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = l_filename
        filetype                = l_filetype
        has_field_separator     = yes              "use tabs
*       HEADER_LENGTH           = 0
*       READ_BY_LINE            = 'X'
*     IMPORTING
*       FILELENGTH              =
*       HEADER                  =
      CHANGING
        data_tab                = <l_data_tab>     "w/o header line
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        not_supported_by_gui    = 17
        OTHERS                  = 18.
    IF sy-subrc <> 0.
    endif.

and then <b>open data</b> set destination

and transfer the data set using <b>trasfer </b>.

Read only

Former Member
0 Likes
2,005

Hi,

There is no such Program is there, even you can wirte small code for the same,

Use GUI_UPLOAD to get the data from Presentation server and load it in to a Internal table,

then use <b>OPEN DATASET <filename> FOR INPUT IN TEXT MODE</b>

then use *-- LOOP UNTIL THE END OF FLAT FILE

DO.

*-- POPULATES FLAT FILE DATA INTO INTERNAL TABLE

READ DATASET <filename> INTO <Internal table>.

IF sy-subrc <> 0.

EXIT.

ELSE.

APPEND <internale table>.

CLEAR: <internale table>.

ENDIF.

ENDDO.

*--Close the file

CLOSE DATASET <filename>.

hope you understand

Regards

Sudheer

Read only

Former Member
0 Likes
2,005

You can:


report ztest.

data: begin of itab occurs 0,
        field(256),
      end   of itab.
data: dsn(100) value '/usr/sap/xfr/FIS/testbmp'.

call function 'GUI_UPLOAD'
     exporting
          filename   = 'c:temptest.txt'
     tables
          data_tab   = itab.

open dataset dsn for output in binary mode.

loop at itab.
  transfer itab-field to dsn.
endloop.

close dataset dsn.

Rob

Read only

Former Member
0 Likes
2,005

Use transactions:

CG3Y and CG3Z.

Cheers

Read only

Former Member
0 Likes
2,005

Hi,

Try with OPEN,READ and CLOSE DATASETS

Thanks

Eswar