2008 Oct 31 12:13 PM
Hi all,
I use the BAPI BAPI_OBJCL_CHANGE to change the characteristics of batches.
The BAPI works fine.
But now I have a case where the same BAPI is not changing the characteristic value the new one will be added to the classification.
I don't want to add the value. I always want to change the value.
Any ideas?
regards
Hello
From documentation for this FM:
This BAPI changes an existing classification, or creates the classification if it does not yet exist.
Try to use Instance counter in parameter table for multiple lines.....
2008 Oct 31 12:19 PM
Hello,
Check this FM y we will use it
IN CASE THE CHARACTERISTICS ALREADY EXISTS CHANGE THEM
----
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
EXPORTING
objectkey = y_lv_matnr
objecttable = y_lv_tabelle
classnum = y_lv_klasse_d
classtype = y_lv_klassenart
keydate = sy-datum
TABLES
allocvaluesnumnew = y_i_alloc_num
allocvaluescharnew = y_i_alloc_char
allocvaluescurrnew = y_i_alloc_curr
return = y_i_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = y_k_x.
----
IN CASE THE CHARACTERISTICS DO NOT EXISTS CREATE THEM
----
CALL FUNCTION 'BAPI_OBJCL_CREATE'
EXPORTING
objectkeynew = y_lv_matnr
objecttablenew = y_lv_tabelle
classnumnew = y_lv_klasse_d
classtypenew = y_lv_klassenart
keydate = sy-datum
TABLES
allocvalueschar = y_i_alloc_char
return = y_i_return.
Try in this way you will find the solution
2008 Oct 31 12:23 PM
Hi,
my problem is that FM BAPI_OBJCL_CHANGE is normally changing the classification
BUT NOW
i have one value which will be added with the same FM!!!!
regards
2008 Oct 31 12:34 PM
Hello
Before call FM BAPI_OBJCL_CHANGE you need call BAPI_OBJCL_GETDETAIL.
Then analyze returned characteristics. If necessary characteristic is present in classification - update this, if not present - do nothing (because it will be created).
2008 Oct 31 12:47 PM
Hi,
I have found the error. In the classification the characteristics value was configured to multiple lines.
But what do i have to configure that the BAPI make an update to the value and not an insert.
regards
2008 Oct 31 1:00 PM
Hello
From documentation for this FM:
This BAPI changes an existing classification, or creates the classification if it does not yet exist.
Try to use Instance counter in parameter table for multiple lines.....
2008 Oct 31 1:47 PM
I guess this mite be helpful as I used teh FM to modified the custom status.
w_objekinob = lips-matnr. " Material
w_objekinob+18 = lips-werks. " Shipping plant
w_objekinob+22 = lips-charg. " Batch #
wa_allocvaluescharnew-value_char = '71'.
wa_allocvaluescharnew-charact = 'CUSTOMS_STATUS'.
IF t_allocvaluescharnew[] IS NOT INITIAL.
gv_objek = w_objekinob.
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
EXPORTING
objectkey = gv_objek
objecttable = 'MCHA'
classnum = 'BATCHMGT'
classtype = '022'
TABLES
allocvaluesnumnew = t_allocvaluesnumnew
allocvaluescharnew = t_allocvaluescharnew
allocvaluescurrnew = t_allocvaluescurrnew
return = t_return.
ENDIF.
Cheers,
Gita
2008 Dec 03 11:04 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |