06-02-2011 8:58 AM
Hi Experts,
I am currently getting dump while calling bapi "BAPI_MATERIAL_SAVE_DATA" and the error says..."Data objects in Unicode programs cannot be converted."
Error analysis
The statement
"MOVE src TO dst"
requires that the operands "dst" and "src" are convertible.
Since this statement is in a Unicode program, the special conversion
rules for Unicode programs apply.
In this case, these rules were violated.
1297 WHEN cust_mara.
1298 ENHANCEMENT-SECTION
>>>>> MOVE ti_extensionin+c_length TO wa_bapi_te_mara. ......... line we are getting dump
1300
1301 * Lesen der Ankreuzleiste
we have changed the structure of mara and 3 new custom fields added in that.
any one has any idea as to why we are getting the unicode error now ..earlier it was working fine.
Please help!
Regards,
Rajesh!
06-02-2011 9:02 AM
Hi,
I see that you have mentioned ENHANCEMENT-SECTION.
So the place where the dump occurs, is it your own custom code in the enhancement section ?
Regards
06-02-2011 10:13 AM
06-02-2011 10:30 AM
Hi Rajesh,
The error is due to type mismatch, could you please post the data type of the Z Fields that you have added. Or you can check this yourself...the structure "BAPI_TE_MARA" should be enhanced as per the enhancement category - Character/Numeric(check this in SE11)...are you sure that the Z fields that you have added are Character/Numeric?
Regards,
Chen
06-02-2011 10:34 AM
No! the new fields are also of type decimal which we have added in MARA. I hope that we have some badi which should be implemented when we extend the structure with non character fields.
But i don't know much about that badi ...still searching for the answer.
Regards,
Rajesh!
06-02-2011 10:45 AM
Hi,
If that is the case.. Then go to SE19 and put Z* and search the badi... you will get it .
Regards,
Nagaraj
06-02-2011 11:02 AM
Hi Rajesh,
This is what the documentation of the BAPI has to say...
The structures BAPI_TE_<NAME> (<NAME> = MARA, MARC, MARD, MBEW, MLGN, MLGT, MVKE) and the relevant checkbox structures BAPI_TE_<NAME> (<NAME> = MARAX, etc.) must first be extended by the customer to include the fields required. The standard structures contain only the corresponding key fields. When including new fields in these structures, make sure that the field has the same name as the field in the database table. In addition, the fields in the structures BAPI_TE_<NAME> may only be of the type CHARACTER. The data element BAPIUPDATE must be used for the fields in the checkbox structure (except for key fields).
Not sure if there is a BADI that can help you with this, though you can try with enhancement - MGA00001, implement the function exit in this FM and check if it gets triggered in the flow of the above BAPI. If it gets triggered, then export the custom values into memory and import it in this FM...this FM has a changing parameter MARU with which you can append the values for your Z fields.
If you are on ECC 6.0, there must be enough Enhancement spots or you can implement an appropriate Implicit Enhancement also.
Regards,
Chen
Edited by: Chen K V on Jun 2, 2011 3:40 PM
Edited by: Chen K V on Jun 2, 2011 3:45 PM
06-02-2011 10:24 AM
Hi,
It may be due to type mismatch...
you can do one thing,
first, move ti_extensionin+c_length to a variable of type wa_bapi_te_mara-xxxxx
and then move that variable to corresponding work area field..
Thanks,
Raghav M.
06-02-2011 10:27 AM
06-02-2011 10:31 AM
Hi,
The statement
"MOVE src TO dst"
i think you are passing values from one variable to other variable which are not mutually compatible.. Try to pass with same data type...
and see.
Regards,
Nagaraj
06-02-2011 12:11 PM
Hi,
How you pass the Zfield in the extensionin. See the Example code and compare the your code.
ls_bapi_te_mara-material = ls_headdata-material.
ls_bapi_te_mara-zztest1 = '4'." Pass the zfield and the value
ls_bapi_te_marax-material = ls_headdata-material.
ls_bapi_te_marax-zztest1 = 'X'.
ls_extensionin-structure = 'BAPI_TE_MARA'.
ls_extensionin-valuepart1+0(18) = ls_bapi_te_mara-material.
ls_extensionin-valuepart1+18(1) = ls_bapi_te_mara-zztest1.
APPEND ls_extensionin TO lt_extensionin.
ls_extensioninx-structure = 'BAPI_TE_MARAX'.
ls_extensioninx-valuepart1+0(18) = ls_bapi_te_mara-material.
ls_extensioninx-valuepart1+18(1) = ls_bapi_te_marax-zztest1.
APPEND ls_extensioninx TO lt_extensioninx.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = ls_headdata
TABLES
returnmessages = lt_messages
extensionin = lt_extensionin
extensioninx = lt_extensioninx.
Are you passing the Zfield value like this.
Regards,
Dhina..