Application Development 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: 

Attaching file in module pool

former_member1292715
Participant
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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

0 Kudos

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.

former_member184703
Participant
0 Kudos

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.