Display and Manage Attachments of Generic Object Services in Webdynpro

Hi All,
I need to have a button in the webdynpro that when a user clicks it will pop up a table that display a list of files already attached to a Generic Object Services(GOS) and also allow the user to delete the attachments and upload new attachments.
Can anyone advice me of any Function Modules or Methods that i can use to achieve those functions (retrive and display attachments in the GOS, delete existing attachment from GOS, upload new attachment to GOS).
Thanks and Regards,
weilong

Hi
You need to pass parameters as per the code below
****Data Types
  CONSTANTS:lc_dokob        TYPE dokob VALUE 'KNA1',
              lc_dokar      TYPE dokar VALUE 'LEG',
              lc_dappl      TYPE dappl VALUE 'BVO',
              lc_sign       TYPE c VALUE 'I',
              lc_option(2)  TYPE c VALUE 'EQ',
              lc_docpart(3) TYPE c VALUE '000',
              lc_docversion TYPE dokvr VALUE '00',
              lc_status     TYPE dokst VALUE 'AL',
              ls_attc-doknr    TYPE doknr,
              ls_return TYPE bapiret2,
*****Function Module
  CALL FUNCTION 'BAPI_DOCUMENT_DELETE_DIRECT'
        EXPORTING
          documenttype    = lc_dokar
          documentnumber  = ls_attc-doknr
          documentpart    = lc_docpart
          documentversion = lc_docversion
        IMPORTING
          return          = ls_return.
Thanks
Vishal

