FM to create external document(URL) in IE02

Hi,
I need to create external document(URL) for equipment master.
We can create manually it is done by clicking a button Services for Object and then selecting option (Create External Document URL).
I refered many links but failed to create the url in IE02.Please help me with the example.
Regards,

Hi,
You will need to use function BINARY_RELATION_CREATE for this.
Check how is it handled in function SGOS_URL_CREATE_DIALOG. Also check code in PAI of screen 2400 (subroutine create_url_doc). You will need to use that code.
Sridhar

Similar Messages

  • Create External document (URL) in SAP Personas

    Hi Smart People!
    To save some steps and incorporate a scanner I am working on creating buttons to "Attach Documents" in different areas such as MM03, FB03, and a few others where we have to keep a scanned in document attached to certain other Materials or Payables and such. All docs are scanned in and saved online and then we use the "create external document (url) menu option to link it where it is needed in SAP.
    In one place it works just fine and in the others it is not working at all and custom button or even just following the already existing menu options it keeps giving me this error. I tried search on the SCN and Google and no such luck on this error. Anyone have any ideas? See pic below and also the text below is the separated error so you can see what it actually says.
    [Unknown] ses[0]/wnd[0]/usrUSRAREA/ctlcntITS/itsdoc
    Thank you for any help you can give!

    That screen shot is for the Silverlight browser plugin.
    You can check your Personas version and patch level in System -> Status. Clicking on the magnifying glass in the SAP System Data box will list all the components of the ERP system. It will tell you what Personas version and SP is installed.
    Something like this:
    The above means Personas 2.0 SP2.
    If you indeed happen to have Personas 2.0 with no support package (so SP level says 0000), then the first thing I'd recommend is to bring the system to the latest level, which would be like in the screen shot, and then trying again. There is a good chance the problem will be resolved.
    If your system is completely up-to-date and it still gives you trouble, then create an OSS incident.

  • Tnx. IW22 Change PM Notification -  Create external document (URL) posting

    Hi:
    I am in transaction IW22 i.e. Change PM Notification.  There is a 'Services for object' drop down which appears below the enter tick.  This appears in online but not in BDC.  I have tried it through the transaction SHDB i.e. Transaction Recorder also herein the 'Services for object' does not appear.  I need to post entries through 'Create external document (URL)' through the 'Services for object' drop down using BDC / BAPI / etc.
    Please advice.
    NB.

    Hi NB,
    We have similar issue for QM notification and I have used function "SO_OBJECT_INSERT".
    I am enclosing my code may be useful for you:
    FORM CREATE-URL-ATTACHMENT.
      CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
        EXPORTING
          REGION    = 'B'
        IMPORTING
          FOLDER_ID = FOLDER_ID
        EXCEPTIONS
          OTHERS    = 1.
      CLEAR: LS_OBJCONT, LT_OBJCONT, LT_OBJHEAD.
      REFRESH: LT_OBJCONT, LT_OBJHEAD.
      CONCATENATE '&KEY&' H-URL INTO LS_OBJCONT.
      APPEND LS_OBJCONT TO LT_OBJCONT.
      CLEAR: L_OBJ_DATA.
      L_OBJ_DATA-OBJSNS = 'O'.
      L_OBJ_DATA-OBJLA  = SY-LANGU.
      L_OBJ_DATA-OBJDES = 'NOTES URL'.
      CALL FUNCTION 'SO_OBJECT_INSERT'
        EXPORTING
          FOLDER_ID             = FOLDER_ID
          OBJECT_TYPE           = 'URL'
          OBJECT_HD_CHANGE      = L_OBJ_DATA
        IMPORTING
          OBJECT_ID             = L_OBJ_ID
        TABLES
          OBJHEAD               = LT_OBJHEAD
          OBJCONT               = LT_OBJCONT
        EXCEPTIONS
          ACTIVE_USER_NOT_EXIST = 35
          FOLDER_NOT_EXIST      = 6
          OBJECT_TYPE_NOT_EXIST = 17
          OWNER_NOT_EXIST       = 22
          PARAMETER_ERROR       = 23
          OTHERS                = 1000.
      CLEAR: IS_OBJECT.
      IS_OBJECT-OBJKEY = WQMNUM.
      IS_OBJECT-OBJTYPE = 'BUS2078'.
      CLEAR: REL_DOC.
      CONCATENATE FOLDER_ID L_OBJ_ID INTO REL_DOC-OBJKEY.
      REL_DOC-OBJTYPE = 'MESSAGE'.
      CALL FUNCTION 'BINARY_RELATION_CREATE'
        EXPORTING
          OBJ_ROLEA    = IS_OBJECT
          OBJ_ROLEB    = REL_DOC
          RELATIONTYPE = 'URL'
        EXCEPTIONS
          OTHERS       = 1.
      IF SY-SUBRC EQ 0.
        COMMIT WORK.
      ELSE.
        T_MESSAGE = 'Notification Attachment Add Failed'.
        APPEND T_MESSAGE.
        CLEAR: T_MESSAGE.
        T_MESSAGE = 'Reference:'.
        T_MESSAGE+11(20) = H-REF.
        APPEND T_MESSAGE.
        CLEAR: T_MESSAGE.
        T_MESSAGE = 'Notification:'.
        T_MESSAGE+14(12) = WQMNUM.
        APPEND T_MESSAGE.
        CLEAR: T_MESSAGE.
        T_MESSAGE = 'URL:'.
        T_MESSAGE+5(72) = H-URL.
        APPEND T_MESSAGE.
        PERFORM SEND-EMAIL.
      ENDIF.
    ENDFORM.                    "create-url-attachment
    Hope this may help you.
    Please reward all the useful answers.
    Regards,
    Lanka

  • MM03/MM02 Need to create external document URL

    Hi All,
        We are having a requirement to create web link for materials using transactions MM03 or MM02.
        The exact path for this is as follows:
        Go to MM03/MM02 -> Enter material ->Basic data view -> Systems Menu -> Services for object -> Create external document URL.Here we need to enter the title and URL.
        The other path is clicking on the services for objects button that comes on the title bar and create the same.
        Is there any BAPI that can be used to achieve this.
    Reward points assured.
    Thanks and regards,
    Nilesh.

    Hi Nilesh,
        can you try 
    Using this function module:
      CALL FUNCTION 'GUI_RUN'
      EXPORTING
      command ='IEXPLORE.EXE'
      PARAMETER ='WWW.YAHOOMAIL.COM'.
    CD =
    IMPORTING
    RETURNCODE =
    in the appr place of coding
    <u>Reward pts if found usefull :)</u>
    Regards
    Sathish

  • FM to create external document(URL)   FBL1n transaction

    Hi!
    I'm trying to create a URL link in FBL1n but I'm not been able to do it.
    I checked this link[ FM to create external document(URL)|FM to create external document(URL)]
    but I'm not getting the URL in the link list.
    I can create the link manually as Vimal kumar  did, but in transaction FBL1n.
    My code is like this (I think one of the parameters is wrong.)
    data: it_BAPIPROPER type BAPIPROPER occurs 0,
          wa_BAPIPROPER like BAPIPROPER.
    DATA: WA_logical_system LIKE TBDLS-LOGSYS.
    CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
    IMPORTING
       OWN_LOGICAL_SYSTEM         = WA_logical_system
    EXCEPTIONS
       OWN_LOGICAL_SYSTEM_NOT_DEFINED       = 1
       OTHERS                               = 2.
    wa_bapiproper-prop_name = 'DESCRIPTION'.
    wa_bapiproper-prop_value = 'Test'.
    APPEND wa_bapiproper TO it_bapiproper.
    CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CRE_O_URL'
    EXPORTING
    LOGICAL_SYSTEM        = WA_logical_system
    classname = 'BSEG'
    classtype = 'BO'
    object_key ='10001900000000210001'
    url = 'http://metcold/ss2000/plainlinkurl.asp?dbid=08&k=Supplier_No,Invoice_No&v=22549,029214758&username=guest&password=guest.url'
    mimetype = 'TEXT/PLAIN'
    TABLES
    properties = it_bapiproper
    commit WORK.
    this is been execute with sy-subrc eq 0.
    Any idea?
    Thanks.

    Hi
    I tried attach an URL to document line, but without results. If I tried add URL to document header, all works perfectly. Maybe its not possible to add url-s into document lines...

  • FM to create external document(URL)

    Hi All,
    I need to create external document(URL) for equipment and functional location. Manually it is done by clicking a button (called Services for Object) which appears in the left upper corner (on the left side of the transaction heading) and then selecting option (Create External Document URL). Infact this button is availaible in many transactions.
    I need FM/BAPI using which i can create external document(URL) to equipment and functional location programmaticaly.
    Regards,
    Vimal

    Hi Viquar Iqbal,
    Thanks for ur help. It worked.
    The working code (For others reference)
    wa_BAPIPROPER-PROP_NAME = 'DESCRIPTION'.
    wa_BAPIPROPER-PROP_VALUE = 'Test'.
    APPEND wa_BAPIPROPER to it_BAPIPROPER.
    CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CRE_O_URL'
      EXPORTING
        classname             = 'EQUI'
        classtype             = 'BO'
       OBJECT_KEY            ='000000000020000038'
        url                   = 'http://sparsh/V1/'
        mimetype              = 'TEXT/PLAIN'
    TABLES
      PROPERTIES            = it_BAPIPROPER
    Regards,
    Vimal
    Edited by: Vimal  kumar on Feb 18, 2009 2:59 PM

  • 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

  • Create external document (URL) - Attachment in FI document

    Hi all,
    how can I add with a custom program an URL as attachment in a FI document?
    And how can I remove the possibility to delete this attachment for a user when he enters in change mode FB02?
    Many thanks.
    Luca

    hi,
    u have to do 2 things.....
    1) attach the created fi docs to browser(FM is available but i forgot it)
    2) call function module CALL_BROWSER and WS_EXECUTE to execute the attached fi docs...
    regards
    dinesh.a

  • 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

  • Insertion of external document(URL) in FB03 programmatically.

    Hi All,
    I have to insert the external document(URL) in the FB03 programmatically.File will contain Document Number, Company Code,
    Fiscal Year along with the url.Is there any FM to accomplish such a requirement?
    any help will be appreciated.
    Thanks in advance.
    Regards,
    Sarbajit.

    Hi Sarbajit,
    Would you mind sharing your solution?
    Regards,
    Brian

  • External document (URL) don't save the link

    Hi experts,
    I want to show "Service for object" button by creating Business Object (SWO1) with
    Interface = IFGOSXSERV
    Keyfield = Ref. Table --> ANLA
                     Ref. field --> ANLN1
    And my codes :
    CONSTANTS: OBJTYPE TYPE BORIDENT-OBJTYPE VALUE 'ZGOS'.
    DATA: MANAGER TYPE REF TO CL_GOS_MANAGER,
          OBJ TYPE BORIDENT.
    PARAMETERS: MATNR TYPE MARA-MATNR.
    AT SELECTION-SCREEN OUTPUT.
    CLEAR OBJ.
    SET OBJECT TYPE TO 'ZGOS'
    OBJ-OBJTYPE = OBJTYPE.
    SET OBJECT KEY = REPORT NAME
    SELECT SINGLE NAME
    FROM ANLA
    INTO OBJ-OBJKEY
    WHERE BUKRS = p_bukrs AND
                 ANLN1 = p_anln1 AND
                 ANLN2 = p_anln2.
    CALL GOS MANAGER WITHOUT CONTAINER (WILL BE DISPLAYED IN THE TOOLBAR)
    CREATE OBJECT MANAGER
    EXPORTING
    IS_OBJECT = OBJ
    EXCEPTIONS
    OTHERS = 1.
    What I want is each AssetNo have external Link (URL), but when I add external link and I rerun the program from SE38, the link is not saved.
    And I want to have a reference with External link between AS02 and my custom program. (If you add external link in particular AssetNo by AS02, it will be shown in my custom report, otherwise)
    Can you help me on this?
    Regards,
    Andreyus
    Edited by: Andreyus on Aug 8, 2011 11:56 AM

    Barbara,
    Some additional tips.
    AppleWorks has stopped working correctly
    Document content not saved
    AppleWorks fails to save properly
    ali b

  • Create external document

    Hi all,
    I just want to know if it's possible ti create an external document on a sales order programmatically ?

    ok

  • PM Notification Attachments via "Create Attachment" vs "Creat Ext Doc (URL)

    Uwe -
    Did you create the PM notification attachment using
    “Create Attachment”
    or “Create External Document (URL)”  ???
    Mine were created as attachments, not as external documents - that may be why your code isn't working ...
    I'm going to try to do an external document create and see if that works ...
    Dave

    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

  • Create a Note / External Document for Suppliers

    Hi Gurus!
    I'm developing a new procedure for a customer in which i've to create a supplier (Transaction XK01)  and then manage the creation/modify/deletion of Notes and External Document.
    With FM SO_DOCUMENT_READ_API1 i can read the Notes/Ext. Doc.
    With Fm SO_DOCUMENT_UPDATE_API1 i can update them
    With FM SO_DOCUMENT_DELETE_API1 i can delete also.
    But i'm in big trouble with the creation of them.
    I was thinking to use FM SO_DOCUMENT_INSERT_API1 but i cannot find a documentation for it and seems to need some information like FOLDER_ID that i cannot retrieve.
    Can you help me?

    Found:
    SO_FOLDER_ROOT_ID_GET
    Passing  REGION  = 'B'
    The problem is that 'B' isn't a value you can find in the matchcode, but it works anyway!

