Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in Insert Statement

Former Member
0 Likes
1,935

hi guru,

I am doing the unicode checking of the program... during that i hv found one error in insert statement.

the error is "The type of the database table and work area (or internal table) "WA_SRV" are

not Unicode convertible".

so plz help me on this matter..

INSERT ZSRVDET FROM WA_SRV.

where wa_srv is work area.

zsrvdet is z table.

1 ACCEPTED SOLUTION
Read only

sridhar_meesala
Active Contributor
0 Likes
1,807

Hi,

Declare the work area type same as that of the database table.

Thanks,

Sri.

12 REPLIES 12
Read only

sridhar_meesala
Active Contributor
0 Likes
1,808

Hi,

Declare the work area type same as that of the database table.

Thanks,

Sri.

Read only

0 Likes
1,807

i declared it like this... it has some error

TYPES : BEGIN OF GS_SRV,

INVNO LIKE ZSRVDET-INVNO, "Official Excise Document Number

MINVNO LIKE ZSRVDET-MINVNO, " mul invoice number

INVDATE LIKE ZSRVDET-INVDATE, "Excise Document Date

CUSTMAT LIKE ZSRVDET-CUSTMAT,"Material Number Used by Customer

MATNR LIKE ZSRVDET-MATNR, "Material Number

SRVNO LIKE ZSRVDET-SRVNO, "SRVNO

SRVDATE LIKE ZSRVDET-SRVDATE, "SRV DATE

QTY LIKE ZSRVDET-QTY, "Target quantity

NETAMOUNT LIKE ZSRVDET-NETAMOUNT, "NET AMOUNT PER MATERIAL

RECAMOUNT LIKE ZSRVDET-RECAMOUNT, "RECEIVED AMOUNT PER-

"-MATERIAL

NETAMOUNT1 LIKE ZSRVDET-NETAMOUNT1, "NETAMOUNT IN CURRENCY

END OF GS_SRV,

DATA: GT_SRV TYPE STANDARD TABLE OF GS_SRV,

DATA: WA_SRV TYPE GS_SRV,

Read only

0 Likes
1,807

Hi,

See whether all thesefields are there in the database table into which you are inserting. It should contain all the fields in the same order.

If not declare the internal table and work area similar to that of the database table.

DATA: GT_SRV TYPE STANDARD TABLE OF database_table.
DATA: WA_SRV TYPE database_table.

Thanks,

Sri.

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,807

Hi

check wherhetr your ztable struture and the work area structure in compatible or not?

ZSRVDET structure and WA_SRV structure should be in Synch.

Regards,

Sreeram

Read only

Former Member
0 Likes
1,807

Maintain the same structure for the internal table as the db table

Thanks & Regards

Read only

faisalatsap
Active Contributor
0 Likes
1,807

Hi, Manish

Please Check the Type of WA_SRV it must same as ZSRVDET

Please Reply if any Issue,

Best Regards,

Faisal

Read only

0 Likes
1,807

i declared it like this... it has some error

tables: zsrvdet

TYPES : BEGIN OF GS_SRV,

INVNO LIKE ZSRVDET-INVNO, "Official Excise Document Number

MINVNO LIKE ZSRVDET-MINVNO, " mul invoice number

INVDATE LIKE ZSRVDET-INVDATE, "Excise Document Date

CUSTMAT LIKE ZSRVDET-CUSTMAT,"Material Number Used by Customer

MATNR LIKE ZSRVDET-MATNR, "Material Number

SRVNO LIKE ZSRVDET-SRVNO, "SRVNO

SRVDATE LIKE ZSRVDET-SRVDATE, "SRV DATE

QTY LIKE ZSRVDET-QTY, "Target quantity

NETAMOUNT LIKE ZSRVDET-NETAMOUNT, "NET AMOUNT PER MATERIAL

RECAMOUNT LIKE ZSRVDET-RECAMOUNT, "RECEIVED AMOUNT PER-

"-MATERIAL

NETAMOUNT1 LIKE ZSRVDET-NETAMOUNT1, "NETAMOUNT IN CURRENCY

END OF GS_SRV,

DATA: GT_SRV TYPE STANDARD TABLE OF GS_SRV,

DATA: WA_SRV TYPE GS_SRV,

Edited by: Manish Sharma on Jul 23, 2009 7:50 AM

Read only

0 Likes
1,807

Hi,

Use the MANDT field as the first field in your declaration of the structure like I mentioned before.

Read only

0 Likes
1,807

Hi,

If the declaration of the strcuture is causing more problems, declare your internal table TYPE STANDARD TABLE of database table and the work are LIKE LINE OF the internal table.

The Unicode error occurs when the structures are different.

Read only

Former Member
0 Likes
1,807

Hi,

Please check if the internal table or the corresponding work area has the same structure as that of the database table. Only then the INSERT statement into the database will be successful.

Check if you have used the MANDT field in the declaration. That could probably be a reason for the error.


MANDT type SY-MANDT  "Try including this in your declaration as the first field in your structure

Read only

0 Likes
1,807

No iam not using mandt field in the table zsrvdet

Read only

Former Member
0 Likes
1,807

Hi ,

check whether your internal table and workarea is of same type .

Please let me know if you still have any issues on this.

Thanks and regards,

Rajeshwar.