RFCs to create GOS attachment

Hi Experts,
I'm not ABAPer at all. Here are only my suppositions and please do not judge me strictly.
I need to upload PDF file as a GOS attachment to the QM notification from external system (SAP MII) using RFC. As I found out there is no remote-enabled FM for this. There is only SGOS_NOTE_CREATE for notes. I investigated it and found out that all FM's that are used inside it are remote-enabled.
Question: is it possible to call from my external system same 3 FMs as in SGOS_NOTE_CREATE (SO_FOLDER_ROOT_ID_GET, SO_OBJECT_INSERT, BINARY_RELATION_CREATE_COMMIT) to create attachment instead of note? I guess that in general i need to provide SO_OBJECT_INSERT with some other parameters than it is done in SGOS_NOTE_CREATE, so it will create attachment-object instead of note-object in SAPoffice. Is this way possible, or there should be more steps to create attachment?
thanks in advace,
Petr

Hi,
In the above code what is is_object and attachment parameters corresponds to. What are the values needs to used in this parameters.
data: l_object_id_loio type SDOKOBJECT,
       l_object_id_phio type SDOKOBJECT.
  call function 'SO_LOIO_PHIO_CREATE'
        importing
             loio_object = l_object_id_loio
             phio_object = l_object_id_phio
        exceptions
             kpro_model_error = 103
             x_error          = 1000
             others           = 1000
call function 'SO_KPRO_DATA_INTO_OBJCONT_PUT'
              exporting
                   loio_object = l_object_id_loio
              tables
*                CONTEXT     =
                   objcont     = i_objcont.
   x_obj_data-file_ext = 'HTM'.
     x_obj_data-OBJPRI = '5'.
      x_obj_data-extct = 'K'.
     x_obj_data-objla = sy-langu.
     x_obj_data-objdes = '000004280212022400687486'. "wa_attach-filename.
     x_obj_data-objlen   = LINES( i_bin_data ) * 255. "i_soli_size. 000000007319
     CONDENSE x_obj_data-objlen.
CONCATENATE '&SO_FILENAME=' '000004280212022400687486.htm' INTO x_objhead. "wa_attach-filename INTO wa_content.
     APPEND x_objhead TO i_objhead.
     x_objhead = '&SO_FORMAT=BIN' .
     APPEND x_objhead TO i_objhead.
     CALL FUNCTION 'SO_OBJECT_INSERT'
       EXPORTING
         folder_id                  = l_fol_id
         object_hd_change           = x_obj_data
         object_type                = 'EXT'
         owner                      = sy-uname
       IMPORTING
         object_id                  = x_object_id
       TABLES
         objcont                    = i_objcont    "&SO_KProObjectID=SOFFLOIO E2870D61F569E7F186CB0013216A31DB
         objhead                    = i_objhead     "&SO_FILENAME=000227964812102400687486.htm &SO_FORMAT=BIN
       EXCEPTIONS
         active_user_not_exist      = 1
         communication_failure      = 2
         component_not_available    = 3
         dl_name_exist              = 4
         folder_not_exist           = 5
         folder_no_authorization    = 6
         object_type_not_exist      = 7
         operation_no_authorization = 8
         owner_not_exist            = 9
         parameter_error            = 10
         substitute_not_active      = 11
         substitute_not_defined     = 12
         system_failure             = 13
         x_error                    = 14
         OTHERS                     = 15.
     IF sy-subrc = 0 AND x_object-objkey IS NOT INITIAL.
       x_folmem_k-foltp = l_fol_id-objtp.
       x_folmem_k-folyr = l_fol_id-objyr.
       x_folmem_k-folno = l_fol_id-objno.
       x_folmem_k-doctp = x_object_id-objtp.
       x_folmem_k-docyr = x_object_id-objyr.
       x_folmem_k-docno = x_object_id-objno.
       l_ep_note = x_folmem_k.
       x_note-objtype = 'BKPF'. "c_message.
       x_note-objkey = l_ep_note.
       CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
         EXPORTING
           obj_rolea    = x_object
           obj_roleb    = x_note
           relationtype = 'ATTA'
         EXCEPTIONS
           OTHERS       = 1.
