Help in Purchase order check BADI !

Hi Experts,
I have made some changes in the BBP_DOC_CHECK_BADI for the BUS2201 object implementation whereby I had implemented the changes for checking the attachment details in the Purchase Order. Now here I used the Function Module BBP_PD_PO_GETDETAIL to get the PO details by giving the GUID as iv_doc_guid.
The sample code is below :
CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
EXPORTING
   I_GUID                           = iv_doc_guid
   I_WITH_ITEMDATA                  = 'X'
IMPORTING
   ET_ATTACH                        = gt_attach
TABLES
   E_ITEM                           = gt_item
I have taken the details of attachments which get populated in the structure ET_ATTACH and checked for various conditions in attachments.
I find that if the PO has a change version wherein the previous version did not have any attachments - everything works normally.
But if the previous version of PO had faulty attachments - and the user deletes the attachments in the change version - I find that the function module still takes the active version GUID as input to the PO as a result of which it checks for the faulty attachments and throws error.
Now there are no attachments in the change version of the PO. Can any one tell me whether it is possible to pass the guid -- such that it checks if the same attachments in the active document have been modified in the change version , so that if the faulty attachments in the active version are changed to the correct ones it should not throw an error!!!
Looking forward for your expert comments.
With Regards,
Rajesh R

Hi
Read this ...
As I told you in my earlier reply ...
<u>ET_ATTACH table uses structure - BBP_PDS_ATT_T . This structure has following fields -></u>
GUID     Globally Unique identifier
P_GUID     Parent GUID
LOGICAL_SYSTEM     Business Document Service: ID of Logical System
CLASSNAME     Business Document Service: Class name
CLASSTYPE     Business Document Service: Class type
OBJKEY     Business Document Service: Object key
DOC_ID     Business Document Service: Document ID
DOC_VER_NO     Business Document Service: Document version number
DOC_VAR_ID     Business Document Service: Document variant ID
DESCRIPTION     Attachment Description
URL     URL Case-Sensitive
TYPE     Procurement Document Attachment Type
INTERNAL_IND     Indicator Showing if Attachment is only for Internal Use
DEL_IND     Deletion Indicator SRM Purchasing Document
<u>We can use either the DOC_ID / DOC_VER_NO fields to determine the active versions. You need to see in debugging, which all fields get poupulated with values in case of versions in this structure, to code your logic accordingly.</u>
<u>Anyways, please find some sample code for dealing with Active versions.</u>
append lines of et_attach to lt_attachment_versions.
* Due to the fact, that the currently active version is in the
* received phio list and that it is possible, that there are
* several phios with the same version number (check_in) the
* output table has to be additionally prepared.
  SORT lt_attachment_versions BY
     guid            ASCENDING
     p_guid          ASCENDING
     loio_class      ASCENDING
     phio_version_no ASCENDING
     changetime      DESCENDING.
  lv_version_no = 1.
  WHILE lv_version_no < is_attach-phio_version_no.
    READ TABLE lt_attachment_versions
      INTO ls_attachment_version WITH KEY
        guid            = is_attach-guid
        p_guid          = is_attach-p_guid
        phio_version_no = lv_version_no
        del_ind         = space.
    IF sy-subrc EQ 0.
      APPEND ls_attachment_version TO et_attach_versions.
    ENDIF.
    lv_version_no = lv_version_no + 1.
  ENDWHILE.
  DELETE et_attach_versions WHERE NOT del_ind IS INITIAL.
<u>Other links which might help.</u>
<b>http://help.sap.com/saphelp_srm50/helpdata/en/46/882fdd8bfc1743bd5ef8b532f94402/frameset.htm
http://help.sap.com/saphelp_srm50/helpdata/en/a7/81b463611c124d8c9d2c5bd8d17b34/content.htm</b>
Hope this will help.
Regards
- Atul

