Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Calculating the GR date automatically in ME21/ME22N

$
0
0

Hi  Gurus,

 

I have a requirement of calculating the GR date automatically and updating it when ME21N/ME22N is triggered.

 

I am using the code below in the BADI ME_PROCESS_PO_CUST~PROCESS_ITEM.

 

Validation for document types is done.
* Geting the Header details
    im_header = im_item->get_header( ).


* Getting the Items from the Header
    lt_items  = im_header->get_items( ).
   
LOOPAT lt_items
       
INTO lwa_items .
*   Get PO item data
      lwa_item = lwa_items-item->get_data( ).

The value 60 is fetched from a custom table.


      lv_date = lwa_item-eeind +
60 .
     
IF lwa_item-lewed ISINITIAL
        lwa_item-lewed = lv_date .
     
ELSEIF lwa_item-lewed <> lv_date .
       
MESSAGE'Change the GR Date!!'TYPE’E’.
     
ENDIF.
     
CALLMETHOD lwa_items-item->set_data( lwa_item ).
   
ENDLOOP .
 
ENDIF. 

 

For a change in delivery date i have to compare the calculated GR date value with the GR date that was available initially.

 

Can you please suggest if there are any structures to get the value of the GR date that was stored initially in Ekpo table.

 

The tables TEKPO BEKPO etc are not getting populated in this BADI.

 

 

 

Thanks,
Prema


Viewing all articles
Browse latest Browse all 8332

Trending Articles



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