I am using this code for attaching a .HTM external file automatically to a invoice document. But unable to attach it.
Can you please help.
Regards,
Rafi

Similar Messages

  • Create GOS attachment of BUS2012 in workflow

    Hi all,
    I've developped an workflow for approval of purchase order. When the approver has rejected the purchase order I create a document from template to describe the the reason for rejection. Now I want to attach in the workflow this document with rejection reason to the GOS of the purchase order (BUS2012). I've an container operation to assign the document to the adhoc_attach / adhoc_object, but this is only for the workflow instance. I want that if somebody else outside the workflow displays the purchase order can see the document with rejection reason by using the GOS attachmentlist. How can I assign the document with rejection reason to the GOS of BUS2012 in the workflow?
    Regards Patricia

    Hi
    Please use the following FM
    CALL FUNCTION 'SO_OBJECT_INSERT'
        EXPORTING
          folder_id        = ls_fol_id    "system folder ID
          object_type      = 'EXT'        "external
          object_hd_change = ls_obj_data  "file name and extension
        IMPORTING
          object_id = ls_obj_id           "system ID for the file
        TABLES
          objhead = it_objhead
          objcont = it_content
        EXCEPTIONS
          active_user_not_exist = 35
          folder_not_exist      = 6
          object_type_not_exist = 17
          owner_not_exist       = 22
          parameter_error       = 23
          OTHERS                = 1000.
    *finally link file (object) to master data
      CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
        EXPORTING
          obj_rolea    = ls_object
          obj_roleb    = ls_note
          relationtype = 'ATTA'
        EXCEPTIONS
          OTHERS = 1.
      ENDIF.
    Thanks
    Arghadip

  • How to create GOS view attachment list in ECC6

    Hi,
    I created Z transaction. I have to create View attachment List to this transaction. How to create GOS view attachment list in ECC6. can anybody send sample code on this.
    Thanks in advance.
    Zakir.

    Hi all,
    I've following problem with class CL_GOS_ATTACHMENTS.
    Transaction IE01/02/03 (create/change/display equipment) starts and instantiate GOS manager, and related BAdI are called.
    Then, when I choose one of available service, CL_GOS_ATTACHMENTS is instantiated, and inside that class a new GOS manager is instantiated, inspite of already existing instance.
    As a result, related BAdI are called twice, but unfortunately second time some SY variables are not correctly filled, particularly SY-TCODE and SY-MODNO are both empty.
    I've develop a workaround so that when sy-tcode is filled I save it somwhere, and when it's empty I filled it from saved value, does anyone know any other solution??
    Many thanks
    Regards
    m@x

  • Services for Object (GOS) Attachement List not showing after attachment

    Hi All,
    I have created a new entry for the Generic Object Service List and this links to a copy of the CL_GOS_SRV_ATTACHMENT_CREATE class (Create attachment) with some additional logic. However, after attaching a file, the "Attachment List" does not become available until after I re-enter the transaction. The attachment list is showing the correct attachments.
    After some (understatement...) investigation, I found that even if I try and link the new service to a unchanged copy of the CL_GOS_SRV_ATTACHMENT_CREATE service in SGOSATTR, it is not working. It is attaching fine, but the "Attachment List" entry in the Services for Object Menu is still greyed out. If I attach the original class CL_GOS_SRV_ATTACHMENT_CREATE to the newly created entry it works fine. e.g. straight after I attach a file to the transaction, the menu entry becomes available.
    I can't find where the re-draw of the GOS menu happens and hence can not determine what is going wrong. Does anybody know if this is part of the Kernel or is this actually done in ABAP ?
    Am I missing something ? Debugging including system debugging for two days now and can't find it... very frustrating.
    Any help would be appreciated.
    Thanks,
    Wouter.

    Hi Wouter,
    I had originally posted to ask if you had resolved this since I was facing the same issue, but then deleted my post when I was able to get it working. Sorry, I didn't mean to initiate a flurry of activity in such an old thread.
    My scenario is I created a new GOS service entry in table SGOSATTR using transaction SGOSM. My new service uploads attachments to an external document management system via a call to a RESTful web service. The class I use in the SGOSM entry is a custom subclass of CL_GOS_SRV_URL_CREATE.
    I resolved this issue by taking a look at what CL_GOS_SRV_URL_CREATE does in its EXECUTE method. The key bits to refresh the GOS Attachment List with the new attachment are...
    raise event commit_required. " if SGOSM has the commit flag checked
    raise event service_succeeded
           exporting eo_service = me.
    These events tell any subscribers to go do their thing-- which in this case includes a refresh of the GOS Attachment List. So in the EXECUTE method of my custom subclass, after I call function BINARY_RELATION_CREATE, I raise these events...
    CALL FUNCTION 'BINARY_RELATION_CREATE'
       EXPORTING
           obj_rolea     = gs_object
           obj_roleb    = rel_doc
           relationtype = 'URL'
       EXCEPTIONS
           OTHERS       = 1.
    CASE sy-subrc.
       WHEN 0.
           MESSAGE s043(sgos_msg). " The attachment was successfully created
           RAISE EVENT commit_required.
           RAISE EVENT service_succeeded
                 EXPORTING eo_service = me.
       WHEN OTHERS.
           MESSAGE s042(sgos_msg). " The attachment has not been created
    ENDCASE.
    I hope this is helpful to you even though your initial implementation was a while back. Thanks for replying to my question though!!
    Cheers,
    Amy

  • How to transfer GOS attachment to my work item

    Hi Friends,
      I have the following requirement. The user while creating a Appropriation request in tcode IMA1N will create an attachment using Generic Object Services(GOS). once he saves my workflow will trigger and it will go to approval. I need to show the attachment created using GOS in my Work item. How to achieve this. Please advice.

    I have some annotations:
    The object type ARCHIVE is for archived Data Files from the DataArchiving. The object type for ArchiveLink documents is  IMAGE
    The default method is  .Display   to display the document.
    The GOS-Attachment is not a SAP ArchiveLink document. This attachment is stored in SOOD and linked via the GOS-relationship table SRGBTBREL
    The business object, that can be used here is: SOFM
    The object instance needs to be found with a custom self-made background method, to find the correct link and create an object instance.
    After that, this instance can be used as a secondary method in the work item's execution or attached to the ADHOCOBJECTS as already mentioned here.
    Good luck,
       Florin
    P.S.: Similar reply cross-posted to SAP-WUG

  • RFC to soap with attachment

    Hi all,
    I need to implement a synchronous scenario where an R/3 system sends data via RFC to an external system that expects it in the format of soap with attachment. Then the external system responds with soap message without attachment.
    My main concern is how to create a soap attachment from payload that I get from the RFC sender adapter.
    I would appreciate any your suggestion how to implement this scenario. If possible, I would prefer to avoid using java modules and BPM, since I am not very skilled with them.
    Thanks Janos.

    >
    janos malizero wrote:
    > Hi all,
    >
    > I need to implement a synchronous scenario where an R/3 system sends data via RFC to an external system that expects it in the format of soap with attachment. Then the external system responds with soap message without attachment.
    > My main concern is how to create a soap attachment from payload that I get from the RFC sender adapter.
    > I would appreciate any your suggestion how to implement this scenario. If possible, I would prefer to avoid using java modules and BPM, since I am not very skilled with them.
    >
    > Thanks Janos.
    well i think your darkest fears just came true ... the only option here is to write a module to create the attachments for you. The trick is once the module create the attachment, you need to check the option keep attachments in the SOAP receiver CC.
    How to create modules -
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a

  • Transfer GOS Attachment (Single/Multiple) from custom program to XK01

    Hi,
    GOS - Generic Object Service is a way one can attach single / multiple attachment. I have a custom program where there is a GOS with some attachment (used CL_GOS_MANAGER class).
    Next I need to send / transfer this GOS attachment from my custom program to say a standard transaction , eg XK01.
    Whether we can achieve this functionality, ie. we are able to create/save attachment but is there a way to send attachment (not via email) such that the same attach itself to the GOS of the standard transaction. I don't see any method in the CL_GOS_MANAGER class by which we can achieve this!
    Any suggestion/solution will be highly appreciated!
    Thanks,
    Deb

    Hi,
    I am trying to send attachment linked to a custom BO to standard BO eg, LFA1 using 'GOS_SERV_TOOLS_TEST' (copy_linked_objects).
    Surprisingly, I am able to copy/send attachment list within same BO (LFA1) from one LIFNR to another LIFNR. But the same method does not work when I try to copy attachment between diff BO example from VENDOR BO to MATERIAL BO. Why is it so?
    Also it does not work between a custom BO & standard BO. Please suggest in case I am missing on anything!
    Thank,
    Deb

  • Retrieve GOS Attachment

    Hi All,
    I am developing a program to retrieve the GOS attachment from PO attachment and send to the vendor through email. Kindly advise me to resolve this problem because I have no idea how to retrieve the attachment from the GOS table.
    Many thanks and best regards,
    Ting Wei Hong

    Hi,
    There is a class CL_GOS_MANAGER. Use that.
    See here for an example:
    data: o_gos type ref to cl_gos_manager.
      data: o_att type ref to cl_gos_attachments.
      data: ls_borident type borident.
      ls_borident-objkey = gs_data-vgbel.
      ls_borident-objtype = zcl_word=>co_busobject_worddocument.
      free o_gos.
      create object o_gos
        exporting
          ip_no_commit = space.
      call method o_gos->start_service_direct
        exporting
          ip_service       = 'VIEW_ATTA'
          is_object        = ls_borident
        exceptions
          no_object        = 1
          object_invalid   = 2
          execution_failed = 3
          others           = 4.
      if sy-subrc <> 0.
        message 'Geen bijlagen aanwezig. Toolbox wordt getoond' type 'S'.
        o_gos->display_toolbox( is_object = ls_borident ).
      else.
        message 'Bijlagen aangepast' type 'S'.
      endif.

  • GOS attachement

    Hi
    is there any standard bapis or RFcs are available to export GOS attachment from R/3 to external systemsv.  the attachement will be exist in qm02 transaction . if in case of n attachment i have to upload latest one .

    hi reddy,
    Welcome to SDN forum.
    use function module
    <b>BDS_GOS_CONNECTIONS_GET</b>
    to get the GOS attachment list
    Refer this link
    /people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background
    Reward with points for helpful answers.
    Cheers
    Alfred

  • Can we use custom RFC in creating models in Visual composer??

    Dear Experts,
    Can we use custom RFC in creating models in Visual composer??
    If yes, kindly provide some documents or links which would guide me how to achieve it.
    Warm Regards
    Upendra Agrawal

    Hi,
    Yes,you can do it.
    Configure the rfc and use like others Standard BAPI procedure.
    [https://www.sdn.sap.com/irj/scn/wiki?path=/display/vc/connectivity]
    Regards,
    Govindu

  • How can I verify an apple id already created without attaching a credit card?

    how can I verify an apple id already created without attaching a credit card?

    Why do you need to verify it? Have you received an email telling you to click a link to do so? - if so it's very possible that it's a scam designed to trick you into entering your credit card details. If you have received such an email don't follow any links in it. If it's not addressed to you by name it's unlikely to be from Apple.
    You could copy and paste the email into a post here so that we can have a look at it - remove your own email address when you do this.
    If there is some other reason you want to verify the ID please give more details.

  • Creating an Attachment for an Order by a 3rd Party Application

    Hi All,
    I want to create an attachment for, say, a Work Order.
    The file is in a particular directory in the Application Server and I am executing the FM with the required file information.
    Now the FM has to take the file from the application server and attach it to an order. Following is the approach I am following:
    I am using Open Dataset and Read Dataset Commands to read the file, IN BINARY MODE, in an internal table which has a filed of type RAW.
    Till now I think I have achieved the successful conversion of the file data into binary data. Am I right?
    Then I am calling the BDS_BUSINESSDOCUMENT_CREA_TAB BAPI while passing it the neccessary details.
    The .txt file is getting successfully attached to the order.
    With the .doc, .ppt files they are getting attached in the Order, I can see them in the Attachment List, but when I try to open them, I get this error:
    Attachment list   Error while opening document
    So I think the attachment is working fine.. but the conversion of data has some issue.
    Can you guys please help me out with ideas??
    Waiting..
    Thanks,
    Ankur

    I found the solution much later and I am closing this thread.
    Can we delete a thread which I feel is not required or helpful anymore?

  • RFC to Create Campaign

    Hi All,
    I am looking for a RFC to create a campaign.I looked at MKT_ELEMENT_CREATE but it gives me dump.Can anyone suggest me what BAPI/RFC I can use to create a campaign?
    Regards,
    Jyothi

    what is the CRM version you are working with ?

  • How to create and attach a castlib to a movie

    Hi,
    I would like to know if there is a way to create and attach
    an external castlib to a movie with lingo.
    I need to insert a new cast in about 2 hundred movies...
    Thanks
    Paolo

    lao <[email protected]> posted in
    macromedia.director.lingo:
    > Hi,
    > I would like to know if there is a way to create and
    attach an external
    > castlib to a movie with lingo. I need to insert a new
    cast in about 2
    > hundred movies... Thanks
    There used to be an Xtra by Penworks (I think) that could do
    that, but it
    seems to be gone now. You could look around the Mile High
    Table O'Products
    http://www.updatestage.com/external/the-mile-high-table-oproducts.html
    Speaking of updateStage, I seem to recall Gretchen McDowell
    (former owner)
    mentioning a method you might try. I think it went something
    like:
    Save an external castLib to a different filename.
    Then use importFileInto to import that castLib to a member in
    a different
    castLib.
    Or maybe using new() to create a castLib member, then set its
    filename to the
    new external castLib.
    I never tried it and my memory fades fast, but try something
    along those
    lines.
    If that method doesn't work, you can use the vList Xtra to
    save/load
    everything that a castLib would hold and more.
    Mark A. Boyd
    Keep-On-Learnin' :)

  • Can I create an 'attach files' button in a pdf form?

    Hello,
    I'm working on a mac and want to create and 'attach files' option to my briefing form. Clients will access the form in reader, attache word documents then submit the form.
    I have no javascript experience and am not too advanced with Acrobat so will need very basic instructions if it is possible.
    Thanks for any help.
    Cheers,
    Leah =)

    I just responded to this here: http://acrobatusers.com/forum/forms-acrobat/create-attach-files-button-pdf-mac

