Skip to Content

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.

To report this post you need to login first.

17 Comments

You must be Logged on to comment or reply to a post.

  1. Michelle Crapo
    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

    (0) 
    1. nabheet madan 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

      (0) 
      1. nabheet madan 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

        (0) 
      2. Michelle Crapo
        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

        (0) 
  2. Vishal Sharma

    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

    (0) 
  3. Roberto Mariani

    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

    (0) 
  4. 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

    (0) 
  5. Bartosz Bien

    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.

    (0) 

Leave a Reply