07-23-2010 4:21 PM
Hello all,
I getting some errors when I trying to use this BAPI.
The fields will be filled by an excel file:
OBJEK / OBJTYPE / KLART / CLASS / DESIGNATION_COURT / GPE_MARCHANDISES
1754490 / Mat / 001 / M001 / DLE10 - Chargement Txt Cde / 0102
DIVISION_ARTICLE / MATIERE / CONSTRUCTEUR / CDF_ATELIER / DCF
0273 / TEST / XYZ / 02 / DCF
into the program, I am coding:
DATA: t_char LIKE bapi1003_alloc_values_char OCCURS 0 WITH HEADER LINE,
t_num like BAPI1003_ALLOC_VALUES_NUM OCCURS 0 WITH HEADER LINE,
t_curr like BAPI1003_ALLOC_VALUES_CURR OCCURS 0 WITH HEADER LINE,
t_retur LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: status TYPE bapi1003_key-status.
t_char-charact = 'DESIGNATION_COURTE'.
t_char-value_char = 'DLE10 - Chargement Txt Cde'.
t_char-charact = 'GPE_MARCHANDISES'.
t_char-value_char = '0102'.
t_char-charact = 'DIVISION_ARTICLE'.
t_char-value_char = '0273'.
t_char-charact = 'MATIERE CONSTRUCTEUR'.
t_char-value_char = 'TEST'.
t_char-charact = 'REF_CONSTRUCTEUR'.
t_char-value_char = 'XYZ'.
t_char-charact = 'CDF_ATELIER'.
t_char-value_char = '02'.
t_char-charact = 'DCF'.
t_char-value_char = 'DCF'.
t_char-charact = 'DIVISION_ARTICLE'.
t_char-value_char = '7852'.
APPEND t_char.
CALL FUNCTION 'BAPI_OBJCL_CREATE'
EXPORTING
objectkeynew = 'TEST'
objecttablenew = 'MARA'
classnumnew = 'M001'
classtypenew = '001'
status = '1'
* STANDARDCLASS =
* CHANGENUMBER =
KEYDATE = SY-DATUM
* NO_DEFAULT_VALUES = ' '
IMPORTING
classif_status = status
TABLES
* ALLOCVALUESNUM =
allocvalueschar = t_char
* ALLOCVALUESCURR =
return = t_retur.
After executing this BAPI, I got this message at table t_retur:
Assignment does not exist or is not valid on
07-24-2010 5:46 AM
Hi ,
Please debug BApi when you are passing all required parameters ,
Because then only you will come to know while passing which parameter you are getting that error .
Try to go satep by step You will defenatily find where is problem and according you can find solution also try on your own first.
Regards
Deepak.
07-23-2010 10:34 PM
Get the error message class and # and read the long text in transaction SE91.
It seems to me there is something wrong with the values you're entering (e.g. they're simply wrong or configured differently), but I'm not sure how anyone in the forum is supposed to figure this out since we don't have access to your system.
07-24-2010 5:46 AM
Hi ,
Please debug BApi when you are passing all required parameters ,
Because then only you will come to know while passing which parameter you are getting that error .
Try to go satep by step You will defenatily find where is problem and according you can find solution also try on your own first.
Regards
Deepak.
07-24-2010 5:57 AM
hi ,
Take help from this code
data:
l_classnumnew like bapi_class_key-classnum,
l_classtypenew like bapi_class_key-classtype,
l_classbasicdata like bapi1003_basic,
l_t_return like table of bapiret2 with header line,
l_t_classdescriptions like table of bapi1003_catch with header line,
l_objectkeynew like bapi1003_key-object,
l_counter like sy-tabix.
----
l_classnumnew = wagud-filgr.
l_classtypenew = wagud-klart.
l_classbasicdata-status = rwaka-statu.
loop at g_t_kunnr where not selkz is initial.
clear l_t_return.
refresh l_t_return.
clear l_objectkeynew.
l_objectkeynew = g_t_kunnr-kunnr.
call function 'BAPI_OBJCL_CREATE'
exporting
objectkeynew = l_objectkeynew
objecttablenew = 'BETR'
classnumnew = l_classnumnew
classtypenew = l_classtypenew
STATUS = '1'
STANDARDCLASS =
CHANGENUMBER =
KEYDATE = SY-DATUM
tables
ALLOCVALUESNUM =
ALLOCVALUESCHAR =
ALLOCVALUESCURR =
return = l_t_return.
loop at l_t_return where type eq 'A' or type eq 'E'.
exit.
endloop.
if sy-subrc ne 0.
l_counter = l_counter + 1.
endif.
endloop.
Regards
Deepak.
07-24-2010 7:11 AM
I think you need to append to t_char for each charact and value_char
t_char-charact = 'DESIGNATION_COURTE'.
t_char-value_char = 'DLE10 - Chargement Txt Cde'.
append t_char. clear t_char.
07-24-2010 1:12 PM
Hi Rimeira,
I am new to SAP. But I tried to solve the problem,
First of all, I am not getting any error while executing,
and Second thing I want to ask you that why are you using APPEND statement at last only? before calling the BAPI FM?
I think either I am unable to get the logic, or you have forgotten to write.
Thank you Rimeira
(Sachin).
07-24-2010 10:28 PM
Thank you all for your help!
I got a solution with you.
First, I had a mistake doing only one append after all itens into the internal table t_char.
After, I did a debug at the FM and found that I was putting the erroneous importing parameters:
instead of:
objectkeynew = 'TEST'
the parameters should be:
objectkeynew ='000000000001754490'
The material number with leading zeros.
Now it works!