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

Similar Messages

  • Customer field in ME22N Purchase Order Transaction

    Hi all,
    I have to add an additional field to Ekko and want to maintain it using the Enjoy Purchase Order Transaction.
    To do so, I added an append to ekko and MEPOHEADER with my z-Field and implemented the Badis:
    ME_PROCESS_PO_CUST  Method PROCESS_HEADER to read the data from vendor and to set the modell using:
    call method lo_obj->set_data
        exporting
          im_data = lw_header.
    In ME_GUI_PO_CUST  Method TRANSPORT_FROM_MODEL I want to read the data using
    data: lo_header       type ref to if_purchase_order_mm,
    lw_header = lo_header->get_data( ).
    my Problem: My Z-Field in structure lw_header is initial; the data is lost!
    Did I forget a step? Is it necessary to add z-fields to CI_EKKODB instead of using own appends?
    Thx

    Hi,
    If you want to add fields in header then append the fields to the standard structure
    'CI_EKKODB' provided in EKKO table and if it is item level then append the fields to the structure
    'CI_EKPODB'.
    Now in 'MM06E005'  make use of the following components for your use.
    1) EXIT_SAPMM06E_006 - Export Data to Customer Subscreen for Purchasing Document Header
    Here, you can export the data to the subscreen by making use of the parameters 'I_EKKO' and 'I_CI_EKKO'
    provided in the import parameters of the exit.
    2) EXIT_SAPMM06E_008 - Import Data from Customer Subscreen for Purchasing Document Header
    You can import the data from screen from 'EKKO_CI' and if you want to update the EKKO table with those values
    then make use of the parameter 'E_CI_EKKO'.
    I hope this will help you.
    If you want anymore help, get back to me.
    Regards,
    Jallu

  • Purchase Order Approval Notifications and Multiple Currencies

    All,
    If I have a user who creates a requisition in EUR and then submits the requisition for approval to someone who has a default currency of USD, the workflow notification will show the value of the requisition in both EUR and USD. This is because the ICX: Preferred Currency profile option has been set at the user level.
    However, this does not work for purchase order approval notifications, just requisitions. This makes my management unhappy. Oracle Support indicates this is an enhancement request. However, I have a difficult time believing there is not something in the Oracle apps that allows this functionality in the PO Notification. We are on 11.5.10.2.
    Many thanks,
    Jeremy

    Is this what you are looking for?
    http://help.sap.com/saphelp_47x200/helpdata/en/75/ee14a355c811d189900000e8322d00/frameset.htm

  • BAPI for  Reversal of Goods Receipt Purchase Order(Transaction : MIGO)

    Hi all,
    Is there any BAPI for the Reversal of posting the documents Goods receipt Purchase order
    (Transaction: MIGO).
    Any inputs on this..is highly appreciable...
    thanks in advance...
    regards..
    prathima.

    Hi,
    Try this passing material doc and year.
    * Cancel the goods movement (creates a reversal document)
      CALL FUNCTION 'BAPI_GOODSMVT_CANCEL'
        EXPORTING
          materialdocument = g_material_doc
          matdocumentyear  = g_matdoc_year
        TABLES
          return           = i_return.
    Edited by: Raj on May 14, 2008 7:46 PM

  • BAPI needed  for  Goods Receipt Purchase Order(Transaction : MIGO)

    Hi all,
    We have a requirement where in we need to post the documents throuh BAPI for Goods receipt Purchase order(Transaction: MIGO).
    Any inputs on this..is highly appreciable...
    thanks in advance...
    regards..
    prathima.

    Hi,
    use 'BAPI_GOODSMVT_CREATE'
    Check this sample.
    code
    REPORT ZRICH_0001 .
    Structures for BAPI
    DATA: GM_HEADER TYPE BAPI2017_GM_HEAD_01.
    DATA: GM_CODE TYPE BAPI2017_GM_CODE.
    DATA: GM_HEADRET TYPE BAPI2017_GM_HEAD_RET.
    DATA: GM_ITEM TYPE TABLE OF
    BAPI2017_GM_ITEM_CREATE WITH HEADER LINE.
    DATA: GM_RETURN TYPE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA: GM_RETMTD TYPE BAPI2017_GM_HEAD_RET-MAT_DOC.
    CLEAR: GM_RETURN, GM_RETMTD. REFRESH GM_RETURN.
    Setup BAPI header data.
    GM_HEADER-PSTNG_DATE = SY-DATUM.
    GM_HEADER-DOC_DATE = SY-DATUM.
    GM_CODE-GM_CODE = '04'. " MB1A
    Write 971 movement to table
    CLEAR GM_ITEM.
    MOVE '412' TO GM_ITEM-MOVE_TYPE .
    MOVE 'Q' TO GM_ITEM-SPEC_STOCK.
    MOVE '3800533484' TO GM_ITEM-MATERIAL.
    MOVE '1' TO GM_ITEM-ENTRY_QNT.
    *MOVE 'PC' TO GM_ITEM-ENTRY_UOM.
    MOVE '1060' TO GM_ITEM-PLANT.
    MOVE '0007' TO GM_ITEM-STGE_LOC.
    *MOVE '0901' TO GM_ITEM-MOVE_REAS.
    MOVE 'P203601001' TO GM_ITEM-WBS_ELEM.
    MOVE 'P203601001' TO GM_ITEM-VAL_WBS_ELEM.
    APPEND GM_ITEM.
    Call goods movement BAPI
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
    EXPORTING
    GOODSMVT_HEADER = GM_HEADER
    GOODSMVT_CODE = GM_CODE
    IMPORTING
    GOODSMVT_HEADRET = GM_HEADRET
    MATERIALDOCUMENT = GM_RETMTD
    TABLES
    GOODSMVT_ITEM = GM_ITEM
    RETURN = GM_RETURN.
    IF NOT GM_RETMTD IS INITIAL.
    COMMIT WORK AND WAIT.
    CALL FUNCTION 'DEQUEUE_ALL'.
    ELSE.
    COMMIT WORK AND WAIT.
    CALL FUNCTION 'DEQUEUE_ALL'.
    ENDIF.
    WRITE:/ GM_RETMTD.
    LOOP AT GM_RETURN.
    WRITE:/ GM_RETURN.
    ENDLOOP.
    [/code]
    Also check the Bapis
    BAPI_PO_CREATE --> To create Purchase Order
    BAPI_PO_CHANGE --> To change Purchase Order
    BAPI_PO_GETDETAIL --> Todisplay Purchase Order
    Regards,
    Raj.

  • Regarding screen fields include in purchase order transaction

    Hai guys,
        I need to add new field in purchase order transaction ( me21n, me22n, me23n ) . i have added the new field in screen painter. when i was creating the field and then i made the field to refer from dictionary , when i refer from dictionary the field is showing in non-editable format.how to make the field  as editable format to enter the value.what is the settings behind it please explain.
    for your information i have added one more field without refering dictionary it is accepting inputs .
    Regards,
    N.selvamuthukumar.

    thanks for your reply.
    we have already  done the changes as you mentioned. but still we are facing the same problem of inactive state on the newly created field.
    kindly suggest any other settings to be done for dictionary related fields.. (we have enabled the dictionary related option in the screen field properties menu)
    otherwise provide step by step setting for new field creation.....(se51)
    thanks with regards
    selva

  • Creating new DMS info record directly from purchase order transactions

    Hello Everybody,
    does anyone knows of a way to make it possible for users to Create New DMS info record directly from the purchase order transactions ?
    e.g:
    in ME22N there is a button of "Documents" for an item level in the order, but that button only allows to link an existing info record.
    Link To a screenshot:
    http://img263.imageshack.us/i/me22n1.jpg/
    Regards,
    Yossi Fridman.

    hi
    This query has already been addressed in the following Forum by Christoph Hopf..
    pls chk link below.
    Create DIR through P.O and Sales order screen
    Thanks
    john
    Edited by: johnpp on Feb 15, 2011 11:54 AM
    Edited by: johnpp on Feb 15, 2011 11:57 AM

  • SUS Purchase Order Confirmation notification (or alert) is possible ?

    Hello,
    We work on a SRM 5 release with a classic scenario.
    We use the EBP-SUS supplier collaboration scenario (clients are different for SRM and SUS).
    The purchasing document flow is describe below:
    1- SRM Shopping Cart
    2- R/3 Purchase Request (then, SRM SC history is updated with the PR number)
    3- R/3 Purchase Order (then, an IDoc is sent to XI which generates a XML document sent to EBP-SUS in order to create the corresponding sales order - SRM SC history is updated with the PO number).
    4- Then, supplier can confirm or reject the PO received. So, the SUS Purchase Order Confirmation is generated and sent back to R/3 ( via XI)
    5- R/3 PO is updated with the posted PO confirmation (you can see the confirmation control key AB in the 'Confirmation' tab of the PO item concerned).
    My request is to send a notification to the requester's mail client in order to inform him that supplier confirmed or rejected the PO.
    I noticed that notification receivers definition is possible in SPRO, but only for "Process Purchase Order Response". I guess this notification is for BUS2209 (SRM POR) and not for BUS2232 (PO confirmation for SUS).
    That's why i cannot use it: can anyone confirm this ?
    As alternative, i tried to use alert management in SPRO (in the SUS client) for BUS2232 with sub-category of event SRM_SUS_PO_CONF in ALRTCATDEF transaction for SRM Alerts, but it does not work (even if i schedule report RSALERTPROC ).
    Does anyone have a suggestion regarding my customizing ?
    Finally, when PO confirmation is posted in R/3 (step 5 seen above), the SRM SC history is not updated with the PO confirmation number: is this the standard way ?
    If yes and that the described notification (alert) customizing i indicated above are not possible, does it seem i will have to develop a specific notification process in R/3 when R/3 PO is updated with its PO confirmation coming from SRM-SUS ?
    Thank you for your help.
    Regards.
    Laurent.

    Hello Nagarajan,
    >
    >  Looks like your intent is to notify the  Shopping Cart requestor about the PO response that happens in the Back end system!
    > This looks strange but then it is really required if you have a common buyer in SRM and MM.
    >(...)
    Requester being the initiator of purchasing document flow, custumer request is to alert him about supplier POR.
    If i send my notification from R/3, i will get Requester name at R/3 PO item. Then, by a RFC call to SRM, i will get his data to generate my e-mail.
    >
    > The following approach can be adopted:
    > 1.Purchase Oder  Response Message can be pulled out of the XI thro a technical routing into the SRM which will post the Purchase Oder response in the SRM ( SRM PO will be updated)..There could be some issues with the variance POR and the status of the POR but that can be handled..
    >(...)
    I cannot do this: PO does not exist in SRM as we are in classic scenario.
    >
    > I am unsure of the Alert Management.. but I heard there should be a way for that also..
    > (...)
    I carry on checking this solution
    >
    > You can raise an OSS Message for the same pls.
    >(...)
    Don't have time for this and SAP will answer that this is consulting and not support
    I will also verify if i can find a BAdI dedicated to SUS Purchase Order Response and use it to generate my e-mail from SUS client (or maybe some enhancements).
    Regards.
    Laurent.

  • Restrict Purchase Order to generate custom output message on condition.

    Hi Experts,
    We have custom message / output types ZEMA(E-Mail) & ZNEU(Standard Mail) configured for Purchase Orders.
    We have a requirement from client to restrict the generation of output message ZEMA, if the amount of the PO is greater than some limit say 100USD. And the message output should also be avoided to create entry in ME9F.
    Can you please advise if there are some way (User Exit?) that prevent the output message in this scenario (specific PO Type) without touching the current Condition setup?
    Here I would need the new PO object being created and the amount on the PO from the field NETWR.
    Thanks,
    Ankur

    Hi Jurgen,
    Sorry for missing out the Dump details earlier.Please find below an extract from the dump:
    Category               ABAP Programming Error
    Runtime Errors         POSTING_ILLEGAL_STATEMENT
    ABAP Program           FRMSCM0012
    Application Component  Not assigned
    Date and Time          10.06.2014 08:30:46
    Error analysis
         There is probably an error in the program
         "FRMSCM0012".
         This program is triggered in the update process. The following ABAP
         statements are illegal here:
         - CALL SCREEN
         - CALL DIALOG
         - CALL TRANSACTION
         - SET SCREEN
         - LEAVE TO LIST-PROCESSING
         - SUBMIT
         - LEAVE SCREEN
         - LEAVE LIST-PROCESSING
         - LEAVE PROGRAM
         - LEAVE TO TRANSACTION
         - MESSAGE I/W/E (if not handeld using EXCEPTIONS ERROR_MESSAGE)
         - MESSAGE A
    How to correct the error
         Probably the only way to eliminate the error is to correct the program.
    If the error occurs in a non-modfied SAP program, you might be able to
    find a solution in the SAP Notes system. If you have access to the SAP
    Notes system, check there first using the following keywords:
    "POSTING_ILLEGAL_STATEMENT"
    "FRMSCM0012" bzw. FRMSCM0012_SF
    "SFORM_PRINT_OUTPUT"
    Information on where terminated
        The termination occurred in ABAP program "FRMSCM0012", in
         "SFORM_PRINT_OUTPUT". The main program
        was "RSM13000 ".

  • Could you restrict purchase orders based upon Vendor / Material Group?

    Hey everyone - I've got a general "could this be done" kind of question. 
    We would like to add on to the vendor purchasing view to include "valid" material groups.  This would then have what material groups could be purchased for which company code for that vendor.  Then in the purchase order creation / modification we would like to be able to validate this purchase order against this vendor / company code / material group combination.
    Obviously with enough custom code this could be done.  My question is whether it could be done without out introducing too much custom code - how would you construct such a solution to this problem?
    We are a SAP 4.7 shop.
    Thanks!   Ken Little

    >
    Ken Little wrote:
    > Hey everyone - I've got a general "could this be done" kind of question. 
    >
    > We would like to add on to the vendor purchasing view to include "valid" material groups.  This would then have what material groups could be purchased for which company code for that vendor.  Then in the purchase order creation / modification we would like to be able to validate this purchase order against this vendor / company code / material group combination.
    >
    > Obviously with enough custom code this could be done.  My question is whether it could be done without out introducing too much custom code - how would you construct such a solution to this problem?
    >
    > We are a SAP 4.7 shop.
    >
    > Thanks!   Ken Little
    By include "valid" material groups i think it means you are introducing a new field or some value in already existing field in vendor master.
    1) Now to restrict PO based upon material group a small custom code is needed.
        Use BAdI ME_PROCESS_PO_CUST....here write a code with help of your ABAP person that system will first select the 
        LIFNR (vendor code) entered in the PO...then it will check the same LIFNR in LFM1 table...here it will check the material
        group in the customized field & if found that it is within the list of previous listed material group then it will allow to process
        further or otherwise give a customized error message.
    or
    2) Use the field Group in OMSF...here maintain a common group against the material groups you want to do the purchase cycle.Now ask your BASIS person to use this group in carry out a specific activity, the user must have authorization for the combination of the activity and the authorization group.
    Regards,
    Indranil

  • Specific Exchange rate type for Purchase order transactions

    Hello,
    Is there any transaction in customizing where we can default a specific exchange rate type to be used for specific transactions. To explain in more detail, I am setting up a new exchange rate type which will be maintained by Treasury. We want Purchase Orders (in a specific Purchasing Org) to be raised only with that rate type. There are other requirements as well like that Exhange rate field should be non editable in the Purchase order etc.
    Any inputs would be of great help
    Keyur

    I donot think any such standard setting is there..
    Depending on the currency that you enter....in PO foreign currency...excahnge rate is read from transaction OB08....
    Or if you manually key in the excahnge rate in pO header.

  • Purchase order fax notification in case of error

    Hello Everybody,
    We have the following scenario:
    ERP 6.0
    sending purchase order via fax manually(ME9f) after approval
    when fax doesn't reach the recepient, usually the person who sent the fax, automatically receives a document to SAP inbox with information that fax with PO nr xxx did not reached the recepient. However in some cases, it goes not to the sender but the approver. Does anybody knows the rules here? If I go to SOST transaction I can see that in those 'weird' cases, the approver is the sender but users say, that he never sends any POs. Any clue what can it be?
    kind regards,
    Robert

    Hi Arun,
    As far as Resubmittting is concerned, there are two ways by which you may resubmit a message in 11g -
    1. Through UI (http://blogs.oracle.com/oracleb2bgurus/2009/09/what_do_i_like_most_in_11g_-_r.html)
    2. Through Resubmit command line utility (http://blogs.oracle.com/oracleb2bgurus/2009/09/b2b_commandline_utilities.html)
    Notification is not an in built mechanism in Oracle b2b. You may like to implement the same using BPEL. As Nitesh mentioned, by default exception/error message is enqueued to IP_IN_QUEUE and has the recipient name b2berroruser. You may develope a BPEL process listening for error messages (recipient name=b2berroruser), and perform required notification processing (EMail, SMS, Fax etc.) in that.
    Regards,
    Anuj

  • Restrict purchase order document type at plant level

    Dear,
    I would like to restrict the purchase order document type at plant level,
    Plz help me.

    Hi Dear,
                 at the Plant level you have to use the below given Authorization Objects for the Users in different Plant
    M_BEST_BSA     Document Type in Purchase Order
    M_BEST_WRK     Plant in Purchase Order
    Give the values of the respective Plant and Order Type for the Respective Users.
    For more help you can contact your Security Team.
    but before that please check out in the T-Code SU24, if both the Objects are active, if not then ask the ABAP person to activate them.
    Hope it helps you.
    regards,
    yawar Khan

  • Restrict purchase order line item selection in MEMASSPO

    How to restrict in authorizations of role which purchase order line item can be selected by user in the memasspo.
    I have a scenario where Business wants that no user should be allowed to select all the Purchase Order line items rather should be displayed sub set of the entire purchase Order line items while attempting to do mass change in the PO created.
    Thanks & Regards,
    Abhimanu

    The mass transaction is meant to change many POs and their items at one time.
    The user can not change anything with mass which he cannot do in ME22N.
    if he can do it in ME22N, why should he not be able to do it in MEMASSPO?
    Based on what criteria should a item be restricted from a change in your special case, how do you define your subset?

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

Maybe you are looking for

  • Macbook Pro Win 7 x64

    Hi, I have recently bought a MacBook Pro 2009 from a mate who sold it as faulty. The Apple store said it was a faulty Logic Board but couldn't say for certain what the problem was. Having experience with PCs I tried putting an old HDD in to test if i

  • OPERATION CHANGE IN ORDER

    Hello Experts, I have an issue regarding process order. If i add an operation while process order creation then will it get updated in recipe master table PLPO. Or suggest me an table in which i can find this updated values of operations. Thank you.

  • Wait Time Duration

    I need to set an infinite wait time at the end of a timeline so the video stops and waits on the last video frame cleanly. The user then pushes the ENTER or PLAY to advance seamlessly to the next timeline. Currently I need a secondary program (DVD Re

  • How to number spreads, as opposed to numbering pages?

    Can anyone help with a method to number spreads, rather than pages? I have hunted thoroughly on forums and in plug-ins, but the only thing I have found a few scripts that either don't work or don't exist any more. First, "why would anyone want to do

  • OCI with Eclipse or Another IDE

    M8's, Im really new in C programing, but i need implement this environment. I tryed ALL ways to do that, but without success. I Have a Client oracle in my Unbuntu S.O. But i need just make my Client trade information  with my AIX oracle server. if so