Maybe you are looking for

  • Conversion of int to String

    hi, Do someone know which way of converting the int to String is better? In term of performance and other issues in the handset: 1. int a = 5; String b = a + ""; 2. int a = 5; String b = String.valueOf(a); Thank you!

  • Unable to install via downloaded HP Webpack gc_w01_enu_nb.exe for HP PSC 1315

    I have a HP PSC all-in-one 1315 that I want to install on my new netbook running on Windows XP. As the netbook has no DVD drive I downloaded the full feature software and driver pack. When I double clicked it the files were extracted but the install

  • UTL_HTTP to call a web service to send SMS

    Hi All, I am trying to send SMS through a web service, and before doing it on a form, I tried to check this with UTL_HTTP from sql plus below given is the code i tried SQL> SET DEFINE OFF SQL> SELECT UTL_HTTP.REQUEST('http://80.227.146.106/Receiver/s

  • How can I close a tab when the close button is not highlighted?

    I don't know how to close a tab without the x in the upper corner. The support page stated I should right click on the tab for the close button but it is not highlighted in my drop down menu.

  • Whats with iPhone 5 battery

    my battery is ****, when I say **** i mean i might as well dont disconnect the phone from the power point  i carry a cable with me and charge the device in the car, at work, and at home, only use it without charge when i go for a smoke and the bustar