Changing Item Values before saving Purchase Requisition in me51n, set_data function

Hello,
        I have written a user exit, which is called whenever changes are made to a purchase requisition. User Exit is MEREQ001 , function module EXIT_SAPLMEREQ_010 . My requirement here is that the Requisitioner should be 135 for every PR item under certain conditions. Therefore whenever there is any change made to the PR, before saving the PR item, I need to set the Requisitioner to 135, give a status message saying that the Requisitioner is set to 135 and save the Pr with the changed values. Following is the code I have written in EXIT_SAPLMEREQ_010. However, the set_data function called below does not change the PR values. Pls help
data: lt_item type mmpur_requisition_items,
       wa_item type mmpur_requisition_item,
       wa_itemdet type mereq_item,
       wa_itemref type ref to if_purchase_requisition_item,
       w_message type i.
constants: c_135 type afnam value '135'.
call method im_req_header->get_items
     receiving
             re_items = lt_item.
    loop at lt_item into wa_item.
     wa_itemref = wa_item-item.
     wa_itemdet = wa_itemref->get_data( ).
     if wa_itemdet-afnam ne c_135.
       w_message = 1.
       wa_itemdet-afnam = c_135.
       call method wa_itemref->set_data( wa_itemdet ).
     endif.
   endloop.
  IF w_message = 1.
    MESSAGE 'Requisitioner defaulted to 135 for all items' TYPE 'I'.
  ENDIF.

Hi Sachin,
           I am able to get a reference to if_purchase_requisition_item in my code (wa_itemref ) and am also able to access each of the line items in the PR in the work area wa_itemdet.
At this point in the code ( wa_itemdet-afnam = c_135 ) , the work area value is set to '135', However, call method wa_itemref->set_data( wa_itemdet ), does not change the values of the work area wa_itemdet . Pls help

