04-11-2006 2:46 PM
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
04-11-2006 3:48 PM
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
04-27-2006 9:12 PM
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
04-27-2006 8:28 PM
06-29-2006 12:50 PM
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
06-29-2006 4:16 PM
Hi All,
The issues is resolved.
Actually the material was not padded with preceding zeroes.
Thanks,
Chamu