03-11-2014 7:03 AM
Hi Gurus ,
I am in the middle of the technical issue related to the GOS_EXECUTE_SERVICE function module.
Everything is working fine but when i am attaching a file from my pc, it's taking the filename as it is. it sounds good.
But here comes the problem, i have a requirement of adding the filename starting with a common name.
Suppose i have attached a file and it's name is abc.pdf but i want to display it as zbp_abc.pdf.
Thanks and Regards.
Dhananjay
04-22-2014 12:26 PM
03-11-2014 10:26 AM
03-13-2014 4:55 AM
03-13-2014 12:11 PM
Hi Dhananjay,
Go through this my document link below for ref purpose , here defined the process of attaching file using GOS and while attaching file it gives an option to give name of file as per your requirement. It's enables a tool for attachment which is much like in VF03 or other standard tcodes.
http://scn.sap.com/docs/DOC-39470
Many Thanks / Himanshu Gupta
03-13-2014 12:31 PM
Hi Himanshu,
Thanks for your first reply
I have used this function module.
CONCATENATE ls_final-pernr ls_final-reinr INTO
ls_object-objkey.
ls_object-objtype = 'BUS2089'.
CALL FUNCTION 'GOS_EXECUTE_SERVICE'
EXPORTING
ip_service = 'VIEW_ATTA'
is_object = ls_object
ip_no_commit = ' '
ip_popup = 'X'
ip_rwmod = 'E'
* IT_SERVICE_SELECTION =
* IP_VSI_PROFILE =
IMPORTING
ep_event = lp_event
ep_status = lp_status
ep_icon = lp_icon
ep_message = lp_message
EXCEPTIONS
execution_failed = 1
OTHERS = 2.
It's working great. but i want to add a prefix before the file name. means after saving the file it must look like tv_abc.pdf and not like abc.pdf.
But file which i have selected from desktop is abc.pdf and after attaching it looks like tv_abc.pdf on screen.
Thanks in advance.
Regards
Dhananjay
03-13-2014 12:34 PM
Hi,
maybe (not sure) you could do this modify the SWO1 transaction of the corresponding object.
or you could copy/change the class used for archived the object.
Did you use the standard GOS button or a specific object ?
regards
Fred
03-13-2014 12:41 PM
Hi Frederic,
I am using the standard GOS Button.
Can you please tell me where to modify the SWO1 transaction for the create button.
Any help will be appreciated.
I did lots of things like copied the standard class to zclass. But always got failure.
Regards.
Dhananjay
03-13-2014 1:08 PM
03-13-2014 1:36 PM
Hi Fred,
in that attachment, i just found that how i can change the menu. i don't want to change the menu.
On the click of create attachment, the popup window will open. i will select a file, suppose abc.pdf. after selecting it, when the contents of alv will be displayed, i want to see it as tv_abc.pdf.
Thanks for your response.
Regards
Dhananjay
03-13-2014 3:17 PM
You could use BAdI GOS_SRV_REQUEST (*) to "intercept" service execution and use your own copy of standard methods, including the rename of attachment.
Regards,
Raymond
(*) I prefer usage of BAdI to change of tables SGOSATTR/SGOSCUST as it enables more options.
03-14-2014 9:32 AM
Hi Raymond,
I didn't understand. Can you explain please? Or if you have any document then give me the link.
I have not that much experience with SAP.
Thanks
Dhananjay
03-19-2014 12:24 PM
Read first the BAdI documentaiton (and some documents at help.sap.com on how to implement BAdI - https://help.sap.com/saphelp_nw04s/helpdata/en/5e/ebb541c5b63031e10000000a155106/content.htmImplementation of BAdIs) with this BAdI you can use your own method to attach a document, so you could wrap the standard method and then analyze its result and change data.
Also use search tool to get document like Attach files to GOS with Save, Retrieve, Delete functionality in SAP Web Dynpro ABAP - Part 1 where you will find many of the required FM and methods you will require for your task.
Regards,
Raymond
03-19-2014 8:52 AM
03-20-2014 11:43 AM
Hi,
At lastly i debugged deeply 'cl_gos_srv_attachment_create' class with 'execute' method and i found that i can change it at the 'SO_OBJECT_INSERT' . But this is the standard class and standard function module, so how i can add my piece of code for my requirement???.
Any ideas?
03-27-2014 8:54 AM
03-30-2014 12:00 PM
Hi Dhananjay,
there will be a standard solution for this from Basis 7.30. Please have a look on KBA 1895197. But this is a manual solution to change the filename after it was attached.
(Please not, that this development currently available only from GOS standard attachments and not for ArchiveLink business documents.)
Best regards,
Janos
04-22-2014 12:26 PM
04-22-2014 1:16 PM
Can you please share this with the others? Maybe it will help other SCN users too.
04-22-2014 1:25 PM
1. Import parameter from report program and export the parameter at:
Include program -> LSO30F00
Sub-Routine -> so_split_file_and_extension ( line no 246-311)
Enhancement implementation to be done at the end of sub-routine for prefixing the file with ‘TV_”.
2. Clearing of import parameter at end of the report.
Thanks
Dhananjay
01-18-2016 7:47 AM
Hi Dhanajay,
Above mentioned solution was very helpful for me.
But My requirement is how to put validation while deleting attachment.
Validation:User ID through which attachment got created should allowed to Delete attchment.
I am not getting right place to put validation.
Regards,
Pai