‎2009 May 21 1:02 PM
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.
‎2009 May 21 1:48 PM
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
‎2009 May 21 1:05 PM
hai sekhar,
give the path of application server instead of presentation server
regards
afzal
‎2009 May 21 1:06 PM
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
‎2009 May 21 1:06 PM
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
‎2009 May 21 1:07 PM
Hi,
You will have to make use of OPEN DATASET , TRANSFER and CLOSE DATASET statements.
Regards,
Ankur Parab
‎2009 May 21 1:10 PM
‎2009 May 21 1:19 PM
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
‎2009 May 21 1:48 PM
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
‎2009 May 26 11:50 AM
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