Application Development and Automation 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: 
Read only

How can forbid changging data when using BAPI 'BAPI_MATERIAL_SAVEREPLICA'?

Former Member
0 Likes
623

I am using BAPI 'BAPI_MATERIAL_SAVEREPLICA' to creat material master data in batch.

But this BAPI also can be used for change mode.

How to forbid the change of MAT data when use this BAPI?

TKS a lot~~

I am looking foward to your response~~~

Edited by: lorryhappy on Dec 22, 2009 11:35 AM

4 REPLIES 4
Read only

Former Member
0 Likes
577

Hi

You can achieve it in another way..

Before Passing Data to BAPI , Check whether the material is existing or not..

If material is existing (Present in Material Master Tables e.g. MARA ) using

data: l_matnr like mara-matnr.

Select single matnr from mara into l_matnr.

IF sy-subrc EQ 0.
" Material is existing ==> Do Not Pass to BAPI
else.
" Material is NOT existing ==> Pass to BAPI for creation.
endif.

Repeat above logic for every material in batch..

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya

Read only

0 Likes
577

Thank you very much !

It will not work.

Fisrt reason is performance,i will do many materials,also contains one material in different plants' data.

Second reason as i want to change 90 fileds of mat master data,there will be 10 fields were forbidden to change!

So...In this BAPI, is there any parameter to control it?

Edited by: lorryhappy on Dec 22, 2009 1:08 PM

Read only

0 Likes
577

Hi,

For each paramater, there is a corresponding control structure to control the update of material.

For example:

for paramater 'CLIENTDATA ', the control structure is 'CLIENTDATAX'

for paramater 'PLANTDATA', the control structure is 'PLANTDATAX'

So if you pass 'X' to each field in the control structre then only, the fields will get updated.

So if you dotn want to update few fields then dont pass 'X' to that field in the corresponding control structure.

Also check the documenttaion present for this function module and its paramater usage.

Hope it is clear.

Regards,

Swarna Munukoti

Read only

Former Member
0 Likes
577

From MARC to judge plant data

MARA to judge basis data

clear the update flag...