cancel
Showing results for 
Search instead for 
Did you mean: 

EXIT_SAPMM06E_017 in me22n - how to track which line item got changed?

Former Member
0 Kudos

there is a exit EXIT_SAPMM06E_017 for me22n.

i have write some code on that include ZXM06U42.

Now my requirement is i want to know which line item is changed by user.

for eg suppose if there r 4 line items,user is going to change 3 line item

i want to validate the custom fields in the exit.

so i want to know which line item is changed in PO.

anybody worked on this?

Thanks in advance

Kumar

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi, if you want to log the change in me22n on PO, you can rely on 'change document' technology.

The related table is CDHDR & CDPOS.

If you do a change on PO, your input will be store in these two table, include PO & Item No & the field name which you change, and field value.

thanks

Former Member
0 Kudos

Hi

i'm not getting any value on this field UPDKZ (or CONFUPD)after changing the line item values .

I_EKPO-EBELP this field shows line nos..

change pointers i can do that..

but thing is while changing the line no before clicking save button, i want to get that line nos..

suppose if there r 4 lines items, user is trying change the content of 3 line item, immediately i want to catch it before clicking save button me22n transaction.

Kumar

Former Member
0 Kudos

Hi Kumar,

I don't know you have an option to implement the BADI.

If so the I have one suggestion can you implement and use BADI : ME_PROCESS_PO_CUST.

In method : PROCESS_ITEM.

Please fetch the current item data (After User Changed the data) by

DATA: ls_mepoitem TYPE mepoitem,

ls_customer TYPE mepo_badi_exampl,

ls_tbsg TYPE tbsg.

----


  • here we check customers data

----


ls_mepoitem = im_item->get_data( ).

Ls_MEPOitem contains the item data changed by user.

Then get the actual item data saved by using Select single * from EKPO........

Then you can compare your fields and addyour own custom logic.

Lanka

Former Member
0 Kudos

yes i have option to implement..but it is not triggering even i put break pt in badi.

Kumar

Former Member
0 Kudos

Hi Kumar,

First implement the BAdi and put a break point in method PROCESS_ITEM (After implementation you have to write code here. To check first set a break point between method and endmethod).

Please check the sample code for BADI via Transaction SE18> GOto> Sample code.

Please note BADI reads one line item at one time .

Hope this will help.Need any help let me know.

Lanka

Former Member
0 Kudos

Hi Lanka.

Now break-point is working..trying to declar internal table..it is giving error..i will try how to declare in badi..

DATA: ls_mepoitem TYPE mepoitem.

ls_mepoitem = im_item->get_data( ).

*TYPES: BEGIN OF TYPE_EKPO.

  • INCLUDE STRUCTURE EKPO.

*TYPES : END OF TYPE_EKPO.

*DATA I_EKPO TYPE STANDARD TABLE OF TYPE_EKPO WITH HEADER LINE.

  • Select single * from EKPO INTO I_EKPO WHERE EBELP = ls_mepoitem-

*EBELP.

Former Member
0 Kudos

Hi Kumar,

Please declare a work area.

Data : WA_EKPO type EKPO.

ls_mepoitem = im_item->get_data( ).

select single * from EKPO into wa_ekpo where EBELP = ls_mepoitem-EBELP.

Add your own custom code.

Lanka

Former Member
0 Kudos

Hi Lanka

thanks. i have one more question?. is same badi can i use to check all items at the time of save?. because in user exit i'm not able to get sy-ucomm values?.

My requirement is.

already user created PO with 2 or 3 line items.

now he is trying to change one line item..so at that time i have to validate only that particular line item.

But finally when he try to save or click the save button i have to check all line items..

basically i have to check some validation and once again i have to pass the value to bapi BAPI_ACC_DOCUMENT_CHECK.

one more question..how to compare these two work areas?

DATA: ls_mepoitem TYPE mepoitem.

ls_mepoitem = im_item->get_data( ).

DATA : wa_ekpo TYPE ekpo.

SELECT SINGLE * FROM ekpo INTO wa_ekpo

WHERE ebelp = ls_mepoitem-ebelp.

IF sy-subrc = 0.

if wa_ekpo = ls_mepoitem.

endif.

ENDIF.

thanks

Kumar

Former Member
0 Kudos

Hi,

anyone can tell me how to check the current line item, the user changed before clik the save button,

and after save i have to check all line items in user exit of me22n transaction?.

my req is i have to call bapi check in the exit.Thanks

Kumar

Former Member
0 Kudos

Hi Kumar,

The BDI will check all the line items at the time of save.

The BADI : ME_PROCESS_PO_CUST

Will work for you.

You don't know which are the values generally user will change like Qty or Price. Other wise you have to compare field by field.

after chnging the values for the line item you have to use the following method :

CALL METHOD IM_ITEM->SET_DATA

EXPORTING

IM_DATA = LS_MEPOITEM.

I am using the same for changing the PDT value at each line item based on some custom conditions.

Lanka

Message was edited by: Lanka Murthy

Former Member
0 Kudos

how to compare work area in here

DATA: ls_mepoitem TYPE mepoitem.

ls_mepoitem = im_item->get_data( ).

DATA : wa_ekpo TYPE ekpo.

SELECT SINGLE * FROM ekpo INTO wa_ekpo

WHERE ebelp = ls_mepoitem-ebelp.

wa_ekpo = ls_mepoitem equal or not?

Also after checking i have to call

CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'

EXPORTING

documentheader = w_documentheader

TABLES

accountgl = t_accountgl

currencyamount = t_currencyamount

return = t_return

extension2 = t_extension2.

so is it possible to call and pass the some values into bapi in the badi?

Thanks

Kumar

Former Member
0 Kudos

Hi Kumar,

Please compare work ares as

IF wa_ekpo-MENGE = ls_mepoitem-MENGE .

CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'

EXPORTING

documentheader = w_documentheader

TABLES

accountgl = t_accountgl

currencyamount = t_currencyamount

return = t_return

extension2 = t_extension2.

The pass your value which you want to change at item level

LS_MEPOITEM-Fieldname = Your variable retrived from BAPI

CALL METHOD IM_ITEM->SET_DATA

EXPORTING

IM_DATA = LS_MEPOITEM.

endif.

Hope this will help you.

Lanka

Former Member
0 Kudos

yes u r correct,but thing is instead of checking each file like IF wa_ekpo-MENGE = ls_mepoitem-MENGE , i have to check the whole work area.

one more thing so same way i can declear internal table and i can do like include in BADI?.

So as u said when user click save button that time it will check all line items. for that place also i have to write the code.can u pls tell me where is that place or method?.

Thanks for ur continuous help.

Muthu

Former Member
0 Kudos

Hi Kumar,

I don't check the work area comparision . You can try that. But my sueestion is why don't you define a business rule only by changing certain fields (By user ) will trigger the exit.

You can define internal table. Please use Types for that.

Lanka

Former Member
0 Kudos

Hi!

For EXIT_SAPMM06E_017 there is import parameter I_EKPO. Field I_EKPO-EBELP contains line item number for item being changed by user.

Hope it helps.

Regards,

Maxim.

Former Member
0 Kudos

Hi

Try to check the field UPDKZ (or CONFUPD) of item table, these should be the flag for modification type.

Max