01-11-2010 12:09 PM
Hello Guys,
I have a screen which has a button called Attach File (can be any file). If I click on the button, I can select a file from presentation server and that file should be attached for the particular data. And I have another button called Display Attachement, in that case I should be able to display the attached document.
I searched SDN, I couldn't find any closed posts on this.
Anybody please help me out to get me a solution for this. If anyone has demo program, kindly share it across.
Regards,
Yasin.
01-11-2010 12:21 PM
Hi Yasin,
in SAP we have a concept like GOS(Generic Object Service) with this we can attach files ,URL's, workflows etc and we can use these attached files in that screen if necessary ,
[http://help-abap.blogspot.com/2009/02/generic-object-services-gos-toolbar.html]
[http://help.sap.com/saphelp_46c/helpdata/en/94/aa532cddd511d289860000e8216438/content.htm]
please take a look the above Links u may find some solution
i have worked on GOS menu if u have any queries let USknow,
SDN is there to Help
Thanks
Surendra P
01-11-2010 12:21 PM
Hi Yasin,
in SAP we have a concept like GOS(Generic Object Service) with this we can attach files ,URL's, workflows etc and we can use these attached files in that screen if necessary ,
[http://help-abap.blogspot.com/2009/02/generic-object-services-gos-toolbar.html]
[http://help.sap.com/saphelp_46c/helpdata/en/94/aa532cddd511d289860000e8216438/content.htm]
please take a look the above Links u may find some solution
i have worked on GOS menu if u have any queries let USknow,
SDN is there to Help
Thanks
Surendra P
01-12-2010 7:04 AM
Thanks a lot Suri. It's really great and it is working fine. But I have a concern in that.
I am attaching these files based on some RS_NUMBER (is in a Z table) as object key. And in case if I delete the RS_NUMBER from the database table, is it possible to delete the attachments also?
Thanks again.
Yasin.
01-11-2010 12:31 PM
Download internal table to presentation server file(PC) Separating fields/columns by a tab
DATA: ld_filename TYPE string,
DATA: begin of it_datatab occurs 0,
col1(50) type c,
col2(50) type c,
col3(50) type c,
etc....
end of it_datatab.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = ld_filename
filetype = 'ASC'
APPEND = 'X'
write_field_separator = 'X'
CONFIRM_OVERWRITE = 'X'
TABLES
data_tab = it_datatab[]
EXCEPTIONS
file_open_error = 1
file_write_error = 2
OTHERS = 3.
Uploading file from presentation server,
DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.
DATA: begin of it_datatab occurs 0,
row(500) type c,
end of it_datatab.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = i_file
filetype = 'ASC'
TABLES
data_tab = it_datatab "ITBL_IN_RECORD[]
EXCEPTIONS
file_open_error = 1
OTHERS = 2.