Create attachment document XLS for Purchase Requisition

Hi.
I need to add attachment to my Purchase Requisition usig a FM.
I found some topics on SDN where BAPI_DOCUMENT_CREATE2 is used.
I placed it in my code and run it. Return gives me nothing.
I get a new document number each time I run my program, but when I go to ME53n and look at attachment list no documents there.
Can You tell me what parameters with which values should I pass to BAPI_DOCUMENT_CREATE2 to add attachment to a purchase requisition. Mayby I didn't set a good configuration somewhere. Please HLP
Thx in advance
Tom

Hi,
Did you check the function module documentation. It contains one example also. Please check that.
BAPI fm BAPI_DOCUMENT_CREATE is internally calling this BAPI. Please check how it is calling.
Please alos check program LWPLGF06. I think it has similar code.
Thanks,
Ramakrishna
Message was edited by: Ramakrishna Prasad Ramisetti

Similar Messages

  • 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

  • Multiple Document Types For Purchase Requisition For Different Order Types

    Dear SAP Gurus,
    I want to have different document types of Purchase Requisition for different Order types.
    For Example:
    for Order Type ZT01- Document Type used should be YR01
    for Order Type YA01- Document Type used should be ZR01
    How could this be achieved?
    Regards.

    hi
    Kindly check the user exit for the same
    COZF0001 or COZF0002
    regards
    thyagarajan

  • Create Header Text ID for Purchase Requisition

    Hi All,
    I have a requirement of creating a Header Text ID in Purchase Requisition.
    I tried to create it using SPRO but it only creates Texts at Item level.
    I think we can do it using copy control. Please share your input.
    Regards,
    Amit

    Hi Amit ...
    i dont think we can maintain Header Texts at PR header ( also check in MM forums )....
    what you can do is , maintain same text for Vendor(LFM1-Object) ..then it wll automatically can copy to following documents ..ie. PO.
    regards
    Prabhu

  • Attach the file for purchase requisition using BSP service

    Hi All,
    I have Requirement Attach the any file like(PDF,TXT,PPT) to Purchase requisition using BSP service.Could please provide me any function module or BAPI for this functionality.
    Thanks in advance.
    Regards,
    Rajesh.

    Hi All,
    REPORT ZTESTJLG3 . .
    parameter p_mandt like sy-mandt default '120' .
    parameter p_equi type equnr default '1000007' .
    parameter p_path like IBIPPARMS-path memory id AD_LOCAL_PATH .
    parameter p_name(30) default 'Test attach 100007' lower case .
    " nom attachement .
    data w_prog like sy-repid .
    data w_dynnr like sy-dynnr .
    data w_attachement type borident .
    initialization .
    w_prog = sy-repid .
    w_dynnr = sy-dynnr .
    " test jean luc recuperer le code de
    fucntion module 'GOS_EXECUTE_SERVICE'
    data lo_container TYPE REF TO cl_gui_container .
    *call method lo_container->get_container_type .
    at selection-screen on value-request for p_path .
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    PROGRAM_NAME = w_prog
    DYNPRO_NUMBER = w_dynnr
    FIELD_NAME = 'P_PATH'
    IMPORTING
    FILE_NAME = p_path .
    start-of-selection .
    if sy-mandt ne p_mandt .
    write 'Erreur mandt ' .
    exit .
    endif .
    data ws_borident like borident .
    ws_borident-OBJKEY = p_equi.
    ws_borident-OBJTYPE = 'EQUI'.
    data w_document like SOOD4 .
    data : begin of wt_files occurs 0 .
    data fname(128) .
    data end of wt_files.
    wt_files-fname = p_path .
    append wt_files .
    data folder_id like SOODK .
    call function 'SO_FOLDER_ROOT_ID_GET'
    EXPORTING
    region = 'B'
    IMPORTING
    folder_id = folder_id
    EXCEPTIONS
    others = 1.
    w_document-foltp = folder_id-objtp .
    w_document-folyr = folder_id-objyr .
    w_document-folno = folder_id-objno .
    append document to documents.
    w_document-objdes = p_name .
    w_document-objnam = p_name .
    data w_h_data like sooD2 ..
    data w_fol_data like sofm2.
    data w_rec_data like soos6 .
    w_h_data-objdes = p_name .
    CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
    EXPORTING
    METHOD = 'IMPORTFROMPC'
    OFFICE_USER =
    REF_DOCUMENT = w_document
    NEW_PARENT =
    IMPORTING
    AUTHORITY =
    TABLES
    OBJCONT =
    OBJHEAD =
    OBJPARA =
    OBJPARB =
    RECIPIENTS =
    ATTACHMENTS =
    REFERENCES =
    FILES = wt_files
    CHANGING
    DOCUMENT = w_document
    HEADER_DATA = w_h_data
    FOLMEM_DATA = w_fol_data
    RECEIVE_DATA = w_rec_data .
    if w_document-okcode = 'CREA' or w_document-okcode = 'CHNG'.
    w_attachement-objtype = 'MESSAGE'.
    w_attachement-objkey = w_document(34).
    CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
    EXPORTING
    OBJ_ROLEA = ws_borident
    OBJ_ROLEB = w_attachement
    RELATIONTYPE = 'ATTA'
    IMPORTING
    BINREL =
    TABLES
    BINREL_ATTRIB =
    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.
    endif .
    For above requirement i am trying like above code.
    working fine but which transaction i can find the attach file.I am trying to fine using ME52N transaction but i c't find this file.
    Please suggest me how can i find this one
    Thanks in advance,
    RajeshV.

  • Account assignement category for purchase requisition - error message

    Hi All!
    I created a new Item category in service order (IW31) "O" with the account assignment category "O". If I don't set the Consumption posting indicator to V for this category, when I set the account assignment category "O" to the purchase requisition in <i>Plant Maintenance and Customer Service-Maintenance and Service Processing-Maintenance and Service Orders-General Data-Define Account Assignment Category/Document Type for Purchase Requisitions</i>, I receive the message:
    <b>"Acct. assign. cat. "O" for purchase req. does not exist.
    Message no. CS 075"</b>
    The client request is not to charge immediately for the goods receipt with the relevant costs the service order. The client wants to create the goods receipt in a storage location for the plant and then confirm the components and charge the costs after the component confirmation (movement type 261) - similar to stock material.
    Any idea about what should I do?
    Thank you.

    Hi Everyone,
    The problem is solved now. The cause was that the test requisition that I was making was satisfying more than one rules and hence I end dated the remaining rules which solved the problem.
    Thanks!

  • Define new document type for purchase order

    Hello
    I want to create a new document type for purchase ordre with also new number range.
    And within my conditions, the shopping card will be generate either document type ECPO with number range 44 or document type ZOS with number range 33.
    The document type is still a purchase order.
    Is it possible to do that? To assign new document type for purcharse order?
    If yes, is there any Badi to put my conditions of generation of my document type?
    Thank you for your help.
    Regards,
    Peggy

    Hi Markus
    Thank you four your response. Unfortuntly, i do not want to create a new transaction type.
    It is still a purchase order which could be visibled in standard transaction. The behaviour is still like standard PO, and could be visible in standard transaction PO.
    I just want to create 2 types of purchases orders to identify them, so create a new number range and so a new document type for purchase order..
    I have a condition to do "the shopping card will be created in this document type, and this schopping card will be created in this document type".
    But standard document type is ECPO, and I don't really know if it is possible to create new document type for purchase order...
    Peggy.

  • Need to attach document for Purchase requisition usingBAPI_DOCUMENT_CREATE

    Hi All,
    Requirement:
    Attach document(PDF,TXT etc) for purchase requisition using BSP service.
    For this i am finding one function module "BAPI_DOCUMENT_CREATE" please suggest me how to use this function module or its working my requirement or not.
    if it possible provide any sample code for BAPI_DOCUMENT_CREATE
    So that i can move to another why.
    Thanks in advance.
    Regards,
    Rajeshv.

    Hi,
    Did you check the function module documentation. It contains one example also. Please check that.
    BAPI fm BAPI_DOCUMENT_CREATE is internally calling this BAPI. Please check how it is calling.
    Please alos check program LWPLGF06. I think it has similar code.
    Thanks,
    Ramakrishna
    Message was edited by: Ramakrishna Prasad Ramisetti

  • Custom Event for Purchase Requisition Create, Change & Delete

    Hello Experts,
    I want to create a custom event which triggers on Purchase Requisition Create, SAP provide's standard event's for purchase requisition release but not for create.
    What are all the steps and how to create a new event.
    Thanks in Adavance,
    Sandhya.

    Hi Sandhya,
    may i know the reason why you are trying to create custom methods.
    You have business object BUS2009(for PR line item wise release) and BUS2105(for PR overall release).
    Both those business object have events RELEASESTEPCREATED (for PR creation) and SIGNIFICANTLYCHANGED(For PR change).
    Even then if you want to create custom events, create a subtype of the standard business object, then click on events, and then select create. Now create your Z-events, say ZCREATED (For creation), ZCHANGED (for changed) and ZDELETED (for deleted). Now select each event, click on edit -> Change release status -> object type component -> to be implemented. Follow the same for all the events. Then select each event, click on edit -> Change release status -> object type component -> to be released.
    Now click on your custom object, click on edit -> Change release status -> object type component -> to be implemented.Then click on your custom object, click on edit -> Change release status -> object type component -> to be released.
    After this in SWEC tcode, click on new entries. Select change document object as BANF, business object as say ZBUS2105 and event as ZCREATED. make sure radio button on create is checked.
    Similary create entries for ZCHANGED event and ZDELETED.
    Select on change and on delete radio button for event ZCHANGED and ZDELETED event respectively.
    let me know if you have any queries.
    Regards,
    Raj

  • Attachment for Purchase Requisition

    How to retreive a attachement of a Archived Purchase Requisition. The attachement is created by using services for the object option (Not at line item level)

    Hi,
    Did you check the function module documentation. It contains one example also. Please check that.
    BAPI fm BAPI_DOCUMENT_CREATE is internally calling this BAPI. Please check how it is calling.
    Please alos check program LWPLGF06. I think it has similar code.
    Thanks,
    Ramakrishna
    Message was edited by: Ramakrishna Prasad Ramisetti

  • Creating structured texts for purchase requisitions

    Hello,
    I would like to know if it's possible to define structured texts for purchase requisitions. By example, the item text would be like this :
    Building :
    Room :
    and the user should only complete the missing information.
    Does anybody have an idea on how to realize this ?
    Thanks in advance.

    Hi,
    It is not a simple thing to do.
    The item text comes from the material master (if you are using one) and so you could easily have the text for that as "Building   Room" and the material text can be changed (if you configure the system correctly) so they could just add the information.
    But you are limited to the size of the material text and so many people just use a non-material approach and manually key in the information in the text options rather than the Item text on the requisition line on the main screen. But in this case it is not a standard option to preformat the text as you require.
    It is almost as if configurable materials may help, these use the classification function and so they have characteristics, it would be easy enough to have a characteristic for room and one for building. The user would then be prompted to enter just the values for each and so it would do exactly what you need.
    But I don't have enough detailed experience of configurable materials to know for sure that you could use them like this, perhaps someone who knows them well could confirm if this would work?
    Whatever happens it is not a simple standard option, but SAP is very flexible and so there may be a reasonable work-around option.
    Steve B

  • Alternate document type for MRP requisition

    Our purchase scenario is that all MRP purchased items must have an approved contract to move to a purchase order.  In 95% of the cases, this will be true, but there will be that 5% that, due to expiration of the contract or quantity/value exceeded, a valid, approved contract will not be available.  However, the purchase must still proceed.
    Our thought is to create an alternate requisition type that the buyer could change the MRP requisition document to.  This new document type would then be subject to requisition release strategy.
    However, using an MRP generated requisition (creation indicator B), the document does not allow change of the document type.  The new document type is a complete copy of the NB document type used in MRP proposal planning, including the number range.  The only difference is that the new document type is subject to requisition release.
    Changing the document type at the MRP group level won't solve the problem as very few materials will actually require this change.  It would be temporary until the existing contract could be extended and approved or a new one created and approved.  Also, it seems that the MRP group setting affects only the purchase order and not the requisition.
    Is there a way for us to make this process work more smoothly than to have to copy the items from the NB document type to the alternate document type manually?

    Assuming you have a material master involved, why not try MRP Group in TCode OMDT.  You can assign the group to the material and that group can determine the PR type that is created.
    MRP:doc.type purchase requisitions for standard purchase ord
        Identifier allowing a distinction to be made between various kinds of
        purchase requisitions in the SAP system.
        By means of the document type you can, for instance, differentiate
        between a standard purchase requisition and a requisition relating to a
        stock transport order, although both documents belong to the purchasing
        document category "purchase requisition".
    Use
        Among other things, the document type controls number assignment and the
        selection of
    Regards

  • Assign document date to purchase requisition date

    Hi All,
    I have a question regarding purchase requisition. I have a requirement where i have to change the purchase requisition date based on certain condition. I tried to change it in the user exit "MV45AFZZ" when the sales order is released, but at this point the purchase requisition number is not yet created in the database though it is available in this internal table "XVBEP-BANFN" in the include "FV45EFMA_BESCHAFFUNG_SICHERN" of "SAPFV45E". Can anyone tell me when will EBAN table get updated and when should i change the requisition date? I hope the doubt is clear, otherwise let me know.
    Thanks and have a nice day.
    Cheers,
    Ashley

    Hi Ashley
       I have tried on my system and itz working, Can you
    place a break-point in MV45AFZB and see if the flow is
    reaching the place at the point where you need.
       Coming to the Customer Function in
    FV45EFMA_BESCHAFFUNG_SICHERN, have you checked as per
    the documentation of it:
    FU EXIT_SAPFV45E_001
    Text
    Update Purchase Order from Sales Order
    With this customer exit the standard system behavior
    regarding updating order data from the sales order can
    be expanded or restricted.
    The module is called up when the sales order is changed,
    as long as the conditions for changing the order have
    been filled. It transfers the document number, the
    purchase requisition number and a table for the fields
    to be changed in the order (T_PURCHASE_DATA). <b>This
    can be expanded or restricted in the existing
    Customizing.</b>
    <b>The rule is: To change a field with the name
    FIELDNAME, a subprogram (form routine) with the name
    POSITION_CHANGE_FIELDNAME must exist in the program SAPMM06E.</b>
    Try to find if POSITION_CHANGE_BADAT exists in
    SAPMM06E. If not found ask you functional consultant to
    expand it for purchase requistion date and see if it
    works.
    Hope your problem resolves.
    Kind Regards
    Eswar

  • Can't use Overall Release for Purchase Requisitions

    I have two groups, AA and ZZ.  Each group has it's own Class.
    Group AA uses Cost Center Class (CN)  (uses Characteristics Cost Center and Line Amount)
    Group ZZ uses Order Class (OC) (uses Characteristic Order)
    I have built one and only one Release Strategy for each of these Groups.  These Strategies both work successfully when I select the other group to be the group for Overall Release.  That is, if I set ZZ to be for Overall Release, then create a requisition, the release strategy for Group AA is applied successfully.  However, if I modify the req the strategy for ZZ, does not get applied.
    The opposite is true.  When AA is set to be for Overall release, then ZZ works.  However, if I modify the req, then AA's release strategy does not get applied.
    Again, both strategies work correctly when the other Group is set to be the one to use for Overall Release.  However, neither strategy works if its group is set to be the one for Overall Release.
    What am I missing?  I only have two classes, two groups, and two release strategies.

    SAP Standard system allows only 8 levels of release codes.If client requirement is more than 8 then for excess release codes customisation is done by the technical team (Abapers).Lets take an example of 15 release levels required for a client according to his Business needs then in this case initial 7 codes are customised and remaining 8 release codes are configured in the system.
    Release procedure is of two types
    Release Procedure without classification
                 This procedure is applicable only for Purchase Requisitions.
                 Here PR is released Item by Item only.
    Release Procedure with classification
                This procedure is applicable to PR,RFQ,Service Entry sheet,RFQ,PO,Contract  and scheduling agreements.
                Item by Item and Header level releases can be configured
                For PR - both item by item and Header level release can be configured
                For external purchasing documents - Release is possible only at Header level.
    Step 1:
    Create Characteristics
    In this step we need to create characteristics - conditions to be satisfied for triggering Release startegy.For example client has asked to set release strategy based on 3 inputs.Combination of value, Plant and Purchasing group
                1) Total value of PR more than Rs 50,000
                   create  characteristic as "Release_PR_total_value" in transaction code CT04.
                  Tab -  Basic data " Data type --- CURR currency format", "Decimal places - eg. 2 " and "currency  eg. INR or USD"
                  Tab -values key in > 50000 INR
                  Tab -  Additional Data-  Table Name "CEBAN" and Field Name "GSWRT"
                  Tab - Restrictions - class type - 032 - Release strategy
                2) Plant
                     Create characteristic "Release_PR_plant" in transaction code CT04.
                     Tab - Basic data - Data type - CHAR; Number of chars - 4
                     Tab - Values - Key in all the plants for which you are required to configure release proc.  eg. 1000,2000,3000
                     Tab - Additional data - Table name CEBAN and Field Name is WERKS.
                3) Purchaisng Group
                     Create characteristic "Release_PR_PurchasingGroup" in TCode CT04
                    Tab - Basic data - Data Type - char, Number of chars eg. 3
                    Tab - values - Key in all the purchasing Groups for which Release proc. is to be configured as required by Client.
                    Tab - Addnl Data - Table Name CEKKO and field name - EKGRP
    Step 2:
    Define class in transaction code CL02
    Menu path SPRO>Materials Mgmt>Purchasing>Purchase Requisition>Release Procedure>Procedure with Classification>Edit classes
    Here we assign all the above created Characteristics to a CLASS so that a release strategy to be triggered when all the conditions are met.
    Create a new class with free choice of names as "PR_Release_proc" in transaction code CL02.*Key in the class name and select class type as 032 - RELEASE STRATEGY then click on symbol create to enter all the details as mentioned below.
    Tab - Basic data - Enter description as "PR_Release-Proc",
    status- Released, Same classification - check the push button - Warning Message
    Tab- CHAR Enter above created 3 characteristics
    1.Release_PR_total_value
    2.Release_PR_plant
    3.Release_PR_PurchasingGroup
    step3:   
    Menu path is
    SPRO>Materials Mgmt>Purchasing>Purchase Requisition>Release Procedure>Procedure with Classification>set up procedure with classification>
    here define
    1.Release Groups
    Release group 01 is used for Purchase requisitions and 02 for Purchase orders.
    Here assign class "PR_Release_proc" against release code "01"
    check "OvRelPReq" indicator for over all release (All line items )of document in one shot else it will be released line item wise.
    2.Release codes
    Release codes are assigned to Release groups, in Workflow these release codes are tagged to users' SAP IDs through which they will be able to approve or reject a PR in SBWP(Inbox in SAP Business workplace.
    PRs are released by users in transaction code ME54N.
    Eg
    Type of user            - Level -             Release code                    
    PR creator - clerk or Business user -  
    Approver    -  Supervisor                 -   R1
    Approver  -   Project Lead              -   R2
    Approver   -  Asst. Manager             -  R3
    Approver   -  HOD/General Manager  - R4
    Release codes R1 to R5 are assigned to corresponding users.Manager R4 can only approve the PR if prior approvals till R3 are completed else not in ideal situation.
    For detailed info please refer
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/75/ee1fa755c811d189900000e8322d00/frameset.htm
    3. Release Indicator:
    Release indicators show the release status of a Purchase Requisition.
    For detailed info please refer SAP Help official site
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/75/ee1fa755c811d189900000e8322d00/frameset.htm
    4.Release Pre requisites:
    These define the order in which individuals or departments release the PR in sequence.
    3.Release strategies
    Create a new release startegy  eg ."A1" or "U1" , write its description PR release for value >1 lakh
    Now select release codes according to the Chart of Authority set by your client.
    Eg.
    Release startegy " A1 - PR release for value >1 lakh"
    R1 - Supervisor   
    R2- Project Lead    
    R3- Asst. Manager 
    R4- General Manager
    Now click on" Release  Prerequisites "push button and check all the boxes in ascending order.Save the document
    click on "Release statuses" push button, check release statuses then click on "Continue" push button.
    In third push button you can maintain CLASSIFICATION data or later you can directly mainatain in transaction code CL20N for this strategy.
    Classification data for example
    1. Value - > 100000
    2. Plant - 1000,2000,3000 etc
    3. Purchasing groups - 101,102,103 etc
    By clicking on "Release Simulation" push button you can check whether release is getting affected for configured release codes or not.
    In this way you can configure all the required Release startegies.
    Now create a PR in T code ME51N with the above conditions then a new tab will appear in PR creation screen at the time of check.Save the document and this can be released by respective users in TCode ME54N.
    Tcode - ME54N - For Individual Release
    Tcode - ME55 - For Collective Release
    For detailed info please visit SAP HELP website
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/75/ee1fa755c811d189900000e8322d00/frameset.htm
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/75/ee1fa755c811d189900000e8322d00/frameset.htm
    Regards,
    Indranil

  • Workaround for Purchase requisitions

    Dear Experts
    My customer has major two documents in there procurement process. Purchase requisition and purchase orders.
    Since there are no purchase requisitions in SAP B1, can anyone tell me a workaround which you have implemented in any client of yours
    Thanks & Regards
    Kanishka Wickrama

    Hi kanishka,
    You can do as suggested by Thanga Raj. You can also create 2 PLD's for purchase order and when you save it as draft, you can also take the print out and send it to the vendor. For this you also need to update Administration> System Initialization> printing preferences--> uncheck "print draft remarks".
    Thanks,
    joseph

Maybe you are looking for