Similar Messages

  • Rounding Values while creating purchase requisitions using ME51N

    Hi MM Experts,
    I have created some materials with a Rounding Value maintained in MRP1 View of the material master.
    Whenever I raise a purchase order, the order quantity rounds off to the value maintained in the material master which is the correct functionality.
    But when i try to create a purchase requisition using ME51N, the rounding functionality doesn't work.
    Example: Rounding value (in MRP1 view) of a material is 25.
    The order quantity entered is 4. But before saving the PURCHASE ORDER the order quantity will be changed to 25(which is the rounding value). This is the correct functionality but doesn't happen with the PURCHASE REQUISITION (ME51N)
    Can someone guide me on how to make the rounding value work for purchase requisitions when using ME51N?
    Thanks in advance.
    cheers,
    Randi

    Hi!
    i had the same problem with a company.
    i did not find any customizing possibilities.
    I solved it with BAdI ME_PROCESS_REQ_CUST
    Method PROCESS_ITEM.
    I hope this helps
    Flo

  • Change item value before commit

    Hello,
    I have a form in which I issue an execute_query from a mouse click to retrieve database values from a data block onto a form. The user is then able to change the values of these items on the form and commit them via a button on the form. What I want to do is make sure that some of the values, based on another item in the block, are negative and if not, change them to a negative value. before the changes are commited. I can't seem to find the right trigger to accomplish this-- has anyone have an idea on how to do this?
    Thanks in advance.
    Jeff

    Hi,
    How about putting your code in :
    1. Pre-Update or
    2. When-Database-Record
    [Block Level trigger]
    The trigger text could be something like :
    If (:block.col is > 0 ) Then
    :block.col := :block.col * -1;
    End If;
    -- Shailender Mehta --

  • Validation of Item Values before saving the form

    Hi,
    I have requirement in Oracle Forms, we give header information as per the requirement and the lines info of the specific header. In lines whe have two feild as type and amount. If the type is 'E' then we need to sum up the amount value as credit and if type is 'F' we need to sum up of those feild values as Debit and before saving the form we need to check the sum of Credit and Debit is equal or not if equal then we should allow to save the form else it should not. We can have multiple lines under single header..Can any body help on this..Its very emergency..
    Thanks,
    Maggi.

    Hi,
    In Customer-exit ILOM0001 read table IMPT_BUF[] from sap stack. It contains all enteries of measuring points.
    Use below mentioned code in above exits for your reference.
    FIELD-SYMBOLS : <fs_impt> type ANY TABLE.
    data : tab_impt type TABLE OF impt.
    ASSIGN ('(SAPLIMR0)IMPT_BUF[]') to <fs_impt>.
    if sy-subrc is INITIAL.
      tab_impt = <fs_impt>.
    endif.
    table TAB_IMPT is filled wilth all entries of measuring point while creating and changing functional location.
    Thanks,
    Vijay

  • Prin preview of item text before saving PO

    Hello,
    when I create a PO I can use the print preview of the PO before actually creating/saving the PO. However if I do this I can't see the item text. The item text is only visible in the print preview after the PO is saved.
    Do you know if it is possible to change this so I can see the item text before saving in teh print preview?
    Thanks
    Sofia

    You need to take ABAPer help and see the Print pre-view parameters maintained for the Script/Smartform for the PO Output Type you are using..
    If possible try to include the Item text into those parameters..
    As far as I know only for MEDRUCK script, we can see the print pre-view..

  • How to configure Sales order item text copy to Purchase requisition item

    Hi,
    How to configure sales order item text copy to Purchase requisition text then copy to PO item text.
    Regards
    Jack

    Hi Rajesha,
    Thanks for your reply, some of the items in sales order are procured externally by us and our customer maintains text related to price and specification in the item details of the sales order, MRP creates planned order for these materials and these planned orders are always converted in pur requisition, we want that text from the sales order item details should be copied in to the purchase requisitions converted from planned orders.
    is there any user exit which can be called at the time of saving a purchase req or user exit for converting planned order in to pur req.?
    if there is any such exit available, then I think I can read the pegged requirement of the planned order where sales order item will be found then read the text in the item then copy this text in pur req then save pur req may work.
    but this will be a bulky development, please let me know if we can shorten the development.
    Thanks again
    Anand

  • User exit to change item level data in purchase order

    Hi,
    Can anyone let me know the user exit to change item level data in purchase order . there is a badi ME_PROCESS_PO_CUST for this but the issue is its method process_item gets triggered only when the item is changed. My requirment is
    For purchase order document types u201CZSOu201D and u201CZCOu201D, where the purchase order is a u201CLimits Orderu201D only i.e. no materials or services on the purchase order, the print price indicator field should be set to u201Cblanku201D (unchecked).   now i cant use ME_PROCESS_PO_CUST  because process_item wont get triggered if there is no change in itemlevel data.
    Regards,
    Rahul

    Hi Rahul,
    Probably EXIT_SAPLMEKO_002.
    hope it helps,
    Edgar

  • Help - User exit to change item level data in Purchase Order

    Hi,
    Can anyone let me know the user exit to change item level data in purchase order . there is a badi ME_PROCESS_PO_CUST for this but the issue is its method process_item gets triggered only when the item is changed. My requirement is For purchase order document types u201CZSOu201D and u201CZCOu201D, where the purchase order is a u201CLimits Orderu201D only i.e. no materials or services on the purchase order, the print price indicator field should be set to u201Cblanku201D (unchecked).   now i cant use ME_PROCESS_PO_CUST  because process_item wont get triggered if there is no change in item level data.
    Thanks,
    Rahul

    Hi Rahul,
    Probably EXIT_SAPLMEKO_002.
    hope it helps,
    Edgar

  • Copy purchase requisition with me51n

    Hi,
    I have a problem when I want copy a purchase requisition in me51n.
    I have two documents types in specific and I use a variant of transaction who fixed the document type.
    I execute me51N
    I search a purchase requisition with other types.
    I do a drag & drop to copy the purchase requisition.
    But in the first copy, there is a document type present on header level was copied and in the second copy it is a document type comes from reference that is copied.
    I want for the first copy, the document type comes from reference in the copy.
    What am I doing ?
    Thanks.

    in order to perform a Purchase Requisition-Upload from R/3 Backend system into another system there
    are several steps necessary.
    When I am creating a Purchase Requisition at the Backend regarding a valid material-number,
    the Purchase Requisition will be automatically inserted into the table EPRTRANS.
    But not in case of if you create a Purchase Requisition without a Material-Numnber.
    e.g. Purchase Requisition with free text and account assignment.
    Function Module BBP_EPRTRANS_MAINTAIN is reposible for transfering of Purchase Requisition
    into table EPRTRANS.
    I need these PR in the EPRTRANS in order to perform the report BBP_EXTREQ_TRANSFER finally.
    It trnasfers all Purchase Requisition from EPRTTANS to the external system.
    I hope it clarifys some of the confusion .
    regds
    ertas

  • How to change line type on EAM Purchase Requisitions

    When an EAM Work Order is released, we get Purchase Requisitions with the Line Type as the Purchasing Options default. This can be changed on the req but there is no option to select the req line type on the EAM Work Order page.
    There's a Line Type field on the EAM Work Order page but it's different from the Requisition Line Type.
    Just wondering what are our options to give users the ability to select req line type from EAM Work Order page. We know personalization is an option but we'd need to add a brand new field and even if we do, we are unsure that ReqImport will actually use this new field.
    Workflow extensions could also be a solution and was hoping that someone out there would have some tips and tricks to share.
    Regards,
    Sanjib

    I think the only way is to:
    1) read the address data from Matrix 178 and keep the data in your Add-On
    2) delete the original address (activate the menu item (ID = 1293) or send Ctrl-K via Application.SendKeys)
    3) "click" on "Define new"
    4) and enter the data you have read in 1) into the cells of Matrix 178 again...
    HTH

  • How to copy sales order item text in to purchase requisition

    Hi Experts,
    We enter text for the sales order items in the sales order item details.
    we have done settings for the purchase requision to copy text from sales order into purchase requisition and this works for purchase requisitions automatically created from sales order.
    we need to get text from sales order to be copied in purchase requisitions which are created by converting the planned order.
    we have tried SPRO settings SPRO->Materials Management>purchasing--->text for purchase requisition.
    but this settings does not works for Pur Req. created by converting the planned order.
    is this because planned order does not have segment for text like sales order and purchase requisition?
    Please let me know if it is possible through standard SAP or with the lease development, any help will be appreciated.
    Thanks
    Anand

    Hi Rajesha,
    Thanks for your reply, some of the items in sales order are procured externally by us and our customer maintains text related to price and specification in the item details of the sales order, MRP creates planned order for these materials and these planned orders are always converted in pur requisition, we want that text from the sales order item details should be copied in to the purchase requisitions converted from planned orders.
    is there any user exit which can be called at the time of saving a purchase req or user exit for converting planned order in to pur req.?
    if there is any such exit available, then I think I can read the pegged requirement of the planned order where sales order item will be found then read the text in the item then copy this text in pur req then save pur req may work.
    but this will be a bulky development, please let me know if we can shorten the development.
    Thanks again
    Anand

  • Change item value by process in DML Form: best practice?

    Hi,
    i have a working DML Form and would like to build an option for choosing values in a popup window and refreshing the page items after closing the popup window.
    the DML Form has a button which opens the popup window with
    javascript:popUp2('f?p=&APP_ID.:210:&SESSION.', 600, 580)
    the popup window has a javascript function under HTML Header
    <script language="JavaScript">
    function passBack2()
    doSubmit();window.opener.doSubmit();window.close();
    </script>
    and a button which called the javascript function
    javascript:passBack2();
    while the user chooses a new value and closed the popup window an application item holds the selected value.
    the following page rendering of my DML Form use the application item in before header computations to get the new values.
    from the developer toolbar's session link i found the values changed by the computation correctly and signed with 'I' but they will not displayed in the page and will not used in the Automatic Row Processing update.
    how to accomplish this?
    Michael

    Michael,
    while the user chooses a new value and closed the popup window an application item holds the selected value.
    How does that happen, with an after-submit process on page 210?
    the following page rendering of my DML Form use the application item in before header computations to get the new values.
    All your popup page does is submit itself and then submit the calling page. There is no invocation of the before-header computation on the calling page in this sequence. You should use an after-submit computation.
    Scott

  • How do I grey out info per line item on a actioned Purchase Requisition ?

    Hi:
    Can any one please tell me how do I grey out all information for a line item (and all other relevant information for that line on the requisition) on a already actioned  Purchase Requisition /  PO.
    i.e. Although PO is already placed for a requisition, user still changes dates, qty's ect on that line item and we want to prevent this.
    Many thanks.
    W.

    Hi
    Check it in OMCQ
    Convert the message "06 152 Purchase orders already exist for this item" into error item.
    If u still want anybody to change the PR itself... if can be controlled via release indicators...
    Check the release indicators for PO/PR, maintain the "changebale"
    Check this also
    Regards,
    Raman

  • Developer 10g Capture All CHANGED Item Values

    Still learning this application one module at a time so be kind :)
    What is the most efficient way to capture all the data block item values that have changed on the form at say the pre-update trigger?
    I'm thinking of testing for:
    RECORD_STATUS = 'CHANGED'
    and if true then assign the first item to v_item using:
    v_item := 'block_name' || '.' || get_block_property('block_name',first_item)
    Then loop through each item in the block and test the DATABASE_VALUE against the form value and if they are not equal the assign the DB value to a variable and the form value to a variable and build a string of text to be displayed to the user by using:
    IF GET_ITEM_PROPERTY(v_item,DATABASE_VALUE) <> :BLOCK_NAME.ITEM_NAME THEN
    v_dbvalue := GET_ITEM_PROPERTY(v_item,DATABASE_VALUE);
    v_frmvalue := :BLOCK_NAME.GET_ITEM_PROPERTY(v_item,ITEM_NAME);
    v_string := v_string || 'Old value was ' || v_dbvalue || ' and new value is ' || v_form value;
    Then advance to the next item by resetting the v_item variable to the next item using:
    v_item := 'BLOCK_NAME' || '.' || GET_ITEM_PROPERTY(v_item,NEXTITEM);
    And repeat the process until there are no more items in the block:
    EXIT WHEN 'BLOCK_NAME' || '.' || NULL;
    So what would be the most efficient way to do this?

    The form holds information that is inserted by a technician then the manager of the technician has to approve the info and submit it to the director for final approval.
    So what I do is capture any of the changes that the technician makes and put that sting into an email and send it to the manager so they know that changes were made to the record and they can approve or decline the changes before submitting it on to the director.
    My successful POST-UPDATE trigger at the form level ended up like:
    <<
    p_html := 'Catalog item ' || :ITEMS.MANUFACTURER || ' - ' || :ITEMS.MODEL_DESC || ' ' || :ITEMS.MODEL || ' has been modified and the results are as follows: <br> ';
    v_item := 'ITEMS' || '.' || get_block_property('ITEMS',first_item);
    <<item_loop>>
    loop
    exit when v_item = 'ITEMS' || '.' || null;
    v_dbvalue := GET_ITEM_PROPERTY(v_item,DATABASE_VALUE);
    v_itemname := GET_ITEM_PROPERTY(v_item,ITEM_NAME);
    v_block := 'ITEMS';
    v_name := v_block || '.' || v_itemname;
    v_frmvalue := NAME_IN(v_name);
    IF v_dbvalue <> v_frmvalue THEN
    p_html := p_html || 'OLD VALUE WAS: ' || v_dbvalue || '<br>AND NEW VALUE IS: ' || v_frmvalue || '<br>';
    END IF;
    v_item := 'ITEMS' || '.' || get_item_property(v_item,nextitem );
    >>
    The p_html variable is the string that I send to the email package to send out via our mail service.
    Maybe this will help someone with a similar need.
    Cheers,
    Max

  • Setting an item value before print report in BI Publisher

    Hi,
    I am having an issue with setting a page item's value once a button (that prints a BI Publisher report) is pressed. The session state for the item is set, however because the page does not re-load no value appears in the item on the page.
    I am using a button as a page Item and using a Page Branch with the Branch Point set as On Submit: After Processing(After Computation, Validation, and Processing) with the Page set to 0 and the Request set to PRINT_REPORT=REPORT
    Is there any way to set the item value on the page before branching to the report?
    Your help is greatly appreciated.
    -Marsha

    Marsha,
    You can do that as follows:
    1- create a hidden text item (P20_date_hidden) with default value set to sysdate.
    2- for your button >> edit >> Buttom display attributes >> attributes >> type in : onFocus= "set_date();" (( note: am using onFocus because it takes places before onClick ))
    3- In your page >> edit >> HTML header >> type in :
    <script language="JavaScript" type="text/javascript">
    function set_date()
    v_date = $x('P20_DATE_HIDDEN').value;
    $x('P20_DATE_LETTER_SENT').value = v_date;
    </script>
    Hope this helps,
    Sam
    Please reward good answers by marking them correct or useful!

