Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3193

Re: Compare Line Item at Runtime in ME51N/ME52N

$
0
0

Hi Ram,

 

In your case to compare all the line items,i guess method IF_EX_ME_PROCESS_REQ~check needs to be implemented.You can go through default implementation available for this method under class CL_IM_FMFG_FUTURE_DATED_PR.

Slight modification as below can be used to achieve your requirement.

 

METHOD if_ex_me_process_req~check .

   INCLUDE mm_messages_mac.

 

   DATA: ls_mereqitems        TYPE MMPUR_REQUISITION_ITEMS,

         ls_mereqitem         TYPE MMPUR_REQUISITION_ITEM,

         l_mereqitem          TYPE mereq_item,

         lt_mereqitem         TYPE standard table of mereq_item,

         l_msgty              TYPE sy-msgty,

         l_msgno              TYPE t100c-msgnr.

 

*-Get the item data

   ls_mereqitems = im_header->get_items( ).  "GIVES ITEM REFERENCES

 

   LOOP at ls_mereqitems into ls_mereqitem.

     l_mereqitem = ls_mereqitem-item->get_data( ).

     append l_mereqitem to lt_mereqitem.     

     "NOW ALL THE ITEMS ARE COLLECTED SO PROCEED WITH VALIDATIONS

   endloop.

  

*-->IF ANY MISMATCH IN MATKL THEN THROUGH ERROR. 

END METHOD.

 

Please note,I just tried to give you a guidance on this as I have already implemented this kind of validation in case of PO(not sure about PR).This method which I posted here,I could not test in my system.Hope this is helpful.

 

Regards

Pallavi

 


Viewing all articles
Browse latest Browse all 3193

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>