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: 

How to check if only classification data is changed in MM02?

gopalkrishna_baliga
Participant
0 Kudos

Hi Experts,

    i have a requirement where in I have to send classification data to another SAP system.

    This has to be done ONLY when classification data is changed in MM02.

    I found a user exit where I can do my coding:

    FM : EXIT_SAPLMGMU_001

    Include : ZXMG0U02

    However, this user exit is triggered for below 3 cases:

    1. ONLY basic data is changed.

    2. ONLY classification data is changed. < --- My condition.

    3. Both basic and classification data is changed.

    But my condition is applicable only for the 2. point above.

    Therefore how to check if ONLY classification data was changed and nothing else? Please help!

Thanks

Gopal

6 REPLIES 6

former_member196331
Active Contributor
0 Kudos

HI,

Some points i understood.

Suppose classification data was saved in Table xyz. 1st time

Now, 2nd time ,you are changing classification fields changing, you can compare user exit classification  fields data to the table xyz fields data.

if the values are differ which means they had changed it.

in the similar way other basic data also.

condition if only classification Changes.if both are changed.

raymond_giuseppi
Active Contributor
0 Kudos

NB: You could also use BAdI BADI_MATERIAL_CHECK instead of Customer Exit EXIT_SAPLMGMU_001.

In exit or method CHECK_DATA you could use some FM like  MARA_SINGLE_READ to compare current values and database values of fields.

Regards,

Raymond

gopalkrishna_baliga
Participant
0 Kudos

In my user exit

FM : EXIT_SAPLMGMU_001

    Include : ZXMG0U02

I am able to determine if classification data is changed. However I also want to know if basic data was also changed. How to get the changed value in basic data in the same user exit?

I use the below FM to get the changed classification data from buffer:

CALL FUNCTION 'CLAP_DDB_GET_BUFFER_PARAMS'

    EXPORTING

      OBJECT                = lv_material_id

      CLASSTYPE             = '001'

      OBTAB                 = 'MARA'

    IMPORTING

      E_CHANGE_ANY          = lv_chg

      E_OBJ_IN_BUFFER       = lv_buff

      E_CHANGE_OBJ          = lv_obj

      E_CHANGENO_USED       = lv_chgno

    TABLES

      E_AUSP_TAB            = lt_ausp  <--- THis will hold the changed classification data

      E_KSSK_TAB            = lt_kssk

      E_DELCL_TAB           = lt_delcl

      E_DELOB_TAB           = lt_delob.


Here lt_ausp contains the changed classification data. Similarly I am not able to see any other output parameter for basic data change. Can somebody help?


Regards

Gopal

shashank_agarwal
Participant
0 Kudos

This message was moderated.

gopalkrishna_baliga
Participant
0 Kudos

This message was moderated.

0 Kudos

Did you look for TABLES statement in the main program (e.g. MARA and *MARA)