Hot to attach URL of attachment to a Purchase Order

Hi,
We have a requirement where the URLs of the scanned documents need to be associated with Purchase Orders Created in R3. We can do this using SAP GUI by accessing the PO. We want to do this via code. Is there any BAPI available for this? Or Someone can help as to which tables we have to access directly to update these details??
Thanks.
VJ

Hi,
Check out this weblog.
1 - /people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background
2 - /people/rammanohar.tiwari/blog/2006/03/25/generic-object-services-gosin-backgroundpart-ii

Similar Messages

  • Attachement linked to purchase order

    I want to know where the attachements linked to purchase order are getting stored in SAP.Since the attachement are linked to purchase order(header level) ,is it possible to link those attachements at item level so when we select a particular item  and  if the attachement exist for that item then we should be able to navigate to that attachement.These attachement are uploaded from window(any text file).Is it possible to implement this functionality at item level(table control) in purchase order?is there any existing functionality which support this requirement?

    You can also 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.

  • How to add external URL link to SAP object (Purchase Order, Invoice, etc)

    Hello,
    Is there any function module /BAPI that allows me to add an external URL link to a existing Purchase Order
    or Invoice document in R3 system?
    I tried to debug the system but have not found no suitable function module for it.
    I also analyzed the ABAP code of the small GUI window that allows to add a external URL link to
    a Purchase Order, and found the function module SO_OBJECT_INSERT. However I could not debug
    it (seems to be created with BOR objects) so I've no example for it.
    Please help!
    Regards,
    Manuel Dias

    CONSTANTS:
        c_http(36)    TYPE c VALUE '/BpHttpApis/slaphapi?ibmperson/(uid=',
        c_listxml(12) TYPE c VALUE ').list/byxml',
        c_value(5)    TYPE c VALUE 'value',
        c_cn(2)       TYPE c VALUE 'cn',
        c_mail(4)     TYPE c VALUE 'mail',
        c_em_num(19)  TYPE c VALUE 'managerserialnumber',
        c_em_cou(18)  TYPE c VALUE 'managercountrycode'.
      DATA  client          TYPE REF TO if_http_client.
      DATA  url             TYPE string.
      DATA  xbuffer         TYPE xstring.
      DATA  l_value         TYPE zchar2000.
      DATA  l_value_string  TYPE string.
      DATA  content         TYPE string .
      DATA  rows            TYPE STANDARD TABLE OF string.
      DATA  wa_rows         TYPE string .
      DATA  conv            TYPE REF TO cl_abap_conv_in_ce.
      DATA  ixml            TYPE REF TO if_ixml.
      DATA  streamfactory   TYPE REF TO if_ixml_stream_factory.
      DATA  parser          TYPE REF TO if_ixml_parser.
      DATA  istream         TYPE REF TO if_ixml_istream.
      DATA  document        TYPE REF TO if_ixml_document.
      DATA  node            TYPE REF TO if_ixml_node.
      DATA  xmldata         TYPE string.
      DATA  iterator        TYPE REF TO if_ixml_node_iterator.
      DATA  nodemap         TYPE REF TO if_ixml_named_node_map.
      DATA  attr            TYPE REF TO if_ixml_node.
      DATA  name            TYPE string.
      DATA  prefix          TYPE string.
      DATA  value           TYPE string.
      DATA  indent          TYPE i.
      DATA  count           TYPE i.
      DATA  index           TYPE i.
      url = 'http://bluepages.ibm.com'.
      CLEAR: l_value_string, l_value.
    ***Create the HTTP client
      CALL METHOD cl_http_client=>create_by_url
        EXPORTING
          url    = url
        IMPORTING
          client = client
        EXCEPTIONS
          OTHERS = 1.
      IF sy-subrc <> 0.
    Create the HTTP client failure, sy-subrc =
        MESSAGE i005(zm) WITH text-026 sy-subrc.
        EXIT.
      ENDIF.
      CONCATENATE c_http
                  p_accnt
                  p_couty
                  c_listxml
                  INTO l_value.
      l_value_string = l_value.
    ***Get employee information
      CALL METHOD client->request->set_header_field
        EXPORTING
          name  = '~request_uri'
          value = l_value_string.
      client->send( ).
      client->receive( ).
    ***Load to xstring
      CLEAR xbuffer .
      xbuffer = client->response->get_data( ).
      conv = cl_abap_conv_in_ce=>create( input = xbuffer ).
      conv->read( IMPORTING data = content ).
    create the ixml main factory
      ixml = cl_ixml=>create( ).
    create a stream factory
      streamfactory = ixml->create_stream_factory( ).
      xmldata = content.
    create a input stream
      istream  = streamfactory->create_istream_string( string = xmldata )
    create a ixml document
      document = ixml->create_document( ).
    create a xml parser
      parser  = ixml->create_parser( document       = document
                                     stream_factory = streamfactory
                                     istream        = istream ).
    parse the xml document into DOM tree
      IF parser->parse( ) <> 0.
    parse the xml document into DOM tree failure
        MESSAGE i005(zm) WITH text-027.
        EXIT.
      ELSE.
        node ?= document.
        IF node IS INITIAL.
    To be done
        ENDIF.
    create a node iterator
        iterator  = node->create_iterator( ).
    get current node
        node = iterator->get_next( ).
    loop over all nodes
        WHILE NOT node IS INITIAL.
          indent = node->get_height( ) * 2.
          indent = indent + 20.
          CASE node->get_type( ).
            WHEN if_ixml_node=>co_node_element.
          element node
              name    = node->get_name( ).
              nodemap = node->get_attributes( ).
              IF NOT nodemap IS INITIAL.
            attributes
                count = nodemap->get_length( ).
                DO count TIMES.
                  index  = sy-index - 1.
                  attr   = nodemap->get_item( index ).
                  name   = attr->get_name( ).
                  prefix = attr->get_namespace_prefix( ).
                  value  = attr->get_value( ).
                ENDDO.
              ENDIF.
            WHEN if_ixml_node=>co_node_text.
    User name
              IF name  = c_value AND
                 value = c_cn.
          text node
                value  = node->get_value( ).
                p_name = value.
              ENDIF.
    User email
              IF name  = c_value AND
                 value = c_mail.
          text node
                value  = node->get_value( ).
                p_email = value.
              ENDIF.
    Employ serial number
              IF name  = c_value AND
                 value = c_em_num.
          text node
                value  = node->get_value( ).
                p_em_num = value.
              ENDIF.
    Employ country code
              IF name = c_value AND
                 value = c_em_cou.
          text node
                value  = node->get_value( ).
                p_em_cou = value.
              ENDIF.
          ENDCASE.
      advance to next node
          node = iterator->get_next( ).
        ENDWHILE.
      ENDIF.

  • Attachment for a Purchase Order !

    Hi here !
    Back from holiday and immediatly in front of SAP ^^
    You could attach some document to a purchase order ( ME22N, then the menu bar from the button "Service for Object" near the title of the purchase )
    Therefore, just a bunch of question about attachment issue :
    1/ What's the difference between the "Create Attachment" and the "Create External Document (URL)" option ? Does it means that the first one is a document which is uploaded in SAP while the second one is just a link ? If so, where does SAP stock those documents ?
    2/ Is there a BAPI or other sample of code which could attach a document to a Purchase Order ?
    Thanks for your answer !

    FYI: sap does not recommand to store docs in your OLTP database, use a content server for that.
    create attach willl indeed create a document in the database
    url is just an url.
    Very high level:
    Setup an content server
    link to content server via OAC0
    based on custo OAC3 files will stored per object in the content server created above
    There are also some intresting notes:
    Note 1020056 - GOS doesn't work for Purchase order and requisition change
    Note 1140398 - Transferring docs from purchase requsition to purchase order
    Hope this helps!

  • Attach document in Purchase Order

    Hello Experts
    It is possible to attach a scanned document to the purchase order in SAP?
    Thank you in advace,

    Hi,
    1. You cann't save attachment while creating a PO ...
    2. Choose View/Change PO through ME22N
    3. Just above the Document Overview there is a button for services for objects.
    4. From drop down select create
    5. Select create attachment.
    6. Browse for the document.
    7. Save.

  • Changing template of document that gets attached to blanket purchase order

    Hi,
    When a blanket purchase agreement is saved. A pdf document gets attached that blanket purchase agreement. I can see that in Inquire -> View document. How does that gets attached, through which program, how can I change the template of that pdf document?
    Please suggest me.

    No cross posting
    Read the "Rules of Engagement"

  • HOT TO SET THE OUT PUT MESSAGE FOR PURCHASE ORDER

    As i was saving the Purchase order in Me21n the error message that came up was " NO OUTPUT MESSAGE SET FOR THE PO " HOW  DO I SET THE OUTPUT MESSAGE AND SET THE PO PRINT SETTING KINDLY HELP.

    Hi
    First of all Execute  program RSNAST0F in SA38 .
    Following are some steps for PO message printing
    Maintain Output of Purchase Order
    1. Condition Table
    SPRO &#61664; Material Management-> Purchasing -> Message -> Output Control->Condition Tables->Define Condition Table for Purchase Order
    Select:
    Purchasing Doc. Type,
    Purch. Organization,
    Vendor
    2. Access Sequences
    SPRO -> Material Management-> Purchasing -> Message -> Output Control->Access Sequences->Define Condition Table for Purchase Order
    3. Message Type
    SPRO -> Material Management-> Purchasing -> Message -> Output Control->Message Types->Define Message Type for Purchase Order
    Ex:
    EF---> ZNEU
    Select “ZNEU” and double click on “Mail title and texts” and go to
    EN- New Purchase Order Print Out,
    Select “ZNEU” again and double click on “Processing routines,
    Select “ZNEU” again and double click on “Partner Roles
    4. Message Determination Schemas
    4.1. Message Determination Schemas
    SPRO -> Material Management-> Purchasing -> Message -> Output Control->Message Schema->Define Message Schema for Purchase Order-> Maintain Message Determination Schema
    4.2. Assign Schema to Purchase Order
    SPRO -> Material Management-> Purchasing -> Message -> Output Control->Message Schema->Define Message Schema for Purchase Order-> Assign Schema to Purchase Order
    5. Partner Roles per Message Type
    SPRO -> Material Management-> Purchasing -> Message -> Output Control-> Partner Roles per Message Type ->Define Partner Role for Purchase Order
    6. Condition Record
    Navigation Path: SAP Menu-> Logistics -> Material Management -> Purchasing-> Master data->Messages-> Purchase Order-> MN04-> Create
    ZNEU -> ZNB
    Now you create PO(ME21N) and maintain the text and save it. Go to ME22N and print the PO by giving output type ZNEU).
    Vishal...

  • Enable to save documents attachement on purchase order

    Hi Experts
    I attach a document to a purchase order, i save it.
    When i open my purchase order i dont find mu documents attached, but when i apply on modify the system give me all documents attached on the purchase order.
    How can i resolve this please?
    Thanks

    Hi,
    I am a little confused. You said when you 'apply on modify', you call see all the attachments again.
    Would you please tell me what you mean by 'apply on modify'?
    Meanwhile I suggest you deactivate save and change BADI for PO and retest the issue.
    Regards,
    Ivy

  • Missing attachment (Object link) in Purchase Order (PO) seen via ME23N

    There is an issue in which I am not able to see the attachment in few purchase orders. The complete process is as follows:-
    Shopping cart is created in the SRM system and some reference document like a .doc, .xls or .pdf documents are attached with the item position of the shopping cart.
    This shopping cart along with the attachment information is then transferred to R/3 system via RFC connection which creates the Purchase Order in the R/3 system. These attachment document are created with transaction CV01N in the DMS server. These attachments are when opened in the Purchase order in R/3 for a item position, gets displayed from the archive link server.
    However in this case, there is no attachment (.xls) seen for the item position of the purchase order. However it is available and can be displayed in SRM system for the corresponding Shopping cart.
    Anybody know what to be done or missing?

    Hi,
    Check if note 1506581 is present in your system,if not please implement the same.
    Also check if in /SPRO -> IMG Customizing -> "Integration with
    our mysap.com components" -> Supplier Relationship Management ->
    Message Control -> "Activate Document Transfer"
    the customizing is correctly set for BUS2012 (Purchase Order).
    If not, please maintain this entry correctly and re-test the
    scenario.
    Regards,
    Ashwini.

  • Problem with attaching file to Sales Order

    Hello,
    In my company we have the possibility to attach files to sales orders, e.g. pdf files with the printing details.
    These files are added by the GUI user, this works fine.
    Now we have an extra order creation stream in which a pdf file has to be added to the SO without user interaction.
    I found a helpful link ( /people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background )
    This program creates URL links with no problem, but the file generation is not implemented yet.
    I tried to add the file functions to his sample report but still have one problem. The file is uploaded, but not reported as a PDF file in sap. If I select the created attachment SAP allows only the saving of the attachment. After saving the created file is a good PDF file, it opens with PDF-viewers.
    Why does SAP not know this is a PDF file and report it as such (and open the pdf viewer when selected).
    Thanks, Frank.
    source-code:
    REPORT  zzfb_brc                                .
    * Report  Z_RMTIWARI_ATTACH_DOC_TO_BO
    * Written By : Ram Manohar Tiwari
    * Function   : We need to maintain links between Business Object and
    *              the attachment.Attachment document is basiclally a
    *              business object of type 'MESSAGE'.In order to maintain
    *              links, first the attachment will be crated as Business
    *              Object of type 'MESSAGE' using Message.Create method.
    *              Need to check if we can also use FM
    *              'SO_DOC_INSERT_WITH_ORIG_API1' or SO_OBJECT_INSERT rather
    *              than using Message.Create method.
    * I took this program and removed all the parts for adding URL's and
    * notes.
    * Include for BO macros
    INCLUDE : <cntn01>.
    * Load class.
    CLASS cl_binary_relation DEFINITION LOAD.
    CLASS cl_obl_object      DEFINITION LOAD.
    PARAMETERS:
    *  Object_a
       p_botype LIKE obl_s_pbor-typeid DEFAULT 'BUS2032',    "SO
       p_bo_id  LIKE obl_s_pbor-instid DEFAULT '0000757830', "example number
    *  Object_b
       p_docty  LIKE obl_s_pbor-typeid DEFAULT 'MESSAGE' NO-DISPLAY,
       p_msgtyp LIKE sofm-doctp        DEFAULT 'EXT'     NO-DISPLAY,
    *  Relationship
       p_reltyp  LIKE mdoblrel-reltype DEFAULT 'ATTA'.
    TYPES: BEGIN OF ty_message_key,
            foltp     TYPE so_fol_tp,
            folyr     TYPE so_fol_yr,
            folno     TYPE so_fol_no,
            doctp     TYPE so_doc_tp,
            docyr     TYPE so_doc_yr,
            docno     TYPE so_doc_no,
            fortp     TYPE so_for_tp,
            foryr     TYPE so_for_yr,
            forno     TYPE so_for_no,
           END OF ty_message_key.
    DATA : lv_message_key TYPE ty_message_key.
    DATA : lo_message TYPE swc_object.
    DATA : lt_doc_content TYPE STANDARD TABLE OF soli-line,
           ls_doc_content TYPE soli-line.
    * Create an initial instance of BO 'MESSAGE' - to call the
    * instance-independent method 'Create'.
    swc_create_object lo_message 'MESSAGE' lv_message_key.
    * Upload the pdf file, for now from the frontend, in the future from
    * the server.
    DATA:
    *  dsn(40) TYPE C VALUE '/usr/sap/trans/convert/1.pdf', "server location
    l_lines TYPE i. "filelenght
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename   = 'c:t1.pdf'
        filetype   = 'BIN'
      IMPORTING
        filelength = l_lines
      TABLES
        data_tab   = lt_doc_content.
    * no exceptions, the file is there in this example
    break brouwersf.
    ** the coding for the server input, for later
    *OPEN DATASET dsn FOR INPUT IN BINARY MODE.
    *IF sy-subrc <> 0.
    *  EXIT.
    *ENDIF.
    *READ DATASET dsn INTO ls_doc_content.
    *WHILE sy-subrc EQ 0.
    *  APPEND ls_doc_content TO lt_doc_content.
    *  READ DATASET dsn INTO ls_doc_content.
    *ENDWHILE.
    *CLEAR ls_doc_content.
    *CLOSE DATASET dsn.
    * define container to pass the parameter values to the method call
    * in next step.
    swc_container lt_message_container.
    * Populate container with parameters for method
    swc_set_element lt_message_container 'DOCUMENTTITLE' 'Title'.
    swc_set_element lt_message_container 'DOCUMENTLANGU' 'E'.
    swc_set_element lt_message_container 'NO_DIALOG'     'X'.
    swc_set_element lt_message_container 'DOCUMENTNAME' p_docty.
    swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
    swc_set_element lt_message_container 'DocumentSize'    l_lines.
    swc_set_element lt_message_container 'DocumentContent' lt_doc_content.
    swc_call_method lo_message 'CREATE' lt_message_container.
    * Refresh to get the reference of create 'MESSAGE' object for attachment
    swc_refresh_object lo_message.
    * Get Key of new object
    swc_get_object_key lo_message lv_message_key.
    * Now we have attachment as a business object instance. We can now
    * attach it to our main business object instance.
    * Create main BO object_a
    DATA: lo_is_object_a TYPE sibflporb.
    lo_is_object_a-instid = p_bo_id.
    lo_is_object_a-typeid = p_botype.
    lo_is_object_a-catid  = 'BO'.
    * Create attachment BO object_b
    DATA: lo_is_object_b TYPE sibflporb.
    lo_is_object_b-instid = lv_message_key.
    lo_is_object_b-typeid = p_docty.
    lo_is_object_b-catid  = 'BO'.
    *TRY.
    CALL METHOD cl_binary_relation=>create_link
      EXPORTING
        is_object_a = lo_is_object_a
        is_object_b = lo_is_object_b
        ip_reltype  = p_reltyp.
    * Check if everything OK...who cares!!
    COMMIT WORK.

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

  • Link between Purchase order and Attachment list

    Hi All,
    I got a requirement like Purchase orders are from moved from one system to another system.There was a bug in BDC program
    so some Attachment list of the purchase orders are not moved properly to the another system.
                                                   Now my client want a report to generate the Purchase orders which is having attachment list.
    I did not find any table link between Purcahase order and Attachment list.
                                                  So Plz provide me the link between purchase order and attachment list.
    Thanks,
    Ram

    You mean service for object services?
    if yes then u have to create one custom report for Generic Object Services   ( like notes , attachment  , url )

  • How to attach a document to a purchase order !

    Hi !
    For once in this forum, I don't come with a question, but to show some piece of code.
    It is about a remote BAPI which can be call (with PHP for instance) in order to attach a document's URL to a purchase order.
    (This URL is available then through ME23N transaction for users)
    FUNCTION ZBAPI_PO_ATTACH_URL.
    *"*"Interface locale :
    *"  IMPORTING
    *"     VALUE(W_URL) TYPE  SOLISTI1-LINE
    *"     VALUE(W_TITLE) TYPE  SODOCCHGI1-OBJ_DESCR
    *"     VALUE(W_PO_ORDER) TYPE  SRGBTBREL-INSTID_A
    DATA: w_object type table of SOLISTI1,
          wa_object type SOLISTI1,
          w_doc_data type SODOCCHGI1,
          w_doc_info type SOFOLENTI1.
    concatenate '&KEY&' w_url into wa_object-line.
    append wa_object to w_object.
    w_doc_data-obj_name = 'INFORMATION'. "par défaut
    w_doc_data-obj_descr = w_title.
    w_doc_data-obj_langu = 'FR'.
    CALL FUNCTION 'SO_DOCUMENT_INSERT_API1'
      EXPORTING
        FOLDER_ID = 'FOL32000000000004' "Default directory
        DOCUMENT_DATA = w_doc_data
        DOCUMENT_TYPE = 'URL'
      IMPORTING
        DOCUMENT_INFO = w_doc_info
      TABLES
        OBJECT_CONTENT = w_object
    data : obj_role_1 like borident,
           obj_role_2 like borident,
           w_id type string.
    obj_role_1-objkey = W_PO_ORDER.
    obj_role_1-objtype = 'BUS2012'. " BUS 2012 for PO
    concatenate 'FOL32000000000004' w_doc_info-object_id into w_id.
    obj_role_2-objkey = w_id.
    obj_role_2-objtype = 'MESSAGE'.
    CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
      EXPORTING
        OBJ_ROLEA = obj_role_1
        OBJ_ROLEB = obj_role_2
        RELATIONTYPE = 'URL'
    ENDFUNCTION.
    Thanks for reading !

    In the ME23N transaction you can access to attach document here :
    [http://img25.imageshack.us/f/poattachlist.png/|http://img25.imageshack.us/f/poattachlist.png/]
    And if you dble click on the attach document, it will be open through a browser !

  • Another BOM is attaching to Purchase Order

    **In our company we have 2 plant say plant1 and plant2.  i created a purchase order in plant 1 for vendor "mahesh" which contains two items , but when i take the print of purchse order , it contans two material along with a BOM of attached to it. This bom is of plant2.. Again i created new order with different material for vendor "mahesh" this time also the bOM of plant2 is coming in PURCHASE ORDER.. Why BOM of plant2 is attaching to the vendor "mahesh" since we are creating purchase orde for plant 1. OUR vendor master data is centralized

    Hi,
    This has nothing to do with workflow. Please ask this for example in the materials management forum.
    Kind regards,
    Karri

  • Function module to release a work permit attached to a service order.

    Hi,
    We have a requirement of automating the process of work permit release attached to service order.
    I am looking for a function module / BAPI for releasing the work permit attached to a service order by passing service order number and permit ID/Name.
    If any of you have come accrose such one please share.
    Thanks
    Achuthanandan

    Hello Philip
    The following function modules should be useful:
       - CY_PRIMARY_SELECTION            - Function module for selection of orders for the work center
       - CY_SECONDARY_SELECTION          - Check for additional criteria
       - CR_CAPACITY_AVAILABLE_PERIODS   - Reads the available capacity from work center
       - HR_PERSON_READ_TIME_INFO        - Reads the available capacity from person (modification)
       - CY_GET_PART_CAPACITY            - used only for the first period to read backlog
       - CY_LOAD_DISTRIBUTION            - Distribution key
    Please observe that these are simple function modules, not BAPIs, That means, they were developed to be used on the SAP internal programs and they are not supported by SAP when used in custom programs.
    BR
    Caetano

  • To Limiting the size of the attached document in a "Purchase order"

    Does anyone knows how to limit the size of the document indexing in an "Purchase order"?
    Let me explain:
    By the tcode me23n I can create an annex to attach a file to the Purchase order,
    right now there is no limitation on the size of it,
    is there any way to limit that someone attach a giant file to a purchase order and leave me the Database trembling?
    thanks in advance.

    No cross posting
    Read the "Rules of Engagement"

Maybe you are looking for