10-23-2015 2:19 PM
Hi guys, my req is to transfer material charecteristc values from one system to other. I am using BAPI_OBJCL_GETDETAIL to get characteristic values and by using BAPI_OBJCL_CREATE i am trying to create. But cannot create values in target system.thanks.
10-23-2015 3:17 PM
10-26-2015 2:56 AM
I am using
1.Create Batch by calling BAPI
CALL FUNCTION 'BAPI_BATCH_CREATE'
EXPORTING
material = lv_matnr
batch = lv_charg
TABLES
return = lt_rettab.
2. Create Key
* Fetch Object key by passing Material, and Batch
* Fill Material Number
lw_object-key_field = 'MATNR'.
lw_object-value_int = lv_matnr.
APPEND lw_object TO lt_object.
CLEAR : lw_object.
* Fill Batch
lw_object-key_field = 'CHARG'.
lw_object-value_int = lv_charg.
APPEND lw_object TO lt_object.
CLEAR : lw_object.
* Concatenate Object Key
CALL FUNCTION 'BAPI_OBJCL_CONCATENATEKEY'
EXPORTING
objecttable = 'MCH1'
IMPORTING
objectkey_conc = lv_object
TABLES
objectkeytable = lt_object
return = lt_rettab.
To be continued...
10-26-2015 2:59 AM
Fetch Batch Characteristics, these will be empty for new batches
* Fetch object characterstics.
CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
EXPORTING
objectkey = lv_object
objecttable = 'MCH1'
classnum = this is class name
classtype = this is class type '023' etc values
keydate = sy-datum
unvaluated_chars = 'X'
language = sy-langu
TABLES
allocvaluesnum = lt_alloc_num
allocvalueschar = lt_alloc_char
allocvaluescurr = lt_alloc_curr
return = lt_rettab.
. Modify the above num, char and curr internal tables with your values
. Create Batch characteristics
CALL FUNCTION 'BAPI_OBJCL_CREATE' destination 'DEST'
EXPORTING
objectkeynew = lv_object
objecttable = 'MCH1'
classnum = this is class name
classtype = this is class type '023' etc values
keydate = sy-datum
no_default_values = 'X'
TABLES
allocvaluesnum = lt_alloc_num
allocvalueschar = lt_alloc_char
allocvaluescurr = lt_alloc_curr
return = lt_rettab.
This is my code , I am able to create Batch in destination but even after success message in BAPI_OBJCL_CREATE there are no characteristic values assigned in MM03 transaction for that Batch and Material.
10-23-2015 3:23 PM
Hi, use standard tr. BD91, BD92, BD93 for transport. ALE-Configuration must be done before.
10-26-2015 3:02 AM
ALE configurations has been done and I am able to create Batch in destination system , but even after success message in BAPI return table , there are no characteristics assigned in MM03 for that Material and Batch.
10-26-2015 4:51 AM
Hi,
Did you commit the transaction afterwards. The documentation suggests that there are no database changes with this BAPI.
This BAPI does not change the database. To change the database, call BAPI BapiService.TransactionCommit afterwards.
Hope this helps.
10-26-2015 4:55 AM
Yeah but I am using, BAPI_TRANSACTION_COMMIT. Will there would be any difference with BapiService.TransactionCommit.