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: 

Customize MARC - random updates

Former Member
0 Kudos

Hi All,

I have added a custom field to MRP1 sub screen in MM02/03, through this field I am updating MARC table. For updating I am using exit EXIT_SAPLOMCV_902. The issue I am facing is that it updates the fields randomly, i.e. some times update occurs and some times it is blank. I am updating the MARC table against MATNR and WERKS fields.

It is very urgent issue for us, any help will be greatly appreciated and rewarded.

Thanks in advance.

Regards,

Barjinder Singh.

7 REPLIES 7

former_member194669
Active Contributor
0 Kudos

Hi,

Put for break-point in user exit MGA00001.

FUNCTION EXIT_SAPLMGMU_001.

check whether values are getting properly.

aRs

0 Kudos

Yes the values are going correctly, as if i put my code in this exit it updates the field. It happens only in the condition if I am only putting value in this field, if along with this I update any other value on the screen SAP code over writes the value in the MARC table after it comes back from the exit code to main SAP Code.

So values are going as expected, EXIT_SAPLOMCV_902 is called 7-8 times in the flow and is also called when after update the MM02 calls itself by " call transaction 'MM02'".

As I said earlier it happens randomly.

There is another point which may help, if there is a material which I have updated and update is unsuccessful and if I try to update it after some time (i.e. after updating some other materials) it updates. Is there a lock or some thing?

Thanks,

Barjinder Singh.

Former Member
0 Kudos

Hi,

take a work area with the same staructure as MARC..

Select single * from MARC with the MATNR and WERKS and use the

work_area-mrp1 = 'Value'.

Modify MARC from the header line transporting MRP1...

Cheer's

Mahesh

0 Kudos

Hi Mahesh,

Can you kindly explain it to me in little detail, as I am updating a custom field in MARC which I have already added to the table.

FYI - Since I am using an exit I cannot use "Commit Work", SAP doesn't allow it at this level.

Thanks,

Barjinder Singh.

0 Kudos

One thing more, update statement still gives me value of Sy-subrc = 0, and there is no update at DB level.

Thanks,

Barjinder Singh.

0 Kudos

Barjinder,

You can try the other way...

Create a UPdate funcation module and take the material number, plant and the value that you want to populate to the new field as import parameters...

you call this function module in the user exit in Update task mode..

in the fuction module..

take a work area with the same staructure as MARC..

Select single * from MARC with the MATNR and WERKS and use the

work_area-mrp1 = 'Value'.

Modify MARC from the header line transporting MRP1...

<b>I am sure this will work.. I have done the same stuff couple of times.....</b>

Thanks,

Mahesh

Message was edited by:

Mahesh Raganmoni

0 Kudos

In user exits there are X & Y internal tables.. for example xmarc & ymarc..

ymarc is the data already there is database.. any modification we make in workarea say marc should also be changed in the internal table xmarc..because xmarc contains the update/ insert indicator...

Hope this helps..