cancel
Showing results for 
Search instead for 
Did you mean: 

ME51N CHANGE MEREQ3320-PREIS DURING PR CREATION

deepak_dhamat
Active Contributor
0 Kudos

Dear All,

I want to change the Valuation Price in transaction ME51N.

The SAP´s standard gives me the price available in material master record but I need in MEREQ3320-PREIS last buying price of the material.

We have implemented MEREQ001 Customers' Own Data in Purchase Requisition enhancement . and implemented user exit

EXIT_SAPLMEREQ_010 but in that we cannot modify PREIS field which is present in IM_T_EBAN STRUCTURE (import parameter )

Is there any other way to modify MEREQ3320-PREIS (price Valuation) field during SAVE IN ME51N .

Your help is highly appreciated.

regards

Deepak.

Edited by: Deepak Dhamat on Sep 15, 2011 6:25 AM

Accepted Solutions (1)

Accepted Solutions (1)

deepak_dhamat
Active Contributor

Hi Shankar ,

Thank you for the reply .

What we want to achive is in enhancement say either using exit or BADI we want to change valuation price in me51n by

accessing value from below logic i.e

get latest purchasing document no and pass that to ekpo and get max(netpr ) and assign that to pRICE VALUATION .

select max( ebeln ) into w_ebeln from ekpo

where matnr = w_eban-matnr

and werks = w_eban-werks .

if sy-subrc = 0 .

select max( netpr ) into w_netpr from ekpo

where ebeln = w_ebeln .

Regards

Deepak.

former_member195402
Active Contributor
0 Kudos

Hi Deepak,

please try the following in your Userexit:


FIELD-SYMBOLS: <T_EBAN> type mereq_t_eban.
DATA: wa_eban type eban.

ASSIGN ('(SAPLMEREQ)LT_EBAN[]') to  <T_EBAN> .

LOOP AT <T_EBAN> INTO wa_eban.
* => here you can change the value
  MODIFY <T_EBAN> from wa_eban.
ENDLOOP.

Regards,

Klaus

deepak_dhamat
Active Contributor
0 Kudos

HI ,

IT GIVES ERROR

Field symbol <T_EBAN> is not yet assigned

REGARDS

dEEPAK.

Former Member
0 Kudos

Deepak,

Did you check the possiblility of using the BAdI method ME_PROCESS_REQ_CUST->PROCESS_ITEM ? See the parameter IM_ITEM type ref to IF_PURCHASE_REQUISITION_ITEM. May be you can use the method IM_ITEM->SET_DATA & SET_DATAX (see the parameter IM_DATA) to change the required field value.

Regards, Vinod

deepak_dhamat
Active Contributor
0 Kudos

Hi ,

Thank you vinod for your attention .

we have that option but before trying that we want to try using Userexit if possible .

regards

Deepak.

deepak_dhamat
Active Contributor
0 Kudos

Hi ,

Thank you all for your support .

@Klaus : it was helpfull answer but i changed my mind to use BADI .

@vinod : Finaly i implemented badi as you said .

we are using this for only Display purpose .

method .


 if  sy-tcode  ='ME53N' .

DATA:
      ld_attr         TYPE string,
      ld_method       TYPE string,
      lo_obj          TYPE REF TO object,  " root object
      lo_obj_2        TYPE REF TO object.

  DATA : w_ebeln TYPE ekpo-ebeln ,
        w_netpr TYPE ekpo-netpr   .



  FIELD-SYMBOLS:
    <lo_lcl>        TYPE ANY,
    <ls_item>       TYPE mereq_item.


  CHECK ( im_count = 1 ).  " avoid endless iteration -> see NOTE below

  lo_obj     ?= im_item.  " casting to root object !!!!!

  ld_attr = 'MY_STATE'.
  ASSIGN lo_obj->(ld_attr) TO <lo_lcl>.

  ld_attr = 'MY_STATE->ITEM'.
  ASSIGN lo_obj->(ld_attr) TO <ls_item>.


  IF <ls_item>-knttp = 'K' .

    SELECT MAX( ebeln ) INTO w_ebeln FROM ekpo
       WHERE matnr = <ls_item>-matnr
        AND  werks = <ls_item>-werks  .

    IF W_EBELN IS NOT INITIAL .

      SELECT  MAX( netpr ) INTO w_netpr FROM ekpo
           WHERE ebeln = w_ebeln .

      IF W_NETPR  IS NOT INITIAL  .

        <ls_item>-preis = w_netpr  .

      ENDIF.
    ENDIF .
  ENDIF.
ENDIF.

regards

Deepak.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

If i understand correctly, it can be done via MM customizing.

check below link for reference

[;

Regards,

Ravi