Similar Messages

  • Create Attachments to Generic Object Services from Webdynpro appliccation

    Hi,
    I have requirement to Create Attachments  to Generic Object Services(GOS) in equipment master (IE03)  from webdynpro when a user clicks on upload button and also allow the user to delete the attachments .
    Can anyone advice me of any Function Modules or logic to use from Web GUI.
    I used below logic from R/3 to create attachments, but from webdynpro this method doesn't work.
    DATA lo_attachment TYPE REF TO cl_gos_document_service.
      CREATE OBJECT lo_attachment.
      CALL METHOD   lo_attachment->create_attachment
           EXPORTING  is_object = ls_object
           IMPORTING  ep_attachment = lp_attachment
    Your inputs are appreciated.
    Thanks
    Rajesh Yalda

    Hi,
    try using the Class CL_GOS_SRV_ATTACHMENT_CREATE with Method EXECUTE_ITS.
    best regards,
    Michael

  • Attachments Activating Generic Object Services (GOS) in VA41/VA42 at item level

    Hi to All,
    I'm trying to manage attachments for sales document at item level.
    I've already read this wonderfull post (Activating Generic Object Services Toolbar in SAP Objects) but I didn't understand how manage attachments at item level.
    Please, if anyone has ideas of how to achieve it please share solutions.
    Thanks & Best Regards,
    Umberto

    Hi again,
    Thanks for the answers, they were very helpful,
    but the customer isn't happy with the "Store business Documents" and it's Drag n' drop interface.
    I'm to develop a new GOS menu item, that will show
    a normal Open File dialog, and a following popup
    where the user can change the document title shown
    in the Attachment list.
    ARCHIVOBJECT_CREATE_FILE and ARCHIVOBJECT_GET_TABLE
    along with ARCHIV_CONNECTION_INSERT should probably
    cover the functionality I need.
    I know both the BOR type ID and the object ID is
    available to me in the Execute() method of the GOS menu handler I'm overriding, but for the ARCHIV_CONNECTION_INSERT, I'm supposed to supply an AR_OBJECT parameter (I know that this information is stored in the TOAOM table), but I have no clue where to get this information for the current object I'm trying to add an attachment for.
    Regards,
    Lars Wilhelmsen

  • Generic Object Services using WebDynpro ABAP

    I am using Web Dynpro for ABAP and would like to access Generic Object Services (GOS) to view attachments or similar functionality for attachments in web dynpro ABAP. How can I access the functionality of attachments from a Web Dynpro application?
    Any help is appreciated.
    Thanks

    Hi,
    I assume that you wantted to have the attachements in a mail.
    Please check out the Adobe Forms(ie PDF attachements) and Office Control UI elements in WDA.
    Regards
    Lekha

  • How to upload and store attachments to an object in ABAP Webdynpro ?

    Hi all,
    I would like to upload file attachments of various types to a document within SAP (in this case Expense Reports), using Webdynpro ie. The attachment belongs to a particular expense report.  So each document , whether Word, Text, Bitmap etc. would be accessible thereafter by an Expense Report number.
    In SAPGUI, we have the powerful function module GOS_ATTACHMENT_LIST_POPUP which takes a user-defined object key to create and change documents. 
    I'm trying to find an equivalent interface for this in WDynpro. I looked at the component WDK_POWL_WF_DETAIL, but this seems to be suited to Workflow. Can anyone out there give some further tips or examples around this ?
    Regards,
    Gabriel

    Upload using the com.oreilly.servlets package- I don't recall the exact method for using this but it is pretty easy.
    Check the file size and type on upload. Only accept gifs and jpgs smaller than 50k (standard for web- go above this if you like but will take time to download and possibly annoy users.)
    Use AWT to create standard size thumbnails of the pictures or to standardize them so they will fit on the page properly.
    Write the images to the requisite directory. I would suggest giving them a name which matches them directly with the record id number (such as catalogueitem1.jpg) or submit the image name to the database.
    If you are serving on Unix you will need Xvfb or something like it running on your server for AWT to work.
    To display it just take the value from the database and add it to the filename, e.g. :
    <img src="/catalogue/catalogueitem<%=databaseid%>.jpg">
    I'm afraid the code I do this with at the moment is very poor and you will do a lot better with a little research into the topic than trying to follow what I have written.

  • Generic Object Services - View Attachments disabled for non admin user

    Hi,
    I am using SAP 4.7 and the attachments created using table TOA01 - archive link are visible to an administrator user through Generic Object Services toolbox while same View Attachments option appears disabled for other non admin users.
    Kindly help !

    Hi Neha,
    I'm sorry I don't have answer to your question but I wonder if you could help me.
    I'm looking at OSS note 530792 to configure GOS 'create attachment' option to copy the attachments to the archive server. currently, these are written to the SAP office tables SOC3, SOFFCONT1, etc and I want to use the archivelink and SAPHTTP and copy to the archive storage.
    Have you successfully managed to configure your system since you mentioned TOA01?
    In the same GOS menu I've activated the 'Business document' option and can copy these to the archive server by correctly configuring OAC2 and OAC3.
    I'll really appreciate of you could please share your knowledge.
    Thanks.
    Soyab

  • Adding Generic Object Services attachments to PRA trans O3U_DO3

    I would like to add the generic object services attachment menu that is found in vf02 - invoice create to the production and revenue accounting module transaction O3U_DO2/O3U_DO3 Maintain/Display DOI Owners.  I need the ability to attach external documents through archive link to this transaction.  If not possible with generic object services, any other suggestions on how to attach the documents is greatly appreciated.

    Hi,
    Welcome to the SDN Forums!!!
    You need to supply the PC file extension in the container element 'DOCUMENTTYPE'.
    swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
    In your case change the above statement as below:
    swc_set_element lt_message_container 'DOCUMENTTYPE' 'pdf'.
    <b>OR</b> change the default value of p_msgtyp to 'PDF'.
    Cheers,
    Ramki Maley.
    Please reward points if the answer is helpful.
    For info on awarding points click on this link: https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
    Message was edited by: Ramki Maley

  • GOS: Generic Object Services (BC-SRV-GBT)

    Hi All,
    I have a requirement to implement GOS for our Netting document - object type OIA_BUS001, we need to link a url to our document. And I managed to get the toolbox to appear besides the gui title, using both the FM SWU_OBJECT_PUBLISH and the OO codes that was provided in the SAP help.
    But the results is not quite right - in both cases, when I click on the toolbox -> create, all the functions listed, 'Create attachement, 'create note', etc, are greyed out.
    Is there something that I'm missing here?
    That's not the least of my problems. When (being optimistic here) this ok, I need to find a way on how to update the url in the background....
    Appreciate if anybody have some pointers here.
    Regards,
    Nik

    Try the following code.
    /people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background
    Report  Z_RMTIWARI_ATTACH_DOC_TO_BO
    Written By : Ram Manohar Tiwari
    Function   : We need to maintain links between Business Object and
                 the attachment.Attachment document is basiclally a
                 business object of type 'MESSAGE'.In order to maintain
                 links, first the attachment will be crated as Business
                 Object of type 'MESSAGE' using Message.Create method.
                 Need to check if we can also use FM
                 'SO_DOC_INSERT_WITH_ORIG_API1' or SO_OBJECT_INSERT rather
                 than using Message.Create method.
    REPORT  Z_RMTIWARI_ATTACH_DOC_TO_BO             .
    Include for BO macros
      INCLUDE : <CNTN01>.
    Load class.
      CLASS CL_BINARY_RELATION definition load.
      CLASS CL_OBL_OBJECT      definition load.
    PARAMETERS:
    Object_a
       P_BOTYPE LIKE obl_s_pbor-typeid DEFAULT 'BUS2012', " e.g. 'BUS2012'
       P_BO_ID  LIKE OBL_S_PBOR-INSTID DEFAULT '4700000368',  " Key  PO No.
    Object_b
       P_DOCTY  LIKE obl_s_pbor-typeid DEFAULT 'MESSAGE' NO-DISPLAY,
       P_MSGTYP LIKE SOFM-DOCTP        DEFAULT 'URL'     NO-DISPLAY,
    Relationship
       P_RELTYP  LIKE mdoblrel-reltype DEFAULT 'URL'.
      types: BEGIN OF TY_MESSAGE_KEY,
              FOLTP TYPE SO_FOL_TP,
              FOLYR TYPE SO_FOL_YR,
              FOLNO TYPE SO_FOL_NO,
              DOCTP TYPE SO_DOC_TP,
              DOCYR TYPE SO_DOC_YR,
              DOCNO TYPE SO_DOC_NO,
              FORTP TYPE SO_FOR_TP,
              FORYR TYPE SO_FOR_YR,
              FORNO TYPE SO_FOR_NO,
             END OF TY_MESSAGE_KEY.
      DATA : LV_MESSAGE_KEY type TY_MESSAGE_KEY.
      DATA : LO_MESSAGE type SWC_OBJECT.
      DATA : LT_DOC_CONTENT type standard table of SOLI-LINE with header
    line.
    First derive the Attachment's ( MESSAGE )document type.
      P_DOCTY = 'MESSAGE'.
      CASE P_RELTYP.
      In case of URls
        WHEN 'URL'.
           P_MSGTYP = 'URL'.
      In case of Notes / Private Notes
        WHEN 'NOTE' OR 'PNOT'.
           P_MSGTYP = 'RAW'.
        WHEN 'ATTA'.
           P_MSGTYP = 'EXT'.
      Not implemented as yet...exit
         EXIT.
        WHEN OTHERS.
       ....exit
         EXIT.
        ENDCASE.
    Create an initial instance of BO 'MESSAGE' - to call the
    instance-independent method 'Create'.
      swc_create_object LO_MESSAGE 'MESSAGE' LV_MESSAGE_KEY.
    define container to pass the parameter values to the method call
    in next step.
      swc_container LT_MESSAGE_CONTAINER.
    Populate container with parameters for method
      swc_set_element LT_MESSAGE_CONTAINER 'DOCUMENTTITLE'
                 'Title, created programatically'.
      swc_set_element LT_MESSAGE_CONTAINER 'DOCUMENTLANGU' 'E'.
      swc_set_element LT_MESSAGE_CONTAINER 'NO_DIALOG'     'X'.
      swc_set_element LT_MESSAGE_CONTAINER 'DOCUMENTNAME' P_DOCTY.
      swc_set_element LT_MESSAGE_CONTAINER 'DOCUMENTTYPE'   P_MSGTYP.
    'DocumentContent' is a multi-line element ( itab ).
    In case of URLs..it should be concatenated with &KEY& in the begining.
      CASE P_MSGTYP.
        WHEN 'URL'.
          LT_DOC_CONTENT = '&KEY&http://www.gtservicing.com' .
          append LT_DOC_CONTENT.
    In case of Notes or Private Notes, get the data from files on appl
    server or from wherever(? - remember background).
         WHEN 'RAW'.
           LT_DOC_CONTENT = 'Hi How r u?' .
           append LT_DOC_CONTENT.
    In case of File attachments
         WHEN 'EXT'.
          Upload the file contents using open dataset in lt_doc_content .
          Some conversion ( Compress ) might be required.
          Not sure at this point
      ENDCASE.
      swc_set_element LT_MESSAGE_CONTAINER 'DocumentContent' LT_DOC_CONTENT.
      swc_call_method LO_MESSAGE 'CREATE' LT_MESSAGE_CONTAINER.
    Refresh to get the reference of create 'MESSAGE' object for attachment
      swc_refresh_object LO_MESSAGE.
    Get Key of new object
      swc_get_object_key LO_MESSAGE LV_MESSAGE_KEY.
    Now we have attachment as a business object instance. We can now
    attach it to our main business object instance.
    Create main BO object_a
      data: LO_IS_OBJECT_A type SIBFLPORB.
      LO_IS_OBJECT_A-INSTID = P_BO_ID.
      LO_IS_OBJECT_A-TYPEID = P_BOTYPE.
      LO_IS_OBJECT_A-CATID  = 'BO'.
    Create attachment BO object_b
      data: LO_IS_OBJECT_B type SIBFLPORB.
      LO_IS_OBJECT_B-INSTID = LV_MESSAGE_KEY.
      LO_IS_OBJECT_B-TYPEID = P_DOCTY.
      LO_IS_OBJECT_B-CATID  = 'BO'.
    *TRY.
    CALL METHOD CL_BINARY_RELATION=>CREATE_LINK
      EXPORTING
        IS_OBJECT_A            = LO_IS_OBJECT_A
       IP_LOGSYS_A            =
        IS_OBJECT_B            = LO_IS_OBJECT_B
       IP_LOGSYS_B            =
        IP_RELTYPE             = P_RELTYP
       IP_PROPNAM             =
       I_PROPERTY             =
    IMPORTING
       EP_LINK_ID             =
       EO_PROPERTY            =
    *CATCH CX_OBL_PARAMETER_ERROR .
    *CATCH CX_OBL_MODEL_ERROR .
    *CATCH CX_OBL_INTERNAL_ERROR .
    *ENDTRY.
    Check if everything OK...who cares!!
      commit work.

  • Attach Documents to Custom Program Using Generic Object Services

    Hi There,
             I created Object type ZGOS and used in the custom program, when i try to attach documents it allows and then shows in attachment list.
            But When I use that program next time that document attached is not available.
    Is there any separate save Class or FM available for saving the document to the specified custom program.
    I am using following code in the program,
      CLEAR obj.
    SET OBJECT TYPE TO 'ZGOS'
      obj-objtype = objtype.
    SET OBJECT KEY = REPORT NAME
      SELECT SINGLE name
      FROM trdir
      INTO obj-objkey
      WHERE name = sy-repid.
    CALL GOS MANAGER WITHOUT CONTAINER (WILL BE DISPLAYED IN THE TOOLBAR)
      CREATE OBJECT manager
        EXPORTING
          is_object = obj
        EXCEPTIONS
          OTHERS    = 1.
    Thanks in advance.

    Check the Naimesh Patel Blog he explain very well
    http://help-abap.blogspot.com/2009/02/generic-object-services-gos-toolbar.html

  • Connect a Word document instance to Generic Object Services/BDS

    Hello all,
    how can I manage to get a word document created via the Doc_template step to a certain Business Object (like Business Partner). I tried to trace that but I got lost in generations of codes like archivelink, sap office, knowledge provider etc.) I guess it should not be that difficult as I have the key of the word doc instance and the key of the business partner instance. What I want at last is to have that word document linked via attachments/linked objects or something similar....
    Kindest regards from Germany,
    Markus

    Markus,
    Welcome to the forum!
    I have done this sometime ago at a past client site and will see if I can find the code.
    If I remember correctly, this involves converting the attachment to an SOFM object (using method CREATESOFM of BO WF_DOC) and then using function module BINARY_RELATION_CREATE to attach it to the BO. The links below will give you more info. Also Google for BINARY_RELATION_CREATE which should give you more links.
    Re: Link Workflow Document to BKPF object
    <a href="/people/rammanohar.tiwari/blog/2006/03/25/generic-object-services-gos--in-background--part-ii">Generic object services (GOS) - in Background - Part II</a>
    http://mailman.mit.edu/pipermail/sap-wug/2005-September/019547.html
    Cheers,
    Ramki Maley

  • How to create a Generic Object Services for a standard tcode.

    Hi,
    We have a requirement where we are depreciating the assets (standard transaction ABAA) using a custom BDC program. We need to maintain a history (called audit trail) for the particular asset that has been depreciated using this program. For this audit train we have been asked to use "Generic Object Services" in transaction code ABAA.
    Unfortunately, Generic object services are not available in this transaction code. Can you please suggest me how to create "Generic Object Services" for a particular standard transaction code. Also, we have show the details of custom workflow that follows the approval process in order to depreciate the asset. how to show this workflow details using Generic Services. This is a very critical issue, any help will be very help ful.
    Please let me know should you require more information on this topic.
    Thanks,
    Ashish

    Instead of copyg the std fm to z, do the following,
    1. Go to se37 open FM VIEW_KURGV in display mode.
    2. Click on the spiral icon on the top.
    3. Then in menu go edit->enhancment options -> show implicit enhancement
    4. """""""""""""""""""""" kind of lines will appear in the cde, just rt click on the line at the place u want to insert the code and select
         enhancement implementation create.
    5. Give apropriate name for thi , it will inset a n place to write your code.
    This is an std sap methodology and is supported in upgradde also.

  • How to use Generic Object Services(GOS) for each table control record.

    Dear Expert,
                       I am using generic object services for document attachment but i am facing a problem while attaching document to a table control row. my requirement is to attach separate document for each and every row of table control but  i am unable to attach document row wise of the table control.for each row GOS should display corresponding attached document not all the attached document.
    Thanks in Advanced
    Bhuwan Tiwari
    Edited by: BHUWAN TIWARI on Feb 8, 2011 4:16 PM
    Edited by: BHUWAN TIWARI on Feb 8, 2011 4:16 PM

    You haven't explained what object and object key you're using, nor have you provided any indication of how you implemented the GOS attachment functionality.  You need to provide more information to resolve an issue like this.

  • Generic Object Services - Relationships

    Hello Everyone,
    In 4.6c when i go to VA02 Transaction, i see in the top left corner GENERIC OBJECT SERVICES BUTTON.
    This button has options like Create Attachment, Private Notes, Send Object with Note, Relationships, etc.
    Using one of the button in this Generic Object services, that is, RELATIONSHIPS i need to see all the Outbound IDocs and all the Inbound IDocs pertaining to that sales order through which we have logged into VA02 transaction.
    Right now, the Relationship button is disabled, I need to know how do i enable it and when clicked what do i need to do inorder for the IDocs to be displayed.
    This is in 4.6c and not in ECC.
    Your help is appreciated.
    Thanks

    Dear Bob Schmidt
    After your post, I too tried the Additional links and the end result was same as you got :-((.
    Tried to get some links but not sure, whether these links will be of helpful to you.
    [Enable Links in the Tool Area|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/501f3154-b66c-2910-0988-bd9b2440d018]
    [Navigation Between Views|http://help.sap.com/saphelp_nw70/helpdata/en/42/bb8c6cc7131d67e10000000a1553f6/content.htm]
    In the second link, at the bottom some information is given on Additional link but not sure, whether it is related to sale order Additional link )
    thanks
    G. Lakshmipathi

  • Generic Object Services ; create attachment function grey out in Tcode KA03

    Hi all,
    I would like to know how can I enable create attachment function in GOS toolbar in Tcode KA03.
    Currently it was grey out.
    However, was tried to use the same function in KS03 and it works.Please help. Thanks!

    I just found the solution...
    SAP note : 961572
    Symptom</u>
    In the transactions for displaying cost elements (KA03) and changing cost elements (KA02), the 'Services for Object' function does not work correctly, as most Generic Object Services are unavailable.
    Other terms
    KA03, KA02, SWO1, K_OBJECT_SERVICES_INITIALIZE, BUS1059, BUS1030
    Reason and Prerequisites
    The problem is caused by a program error.
    Solution
    Implement the attached program corrections
    Then go to Transaction SW01 (Business Object Builder), enter BUS1059 as the object type, click Change, and make the following changes:
    Navigate to Methods -> RevenueType.Display, press F2 to select it, and go to the 'ABAP' tab page: Select the 'Transaction' radio button, enter the name as KA03, and click 'Save'
    Navigate to Attributes -> Attribute properties, select the 'Mandatory' checkbox, and click 'Save'
    Then change the release status by navigating as follows:
    Edit -> Change Release Status -> Object Type -> To implemented
    Edit -> Change Release Status -> Object Type -> To released
    Then double-click BUS1059 (or select using F2) in SWO1 to reach the 'General' tab page, which should appear as follows:
    ObjectType      BUS1059         Revenue element
    Object Name      RevenueType
    Program          RBUS1059
    Objtype status   generated       Saved      released

  • Attachment List in Generic Object Services disabled

    I want to attach documents to a work centre (transaction CR02, business object BUS0011). This has been configured so that the document will reside in the content management server and will be accessed using Archivelink. I can successfully store the doc using trasnaction OAWD, and can then retrieve the doc using transaction OAOR. The links are correctly created in table TOA03.
    However, when I try and view the docs from the Generic object services button for transaction CR02 the "Attachment List" link is greyed out.
    I've just set this up for invoices (object BKPF) so can't understand why this hasn't worked for work centres. 
    I've implemented the interface IFARCH21 for BUS0011, and this hasn't resolved the issue.
    Any ideas?
    Thanks
    Richard

    Richard,
    Your using the wrong object, I don't have access to an SAP system right now, so I can't tell you what the correct object is, but when it's configured correctly in OAC3 it will not be grey out.  Best thing to do it see what the object the program is publishing.  This is what GOS is looking for.  IFARCH21 is not the answer, unless your using workflow

Maybe you are looking for

  • Cannot export or share project error (-50)??

    I've made a 4 minutes 31 seconds video and tried to export and exporting through quicktime then this message occurred: Unable to prepare project for publishing The project could not be prepared for publishing because an error occurred. (-50) I've eve

  • I am unable to install/download the starterpack for Creative cloud and no one is helping at Adobe

    Please help , I am desparate, I have subscribed to The adobe cerative cloud solution since dec. 25 2013. I am unable to download and install the starter program . I was in contact with your on line chat room. They removed temp files, made folder acce

  • Air-lap1142n Is it dead or just in need of help?

    Hi, I have a number of air-lap1142n-e-k9 access points, so far they have all been deployed successfully aprt from this one unit. When I deployed it, it joined the wlc as normal, downloaded the image, and I was able to rename it etc.. but then a coupl

  • SB LIVE 5.1 EMU10K1-JFF & SYSTEM FREE

    System: .8 Gig P4 52MB Ram GeForce FX5500 256 MB Graphics Plenty of Hard Dri've open (like 20 Gig) Win 98 SE with all updates DirectX 9.0c Latest BIOS Upgrade available (Oct 2004) (BIOS has been tweaked/configured per SB IVE instructions on this site

  • Setting NLS_LANG env variable for adcmctl.sh

    How do set the NLS_LANG env variable specifically for adcmctl.sh? Currently it gets overridden by the NLS_DATE_LANG env variable. I'd like to set it to blank if possible. Thanks in advance!