Skip to Content
Author's profile photo Nabheet Madan

Create/Edit/Delete Attachments using GOS

Creating attachments from Presentation server or notes or URL and displaying or editing them was the requirement given to us. It was all a custom development and custom Business Object was to be used. I found the below mentioned approach to be quickest once to implement the above mentioned requirements.

  • Pop Up to allow user to choose the attachments. User can also add notes and URL also apart from attachments. We created a custom business Object ZBO1 for the same. Then we called the function module SGOS_DOCUMENT_CREATE_DIALOG by passing objectype and objectkey. It displays a popup to select the file/create note/URL. So the first task of getting the pop up for attaching the file was accomplished. You press ok and the file is attached.

  • Second task was to edit them or delete them. this task was also made simple by using another SAP standard function module GOS_ATTACHMENT_LIST_POPUP. In it you have various parameters based on which you can enable editing functionality. For eg Using IP_MODE we can control whether it should be in display mode or change mode.
  • Third task was to write a label on screen mentioning whether some attachment exist if yes then label should ‘EXIST’ else ‘NOT EXIST’. This was also acoomplished by implementing a simple method COUNT_FOR_OBJECT of class CL_GOS_ATTACHMENT. 

You can link these documents to document repository also for which additional confirguration is required.

Please let us know in case we have some better way of implementing the same requirements. It will be great if you can provide your own view and opinions for the same.

Assigned Tags

      17 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Gilles JUNG
      Gilles JUNG
      Seems very interesting.
      Any screen shots ?
      Rgds
      Gilles
      Author's profile photo nabheet madan
      nabheet madan
      Blog Post Author
      Thanks...will update the screen shots soon:)

      Nabheet

      Author's profile photo nabheet madan
      nabheet madan
      Blog Post Author
      Updated with two screen shots.

      Nabheet

      Author's profile photo Former Member
      Former Member
      Hi
      Good one. I did have the similar one last month, I raised a thread
      ( Webforms - data handling and storage )  , please have a look.

      Best Regards
      Saujanya

      Author's profile photo nabheet madan
      nabheet madan
      Blog Post Author
      Thans saujanya:) yeah its sort of similar requirement.. I used it in my custom tcode

      Nabheet

      Author's profile photo Vinoth Kumar
      Vinoth Kumar
      Hi Nabheet- Thank you for sharing this information

      Vinoth

      Author's profile photo nabheet madan
      nabheet madan
      Blog Post Author
      Thanks Vinoth:) lets share and learn..:)

      Nabheet

      Author's profile photo Former Member
      Former Member
      What a great way to start programming in OOP.  I like it.  I like the ALV OOP too for just that reason.  It's easy to use, so we use it.

      Very interesting requirement!  Adding this to my ABAP tricks library.

      Michelle

      Author's profile photo nabheet madan
      nabheet madan
      Blog Post Author
      Hi Michelle

      "Very interesting requirement! Adding this to my ABAP tricks library."--> Shall i take this as actually a trick or somthing else..?Please clarify

      Nabheet

      Author's profile photo nabheet madan
      nabheet madan
      Blog Post Author
      Sorry posted to wrong blog...plus mixing up the things...Bad day today it is..

      @Michelle..What is your twitter id if by any chance you are on it

      Nabheet

      Author's profile photo Former Member
      Former Member
      I'm at work.  Sadly, I can't get to Twitter.  It is @MichelleCrapo.

      I look forward to chatting with you.

      Michelle

      Author's profile photo Former Member
      Former Member
      English is an interesting language, at least American slang English!

      It will go in my folder where I keep all the information that I may need to use later.

      Sorry about that!  Sometimes I forget the multiple languages.  You all amaze me.  I took 3 years of Spanish.  I remember nothing of it.  And if I tried to speak it even then, no one would know what I was talking about, because they couldn't understand me.  I talk with people on SCN who have a multiple language background and am just amazed!

      Michelle

      Author's profile photo Former Member
      Former Member

      Hi Nabheet,

      • Thanks for sharing this knowledge.Infact we had certain similar Requirment but in a WEBDYNPRO Comonenet.
      • So had to use FILE_UPLOAD GUI element in LAYOUT.
      • Seems there are variuos ways to accomaplish this tasks.

      This once gives better insight using BUSINESS OBJECT.

      Infact SAP-NWBC involves these features for same.but not by means of SAP - ABAP

      Kudos!!!!!!!

      -Vishal

      Author's profile photo Former Member
      Former Member

      Hi Nabhee

      Do you have any doc with the code or the step by step of that?

      If you have any example could tell me please?

      thanks

      Author's profile photo Former Member
      Former Member

      Hi we are using the GOS functionality to attach original documents (like .pdf or
      .doc) to transaction FB03.

        

      It works, but we noticed into the attachment list the field "Author"
      remains empty, so there is no way to know who did the attachement activity.

      Another usefull point should be to display into the attachment list the real file name
      of the attachment, because actually  into the field "Name" appears the description of the document type choosed to upload the original document, and this is a generic string like 'Pdf Document', and is not very usefull if you have an Attachment List with a lot of original documents
      attached.

        

      But I'm not a developer and  It's not clear for me at the moment if to satisfy these requests do I have to develop something or maybe its just missing customizing.

      Any Idea ?

      Regards

      Author's profile photo Dhananjay Choubey
      Dhananjay Choubey

      Hi nabheet,

      I am using this class but i have a requirement to add a custom name to my file. Suppose i am accessing from Desktop and filename is abc.pdf but i want to add it as in the form name like tv_abc.pdf.

      May you help me please?

      Regards

      Dhananjay

      Author's profile photo Former Member
      Former Member

      hi

      I want to view attachment for CS/PM Notification using BAPI GOS_ATTACHMENT_LIST_POPUP .

      First I added file in IW22 via GOS button , saved Notification and then I tried to view this file via BAPI with IP_MODE=D but attachment i snot visible.

      Most probably I am referring to the wrong object.

      Can you tell me what data should be passed in IS_OBJECT parameters?

      INSTID

      TYPEID

      CATID

      I was using

      "Notification number"

      BUS2038

      BO

      but it does not work.

      thanks for tips.