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: 

Class assignments deleted when using message type 'CLFMAS'

Former Member
0 Kudos

Hi All,

I would really appreciate some help with this one (I have searched almost the whole web - and can't find any direct answers ).

Basically I have a situation where I'm using the idoc type 'CNPMAS01'. I have two systems that can update different classes (KLASSE_D) with new characteristic values.

However whenever an idoc is processed the class that was already assigned to that material is removed and the new class is inserted. Further explanation below...

-


<b>Step 1:</b>

System A sends Idoc A to insert Class A into material Z.

When I look in MM03 for material Z I see class A and the associated characteristic values.

-


<b>Step 2:</b>

System B sends Idoc B to insert Class B into material Z.

When I look in MM03 for material Z I see class A has been deleted, class B and it's associated characteristic values inserted.

-


Is there anyway to append and not overwrite? I've read something about local classes and a user-exit, but could not solve the problem.

Thanks in advance for all you advice and help

2 REPLIES 2

0 Kudos

Hi,

You can use the customer exit 'EXIT_SAPLCLFM_002' for this requirement.

This customer exit is triggered before saving the Class / Char data for a material in the database during CLFMAS processing.

Sample code:

DATA: wl_allkssk LIKE LINE OF t_allkssk,

wl_allausp LIKE LINE OF t_allausp.

IF i_appl = space.

CLEAR: t_delcl, t_delob.

LOOP AT t_allkssk INTO wl_allkssk WHERE vbkz = 'D'.

CLEAR wl_allkssk-vbkz.

MODIFY t_allkssk FROM wl_allkssk INDEX sy-tabix TRANSPORTING vbkz .

ENDLOOP.

LOOP AT t_allausp INTO wl_allausp WHERE statu = 'L'.

CLEAR wl_allausp-statu.

MODIFY t_allausp FROM wl_allausp INDEX sy-tabix TRANSPORTING statu.

ENDLOOP.

e_active = 'X'.

ENDIF.

Hope this would solve your problem

Regards,

Bhawit

0 Kudos

Hi Richard,

The standard feature is that in the destination SAP server, if the class in without the flag "Local Class", will be  overwriting

Use the transaction CL02 to mark "Local Class" the class, and will be without change by indound CLFMAS idocs

Best regards,

Antonio