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: 

Authorization problem with BAPI_MATERIAL_SAVEREPLICA

Former Member
0 Kudos

HI All,

I have a very strange problem. I call BAPI_MATERIAL_SAVEREPLICA in background and it gives back an authorization problem. First I thought it was because of backgorund running, but it is not true. If I use it just for one material it is working properly, if I want update more materials I got this authorization message. I have already realized that FM MATERIAL_INIT reaches NO_AUTHORITY exception but I do not know why. It is very strange... Any idea ?

Thx.

Peter

5 REPLIES 5

ferry_lianto
Active Contributor
0 Kudos

Hi Peter,

Welcome to SDN.

Please go to transaction code <b>SU53</b> and check your authorization access. You may need to work with BASIS or Security folk to give you proper security access in order to create material using BAPI_MATERIAL_SAVEREPLICA.

Hope this will help.

Regards,

Ferry Lianto

0 Kudos

Ferry is right ...!! Just find authorization object from SU53. Moreover , if you have access to Tr.PFCg you can see the roles and otherwise you can also confirm the object value if you hit table AGR_1251 . it`ll give you the roles, authorization , object and also the field value !!

I hope this`ll give you some idea !!

pl..award the points if it helps you

Thanks

Saquib

Oliver_S
Product and Topic Expert
Product and Topic Expert
0 Kudos

move to ABAP

Former Member
0 Kudos

Hi Peter,

I am trying to fill the create sales area '1000' for material '12345' as follows through BAPI_MATERIAL_SAVEREPLICA.

WA_BAPIE1MATHEADER-FUNCTION = 'INS'.

WA_BAPIE1MATHEADER-MATERIAL = WA_MATHEAD-MATERIAL.

WA_BAPIE1MATHEADER-basic_view = 'X'.

WA_BAPIE1MATHEADER-sales_view = 'X'.

APPEND WA_BAPIE1MATHEADER TO LT_BAPIE1MATHEADER.

WA_BAPIE1MLAN-TAX_TYPE_1 = 'MWST'.

WA_BAPIE1MLAN-TAXCLASS_1 = '0'.

WA_BAPIE1MLAN-material = WA_MATHEAD-MATERIAL.

SELECT SINGLE LAND1 FROM T001W

INTO WA_BAPIE1MLAN-DEPCOUNTRY

WHERE WERKS = '1000'.

APPEND WA_BAPIE1MLAN TO LT_BAPIE1MLAN.

  • plant and sales data

WA_BAPIE1MARC-material = WA_MATHEAD-MATERIAL.

WA_BAPIE1MARCx-material = WA_MATHEAD-MATERIAL.

WA_BAPIE1MARC-AVAILCHECK = 'KP'.

WA_BAPIE1MARC-PLANT = '1000'.

WA_BAPIE1MARCX-PLANT = '1000'.

WA_BAPIE1MARCX-AVAILCHECK = GC_X.

  • distr. channel

WA_BAPIE1MVKE-SALES_ORG = '1000'.

WA_BAPIE1MVKE-material = WA_MATHEAD-MATERIAL.

WA_BAPIE1MVKEx-material = WA_MATHEAD-MATERIAL.

WA_BAPIE1MVKE-MATL_STATS = '1'."mat stat

WA_BAPIE1MVKE-ACCT_ASSGT = 'Z1'."accnt assign

WA_BAPIE1MVKE-ITEM_CAT = 'ZLP1'."item ca

WA_BAPIE1MVKE-DISTR_CHAN = '10'.

WA_BAPIE1MVKEX-DISTR_CHAN = '10'.

WA_BAPIE1MVKEX-DELYG_PLNT = GC_X.

WA_BAPIE1MVKEX-MATL_STATS = GC_X.

WA_BAPIE1MVKEX-ACCT_ASSGT = GC_X.

WA_BAPIE1MVKEX-SALES_ORG = '1000'.

WA_BAPIE1MVKEX-ITEM_CAT = GC_X.

APPEND WA_BAPIE1MVKE TO LT_BAPIE1MVKE.

APPEND WA_BAPIE1MVKEX TO LT_BAPIE1MVKEX.

APPEND WA_BAPIE1MARC TO LT_BAPIE1MARC.

APPEND WA_BAPIE1MARCX TO LT_BAPIE1MARCX.

CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA'

EXPORTING

NOAPPLLOG = ' '

NOCHANGEDOC = ' '

TESTRUN = ' '

INPFLDCHECK = ' '

TABLES

HEADDATA = LT_BAPIE1MATHEADER

PLANTDATA = LT_BAPIE1MARC

PLANTDATAX = LT_BAPIE1MARCX

SALESDATA = LT_BAPIE1MVKE

SALESDATAX = LT_BAPIE1MVKEX

TAXCLASSIFICATIONS = LT_BAPIE1MLAN

RETURNMESSAGES = lt_BAPIE1RET2 .

Row TYPE ID NUMBER MESSAGE LOG_NO

1 S MK 103 Trying to change: 12345

2 E MG 19 The numeric material number 12345 was transferred without leading zeros

3 S MK 103 Trying to change: 12345

4 E MG 19 The numeric material number 12345 was transferred without leading zeros

But the sales org is not getting crated and I am getting the following errors

Can you please let me know how are you filling the tables for the BAPI call BAPI_MATERIAL_SAVEREPLICA.

Thanks,

Chamu

0 Kudos

Hi All,

The issues is resolved.

Actually the material was not padded with preceding zeroes.

Thanks,

Chamu