01-27-2017 12:07 PM
Hi,
I am using BAPI BAPI_OBJCL_CREATE for creating classification view.
i am getting error that "An exception was raised".
Below is my code.
W_CLASSTYPE = '023'
W_CLASSNUM = 'VI_BATCH'.
W_OBJECTTABLE = 'MCHA'.
W_OBJECT = 'RM071'.
DATA: W_CLASSIF_STATUS(1).
CALL FUNCTION 'BAPI_OBJCL_CREATE'
EXPORTING
OBJECTKEYNEW = W_OBJECT
OBJECTTABLENEW = W_OBJECTTABLE
CLASSNUMNEW = W_CLASSNUM
CLASSTYPENEW = W_CLASSTYPE
IMPORTING
CLASSIF_STATUS = W_CLASSIF_STATUS
TABLES
RETURN = W_RETURN
thanx in advance
01-27-2017 2:25 PM
Is not '023' related to 'MARA' and not 'MCHA' (browse table INOB)
Regards,
Raymond
01-27-2017 3:19 PM
I have had it be 023 MCH1 in the past... MCH1 and 023 both are used for cross-plant batches which makes sense.
01-30-2017 6:46 AM
In my systems MARA and MCH1 usually carry this value, so OP should check his Customizing with actual requirement to build a correct key.
01-27-2017 3:17 PM
The first thing I notice here is that the Object is wrong. It is usually a concatenation of the material batch and maybe the plant based on your setup.
Based on your setting you maybe able to see the key directly in table AUSP, or you might have to go through the table INOB to get the internal key from the generated (concatenated) key.
You can either concatenate the key manually, or I prefer using a call to BAPI_OBJCL_CONCATENATEKEY to generate the key for me. In my example I am using class type 022 with objecttable MCHA. You are using 023 which may change your object table to MCH1 or MARA. Like Raymond said, check table INOB to figure out your setup.
l_objecttable = 'MCHA'.
l_objectkeytable-key_field = 'MATNR'.
l_objectkeytable-value_int = l_matnr.
APPEND l_objectkeytable TO li_objectkeytable.
l_objectkeytable-key_field = 'WERKS'.
l_objectkeytable-value_int = werks.
APPEND l_objectkeytable TO li_objectkeytable.
l_objectkeytable-key_field = 'CHARG'.
l_objectkeytable-value_int = charg.
APPEND l_objectkeytable TO li_objectkeytable.
*... § Get object key for the batch
CALL FUNCTION 'BAPI_OBJCL_CONCATENATEKEY'
EXPORTING
objecttable = l_objecttable
IMPORTING
objectkey_conc = l_objectkey
TABLES
objectkeytable = li_objectkeytable
return = li_return.