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

Authorisation Issue in BAPI_MATERIAL_SAVEREPLICA

Former Member
0 Likes
1,772

Hello Experts,

We have created Zprogram to update the material master using BAPI_MATERIAL_SAVEREPLICA . And we have restricted this program only to users who have authorization object M_MATE_STA assigned with ACTVT = 2 & STATM = 'G' (Costing view).

Also, I have added cost_view = 'X' with material number and in BAPI Table parameter's "HEADDATA","VALUATIONDATA","PLANTDATA"

Even after all this, I don't know why BAPI is trying to open "QUALITY_VIEW", due to which report output is "No Authorisation to Quality view" even though user has only for Costing view and updating only costing information.

Please help on this..

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,509

Could you Insure that no field that you change/create in PLANTDATA view are related to quality tab/authorization, even implicitly if creation of record ?

Also don't forget that the system first try to create the data (as MM01) and only then update existing data (as MM02) so some wrong error messages can appear in return parameter when update is actually allowed (ref 545626 - FAQ: Data transfer problems) -> look at RETURNMESSAGES for message MK102 'trying to create...' / error / MK130 'trying to change...' /success / if this is the case execute the commit.

Regards,

Raymond

7 REPLIES 7
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,509

Hi Shreyansh

If you make the changes via SAP transaction MM01/MM02 do you face the same issue..?

Nabheet

Read only

0 Likes
1,509

Hi Nabheet,

MM02 works fine.  But we have issue  only via BAPI

Thanks,

Shreyansh

Read only

0 Likes
1,509

Shreyansh

Can you please provide the message number and message class detail. We may need to check where this message is thrown and on what basis it was called via debugging

Nabehet

Read only

0 Likes
1,509

Message is M3 853

regards,

Shreyansh

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,510

Could you Insure that no field that you change/create in PLANTDATA view are related to quality tab/authorization, even implicitly if creation of record ?

Also don't forget that the system first try to create the data (as MM01) and only then update existing data (as MM02) so some wrong error messages can appear in return parameter when update is actually allowed (ref 545626 - FAQ: Data transfer problems) -> look at RETURNMESSAGES for message MK102 'trying to create...' / error / MK130 'trying to change...' /success / if this is the case execute the commit.

Regards,

Raymond

Read only

0 Likes
1,509

Thanks a lot Raymond.

SAP Note helped us to analyse the issue. Yes. BAPI first try do activities like Create(01) and then Change(02). Since user did not have authorisation to Create , it was raising exception.

Now we have restricted user to ZTcode with auth object M_MATE_STE with 01(Create),02(Change),03(Display) activities for Costing View.

Thanks& regards,

Shreyansh

Read only

Arun_Prabhu_K
Active Contributor
0 Likes
1,509

Hello Shreyansh.

     Try using the BAPI_MATERIAL_SAVEDATA and check if you are getting the error.

Regards.