Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Report based on MM02

Former Member
0 Kudos

hi folks

i want to create a report and the a requirement is:

Whenever a user changes any fields in material master (MM02), a report will display the following fields like

Material No

User Name (Who Changed the fields)

Old Value of the field

New Value of the field

Changed Date and Time.

how can i solve this?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

select objectclas objectid changenr udate utime tcode username

from cdhdr

into table t_changenr

where objectclas eq 'MATERIAL'

and objectid eq s_matnr -- selection screen material

and udate in p_edate

and username in s_ernam.

if sy-subrc ne 0.

message s004(zbhi)

with 'No materials present for the input values'(034).

stop.

endif.

if not t_changenr[] is initial.

sort t_changenr by objectid changenr.

*get the item data from CDPOS

select objectclas

objectid

changenr

tabname

tabkey

chngind

fname

value_old

value_new

cuky_old

cuky_new

unit_old

unit_new

from cdpos into table t_cdpos

for all entries in t_changenr

where objectclas eq 'MATERIAL'

and changenr eq t_changenr-changenr

and objectid eq t_changenr-objectid .

Hope this helps.

cheers,

Lakshmi prasanna Gandham

3 REPLIES 3

Former Member
0 Kudos

Hi

Try CDHDR,CDPOS tables

there u will get change details

Vijay

Former Member
0 Kudos

Hi,

Use MM04 t.code. It displays the material changes.

Enter the material and execute, select the line which has MM02 t.code, choose details.

You will get old value and new value, field.

Regards,

Chandra

Former Member
0 Kudos

select objectclas objectid changenr udate utime tcode username

from cdhdr

into table t_changenr

where objectclas eq 'MATERIAL'

and objectid eq s_matnr -- selection screen material

and udate in p_edate

and username in s_ernam.

if sy-subrc ne 0.

message s004(zbhi)

with 'No materials present for the input values'(034).

stop.

endif.

if not t_changenr[] is initial.

sort t_changenr by objectid changenr.

*get the item data from CDPOS

select objectclas

objectid

changenr

tabname

tabkey

chngind

fname

value_old

value_new

cuky_old

cuky_new

unit_old

unit_new

from cdpos into table t_cdpos

for all entries in t_changenr

where objectclas eq 'MATERIAL'

and changenr eq t_changenr-changenr

and objectid eq t_changenr-objectid .

Hope this helps.

cheers,

Lakshmi prasanna Gandham