Attachments with services for object in ME42 along with RFQ via 'ME9A'  .

Hello Guys,
I have a MM requirement where the user attaches some document in ME42  via services for object functionality to a particular RFQ. Here the user wants to attach this document during sending of mail with ME9A to the vendor.
As by SAP standards we are only able to send RFQ in PDF format to vendors.
Thanks in advance
Regards

Hi,
You can attach an attachment to RFQ IN ME9Avia E-mail. Communication strategy need to define in CS01. E-mail address need to maintain in vendor master record. Codition records need to maintain in NACE or IN mn04. Use sap note  191470. This is for PO, the same can be used for RFQ. Please refer below link for step by step assistance. Thanking you.
RFQ send by mail through SAP server

Similar Messages

  • Send Smartform and Attachments from "Services for Object" in one Mail

    Dear all,
    We create a sales activity with transaction VC01n. We create a Smartform formluar and send the sales activity via E-Mail to the customer, this is working. Additionally we have some attachments in "Services for object".
    How is it possible to send the formular and the attachments in one mail to the customer?
    Thank you
    Michael

    Hi,
    Unfortunaltly there is no standard solution to send forms and attachement in a mail.
    you have to develop it .
    If you need more help tell me .
    regards

  • Need to find table for dispute case attachments in service for objects

    Hi All,
    I have a requirement where i need to find some tables which will hold details of dispute case attachments. After a dispute case is created using UDM_DISPUTE transaction, the concerned person may open that dispute case and can attach some documents/any attachments using services for objects icon at the top left corner of the screen. All i want to know is, in which table (tables related to service object) this attachment details will be stored. Even if the attachments details are stored in service objects related tables, there should be some link for this attachment and dispute case. Please let me know if any of you have some pointers and it would be highly appreciated.
    Thanks in advance,
    Srilakshmi.

    Hi a®s,
    Thanks for your reply. An entry is getting created in this table SRGBTBREL whenever an attachment/URL/notes is attached to a dispute case using services for object and the link between this table and dispute case table SCMG_T_CASE_ATTR is INSTID_A. This field holds the value of CASE GUID from SCMG_T_CASE_ATTR. Now my requirement is whenever an attachment is present in a dispute case i need to set a customized checkbox present in UDM_DISPUTE screen so that when an user opens the dispute case he/she can understand some attachment is present for this case by seeing the checkbox. I found the SCMG* badi's are not helpful to set the checkbox. Please let me know if you have any idea on how to implement it.
    Thanks in advance,
    Srilakshmi.

  • Retrieval of attachments with services for object in ME22n or ME23n

    Hello experts,
    I have a MM requirement where the user attaches some document in ME22n or ME23n via services for object functionality to a particular PO. Here the user wants to attach this document during sending of mail with ME9F to the vendor. First of all is it possible with the standard functionality of ME9F? or Requires some Zdevelopment. Anyone can guide me how to extract the attachment and send it with mail, does it require some configuration from functional side? I searched the forums but did not find the ways to extract.
    Thanks in advance
    Regards
    Raj (SAP ABAP)

    Hi Raj,
    Did you find a way to extract the attachment?

  • Accessing attachments from 'services for object'

    I have been tasked with extracting data from external attachments from the 'services for object' button. I am working in an sap ecc 6.0  environment. I have not found any tips on how to do this from google searches.
    Here is an example. If you look at most of the major documents (purchase order, invoice, delivery, etc.) there will be a little dropdown icon in the upper left corner of the screen
    That icon is the 'Services for Object' button. Clicking on it will display a small popup window with several options including one for attached documents.
    If an attachment (could be word, excel, pdf, URL, etc.) exists it will show up and can be viewed by double clicking on it. Does anyone know how to access
    that attachment programatically?
    Thank you very much in advance.
    deepak

    Hi,
    Create a subroutine in your program and call the FM: SWU_OBJECT_PUBLISH as below:
    CALL FUNCTION 'SWU_OBJECT_PUBLISH'
        EXPORTING
          objtype           = gc_businessobj
          objkey            = gw_header-vbeln
        EXCEPTIONS
          objtype_not_found = 1
          OTHERS            = 2.
    This will automatically display your Services for Object ICON on your report. Here in the FM, gc_businessobj is a global business object = BUS2031(defined as a constant inside the pgm) and gw_header-vbeln can be any valid document no like a sale order, inquiry, quotation etc.
    Use this code snippet and this will work.
    Regards,
    JLN

  • How to link Employee-Trip with "Services for Object" Attachment.

    Hello SAPients.
    This is the scenario: I enter the TCode TRIP, enter a personnel number and hit enter, then click on the 'Subsequent Activities' link, then click on the button 'Services for Object', then click on the 'Attachment List' button, I see a list of attachments for the object.
    The question is, does anybody knows the table relations to get from 'Employee-Trip' to this attachment list? I know that some of the information I need of the attachment list is stored in table SOOD. But I can't find a way to link from 'Employee-Trip' to the attachment list in SOOD.
    Any help will be greatly appreciated <REMOVED BY MODERATOR>
    Thanks .
    Edited by: Alvaro Tejada Galindo on Jun 9, 2008 3:20 PM

    Still searching for the answer, any idea?
    Thanks!

  • Creating attachments from Services for Objects

    Hi,
    I am trying to create an attachment using the FM BDS_BUSINESSDOCUMENT_CREATEF. But it is giving me sy-subrc 4(ERROR_KPRO). Can anyone explain how to correct this and if u have any better code to attach files to BO's pls post it here.
    This is my code:
    DATA : files LIkE BAPIFILES OCCURS 1 WITH header line.
    files-doc_count = '1'.
    files-directory = 'C:\Documents and Settings\e529015\Desktop\'.
    files-filename = 'layout.jpeg'.
    APPEND files.
    data: lv_logsys type TBDLS-LOGSYS.
    CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
    IMPORTING
       OWN_LOGICAL_SYSTEM                   = lv_logsys
    EXCEPTIONS
       OWN_LOGICAL_SYSTEM_NOT_DEFINED       = 1
       OTHERS                               = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CREATEF'
      EXPORTING
       LOGICAL_SYSTEM        = lv_logsys
        classname             = 'BUS2038'
        classtype             = 'BO'
       CLIENT                = SY-MANDT
       OBJECT_KEY            = '300023662'
      tables
        files                 = files
      SIGNATURE             =
    EXCEPTIONS
       NOTHING_FOUND         = 1
       PARAMETER_ERROR       = 2
       NOT_ALLOWED           = 3
       ERROR_KPRO            = 4
       INTERNAL_ERROR        = 5
       NOT_AUTHORIZED        = 6
       OTHERS                = 7
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Best Regards,
    Pavan Jhawar.

    Hi,
    Check this code...
    DATA: NUMBER_ATTACH TYPE i.
    Data Declaration for attachment ********
    data: go_myobject type ref to cl_gos_manager.
    data: lo_container type ref to cl_gui_custom_container,
          ls_object type borident.
    MODULE ATTACH_FILE input.
    if ok_code = 'CATC'.
      IF ZQTHD-JNAME is not initial.
    *******Number Ranges For ATTACHMENT ********
      if zqthd-objectkey is initial.
    CALL FUNCTION 'NUMBER_GET_NEXT'
      EXPORTING
        NR_RANGE_NR                   = '1'
        OBJECT                        = 'ZATTACH_NR'
      QUANTITY                      = '1'
      SUBOBJECT                     = ' '
      TOYEAR                        = '0000'
      IGNORE_BUFFER                 = ' '
    IMPORTING
       NUMBER                        = NUMBER_ATTACH
      QUANTITY                      =
      RETURNCODE                    =
    EXCEPTIONS
      INTERVAL_NOT_FOUND            = 1
      NUMBER_RANGE_NOT_INTERN       = 2
      OBJECT_NOT_FOUND              = 3
      QUANTITY_IS_0                 = 4
      QUANTITY_IS_NOT_1             = 5
      INTERVAL_OVERFLOW             = 6
      BUFFER_OVERFLOW               = 7
      OTHERS                        = 8
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
       endif.
      zqthd-objectkey = NUMBER_ATTACH.
      ls_object-objtype = 'ZQUOTATION'.
      ls_object-objkey  = zqthd-objectkey.
      call method go_myobject->start_service_direct
                    exporting
                          ip_service = 'PCATTA_CREA'
                          is_object = ls_object
                          io_container = lo_container.
    ENDIF.
    endif.

  • Unhide "Services for object" tab (MM02, MIRO, ...)

    Hi, everybody!
    I'm in trouble with "Services for object" tab. I need it in transactions: MM02 and MIRO, but it is hidden.
    I'm not sure about it, but I guess this could be solved with the right authorization. Just don't know which one.
    Could anyone help me?
    Thanks in advance.

    Hi,
    I guess BADI GOS_SRV_SELECT could solve the problem. You may disable the change button and other functions (perhaps using authorizations as a trigger).
    *Structure IS_LPOR contains
    *INSTID * Obkey := keyfields of Business Object
    *TYPEID * i.e. BOR TYPE 'ZDGF_DG'
    *CATID * i.e. 'BO' for BOR
    Be carefull - It is used for all kind of objects - so add CASES for combinatons of CATID/TYPID and call an own function/method for each.
    Kind regards,
    Holger

  • Attachment not shown in MIRO (service for objects)

    We have a problem with services for object in MIRO transaction.
    There's no "service for objects" icon in MIRO transaction, and through menu ("System=>Services for objets") we get this message:
    "No service available".
    But there's an entry with that object ID (invoice number) in table TOA01 with object type BUS2081 (Incoming invoice), which means there's A link for that object ID.
    We checked customizing and compared it to other systems where it's fine and seems ok.
    Can't understand why it doesn't work. Something missing in MM?
    I'd really appreciate any clue.
    Thanks in advance.
    Regards,
    J

    Thanks for answering.
    Well, we have same archivelink customizing in another systemo for MIRO transaction and it works fine.
    There's a development, of course. There's a job that executes a program and attaches the pdf from a server, etc.
    So we can attach pdf files when entering an invoice. Guess there's a missing step, but don't know exactly which.
    Maybe basis people blocked something, but we don't have a clue.
    Regards,
    J

  • Services for Object - Store Business Documents (issue with XLSX files)

    Hi,
    We are using the Services for Object > Store Business Document to be able to drag and drop files into (for example) Sales Inquiry, Sales Order, Sales Quotations etc.
    Within OAC2 we have set up the global document types and these have been linked to the relevant Object Types and Content Repositories in OAC3.  We have also set up the Content Repository as Document Area 'ARCHLINK'.
    The ArhciveLink Basic Settings in OAG1 have the 'Always Copy Document Class from Document Type' set under Storage Settings.
    The issue we are having is with XLSX document types.  When we drag and drop the XLSX documen type using the Store Business Document the file is stored against the Sales Order but when you come to view the attachments MS Excel opens but an error message appears saying 'Excel cannot open the file '******' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file'?
    We have reviewed SAP notes 1925897, 1739026 and 1145885 however non appear to give me a clear answer as to why this is happening?
    I have found that if we unselect the option 'Always Copy Document Class from Document Type' in OAG1 then we can open the XLSX files.
    As we have a significant amount of documents attached to various objects, what would be the implications of making this change agianst existing records and new records?
    Any advice on this issue would be greatly appreciated.
    Gary B

    Hi David,
    No joy I'm afraid!!
    I added entry 'xlslx' with the relevant MIME Type, Application and Description into table TOADD for the ArchiveLink settings and also this entry was already in tables SDOKMIME and SDOKFEXT for KPro.
    I then following the process via the Services for Object within VA12 (Change Inquiry) to then Create > Store Business document > Select the relevant Document Type > Drag and Drop the XLSX file into the empty box.
    I then saved the record and tried to view the attachement but I am still getting the same message  'Excel cannot open the file '******' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file'?
    Our client is on componet SAP_BASIS release 701 Support Level 0014 and Support Package SAPKB70114 and I can see that note 1237688 is for SAPKB70112?
    Regards
    Gary

  • Query with links to 'services for object'

    Hi everybody
    I need your help
    We have pictures (jpg, pdf, tif) linked to materials in material master (in transaction mm02 – services for object). Sometthing like this - but form materials:
    http://www.le.ac.uk/mis/docs/sapdocs/ug/UG5-1%20Services.doc
    We would like to create the "stock report" with links to these attachments. Can anyone tell me if it is possible to create these links in the report?
    I would like the report to look something like this:
    material_number1; stock1; link_to_picture_on_material_number1
    material_number2; stock2; link_to_picture_on_material_number2
    the user should be able to open the attached picture (if it exists) by clicking the link at each material number (even better if the pictures were already displayed in the report)
    Thank you very much in advance
    BR,
    Jana

    There are a number of classes with methods for accessing objects saved using services for object - look for classes starting CL_GOS*
    Help for GOS is available at
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/f5/e16f3a53dee246e10000000a11402f/frameset.htm">Generic Object Services (BC-SRV-GBT)</a>
    In your report you could link to the relevant code to display the image based on an event like at line selection / at user command or using hotspots or similar in an ALV based report
    Andrew

  • Bulk Upload of Attachments (images) to an invoice (Services for object)

    Hi Gurus,
    We are trying to create some kind of program to mass upload scanned images of invoices to an invoice document. At the moment we do each document on its own, we create the attachment to an invoice using FB02, then access the services for objects menu & create attachment.
    Can anyone advise of a way of creating a program to upload these images to a document OR the name of the table where it keeps the location of the attchments.
    I hope that makes sense!

    How to add an attachment to a Purchase Order in SAP?
    You can attach manually any document to PO without using Document Management System ( DMS ) in SAP 4.6C.
    But you cannot attach document while you create PO in T/Code ME21N
    Save you PO ( ME21N ) and again open with change ( ME22N ) then you can attach document through Service for Object button. Service for Object button available down side of Command screen ( in your PO screen ME22N )
    Click your Service Object button -> Create -> Create attachment
    then select your window directory ( which file you need to attach) select your file Now your system shows message  Service "Create attachment" is started.
    Save again your PO. You can see (open) your attachment in same field ( Service for Object ) select and Create and check attachment list. You can attach as many document in your PO.
    Note: This is only information for internal or you can print separately this document for sending to vendor ( fax ) System will not print automatically along PO print out.

  • Attachments to Notifications - using "Services for Object"

    Hi All,
    I have sucessfully created a VC application (7.0 sp13) to create a General Notification in R/3
    using the BAPI -  IQS4_CREATE_NOTIFICATION
    Our users in R/3 4.7 use the button in the Top Left Hand corner of the Screen "Services for Object"
    to attach MS Word documents to Notifcations. Using the Create Attachment option from the Services for Object toolbar that pops up when the button is clicked.
    Has anyone else tried this or have any advice on how this can be done in VC - if you can recommend a BAPI that I can try or will this be a custom ABAP BAPI.
    Thanks in advance for any advice you can offer.
    - Robert

    FUNCTION z_pm_attachment_and_url.
    *"*"Interface local:
    *"  IMPORTING
    *"     VALUE(I_QMNUM) TYPE  QMNUM OPTIONAL
    *"     VALUE(I_AUFNR) TYPE  AUFNR OPTIONAL
    *"     VALUE(I_URL) TYPE  SO_URL OPTIONAL
    *"     VALUE(I_FILE) TYPE  ZPMCT002 OPTIONAL
    *"     VALUE(I_FILENAME) TYPE  STRING OPTIONAL
    *"  TABLES
    *"      T_RETURN STRUCTURE  BAPIRET2
    * Objetos locais
      DATA:
        vl_url         TYPE so_url,
        vl_path        TYPE string,                             "#EC NEEDED
        vl_loopc       TYPE sy-loopc,
        vl_lines       TYPE sy-loopc,
        vl_filename    TYPE string,
        vl_filelength  TYPE i,
        it_url         TYPE STANDARD TABLE OF sood-objdes,
        it_obj_cont    TYPE STANDARD TABLE OF solix,
        wa_obj         TYPE borident,
        wa_obj_cont    TYPE soli,
        wa_obj_data    TYPE sood1,
        wa_folder_id   TYPE soodk,
        wa_document_id TYPE sofmk.
      DEFINE valida_retorno.
        loop at t_return into t_return.
          if t_return-type eq zgtpm_e.
            exit.
          endif.
        endloop.
        if t_return-type eq zgtpm_e.
          exit.
        endif.
      END-OF-DEFINITION.
    * === Valida parâmetros de entrada
      IF i_qmnum IS INITIAL AND i_aufnr IS INITIAL.
    *   Nenhum objeto informado: Informe Nota ou Ordem de Manutenção
        PERFORM mensagem_retorno_tab
        USING
          'ZPM_PORTAL' zgtpm_e '055' '' '' '' ''
        CHANGING
          t_return[].
        EXIT.
      ELSEIF NOT i_qmnum IS INITIAL AND NOT i_aufnr IS INITIAL.
    *   Informe apenas um objeto: Nota ou Ordem de Manutenção
        PERFORM mensagem_retorno_tab
        USING
          'ZPM_PORTAL' zgtpm_e '054' '' '' '' ''
        CHANGING
          t_return[].
        EXIT.
      ENDIF.
      IF  i_url IS INITIAL
      AND i_filename IS INITIAL.
    *   Informe Anexo e/ou URL
        PERFORM mensagem_retorno_tab
        USING
          'ZPM_PORTAL' zgtpm_e '060' '' '' '' ''
        CHANGING
          t_return[].
        EXIT.
      ENDIF.
    * === Define Categoria de objeto
      IF NOT i_qmnum IS INITIAL.
        wa_obj-objkey  = i_qmnum.
        wa_obj-objtype = 'BUS2038'. " Nota PM
      ENDIF.
      IF NOT i_aufnr IS INITIAL.
        wa_obj-objkey  = i_aufnr.
        wa_obj-objtype = 'BUS2007'. " Ordem de manutenção
      ENDIF.
    * === Anexo
      IF NOT i_filename IS INITIAL.
    *   Conteúdo do arquivo
        IF NOT i_file[] IS INITIAL.
          it_obj_cont[] = i_file[].
          DESCRIBE TABLE it_obj_cont LINES vl_lines.
          READ TABLE it_obj_cont INTO wa_obj_cont INDEX vl_lines.
          vl_filelength =
            ( 255 * ( vl_lines - 1 ) ) + STRLEN( wa_obj_cont ).
        ELSE.
          CALL FUNCTION 'GUI_UPLOAD'
               EXPORTING
                    filename                = i_filename
                    filetype                = 'BIN'
               IMPORTING
                    filelength              = vl_filelength
               TABLES
                    data_tab                = it_obj_cont
               EXCEPTIONS
                    file_open_error         = 1
                    file_read_error         = 2
                    no_batch                = 3
                    gui_refuse_filetransfer = 4
                    invalid_type            = 5
                    no_authority            = 6
                    unknown_error           = 7
                    bad_data_format         = 8
                    header_not_allowed      = 9
                    separator_not_allowed   = 10
                    header_too_long         = 11
                    unknown_dp_error        = 12
                    access_denied           = 13
                    dp_out_of_memory        = 14
                    disk_full               = 15
                    dp_timeout              = 16
                    OTHERS                  = 17.
          IF sy-subrc <> 0.
            PERFORM mensagem_retorno_tab
            USING
             sy-msgid sy-msgty sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
            CHANGING
              t_return[].
            EXIT.
          ENDIF.
        ENDIF.
    *   Pasta de Destino
        PERFORM get_folder CHANGING wa_folder_id t_return[].
        valida_retorno.
    *   SAPoffice: definição do objeto, modificar atributos
        wa_obj_data-objla  = sy-langu.      " Idioma
        wa_obj_data-objsns = 'O'.           " Objeto confidencial
        wa_obj_data-objlen = vl_filelength. " Tamanho conteúdo documento
        wa_obj_data-ownnam = sy-uname.      " Nome proprietário
        CALL METHOD cl_report_viewer=>split_path_filename
        EXPORTING
          i_filename = i_filename
        IMPORTING
          e_path     = vl_path
          e_filename = vl_filename.
        SPLIT vl_filename AT '.' INTO
          wa_obj_data-objdes    " Descrição breve do conteúdo
          wa_obj_data-file_ext. " Extensão de file de uma aplicação PC
        CONDENSE wa_obj_data-file_ext NO-GAPS.
    *   Insere Objeto (Anexo)
        PERFORM object_insert
        USING
          'EXT' " Anexo
          wa_obj_data
          wa_folder_id
          it_obj_cont
        CHANGING
          wa_document_id
          t_return[].
        valida_retorno.
    *   Relacionamento Objeto PM x Anexo
        PERFORM relation_create
        USING
          'ATTA'
          wa_obj
          wa_document_id
        CHANGING
          t_return[].
        valida_retorno.
      ENDIF.
    * === URL
      IF NOT i_url IS INITIAL.
    *   Inicializa estruturas comuns a Anexo e URL
        CLEAR:
          it_obj_cont,
          wa_obj_cont,
          wa_obj_data,
          wa_folder_id,
          wa_document_id.
    *   Conteúdo da URL
        MOVE i_url TO vl_url.
        WHILE NOT vl_url IS INITIAL.
          CONCATENATE '&KEY&' vl_url(250) INTO wa_obj_cont.
          APPEND wa_obj_cont TO it_obj_cont.
          SHIFT vl_url LEFT BY 250 PLACES.
        ENDWHILE.
    *   Pasta de Destino
        PERFORM get_folder CHANGING wa_folder_id t_return[].
        valida_retorno.
    *   SAPoffice: definição do objeto, modificar atributos
        wa_obj_data-objla  = sy-langu. " Idioma
        wa_obj_data-objsns = 'O'.      " Objeto confidencial
        wa_obj_data-ownnam = sy-uname. " Nome proprietário
        SPLIT i_url AT '/' INTO TABLE it_url.
        DESCRIBE TABLE it_url LINES vl_loopc.
        READ TABLE it_url INDEX vl_loopc
        INTO wa_obj_data-objdes. " Descrição breve do conteúdo
    *   Insere Objeto (URL)
        PERFORM object_insert
        USING
          'URL'  " Link Inter/Intranet
          wa_obj_data
          wa_folder_id
          it_obj_cont
        CHANGING
          wa_document_id
          t_return[].
        valida_retorno.
    *   Relacionamento Objeto PM x URL
        PERFORM relation_create
        USING
          'URL'
          wa_obj
          wa_document_id
        CHANGING
          t_return[].
        valida_retorno.
      ENDIF.
    * === Libera objetos locais
      FREE:
        vl_url,
        vl_path,
        vl_loopc,
        vl_lines,
        vl_filename,
        vl_filelength,
        it_url,
        it_obj_cont,
        wa_obj,
        wa_obj_cont,
        wa_obj_data,
        wa_folder_id,
        wa_document_id.
    ENDFUNCTION.
    ***INCLUDE LZGPM0010F01 .
    *&      Form  mensagem_retorno_tab
      FORM mensagem_retorno_tab
      USING
        p_msgid TYPE symsgid
        p_msgty TYPE symsgty
        p_msgno TYPE symsgno
        p_msgv1 TYPE any
        p_msgv2 TYPE any
        p_msgv3 TYPE any
        p_msgv4 TYPE any
      CHANGING
        t_return TYPE ty_return.
        DATA:
          vl_msgty  TYPE symsgty,
          wa_return LIKE LINE OF t_return.
        IF p_msgty IS INITIAL.
          MOVE zgtpm_e TO vl_msgty.
        ELSE.
          MOVE p_msgty TO vl_msgty.
        ENDIF.
        IF p_msgno IS INITIAL.
          EXIT.
        ENDIF.
        MOVE p_msgid  TO wa_return-id.
        MOVE vl_msgty TO wa_return-type.
        MOVE p_msgno  TO wa_return-number.
        MOVE p_msgv1  TO wa_return-message_v1.
        MOVE p_msgv2  TO wa_return-message_v2.
        MOVE p_msgv3  TO wa_return-message_v3.
        MOVE p_msgv4  TO wa_return-message_v4.
        MESSAGE ID p_msgid TYPE vl_msgty NUMBER p_msgno
        WITH p_msgv1 p_msgv2 p_msgv3 p_msgv4
        INTO wa_return-message.
        APPEND wa_return TO t_return.
        FREE: vl_msgty, wa_return.
      ENDFORM.                    " mensagem_retorno_tab
    *&      Form  get_folder
      FORM get_folder
      CHANGING
        w_folder_id TYPE soodk
        t_return TYPE ty_return.
        CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
             EXPORTING
                  region    = 'B'  " ?
             IMPORTING
                  folder_id = w_folder_id
             EXCEPTIONS
                  OTHERS    = 1.
        IF sy-subrc <> 0.
          PERFORM mensagem_retorno_tab
          USING
           sy-msgid sy-msgty sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
          CHANGING
            t_return[].
        ENDIF.
      ENDFORM.                    " get_folder
    *&      Form  object_insert
      FORM object_insert USING
        p_objtp     TYPE so_obj_tp
        w_obj_data  TYPE sood1
        w_folder_id TYPE soodk
        t_obj_cont  TYPE zpmct002
      CHANGING
        w_document_id TYPE sofmk
        t_return      TYPE ty_return.
    *   Objetos locais
        DATA:
          it_objcont  TYPE STANDARD TABLE OF soli,
          it_obj_head TYPE STANDARD TABLE OF soli,
          wa_obj_id   TYPE soodk,
          wa_obj_cont LIKE LINE OF t_obj_cont.
    *   RAW to CHAR
        LOOP AT t_obj_cont INTO wa_obj_cont.
          APPEND wa_obj_cont TO it_objcont.
          CLEAR wa_obj_cont.
        ENDLOOP.
    *   Insere objeto
        CALL FUNCTION 'SO_OBJECT_INSERT'
             EXPORTING
                  folder_id                  = w_folder_id
                  object_type                = p_objtp
                  object_hd_change           = w_obj_data
                  owner                      = sy-uname
             IMPORTING
                  object_id                  = wa_obj_id
             TABLES
                  objhead                    = it_obj_head
                  objcont                    = it_objcont
             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.
          w_document_id-foltp = w_folder_id-objtp.
          w_document_id-folyr = w_folder_id-objyr.
          w_document_id-folno = w_folder_id-objno.
          w_document_id-doctp = wa_obj_id-objtp.
          w_document_id-docyr = wa_obj_id-objyr.
          w_document_id-docno = wa_obj_id-objno.
        ELSE.
          PERFORM mensagem_retorno_tab
          USING
           sy-msgid sy-msgty sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
          CHANGING
            t_return[].
        ENDIF.
    *   Libera objetos locais
        FREE:it_objcont, it_obj_head, wa_obj_id, wa_obj_cont.
      ENDFORM.                    " object_insert
    *&      Form  relation_create
      FORM relation_create
      USING
        p_relationtype TYPE binreltyp
        w_obj          TYPE borident
        w_document_id  TYPE sofmk
      CHANGING
        t_return TYPE ty_return.
        DATA wa_doc TYPE borident.
        wa_doc-objtype = 'MESSAGE'.
        CASE p_relationtype.
          WHEN 'ATTA'.
            wa_doc-objkey  = w_document_id(34).
          WHEN 'URL'.
            wa_doc-objkey  = w_document_id.
          WHEN OTHERS.
        ENDCASE.
        CALL FUNCTION 'BINARY_RELATION_CREATE'
             EXPORTING
                  obj_rolea      = w_obj
                  obj_roleb      = wa_doc
                  relationtype   = p_relationtype
             EXCEPTIONS
                  no_model       = 1
                  internal_error = 2
                  unknown        = 3
                  OTHERS         = 4.
        IF sy-subrc = 0.
          COMMIT WORK AND WAIT.
          CASE p_relationtype.
            WHEN 'ATTA'.
    *         O anexo foi criado com êxito
              PERFORM mensagem_retorno_tab
              USING
                'SGOS_MSG' zgtpm_s '043' '' '' '' ''
              CHANGING
                t_return[].
            WHEN 'URL'.
    *         A URL foi criada com êxito
              PERFORM mensagem_retorno_tab
              USING
                'ZPM_PORTAL' zgtpm_s '059' '' '' '' ''
              CHANGING
                t_return[].
            WHEN OTHERS.
          ENDCASE.
        ELSE.
          PERFORM mensagem_retorno_tab
          USING
           sy-msgid sy-msgty sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
          CHANGING
            t_return[].
        ENDIF.
        FREE wa_doc.
      ENDFORM.                    " relation_create
    Edited by: Fabrício Alves Vieira on Apr 8, 2008 3:08 PM

  • I am unable to use services for objects  while creating a PO

    Hi All,
    I am unable to use services for objects  while creating a PO ie in me21n / Me22n .
    Our client wants to attach some doucument along with the PO, we want to use services for object for this. I use this services for objects in admin level , but unable to use this at user level. 
    System gives the following message
    No service available
    Message no. SGOS_MSG002
    Regards
    Gsg

    Hi,
    Refer the following OSS notes 552127, 598073
    For getting Object for services icon in ME21N and ME51N refer OSS note 913251

  • Services for Object in creation mode

    Hi colleagues,
    I am facing one problem and I would appreciate your help and ideas. I want to enable user to use a functionality of "Services for object" in creation mode (in my case transaction IW31). In change or display mode this functionality is enabled, so creating new BOR object and such things are not necessary.
    I understand that services for object are disabled by default in creation mode, because it is not meaningful to assign some documents to object which does not yet exist. But in theoretical way, it should be possible to implement some "tricky" solution. Probably some temporary object could be created at the start of IW31 and attachments could be assigned to this object. And in some user exit executed during processing of save statement (after all checks and such things), attachments could be re-assigned to a real (persistent) object. For unsaved orders it would be necessary to delete temporary object and also attached documents.
    Have someone implemented something similar? Or any helpful ideas?
    Thank you all in advance.
    Regards,
    Adrian

    Hi,
    We have implemented exactly the same in a Ztransaction. Not sure to what extent this will help you. Check below code
      CREATE OBJECT w_gosman
      EXPORTING
    *     io_container     = io_container
    *     is_bc_object     = is_bc_object
        is_object        =  wa_object            "BOR object
    *    it_service_selection =
    *     io_callback      = io_callback
    *     ip_start_direct  = space
        ip_no_instance   = l_inst             "Pass SPACE in your case
        ip_no_commit     = l_commit        "Pass SPACE in your case
        ip_mode          = c_e
      EXCEPTIONS
        object_invalid   = 1
        callback_invalid = 2
        OTHERS           = 3
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    "Here just we are creating a reference by publishing the object.
    "During the transaction commit call below method.
      wa_object-objkey = "Pass your object ID.
    wa_object-objtyp = "Pass your business object
        CALL METHOD w_gosman->set_id_of_published_object
        EXPORTING
    *      is_bc_object   = is_object
          is_object      = wa_object
        EXCEPTIONS
          no_publication = 1
          OTHERS         = 2
        COMMIT WORK.
    Thanks,
    Vinod.

Maybe you are looking for

  • Migrating iTunes library from external hard drive to new laptop

    Hi there, I am wondering if anyone can help me please? I am a complete newbie to this forum thing, I am just getting into this cosmic sharing world but find myself utterly frustrated with iTunes and my new laptop - with little help on the Support pag

  • Why does Pages 4.3 keep crashing since I updated to Mavericks?

    Pages 4.3 was working fine for me until I updated to Mavericks and downloaded Pages 5. I didn't like Pages 5 for obvious reasons, so I deleted Pages 5 app and kept using 4.3. But now Pages is always crashing and giving me the error message, "Pages qu

  • Split valuation conflict

    Folks, 2 questions related to split valuation: 1) We've valuation level at company code and split valuation active. We have set  valuation type A as a default in tcode OMWC. In the stock determination rule, we've set that valuation type A and B can b

  • Order history, Order history

    How do you look at your order history for iphoto?

  • Keepalives for service

    I have a service dependent on two separate keepalive ports for an ip address. The first keepalive monitors the root server web service and the second keepalive monitors an application web service on the server. If either go down I want the Load Balan