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

Change G/L account number for PO in ME21n and Me22n

$
0
0

Hi All,

 

I need to change my GL account number in PO under account assingment tab. I have implemented the badi and under the method process_item i have written my code.

 

But his works only Change ( ME22n). This menthod does not gets trigered when PO is entered and on SAVE.

 

 

This is the code i have written in process_item of ZME_PROCESS_PO_CUST

    DATA : ls_mepoaccounting TYPE mepoaccounting,
         ls_po_accountings TYPE purchase_order_accounting,
         lf_acnt TYPE REF TO if_purchase_order_account_mm,
         lt_po_accountings TYPE purchase_order_accountings.

 

  lt_po_accountings = im_item->get_accountings( ).

  

      LOOP AT lt_po_accountings INTO ls_po_accountings.
        lf_acnt ?= ls_po_accountings-accounting.

   ls_mepoaccounting = lf_acnt->get_data( ).

  ls_mepoaccounting-sakto = '51800'

   CALL METHOD lf_acnt->set_data
              EXPORTING
                im_data = ls_mepoaccounting.

endloop.


Viewing all articles
Browse latest Browse all 8332

Trending Articles



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