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

Data upload from Application Server

Former Member
0 Likes
1,177

i have one program which uploads data from presentation server to sap.

but thing is that now they want to upload data from Application server.

can any body give some idea what are the changes we have to made for earlier program to upload data from application server.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,088

Hi Shekar ,

I thing previously GUI_UPLOAD is used.

For your new requirement no need of the oldcode .

Now You use the following code - -

DATA : w_file(8) TYPE c VALUE 'FILE_NAM', " your present AS file name
       fs_itab(255) TYPE c,
       t_itab LIKE TABLE OF fs_itab.

OPEN DATASET w_file FOR INPUT IN BINARY MODE. " Openning file to read
IF sy-subrc EQ 0.
  DO.
    READ DATASET w_file INTO fs_itab.
    IF sy-subrc NE 0.
      EXIT.
    ELSE.
      APPEND fs_itab TO t_itab.
    ENDIF.
  ENDDO.
ENDIF.
CLOSE DATASET w_file.

Regards

Pinaki

8 REPLIES 8
Read only

Former Member
0 Likes
1,088

hai sekhar,

give the path of application server instead of presentation server

regards

afzal

Read only

Former Member
0 Likes
1,088

Hi

Use datasets for that purpose.

Refer to

DATA: lv_app_server_file TYPE string.

lv_app_server_file = <file_path>.

  • To read file from Application server

OPEN DATASET lv_app_server_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

DO.

READ DATASET lv_app_server_file INTO wa_file_data.

IF sy-subrc = 0.

APPEND wa_file_data TO tb_file_data.

ELSE.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET lv_app_server_file.

Hope it will help you. In case of query, Pls revert back.

Regards

Natasha Garg

Read only

Former Member
0 Likes
1,088

Hi,

use the T-code CG3Y..

it uploads data from Apllication server and downloads to presentation serve.



parameters : p_applfile type rlgrap-file,      "application fiel
                   p_presfile type rlgrap-fiel.      "presentation file
 
submit RC1TCG3Y 
WITH  RCGFILETR-FTAPPL = p_applfilename.
WITH  RCGFILETR-FTFRONT = p_presfile
AND RETURN.
if return = 0.
write :  'data downloaded to' p_presfile .
endif.

Regards,

Prabhudas

Edited by: Prabhu Das on May 21, 2009 5:39 PM

Read only

Former Member
0 Likes
1,088

Hi,

You will have to make use of OPEN DATASET , TRANSFER and CLOSE DATASET statements.

Regards,

Ankur Parab

Read only

former_member556412
Active Participant
0 Likes
1,088

Hi ,

Please refer to the following link.

http://www.sapdev.co.uk/file/file_uptabsap.htm

Regards,

Bhanu

Read only

Former Member
0 Likes
1,088

Hi,

Go through following piece of code .. i hope u will get some help...

OPEN DATASET p_pfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc = 0.

DO.

READ DATASET p_pfile INTO v_excel_string.

IF sy-subrc <> 0.

EXIT.

ENDIF.

it_prior-ssn = v_excel_string(9) .

it_prior-eeno = v_excel_string+9(10) .

it_prior-vorna = v_excel_string+19(30) .

it_prior-nachn = v_excel_string+49(30) .

it_prior-uni_dat = v_excel_string+79(10) .

it_prior-uni_id = v_excel_string+89(20) .

it_prior-locl_id = v_excel_string+109(10).

it_prior-barg_ind = v_excel_string+119(20).

it_prior-wage_dat = v_excel_string+139(10).

it_prior-wage_cod = v_excel_string+149(10).

APPEND it_prior .

CLEAR it_prior .

ENDDO.

CLOSE DATASET p_pfile.

Thanks & Regards

Ashu Singh

Read only

Former Member
0 Likes
1,089

Hi Shekar ,

I thing previously GUI_UPLOAD is used.

For your new requirement no need of the oldcode .

Now You use the following code - -

DATA : w_file(8) TYPE c VALUE 'FILE_NAM', " your present AS file name
       fs_itab(255) TYPE c,
       t_itab LIKE TABLE OF fs_itab.

OPEN DATASET w_file FOR INPUT IN BINARY MODE. " Openning file to read
IF sy-subrc EQ 0.
  DO.
    READ DATASET w_file INTO fs_itab.
    IF sy-subrc NE 0.
      EXIT.
    ELSE.
      APPEND fs_itab TO t_itab.
    ENDIF.
  ENDDO.
ENDIF.
CLOSE DATASET w_file.

Regards

Pinaki

Read only

Former Member
0 Likes
1,088

Hi Shekar,

You need to use Datasets.

1.Open dataset

2.Trasfer

3.CLose Dataset

If u want some example,please feel free to ask.

Good Luck,

Rizwana