Attaching a document to notification using service for object

hellow members,
i look for a table to let me know if a document
is attached to specific object (in my case it"s
a notification).
best regards,
avi
Edited by: avi koren on Jul 16, 2008 9:40 AM

Hellow Johannes,
thank you for your repling.
i don"t think that this is the direction.
In lots of objects in the SAP like a notification or a material,a button call "service for object" is available provide
some functions like
document attaching.
How i can see this attachments?
I think that the answer should be close to the table SOOD.
regards,
avi

Similar Messages

  • 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

  • Mass upload Create External doc URLs using Services for object-Inspmethod

    Hi All,
    Services for object is not active during SHDB recording or ECATT recording in order to mass update Create External doc URLs using Services for object.
    Any body know how to Upload this for any master data 9Insp plan/Material master etc..)

    Developing the program

  • Mass upload Create External doc URLs using Services for object-Materialmast

    Hi All,
    Services for object is not active during SHDB recording or ECATT recording in order to mass update Create External doc URLs using Services for object.
    Any body know how to Upload this for any master data ex.Material master.

    ok

  • Attaching PDF files to PO in Services for Objects

    Hi Experts
    I have got a strange requirement. Upon creation of the Purchase order or after any changes done to the PO, I need print the form and store it into PDF format in the application server. Later I need to upload that file to Services for Objects , button which available on the top of PO, in the Left most one.
    Using that I need to attach the coverted PDF file to that. Everything should be done by the program in the background. Please advice is it possible, if it is possible please help me how to code for this requirement.
    Awaiting for your reply,
    Thanks
    Praveen
    Edited by: Praveen Kumar on Feb 4, 2010 4:25 AM
    Edited by: Praveen Kumar on Feb 4, 2010 5:43 AM

    FUNCTION z_mm_save_po_in_gos.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(PONUMBER) TYPE  EBELN
    *"  EXCEPTIONS
    *"      ERROR_OPEN_FORM
    *"      ERROR_CLOSE_FORM
      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.
      INCLUDE : <cntn01>.
    * TABLES: ekko,
    *         lfa1,
    *         t001,
    *         pekko.
    * Load class.
      CLASS cl_binary_relation DEFINITION LOAD.
      CLASS cl_obl_object DEFINITION LOAD.
    **data declarations
      DATA: l_fstr   TYPE xstring,
            l_fsize  TYPE i,
            l_bsize  TYPE i,
            l_botype LIKE obl_s_pbor-typeid VALUE 'BUS2012', " e.g. 'BUS2012'
            l_bo_id  LIKE obl_s_pbor-instid," VALUE '4610000000'
            l_docty  LIKE borident-objtype VALUE 'MESSAGE',
            l_reltyp LIKE breltyp-reltype VALUE 'ATTA',
            lt_bin TYPE STANDARD TABLE OF char255 WITH HEADER LINE,
            lt_pdf TYPE TABLE OF tline,
            lv_message_key TYPE ty_message_key,
            lo_message TYPE swc_object,
            l_title    TYPE char30,
            lo_is_object_a TYPE borident,
            lo_is_object_b TYPE borident,
    *        lt_nast TYPE TABLE OF nast,
    *        lw_nast LIKE nast,
    *        l_nast  LIKE nast,
    *        l_druvo LIKE t166k-druvo,
    *        l_from_memory,
    *        l_doc   TYPE meein_purchase_doc_print,
    *        l_retcode TYPE i,
            lt_cdpos TYPE TABLE OF cdpos,
            lw_cdpos TYPE cdpos,
            lt_cdhdr TYPE TABLE OF cdhdr,
            lw_cdhdr TYPE cdhdr,
            l_flg,
    *        w_opt  LIKE ITCPO,
            l_text TYPE text60,
            lw_gos   TYPE zmm_gos,
            lr_chno  TYPE RANGE OF text60,
            lw_chno  LIKE LINE OF lr_chno,
            otf      TYPE TABLE OF itcoo.
        DATA: w_full TYPE string.
    **program will check only these values in the change history,
      lw_chno-sign = 'I' . lw_chno-option = 'EQ' .
      lw_chno-low = 'EKKO-FRGKE'. APPEND lw_chno TO lr_chno."Release Indicator: Purchasing Document
      lw_chno-low = 'EKKO-FRGZU'. APPEND lw_chno TO lr_chno."Release status
      lw_chno-low = 'EKKO-RLWRT'. APPEND lw_chno TO lr_chno."Total value at time of release
      lw_chno-low = 'EKET-MENGE'. APPEND lw_chno TO lr_chno."Scheduled Quantity
      lw_chno-low = 'EKPO-NETWR'. APPEND lw_chno TO lr_chno."Net Order Value in PO Currency
      lw_chno-low = 'EKPO-NETPR'. APPEND lw_chno TO lr_chno."Net Price in Purchasing
    *                                                        Document (in Document Currency)
      lw_chno-low = 'EKPO-BRTWR'. APPEND lw_chno TO lr_chno."Gross order value in PO currency
      lw_chno-low = 'EKPO-MENGE'. APPEND lw_chno TO lr_chno."Purchase Order Quantity
      SELECT SINGLE * FROM zmm_gos INTO lw_gos WHERE objectclas = 'EINKBELEG'
                                                   AND objectid = ponumber.
      IF sy-subrc EQ 0.
        IF lw_gos-changenr NE '1000000000'.
          SELECT * FROM cdpos INTO TABLE lt_cdpos
                          WHERE objectclas = lw_gos-objectclas
                            AND objectid   = lw_gos-objectid
                            AND changenr   GT lw_gos-changenr.
          IF sy-subrc EQ 0.
            LOOP AT lt_cdpos INTO lw_cdpos.
              CONCATENATE lw_cdpos-tabname lw_cdpos-fname INTO l_text
                          SEPARATED BY '-'.
              IF l_text IN lr_chno.
                l_flg = 'X'.
                EXIT.
              ENDIF.
              CLEAR: lw_cdpos,
                     l_text.
            ENDLOOP.
            IF l_flg = 'X'.
              DESCRIBE TABLE lt_cdpos.
              READ TABLE lt_cdpos INTO lw_cdpos INDEX sy-tfill.
              lw_gos-changenr = lw_cdpos-changenr.
              MODIFY zmm_gos FROM lw_gos.
              IF sy-subrc EQ 0.
                COMMIT WORK.
              ENDIF.
            ENDIF.
          ELSE.
            l_flg = space.
          ENDIF.
        ELSE.
          SELECT * FROM cdhdr INTO TABLE lt_cdhdr WHERE objectclas = 'EINKBELEG'
                                                 AND objectid   = ponumber.
          IF sy-subrc EQ 0.
            DESCRIBE TABLE lt_cdhdr.
            READ TABLE lt_cdhdr INTO lw_cdhdr INDEX sy-tfill.
            l_flg = 'X'.
            lw_gos-objectclas = lw_cdhdr-objectclas.
            lw_gos-objectid = lw_cdhdr-objectid.
            lw_gos-changenr = lw_cdhdr-changenr.
            MODIFY zmm_gos FROM lw_gos.
            IF sy-subrc EQ 0.
              COMMIT WORK.
            ENDIF.
          ENDIF.
        ENDIF.
      ELSE.
        SELECT * FROM cdhdr INTO TABLE lt_cdhdr WHERE objectclas = 'EINKBELEG'
                                                  AND objectid   = ponumber.
        IF sy-subrc EQ 0.
          DESCRIBE TABLE lt_cdhdr.
          READ TABLE lt_cdhdr INTO lw_cdhdr INDEX sy-tfill.
          l_flg = 'X'.
          lw_gos-objectclas = lw_cdhdr-objectclas.
          lw_gos-objectid = lw_cdhdr-objectid.
          lw_gos-changenr = lw_cdhdr-changenr.
        ELSE.
          l_flg = 'X'.
          lw_gos-objectclas = 'EINKBELEG'.
          lw_gos-objectid = ponumber.
          lw_gos-changenr = '1000000000'.
        ENDIF.
        MODIFY zmm_gos FROM lw_gos.
        IF sy-subrc EQ 0.
          COMMIT WORK.
        ENDIF.
      ENDIF.
    *  IF l_flg EQ space.
    *    l_flg = 'X'.
    *  ENDIF.
      IF l_flg NE space.
        DATA: memkey(10),
              memkey1(10).
        memkey = 'POOTF'.
        memkey1 = 'PONO'.
        EXPORT ponumber TO MEMORY ID memkey1.
        SUBMIT zmmr086 AND RETURN.
        IMPORT otf FROM MEMORY ID memkey.
        CHECK otf[] IS NOT INITIAL.
          import w_full from MEMORY ID 'REV'.
    **convert the otf data into xstring
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = 'PDF'
          IMPORTING
            bin_filesize          = l_bsize
            bin_file              = l_fstr
          TABLES
            otf                   = otf[]
            lines                 = lt_pdf[]
          EXCEPTIONS
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 3
            err_bad_otf           = 4
            OTHERS                = 5.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    **create the object message retriveing the msg details
    *    swc_create_object lo_message 'MESSAGE' lv_message_key.
    ** define container to pass the parameter values to the method call
    *    swc_container lt_message_container.
    **creating the title for GOS
    *    WRITE sy-datum TO l_title.
    *    CONCATENATE ponumber l_title INTO l_title SEPARATED BY '_'.
    ** Populate container with parameters for method
    *    swc_set_element lt_message_container 'DOCUMENTTITLE' l_title.
    *    swc_set_element lt_message_container 'DOCUMENTLANGU' 'E'.
    *    swc_set_element lt_message_container 'NO_DIALOG' 'X'.
    *    swc_set_element lt_message_container 'DOCUMENTNAME' l_docty.
    *    swc_set_element lt_message_container 'DOCUMENTTYPE' 'PDF'.
    *    swc_set_element lt_message_container 'FILEEXTENSION' 'PDF'.
    **convert the file string into binary format
        CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
          EXPORTING
            buffer        = l_fstr
          IMPORTING
            output_length = l_fsize
          TABLES
            binary_tab    = lt_bin.
    *    swc_set_table lt_message_container 'DocumentContent' lt_bin.
    *    swc_set_element lt_message_container 'DOCUMENTSIZE' l_fsize.
    *    swc_refresh_object lo_message.
    *    swc_call_method lo_message 'CREATE' lt_message_container.
    *    swc_get_object_key lo_message lv_message_key.
    ***fill the object key details for purchase order
    *    lo_is_object_a-objkey = ponumber. "purchase order number
    *    lo_is_object_a-objtype = 'BUS2012'. "business object type
    ** Create attachment BO object_b
    *    lo_is_object_b-objkey = lv_message_key.
    *    lo_is_object_b-objtype = l_docty.
    *    CALL FUNCTION 'BINARY_RELATION_CREATE'
    *      EXPORTING
    *        obj_rolea      = lo_is_object_a
    *        obj_roleb      = lo_is_object_b
    *        relationtype   = l_reltyp
    *      EXCEPTIONS
    *        no_model       = 1
    *        internal_error = 2
    *        unknown        = 3
    *        OTHERS         = 4.
    *    IF sy-subrc <> 0.
    *      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    *    ENDIF.
    *    COMMIT WORK AND WAIT.
    *CONSTANTS: pc_file TYPE char128 VALUE '/usr/sap/DEV/DVEBMGS00/data/newdoc5.pdf'.
    *open DATASET pc_file for OUTPUT in BINARY MODE." IGNORING CONVERSION ERRORS.
    *IF sy-subrc eq 0.
    *  TRANSFER l_fstr to pc_file.
    *  IF sy-subrc eq 0.
    *    CLOSE DATASET pc_file.
    *  ENDIF.
    *ENDIF.
        CONCATENATE  ponumber sy-datum sy-uzeit w_full INTO w_full SEPARATED BY '_'.
        CONCATENATE 'C:\' w_full '.pdf' INTO w_full.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
    *   BIN_FILESIZE                    =
            filename                        = w_full
            filetype                        = 'BIN'
    *   APPEND                          = ' '
    *   WRITE_FIELD_SEPARATOR           = ' '
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    *   WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
    *   SHOW_TRANSFER_STATUS            = ABAP_TRUE
    * IMPORTING
    *   FILELENGTH                      =
          TABLES
            data_tab                        = lt_bin[]
    *   FIELDNAMES                      =
    * EXCEPTIONS
    *   FILE_WRITE_ERROR                = 1
    *   NO_BATCH                        = 2
    *   GUI_REFUSE_FILETRANSFER         = 3
    *   INVALID_TYPE                    = 4
    *   NO_AUTHORITY                    = 5
    *   UNKNOWN_ERROR                   = 6
    *   HEADER_NOT_ALLOWED              = 7
    *   SEPARATOR_NOT_ALLOWED           = 8
    *   FILESIZE_NOT_ALLOWED            = 9
    *   HEADER_TOO_LONG                 = 10
    *   DP_ERROR_CREATE                 = 11
    *   DP_ERROR_SEND                   = 12
    *   DP_ERROR_WRITE                  = 13
    *   UNKNOWN_DP_ERROR                = 14
    *   ACCESS_DENIED                   = 15
    *   DP_OUT_OF_MEMORY                = 16
    *   DISK_FULL                       = 17
    *   DP_TIMEOUT                      = 18
    *   FILE_NOT_FOUND                  = 19
    *   DATAPROVIDER_EXCEPTION          = 20
    *   CONTROL_FLUSH_ERROR             = 21
    *   OTHERS                          = 22
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ELSE.
          WRITE: 'File saved on PC'.
        ENDIF.
        FREE: l_fstr,
              l_fsize,
              l_bsize,
              l_botype,
              l_bo_id ,
              l_docty,
              l_reltyp,
              lt_bin,
              lt_pdf,
              lv_message_key,
              lo_message,
              l_title,
              lo_is_object_a,
              lo_is_object_b,
    *              l_doc,
    *              l_nast,
    *              lt_nast,
    *              lw_nast,
              lt_cdpos,
              lw_gos,
              lw_cdpos.
    *      ENDIF.
      ENDIF.
    *  ENDIF.
    ENDFUNCTION.
    plz chk and let me know if any issue.

  • Transfering Documents (mostly .jpg) from Services for Object to DMS

    Hi,
    We are presently in the process of finalizing document attachments via DMS system. We still have a high quantity of documents that were attached through the "Services for object" function (mostly .jpg ) and would like to transfer these to DMS without having to export them for every single object (mostly equipments). Is there any way to do this i.e. mass export of these attachments with their link (ex. at the top of the dialog box: AttachmentFor0000000...) so that they remain .jpg to be able to re-upload quickly in DMS system ?
    Thanks for your help !

    we have in the current system merger project a developer from SAP who is programming this feature for us, so I am pretty certain that there is nothing in standard that can do this job.

  • Using "Services for Object" to attach local files to SAP objects (POs)

    As I understand creating an Attachment to a PO for example from local drive - is a standard SAP functionality that does not require configuration, but ... in our Development, Quality and Production systems any document type can be attached, but not in Training. In Training system only .txt documents can be attached and for others it give the error message "Database error with <INSERT INTO KPRO>, error message number SO 013".
    1) Does it mean that there is a config for it so certain document types can only be attached? and where can I find it?
    2) Is there a way to limit the size of documents that can be attached? since somebody can "accidentally" attach 2 Gig file ...
    Thanks,
    Paul.

    Hi Pavel,
    Yes for Standard SAP functionality that does not require configuration, but for coustomized Transaction if you want to attach any doc or txt file doc then you need to change some code. if iam worng plz correct me.
    in you querry just check with the your basis person some times they may give restrictions or authorizations check.
    this may be helpful to you.

  • Check while MIGO, to check document is attched through SERVICE FOR OBJECT

    Hi,
    While creating a document through MIGO,
    I want to apply a check that during 101 movement type if document is not attached , system should throw a error message
    'Attach document first'.
    Is it possible ?
    If yes , then through which progess BADI or user-exit ?

    Hi
    The authorization objects for attachment to material are as following:
    Object Class BC_Z Basis - Central Functions
    Authorization Object: S_BDS_DS  
    Authorizations for Document Set
    Authorization Field ACTVT :  30
    Authorization Field CLASSNAME:BUS1001
    Authorization Field CLASSTYPE:BO
    other ACTVT
    01     Create or generate
    02     Change
    03     Display
    04     Print, edit messages
    05     Lock
    06     Delete
    24     Archive
    25     Reload
    30     Determine
    70     Administer
    78     Assign
    82     Supplement
    Note: That to be able to attach user should have MM02 authorization..
    Best Regards
    Hope it helps

  • 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.

  • 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

  • Content server for Document attachment through "services for object" Icon.

    Guys,
    I have typical problem in installation of Content server for storing external documents.
    We all know that we can attach the document in SAP using the icon “SERVICES FOR OBJECT”. By this we can attach the document to the specific object we want.
    -Since my client wants only document attachment method not to completely implement SAP DMS, I proposed this method of attaching documents through services for object method.
    -If documents are stored though services for object ,The attached document will directly get stored in sap database(correct me if I am wrong) while  in  DMS it ask you to select the storage location while u check in for any document
    -By storing the doc thru "services for object " For long run when we store the documents in sap database our system will drastically get slow down.
    -In this regard I have a plan to incorporate external storage server.
    -Now I should know that how I should customize content server configuration so that the attachment through services for object will store into this content server I need to know how to define Client, Content Category, Content Repository, Document Area, Physical Machine, IP Address, Port. (OACT & OAC0)
    I appreciate for immediate solution and <u><b>Points will be rewarded for sure.</b></u>
    Regards,
    Murali.S

    Hi Murali,
    Don't Worry, its possible,
    All attachments can be stored in SAP Content Server also, but through archiving process.
    Set up a database storage system.
    Preparation
    Make sure that the HTTP plugin is active.
    Transaction <b>SMICM,</b> "Display Services" function key (shift F1)). The list of services must contain a port other than 0 for HTTP.If not, you must adjust the relevant profile parameter.
    <u>Typical entry:</u>
    icm/server_port_0         PROT=HTTP, PORT=1080, TIMEOUT=900
    <b>Make sure that the /sap/bc/contentserver service is active.</b>
    If no user is defined, then use transaction SU01 to create a new user. Use the "System" user type.Assign
    the SAP_ALL and SAP_NEW profiles to the user. (Eg: HRUSER/PLMUSER/PPUSER etc)
    Transaction <b>SICF,</b> select: default_host - sap - bc -contentserver. Select the function to display/change the service. Make sure that a user is defined.
    Using the relevant data from the newly created user, maintain the anonymous logon data for the
    /default_host/sap/bc/ service and save & activate the changes in transaction <b>SICF</b>.  Double click on content server and give the user name which has been created (HRUSER/PLMUSER/PPUSER/MMUSER etc)
    Check the system PSE.
    Start transaction <b>STRUST</b>. Expand the system PSE. The system PSE must be "green" for each application
    server.
    Determine a suitable exchange directory.
    The exchange directory must be accessible from each application server. If all application servers are running on the same platform (for example, Windows), one network directory that is accessible on all application server (for example,
    server\share) is sufficient. You can generally use the global directory
    (profile parameter DIR_GLOBAL).You can use the RSPARAM report to determine the profile parameters.
    Setting up the storage
    Create a table for storing the data. Using transaction <b>SE11</b>, create a copy of the SDOKCONT1
    table. If you want to create the repository database, you can name the table ZCONT_DB, for example. Save the
    table as a local object. Activate the table.
    Create a repository.
    Use transaction <b>OAC0</b> to create a new repository.
    Use the following parameters:
    Repository Max. two characters, for example,” Z1”
    DocArea: ARCHLINK
    Storage type: R/3 database
    Storage subtype: normal
    Version no. : 0046 
    Contents table <table name> for example: ZCONT_DB
    Exchange directory <directory name> for example:
    server\share\
    Make sure that the exchange list ends with a \ (or /on Unix).If you are using a variety of platforms, you must use transaction FILE to define a suitable logical file name and use this name. Save the settings.
    1. Maintain view table <b>TOAAR_C</b>, via SM31
       Cross client table displayed as information, forget it
    2. In field 'StSytm' you must entered 'Z1' as your system need, or anything that you need but you must configure HR Archive link too.
    3. In field 'Arch.path' (direct above Spoolpath), entered path in your system, this real path in your operating system. May be you should confirm to your Basis consultant where exactly you could store picture files. So if you enter '/', your file exists at root directory at your UNIX system.
    4. Choose 'File store' radio button
    5. Save.
    First
    <b>1. You have to create a number range for SAP ArchiveLink.
        IMG: Basis Components-> Basis Services -> SAP ArchiveLink -> Basic Settings-> Maintain number ranges   
        (Trxn <b>OANR).</b> Create number range 01 from 0000000001 to 9999999999 without the external number flag. 
    2. Document type <b>HRICOLFOTO</b> must exist with document class JPG.
        IMG: Basis Components->Basis Services->SAP ArchiveLink->System Settings->Maintain document types
        (Table<b> TOAVE, Trxn OAC2).</b>
    3. Document type <b>HRICOLFOTO</b> must be linked to object type PREL and Infotype PA0002.
        IMG: Personnel Management->Personnel Administration->Tools->Optical archiving->Set up Optical Archiving
        in HR.  (View V_T585O, no Trxn). In the first two columns there are minuses, the third (Date) has
       a plus - don't put a flag in the check box.
    4. Check which content repository (Archive) is linked to document type HRICOLFOTO and object type  
        PREL. IMG: <b>Basis Components->Basis Services->SAP ArchiveLink->Basic Settings->Maintain Links (Table 
       TOAOM_C, Trxn).</b></b>
    Test
    • Test the repository.
    Use transaction SE38 to start the RSCMSTH0 report. Specify your repository (i.e. Z1) and start the test.
    The report must run without errors. If no problems occurred, you can use the new repository with Archive Link after you carry out the Archive Link Customizing. If problems do occur, check whether one of the related
    notes helps.
    For More Details :
    http://service.sap.com/archivelink.
    <u><b>
    NOTE:- Screen Shots are missing, i was not able to paste here, One more thing is we did this for uploading a PHOTOS into Content Server, Similarly you have to create a REPOSITORY and Z-TABLE to bring all the Attachments from all the selected Objects and then route them to the CONTENT REPOSITORY.</b></u>
    Your Senior ABAP guy would help you in this, if not i may try to help you more by monday.
    Regards
    Rehman
    <b>Reward Your Points if Satisfied.</b>

  • File attachment problem in Services for object XK03

    In XK03 when i try to create a attachment using Services for object icon it is giving an error message in SAP ECC 6.0 after selecting the file from the folder.
    "Error occurred during import"
    Error occurred during import
    Message no. SO424
    Diagnosis
    An error occured during the import of a file.
    System Response
    The import was not carried out.
    Procedure
    If the document is still open in the application, you need to close it before you carry out a new import.
    This error message may indicate a SAP-GUI problem. The cause could be an error during data conversion, for example. Report the error to your system administrator.
    Does anybody knows about this...
    thanks,
    fractal

    Hello Fractel,
    Are you get rid of this issue?
    We have just implemented some of SAP packs/patches and few users face this issue.
    When I tried the same, I did not face this issue.
    Please suggest.
    Regards,
    JPS

  • Change log of attachment in Services for object in PO

    Dear All,
    I am unable to find the history of changes made to a file attached in a PO in the services for object button. Like other changes in header and items of a PO is available is this also available and if so how to get the details of changes of the attachment . The problem is one user had created the attachment in a PO and now finds that the attachment has been deleted as the same is no more there .The document is a word document . I do not find any table where such change record is available .
    Will anybody explain the above?
    Dhruba

    You'll need an ABAPer to look for the table and if their is a history associated with changes.
    What the User could do is subscribe to their objects so that if changed or deleted they receive a message
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/e6/767b44a0fc11d389c60000e8216438/frameset.htm
    Add a function module to include the id name of the person changing the object and/or write the event detail to a table and create a display transaction.
    Regards,
    Nick

  • Services for Object - Create external document (url) 132 characters limit

    Hello,
    I have this requirement:
    Maintenance people would like to relate a document on our portal on a work order to be able to print it with the work order.
    My suggestion was to use Services for Object in the Order -> Create external document (url).
    But the adress field cannot contain more than 132 characters.
    I have URL longer than 132 chars:
    eg: http://server.domain:port/irj/go/km/docs/documents/AAI/Gestion%20documentaire/Public/Entretien/Instructions%20de%20travail/EU-IT-01-02.pdf
    What do you suggest me?
    Thanks,
    François

    Thank you Pete but we are release 700 and this note applies to release 620 and older. I will try to find another note or another way.
    In the meantime we use the short-ID of SAP Portal Documents which are long to retrieve but always under 132 char.
    François

Maybe you are looking for

  • F4 help in an Input Field in WebDynpro

    Hello Evryone, I Have a question based on F4 help. I have a static context node and an element of the node A has a search help shlp_a attached to it. the node A is having a Input field in UI mapped to it. When i use F4 help on this ui element mapped

  • Belkin USB Switch

    How do I get my Belkin USB switch (F1U201) to work with OSX Lion?  It worked with Snow Leopard, but not Lion.

  • Best way to use Kontakt in Logic

    Hi all, Ive been looking a the best procedure to work with kontakt. At this point, the simpler solution for me as been to open an instance of kontakt for every instrument track. I do a lot of midi orchestral programming so I tried to use kontakt as a

  • How to make a Countdown timer Script for Live Streaming

    I have flash media server... Here's a Scenario: User wants to do a Live broadcast.. But.. they don't want to just press record and have it starting Streaming Right that second. They need a Delay to prepare for their Live Broadcasts. Whats the best wa

  • Trying to update my ipod with videos/dvds

    I have been on the internet looking for ways to put my dvds onto my ipod video. I have managed to convert my a movie to mp4 format, and put it on my itunes, where it successfully plays. However when I try to get the movie from itunes to my ipod video