In my program I create a batch before a good receipt. This good receipt is created with the bapi 'BAPI_GOODSMVT_CREATE'. In this last bapi I'm able to add the batch number.
If I create the batch I have also to add some characteristics. So I have looked for an example and found one. The example I follow is "Batch create and characteristics via BAPI (example)".
The creation of the batch number and the creation of the objectkey works fine but when I come to the form 'extract_original_batch' with the bapi 'BAPI_OBJCL_GETDETAIL' I receive the following error message "Assignment does not exist or is not valid on".
The class it self is valid till 31129999 and I'm able to assign values during a good receipt with MIGO.
What could be wrong or has an other example to find out what's the problem.
This is what I inserting into the bapi:
p_matnr = '0000010393' a valid materialnumber
p_werks = '0010'
p_charg = '0001000125'
w_object = 00000000000001039300100001000125
p_class = 'ZMMGASOPSLAG'
p_klart = '023'
Here is a part of the program.
FORM build_object_key *
p_it_messages LIKE it_messages
p_it_object STRUCTURE bapi1003_object_keys
P_WERKS LIKE EKPO-werks
P_MATNR LIKE EKPO-matnr
P_WA_ONTV_BEST_LGORT LIKE EKPO-lgort
P_charg LIKE mcha-charg
p_ebeln LIKE EKPO-ebeln
p_ebelp LIKE EKPO-ebelp
p_object LIKE bapi1003_key-object.
DATA: BEGIN OF XEMSEG OCCURS 1.
INCLUDE STRUCTURE BAPIRET2.
DATA: END OF XEMSEG.
build the object key
it_object-key_field = 'MATNR'.
it_object-value_int = p_matnr.
it_object-key_field = 'WERKS'.
it_object-value_int = p_werks.
it_object-key_field = 'CHARG'.
it_object-value_int = p_charg.
CALL FUNCTION 'BAPI_OBJCL_CONCATENATEKEY'
objecttable = 'MCHA'
objectkey_conc = p_object
objectkeytable = it_object
return = XEMSEG.
IF not xemseg is initial.
Message was edited by: R. Meijn