Similar Messages

  • Authority check on Creation of Purchase order usin badi BBP_ITEM_CHECK_BADI

    hi all,
    i have to apply authority checks on creation of Purchase order and shopping cart in SRM using badi BBP_ITEM_CHECK_BADI.
    i have applied checks on creation of shopping cart   using this badi which have some filters but how to apply on purchasing order using BBP_ITEM_CHECK_BADI.

    hi,
      You can use the BBP_DOC_CHECK_BADI.
    BR,
    Disha.
    Pls rewar points for useful answers.

  • I'm asked to deselect the GR indicator for ZNPP purchase orders using BADI.

    Hi Experts,
    I'm asked to deselect the GR indicator against ZNPP purchase orders created from SRM using BADIs
    BAdI BBP_CREATE_BE_PO_NEW ,BBP_CREATE_BE_RQ_NEW  and FILL_PO_INTERFACE1  and FILL_RQ_INTERFACE  methods respectively.
    Can you please give me idea what I can do with this..
    Im unable to find the field name(WEPOS) for GR indicator.
    Please help me out..today is the deadline for me.

    These BADI's are in SRM not in ECC. Check the interface parameters of those badi methods. you will find some option to pass. if not you have to do it in ECC only.

  • Post changes of Purchase Order with BADI  ME_PROCESS_PO_CUST

    Hello All,
    I have to make changes to a Purchase Order when it is posted. In some cases I have to set the field WEBRE.
    What i tried is the BADi - Method ME_PROCESS_PO_CUST~post.
    Following Code I entered:
    DATA: position TYPE PURCHASE_ORDER_ITEM,
            tab_pos TYPE PURCHASE_ORDER_ITEMS,
            position_data TYPE mepoitem,
            xcheck TYPE MMPUR_BOOL,
            kopf TYPE REF TO CL_PO_HEADER_HANDLE_MM,
            position_check TYPE mepoitem.
      CLEAR: kopf.
      tab_pos = IM_HEADER->get_items( ).
      xcheck = IM_HEADER->IS_CHANGEABLE( ).
      TRY .
        kopf ?= IM_HEADER.
      CATCH cx_sy_move_cast_error.
      ENDTRY.
      IF kopf is  NOT INITIAL.
         kopf->MY_CUST_FIREWALL_ON = 'X'.
      ENDIF.
    LOOP AT tab_pos INTO position.
      position_data = POSITION-item->get_data( ).
      xcheck = POSITION-item->IS_PERSISTENT( ).
      IF position_data-werks(1) EQ 'D' OR
         position_data-werks(1) EQ 'G' OR
         position_data-werks(1) EQ 'P' OR
         position_data-werks(1) EQ '1'.
      ELSE.
        IF position_data-wepos = 'X' and position_data-UMSON is initial.
          position_data-webre = 'X'.
          POSITION-item->set_data( position_data ).   "write data
        ENDIF.
      ENDIF.
       position_check = POSITION-item->get_data( ). " check if it is written
    ENDLOOP.
    Now my Problem is, that my changes in  position_check are ok, but they are not written to database and I don't know why.
    I have made the changes with TA ME22n.
    I also tried ME_PROCESS_PO_CUSTcheck and ME_PROCESS_PO_CUSTprocess_item. With method process_item it is written to database, but it is not the right point of time. I just want these changes when the purchase order is posted.
    Got anybody an idea, maybe another Exit, Badi or what I'm doing wrong?
    Best regards,
    Ronny

    HI
    Try using this BADI
    ME_PURCHDOC_POSTED - Define Follow-On Processing for External Purchasing Documents
    We have used this BADI for updating the fields in the header and item level; after posting
    Thanks & Regards
    KK

  • Purchase Order Creation BADI's or Exits

    Hi All,
                  I am creating a purchase order in SRM and the same is reflected as purchase order in R/3 which is done in the backend.
                  My requirement is i have to populate the Invoicing Party Details in R/3 purchase order that gets created automatically when a PO is created in SRM. I am able to update the Invoicing party using the BAPI_PO_CHANGE for a PO stand alone once the PO is created. 
                 But i have to populate it when the is getting created for the first time from SRM. Is there any BADI or Exit to do this. I have tried the BADI ME_PURCHDOC_POSTED but i cannot call BAPI_PO_CHANGE by passing the PO number as the PO is not yet created.
                 Please help me its urgent.
    Regards,
    Ravi G

    Hi ravi,
    can you please tell me the Tcode  for creation of purchaze order in SRM.
    thank you
    sunny.

  • Help on purchase order exits..

    Hi gurus,
            My requirement is i need to capture time, when the purchase order is created.For this i searched the DB tables but there is I didnt found any table filed for that one.This Time field i put in the form layout of MEDRUCK for the corresponding Purchase Order. Please guide me how to do this.
                   Thanks in Advance.
    Thanks and Regards
    Srihari.

    Hi srihari,
    i have a code which reads data from cluster tables. This code might help u.Look at this code.
    here is a sample code ..
    **Subroutine to get BSIS data(G/L Accounts)
    PERFORM GET_BSIS_DATA.
    **Subroutine to get BSAS data(G/L Accounts (Cleared Item)
    PERFORM GET_BSAS_DATA.
    Proceed only if data found
    CHECK GV_NODATA_FLG IS INITIAL.
    **Subroutine to get BKPF data(Accounting Document Header)
    PERFORM GET_BKPF_DATA.
    **Subroutine to get BSEG data(Accounting Document Segment)
    PERFORM GET_BSEG_DATA.
    FORM GET_BSIS_DATA.
    CLEAR IT_GLACCOUNTS.
    REFRESH IT_GLACCOUNTS.
    SELECT BUKRS
    GJAHR
    BELNR
    FROM BSIS INTO TABLE IT_GLACCOUNTS
    WHERE BUKRS IN S_BUKRS AND
    ( HKONT IN S_HKT_IC OR
    HKONT IN S_HKT_TX ) AND
    BELNR IN S_BELNR AND
    BUDAT IN S_BUDAT .
    ENDFORM. " GET_BSIS_DATA
    FORM GET_BSEG_DATA.
    CLEAR IT_BSEG.
    IF NOT IT_GLACCOUNTS[] IS INITIAL.
    SELECT BUKRS
    BELNR
    GJAHR
    BUZEI
    SHKZG
    MWSKZ
    DMBTR
    KOSTL
    AUFNR
    XAUTO
    HKONT
    PROJK
    XBILK
    FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_BSEG
    FOR ALL ENTRIES IN IT_GLACCOUNTS
    WHERE BUKRS = IT_GLACCOUNTS-BUKRS AND
    BELNR = IT_GLACCOUNTS-BELNR AND
    GJAHR = IT_GLACCOUNTS-GJAHR.
    ENDIF. "IF NOT IT_BKPF[] IS INITIAL
    ENDFORM. " GET_BSEG_DATA
    HoPE THIS HELPS U..
    reward if useful
    thanks and regards
    suma

  • F4 Help for Purchase Order field in SRM

    Hello,
    I am working on developing a report program in SRM in which I have the fields Purchase Order Number, Fund, WBS Element for which I've taken the reference type as crmd_orderadm_h-object_id, BBP_PDACC-FUND, BBP_PDACC-WBS_ELEM_E respectively. I would like the F4 help to be added for these fields. How do I do that? Please let me know.
    Thanks,
    Venkata Phani Prasad K

    Closing Thread.

  • Unlimited delivery check box in purchase order checked automatically.

    Hi
    While i am creating a purchase order for certain material the unlimied delivery is enabled automatically for certaqin material group.
    I n mmaterial master also this is unlimited delivery is not maintained and in the purchase value key config also not maintained.
    Can you let me know is there any other config. for this yo dectivate
    Thanks in Advance
    Sunil

    Hi
    In material master you can check unlimited over delivery under Purchasing tab. Please check whether it is ticked or not.
    And also in Info record, under purchasing data you can check this tab.
    Thanks

  • Help Bapi Purchase order with reference to purchase requisition no

    Hi,
    i used BAPI_PO_CREATE1 for creating purchase order with reference to Purchase requisition number but im getting these error
    please help me to solve this
    1 E BAPI 001 No instance of object type PurchaseOrder has been created. External reference:
    2 E MEPO 001 Purchase order item 00010 still contains faulty schedule lines
    3 E 06 054 Doc. type/item cat. NB/S (requisition) <-> NB/ (purch. order)
    4 E 8W 162 No schedule line exists for schedule line number 0010000030 00010 0000.
    Thanks & Regards,
    Azhar
    Message was edited by:
            Azhar

    Hi Azar,
    I am also getting the same messages, did you get resolve the issue.

  • Need help in work order save BADI and create BAPI

    hi expert
    Our issues are below list
    1. When release and save the work order ,the standard BADI(WORKORDER_UPDATE) have not the parameters about service information . (for this issue , chunfai had give a solution ,we are testing it )
    2. When we create work order by BAPI(BAPI_ALM_ORDER_MAINTAIN), the BAPI canu2019t provide the parameters about service information .we canu2019t create WO including service data.
    3. When we update work order by BAPI(BAPI_ALM_ORDER_MAINTAIN), the BAPI canu2019t provide the parameter about service information . we canu2019t update WO including service data.
    could anyone can provide some suggestion for above question ? thanks for a lot

    Please check BADI IBAPI_ALM_ORD_MODIFY its method has a parametrs CT_HEADER_SRV and CT_HEADER_SRV_UP you can pass your data here...
    Lets say this BAPI you are calling in custom program than if you donot see any parametrs where service data can be passed then you can export the data before calling bapi and import in this badi implementation and complete your task..
    Please check BAPI and BADI documentation for more details
    Even  BAPi has these two parameters.
    Nabheet
    Edited by: nabheetmadan09 on Jan 11, 2012 2:08 PM

  • Need help abt Purchase order and material document number

    1)Is there any releation ship between Purchse order number and material document number?
    2) I found aBAPI to get the goods receipt details. That is BAPI_GOODSMVT_GETDETAIL. But it is excepting Material document number and material document year as input parameters.Is there any BAPI to get goods receipt details by using purchase order number?

    hi kiran
    check this thraed. this gives you relatinship between Purchse order number and material document number
    Retrieving Accounting Document number based on PO numbers
    BAPI to get goods receipt details by using purchase order number is
    BAPI_GOODSMVT_CREATE
    thanks
    Sachin

  • Need help on purchase order form

    Hi friends,
    Is it possible to put one folder ( tab) in purchase order form. I am trying to put folder in po screen. if i put any button object in po form it works. but when i put folder it is not showing folder and no errors.
    can anybody help me.....

    Hi Manish,
    it is possible to add the folder to purchase order form.
    you get the reference to Tax Folder of Purchase Order as Item.
    oItem=poForm.Items,Item("2013")
    then set the properties for your folder
    oFolderItem.visible=true
    oFolderItem.left=oItem.Right
    oFolderItem.top=oItem.Top
    oFolderItem.height=oItem.height
    oFolderItem.Width=oItem.width
    oFolderItem.frompane=0
    oFolderItem.topane=0
    oFolderItem.Specific.caption="asdf"
    oFolderItem.Specific.GroupWith("2013")
    Hope it helps you
    Regards
    Vishnu

  • Help Restriction Purchase Order Transaction Notification

    Good afternoon experts community'm doing a lock which I doubt as raise it, the case is as follows:
    The purchase order should not be created if the unit price of the item is higher than the price of the price list of sap, the problem is that now they will start to use the extra coin price list, that is why it is requires blocking the creation of the purchase order if the order price is higher or not applicable to the two alternatives we have in our price list.
    In advance I will be grateful if anyone reads this post and I can reach out to fill this requirement and also bring something more to my knowledge.
    best regards!
    example
    if @transaction_type = 'A' and @object_type='22'
    begin
        set @itemcode =(select top(1) o1.itemcode
                          from opor o inner join por1 o1 on o1.docEntry = o.docEntry
                                      inner join ocrd c  on c.cardcode  = o.cardcode
                         where u_facnum is not null
                           and  not exists(
                                           select *
                                             from itm1
                                            where itemcode  = o1.itemcode
                                              and pricelist = c.listnum
                                              and (price > o1.Price and AddPrice1 > o1.Price  or itemcode in ('FLETE','SEGURO'))
                           and  o.docEntry = @DocEntry)
       if (
           select count(*)
             from opor o inner join por1 o1 on o1.docEntry = o.docEntry
                         inner join ocrd c  on c.cardcode  = o.cardcode
            where u_facnum is not null
              and  not exists(
                              select *
                                from itm1
                               where itemcode  = o1.itemcode
                                 and pricelist = c.listnum
                                 and (price > o1.Price and AddPrice1 > o1.Price  or itemcode in ('FLETE','SEGURO'))
              and  o.docEntry = @DocEntry
           )>0
       begin
         set @error = 1
         set @error_message = 'Error el articulo '+@itemcode+' no concuerda a lista de precios del cliente.!'     
       end
      end

    Hi,
    Please avoid using Transaction Notification if you want to insert a B1 object via DI API using the integration framework.
    The reason is, that the integration framework uses the DI API logic and this transaction notification runs on top after the DI API process is finished. Therefor it is not really part of the DI API process.
    This could cause an unexpected exception in the DI Adapter of the Integration Framework.
    My proposal is to check your mentioned logic within the integration framework instead of using the transaction notification at the end.
    E.g. Build a flow using a SQL Call atom to retrieve the pricelist price you want to compare with.
    You can built a conditional processing in your integration flow to avoid the creation of the purchase order or directly change the price on the flow.
    Another option is to check your logic, create the purchase order with status "for approval" and inform the keyusers via B1 alert message out of your integration scenario step.
    Best regards
    Bastian

  • Please help in purchases order amendment dates

    please help me in purchase order amendment date
    how to maintain this and how it will be reflect in invoice...

    Hi!
    If you wanted to create an own search help for that field, just go to SE11 transaction, and create a new search help.
    Join your Z-table with the customer table and create a view. Use this view in your new search help.
    Regards
    Tamá

  • Help with purchase order detail

    Hello Experts,
    I am currently trying to get information on a purchase order, but not having any luck.  I need to find the PO Number, and PO Approval Date.  I cannot find either of these.  I have tried using BBP_PD_PO_GETDETAIL, but have no luck with this.  here is what I have:
    move w_result-sc_guid TO lv_guid.
            CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
             EXPORTING
               I_GUID                           = lv_guid
               I_OBJECT_ID                      = w_zwkflw_rep-object_id
               I_WITH_ITEMDATA                  = 'X'
               I_READ_FROM_ARCHIVE              = 'X'
             IMPORTING
               E_HEADER                         = ls_e_header
             TABLES
               E_ITEM                           = lt_e_item
    All I have available is shopping cart number.  Can anyone assist please?  Thank you.

    hi,
    try below steps to retrieve purchase order details from a shopping cart.
    get the purchase order GUID in ET_HEADER_REL parameter of BBP_PD_SC_GETDETAIL fm using the shopping cart number or GUID.
    then to get the purchase order details, use BBP_PD_PO_GETDETAIL importing I_GUID = purchase order GUID from ET_HEADER_REL.
    regards.

Maybe you are looking for

  • How do you connect to HP 4630 printer WiFi

    I had just installed Maverick on my Macbook and had to buy a new printer, HP 4630 Officejet.  The MAC does NOT recognize the printer by Wi-FI although it will print if I have it attached by cable.  It is listed as the printer in system preferences.

  • Why do i keep getting texts that are not sent to me?

    Well it started when i wanted to explore the new software (iOS 6.0) provided by Apple on my old iPhone 3Gs. i asked my dad to call me so i could try out the new feature in whitch you send messages straight from the lock-screen. so i sent the message

  • Laserjet 1020 printing alignment

    I am using a Laserjet 1020 on Windows XP, connected via USB.  When printing documents from Word 2007, Print Preview shows the document as I want it to be, but when it actually prints, it comes out about half an inch higher up the page.  Nothing is cu

  • AII 4.0: Material movements, warehouse movements ?

    Hi, Could anyone who's in the AII 4.0 rampup tell me if AII 4.0 supports simple material movments (from one storage location to another for example) or warehouse movements (TO for example)? Thanks very much Regards, michal

  • HT3986 Can I load a branded version of Windows 7 on my Macbook Pro with Mac OS 10.7.5

    Can I install a branded version of Windows 7 on my MacBook  Pro with MAC OS 10.7.5. I am attempting to  run a Windows version of Family Tree Maker with BootCamp. I am having too many problems with the Mac version of Family Tree Maker wity syncing. Th