Maybe you are looking for

  • Install problems - Red Hat 5.2 and Oracle 8.0.5.1

    I am trying to install Oracle 8.0.5.1 on 200Mhz/48Meg Intel Pentium system with RedHat 5.2 As I'm rather new to Linux, I decided to find a thorough description of the installation procedure and have used the one on: http://jordan.fortwayne.com/oracle

  • 64-bit vs 32-bit Oracle on Win2003

    Background: I’ve been tasked to come up with the appropriate hardware/software solution for my company, an MMOLG (Massively Multiple On-Line Gaming) enterprise as it gets ramped up for two huge game releases. We use My SQL (4.x) for managing the Web

  • AnyConnect client reconnects after 1 minute

    AnyConnect client reconnects after 1 minute; WHY version 3.1.02026 ASA:asa911-k8.bin [25-4-2013 8:16:11] Establishing VPN session... [25-4-2013 8:16:11] Checking for profile updates... [25-4-2013 8:16:11] Checking for product updates... [25-4-2013 8:

  • PDF Form giving different data compare to smart form

    Hi Friends, There are few scenerion in my system where my application produce a PDF form (Smart Form Convert to PDF through OTF) In some case when I execute/print the form it shows me all PO form  represnt me a differnt PO form althought their smartf

  • AirPort Not Seeing Networks

    The writing's on the wall but I'll put up a post as one last ditch effort. I took in a PowerBook 15" 1.5 GHz. First thing I did was do an Archive and Install of OS X 10.4. With the first boot the AirPort wasn't seeing nearby networks. I then exhauste