2007 Jan 10 6:07 AM
Hi,
I have a requirement to insert the files(,pdf , .txt , .doc , .xls ) in fileserver from
abap program.
how to do .
Pls help.
2007 Jan 10 6:10 AM
Hi,
I have a requirement to insert the files(,pdf , .txt , .doc , .xls ) in fileserver from
abap program.
how to do .
Pls help.
2007 Jan 10 6:10 AM
2007 Jan 10 6:11 AM
1) USe GUI_UPLOAD and GUI_DOWNLOAD for ulpoading and downloading file on presentation server.
2) use below demo code to download or upload file to or from Application server -
if it is one time use transaction CG3Y and CG3Z
REPORT ZGILL_AS message-id rp .
tables: pa0001,pa0002.
select-options s_pernr for pa0001-pernr no intervals MODIF ID XYZ.
parameters: p_dwnld AS CHECKBOX ,
p_upld AS CHECKBOX DEFAULT 'X'.
parameters: P_DSNI(75) TYPE C MODIF ID ABG DEFAULT
'/usr/local/sapdata/amit.dat' LOWER CASE.
data: begin of itab occurs 0,
pernr(8),
sp1(1) value ',',
werks(4),
sp2(1) value ',',
persg(1),
sp3(1) value ',',
persk(2),
end of itab.
data: s_eof(3).
start-of-selection.
if p_upld = 'X'.
OPEN DATASET P_DSNI FOR OUTPUT IN LEGACY TEXT MODE.
PERFORM FETCH_DATA.
STOP.
elseif p_dwnld = 'X'.
OPEN DATASET P_DSNI FOR INPUT IN LEGACY TEXT MODE.
IF SY-SUBRC NE 0.
MESSAGE E016 WITH
'Error opening seq. file, RC:' SY-SUBRC.
EXIT.
ENDIF.
CLEAR S_EOF.
DO.
PERFORM FETCH_file.
IF S_EOF EQ 'YES'. stop. ENDIF.
ENDDO.
endif.
END-OF-SELECTION.
if itab[] is not initial.
perform print_file1 tables itab.
else.
write:/ 'No records exists'.
endif.
&----
*& Form FETCH_DATA
&----
text
----
--> p1 text
<-- p2 text
----
FORM FETCH_DATA .
SELECT * FROM PA0001 WHERE PERNR IN S_PERNR.
MOVE-CORRESPONDING PA0001 TO ITAB.
TRANSFER ITAB TO P_DSNI.
APPEND ITAB.
ENDSELECT.
CLOSE DATASET P_DSNI.
ENDFORM. " FETCH_DATA
&----
*& Form FETCH_file
&----
text
----
--> p1 text
<-- p2 text
----
FORM FETCH_file .
READ DATASET P_DSNI INTO itab.
append itab.
clear itab.
IF SY-SUBRC NE 0.
S_EOF = 'YES'. EXIT.
ENDIF.
ENDFORM. " FETCH_file
&----
*& Form print_file1
&----
text
----
-->P_ITAB text
----
FORM print_file1 tables P_ITAB structure itab .
write:/2 'EmpNo',
14 'Personnel Area',
34 'Emp Group',
47 'Emp SubGroup'.
skip 1.
loop at p_itab.
write:2 p_itab-pernr,
14 p_itab-werks,
34 p_itab-persg,
47 p_itab-persk.
skip 1.
endloop.
ENDFORM. " print_file1
2007 Jan 10 6:13 AM
2007 Jan 10 6:26 AM
2007 Jan 12 12:23 PM
CG3Z is Ok.I am able to file transfer through this Tcode.
But I need this operation through a program. So I think I have to use Open Dataset commands for the same.Pls give me the code for File transfer using Dataset statments and not the internal table data transfer.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |