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 !

Similar Messages

  • Document flow in Purchase order

    Hi,
    How can check the document flow in purchase order(me22n).  Please help me on this issue..
    Thanks..

    HI
    There is no document flow like SD in MM
    Inorder to get the doc flow for a PO you can goto ME23N or ME22n and in item details click on PURCHASE ORDER HISTORY TAB here you will get the GR , IR etc.
    Alternatively you can goto table EKBE and enter the EBELN (PO number ) and execute you will get the doc flow
    regards
    Prashanth

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

  • How to attach a document  to a material

    Hi
      how to attach a document to the material.if i attach a document to a material. will get automatically pulled up to the bom and then to the
    production order.
    how to do this.

    Hi,
    First inCV01N transaction create document with proper document type which document u want to attach and continue,
    In the Orginals subscreen click it on the open original and upload the file which is in ur local system.
    Once u upload click it on the Object Link tab, In the Object link tab select the material master sub tab.
    In this sub tab  enter the material number and plant and save.
    Go to material master -->Basic data1 view --> In this view  click it on the basic data text tab, it will take u document sub tab in that select the document which u have attached and click it on the detail infomation, there u can view the document.
    Note: For Document maintainance in the SAP needs separate server.
    Regards
    Vijay

  • How to attach a document to an infotype?

    Hi,
    Can someone provide me with detail on how to attach a document to an infotype record. This could be any document type, i.e. word doc, jpeg, etc.
    Thank you,
    Warren.

    Thank you Rahul.
    I should have been more specific in my question.
    If I create a custom infotype for eg PA9002, and I create a record for employee 8000010, can I in that infotype 9002 record attach a document?

  • How to attach a document for a resume on a iPad

    How to attach a document to a resume using a ipad

    This is a little klugy, but should work:
    Open teh received email (the one you need to reply to)
    Tap on the body text and Select All, then Copy
    Open the document app (note sure which one you are using), and send the resume document via email
    Tap on teh body of the document and paste the copied text in
    Modify the Subject *** needed (you may want to include the "RE:" at the beginning
    Send
    Offer Apple some product feedback here : http://www.apple.com/feedback/

  • How to attach a document from cloudOn to my online application form or website

    How to attach a document from cloudOn to an online application form or website?

    You will need an app (web browser) capable of both storing a document and accessing the site's functionality sufficiently enough to upload a file. Safari can't do this (and I'm pretty certain CloudOn can't either). A couple of options:
    iCab Mobile - store documents in the Downloads section and has settings to both change the BrowserID to a non mobile browser to unlock site functionality, and has a setting for uploading files from its storage rather then iOS in general. Its not free, but not very expensive and is a pretty could all around web browser in its own right. I've been using it for quite some time.
    iUploader - has both free (trial) and paid versions. I've only experimented with it a bit, but works fairly well. Like iCab, has its own file container that you up load from.
    In both cases you would need to transfer your files from the source app (CloudOn, in this case) to the file storage, and then access the website.

  • How to attach a document using the Send mail component

    Hello,
    I would like to know how to attach a document in a email using the Send mail component.
    There are these nodes into the atom but I don't know how to use it.
    <attachment doc="/ds/grp/doc" pltype="xml">
              <xsl:copy-of select="/vpf:Msg/vpf:Body/vpf:Payload[@Role='S']/vpf:Msg/vpf:Body"/>
            </attachment>
    Does anyone know ?
    Thank you.

    Hello All,
    Regarding to the mail adapter, here are some updates:
    1. B1i will support sending HTML attachemnt via "Send Email" atom in B1 882 PL09. An example here:
    <attachment doc="test.htm" pltype="htm">
    <![CDATA[<html>
      <head>
        <title>Enter the title of your HTML document here</title>
      </head>
      <body>
        <p>Enter the body text of your HTML document here</p>
      </body>
    </html>]]>
    </attachment>
    2. In addition, B1i will support sending binary attachment and sending html content in Q1,2013.
    Thanks & Best Regards,
    Qiaoli

  • How to Create inspection that assign to Purchase Order / Material Document

    Dear QM Master,
    I am using QA01 to create inspection lot but can any master tell me , How to Create inspection that assign to Purchase Order / Material Document ?
    Appreciate.
    Thank you.

    Hello,
    When you create an inspection lot manually, you cannot reference an original document (for example, a goods receipt document, an order, or a delivery note).
    In QA01 you can create inspection lot manually for all inspection lot origins except the following:
    10 - Delivery to customer with sales order
    11 - Delivery to customer without sales order
    12 - General delivery
    13 - Repetitive manufacturing
    14 - Plant maintenance
    You can also refer this link
    http://help.sap.com/saphelp_47x200/helpdata/en/2d/3519d8448c11d189420000e829fbbd/frameset.htm
    Please check and revert.
    Regards,
    Priyanka

  • HT2128 Does any one know how to attach a document from your mail, while you are already in your e-mail, meaning not having to look for your file first and then open the e-mail.

    Does any one know how to attach a document from your mail, while you are already in your e-mail, meaning not having to look for your file first and then open the e-mail.

    Luis
    Good question - and one that a lot of (business) people would like solved!
    Your question prompted me to do some research, and I found this workaround posted by Scott Grossberg:
    His solution actually addresses a second problem too - how to attach a document when replying to an email message. In your case you may not need to consider the "reply" aspect - but if not right now, it'll come in useful someday!
    I've pasted it verbatim - if it works for you (it does for me) then all credit goes to Scott for solving the problem. There's just one thing I'd add to his solution: you will probably want to rename the message, as by default Goodreader gives it the Subject line: Mail with GoodReader attachments.
    THE GOODREADER OPTION
    1.  CREATE the document you want to send.
    2.  SAVE it to GoodReader (this will require you to buy and install the app).
    3.  Go to your email and OPEN the email thread to which you want to Reply and attach your file.
    4.  COMPOSE your Reply.
    5.  DOUBLE TAP the message.
    6.  TAP SELECT ALL. This will copy the entire email thread.
    7.  OPEN GOODREADER on the iPad and go to the file you want to send as part of your Reply.
    8.  At the bottom of the GoodReader screen you will see an EXPORT icon (it looks like a rectangle with an arrow pointing to the right).
    9.  TAP the Export button.
    10.  TAP EMAIL FILE. Depending on your needs, tap either SEND FILE “AS IS” or “FLATTEN ANNOTATIONS.” This will open a compose message screen with the chosen document already attached.
    11.  TAP in the body of the email screen. TAP PASTE. This will place your composed Reply and the prior email thread into the message.
    12.  ENTER the Recipients’ names in the TO: field of your message.
    13.  SEND your email Reply.
    The modified version (= when composing a new message rather than a reply):
    1 Make sure that the doc you want to attach is saved in GoodReader
    2 In the message you are composing, double tap, select all, and then copy.
    3 Open GoodReader and select the file you want to attach
    4 Select the export button at the bottom of screen
    5 Select e-mail file
    6 Position cursor in body of the email message, tap and paste. You may want to delete the "sent from GoodReader" text that precedes the attachment.
    7 Rename your message (as by default it will be Mail with GoodReader attachments)
    8 Add the recipient's address in the To field.
    Hope this helps! All thanks to Scott for this workaround.

  • How to attaching the documents to WBS element in projects .

    Hi Friends,
    Can any one explain me how to attaching the documents in project WBS element. We have u201CDMSu201D server. But I donu2019t know the process. Please explain me step by step the entire process of attaching documents to WBS elements in project.
    Regards,
    Hari Krishan

    Hi...
    Im adding to Expert..Venkats reply.
    Plz see this link
    http://help.sap.com/saphelp_45b/helpdata/en/95/5fdf348840ee64e10000009b38f83b/frameset.htm
    Regards
    Chandra

  • How do I enter Document Type for Purchase requisition IDOC

    Hello,
    File - IDOC (PREQCR.PREQCR02)
    The file is getting picked up and shows up a checkered flag in Moni..
    but in WE05, on R3 side, i see an error message
    "Enter Document Type"
    How do I enter document type for Purchase requisition IDOC?
    will that solve this issue?
    thanks and regards
    Nikhil.

    Hi,
    For error 51, you need to set the default document type in the inbound processing FM of the IDOC
    Standard type - NB
    Subcontrator type
    Blank PO
    Service PO
    Stock transport PO.
    Document types is used for below things,
    1. It controls the no. range of the document i.e. the doc no.
    2. It controls whether doc no. is auto assigned or manually entered
    3. It controls the field status of the doc header fields i.e. whether input is mandatory or optional
    4. It controls the physical doc filing
    Thanks
    Swarup

  • TS2928 could someone please tell me how to attach a document to email as an icon that opens....so it does not appear as text in the email??

    could someone please tell me how to attach a document to email as an icon that opens....so it does not appear as text in the email??

    Paste this into Terminal and hit return. If this attachment is text, it should work. Not sure about jpegs.
    defaults write com.apple.mail DisableInlineAttachmentViewing 1
    To reverse the setting, change the 1 to a 0.

  • How to see the ouput of a purchase order on screen??

    Hi all , how to see the output of a purchase order (ME23) on screen?
    Points will be awarded!!!!
    Thanks & Regards
    John

    Hi,
    If any output tye is associated to PO and it is been triggered then User ME9F tocde to view the output.
    To check thise first Use: ME23 and click on Messages, if any outputs are triggered and they are in Yellow status then Use ME9f. Once you execute you will get Outputs in the screen, then choose the output and click on Display Message button. Your output will be displayed on the screen.
    Regards,
    Ashok

  • How to change material component for a Purchase Order?

    How to change material component for a Purchase Order?
    I need FM .
    PLEASE help

    Dear ,
    Create PO with item category L....There in Item detail you will get tab for material.
    There click in component Button, it will take you to the component screen there you can assign and deassign components.
    Hope this helps.
    Regards
    Utsav

Maybe you are looking for