Maybe you are looking for

  • Netgear wireless router won't connect to my HP Pavilion via ethernet cable

    I had bought the Netgear LT wireless router for my home and I cannot get my Pavilion PC to connect via the ethernet cable. All of our tablets will connect wirelessly as well as my laptop. The laptop will also connect using the ethernet cable. I had u

  • SQL statement for query of all values

    I am trying to pull all the EE's that do not have a value in a specific fields for any row in history. Example Employee table Each employee can have 5-10 rows each The field employeeX can be either Y or N I only want to pull the distinct employee's n

  • Which product(s) to use?

    Hi Apologies if this is in the wrong place, wasn't sure what application to add it under. I have recently purchased Creative Cloud, I have used Photoshop and Dreamweaver for many years now.  I wouldn't class myself as an expert by any means, but I ca

  • Java and ML - can someone explain?

    In my total ignorance of Java, can someone please explain what, if anything, should be installed in 10.8.3? If I go to java.com, it says I don't have Java installed and the 'Missing Plug-in' graphic shows. I've seen all sorts of stuff about Java 7, J

  • Oracle 11i Rapidwiz Error on RHEL5

    Hi DBAs, I am trying to install the Oracle 11.5.10.2 on Linux RHEL5.3 on a 32 bit Plateform. I am getting the error as I run the rapidwiz as 'Oracle User'. $./rapidwiz Rapid Install Wizad is validating your file system ...... Rapid Insatll Wizad will