2016 Jan 06 1:46 PM
Dear Gurus,
We are unable to use this BAPI to modify existing characteristics.
No error returned in return.
following is sample code
*Program
CHARACTERISTICS-NAME_CHAR = 'ZPLM_T1'.
CALL FUNCTION 'BAPI_CHARACT_GETDETAIL'
EXPORTING
charactname = CHARACTERISTICS-NAME_CHAR
* KEYDATE = SY-DATUM
* LANGUAGE =
IMPORTING
CHARACTDETAIL = wa_detail
tables
CHARACTDESCR = t_desc
return = t_return.
wa_detail-DECIMALS = '1'.
append wa_detail to wa_detail_1.
CALL FUNCTION 'BAPI_CHARACT_CHANGE'
EXPORTING
charactname = CHARACTERISTICS-NAME_CHAR
* CHANGENUMBER =
* KEYDATE = SY-DATUM
tables
charactdetailnew = wa_Detail_1
CHARACTDESCRNEW = t_desc
return = t_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
However if we do this in SE37 with Commit BAPI in sequence it works.
Not sure what is wrong.
Thanks and regards
2016 Jan 06 10:49 PM
Hi Niketan,
looking at your code above, I think that the field template must be cleared, before appending wa_detail to wa_detail_1.
That is, just add the following CLEAR wa_detail-template. line between the existing code:
wa_detail-DECIMALS = '1'.
CLEAR wa_detail-template.
append wa_detail to wa_detail_1.
and I do believe it will work (just tried in my sandbox system, successfully).
The reason why the 'template' must be cleared is explained by the fact that, as it is read from the BAPI_CHARACT_GETDETAIL, it is showing the value template before the decimal change, and hence it is not in line with the change itself.
Hope this will help.
Thanks and regards,
Flavio