Quantcast
Channel: SCN: Message List - ABAP Connectivity
Viewing all articles
Browse latest Browse all 3125

bapi_objcl_change_key Issue change characteristics of batch

$
0
0

Hi Expert,

 

I am using bapi "bapi_objcl_change_key" to change the existing characterstics of batch.I am able to update it required characteristic but rest all characteristics are getting deleted and recreated again.I can see that in change document.

Please find the below code which i implementing.

 

 

BAPI_OBJCL_CHANGE_KEY

 

To get Object Key of the mateial batch that should be updated.
CALL FUNCTION 'BAPI_OBJCL_GET_KEY_OF_OBJECT'
EXPORTING
objectname     = ch_object
objecttable    = c_mch1
classtype      = c_023
IMPORTING
clobjectkeyout = lv_obj
TABLES
return         = lt_ret.

 

Here i get the object key values.

 

CALL FUNCTION 'BAPI_OBJCL_GETDETAIL_KEY'
EXPORTING
clobjectkey           = lv_obj
classnum              = c_z_lly_batch_gbl
keydate               = sy-datum
language              = sy-langu
IMPORTING
STATUS                = lv_stat
STANDARDCLASS         = lv_std
TABLES
allocvaluesnum        = lt_allocvaluesnum
allocvalueschar       = lt_allocvalueschar
allocvaluescurr       = lt_allocvaluescurr
return                = lt_ret.

 

Here i pass the object key value and pass the class name "Z_LLY_BATCH_GBL" .

 

Appedning the record from above it_allocvalueschar ,lable date which is going to be updated.

ls_allocvalueschar-charact =  c_label_mfg_date.
ls_allocvalueschar-value_char = gv_lmd.
APPEND ls_allocvalueschar TO lt_allocvalueschar.

 

passing the information to bapi BAPI_OBJCL_CHANGE_KEY'.

CALL FUNCTION 'BAPI_OBJCL_CHANGE_KEY'
EXPORTING
clobjectkey         = lv_obj
classnum            = c_z_lly_batch_gbl
status_new          = lv_stat
standardclass_new   = lv_std
keydate             = sy-datum
TABLES
allocvaluesnum_new  = lt_allocvaluesnum
allocvalueschar_new = lt_allocvalueschar
allocvaluescurr_new = lt_allocvaluescurr
return              = lt_ret2.

 

I have searched in SDN but not able to get the solution.Please let me know if i am missing any parameter.


Viewing all articles
Browse latest Browse all 3125

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>