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

Are not mutually convertible in a Unicode program

Former Member
0 Likes
2,693

Hi guys,

I'm getting error: "LS_EDIDD-SDATA and LS_STRUCTURE are not mutually convertible in Unicode Program"

I have PRKST which is Amount field in LS_STRUCTURE, which causes this problem.

But if I change type of PRKST to CHAR15, then it doesn't give error.

But i want to use this field with type PRKST( CURR 11, decimal places 2).

Please help. Its urgent.

Thanks,

Mehul Lad

Moderator message - "Urgency" is not allowed in the forums. Read the RoE.

Message was edited by: Suhas Saha

Hi guys,

I'm getting error: "LS_EDIDD-SDATA and LS_STRUCTURE are not mutually convertible in Unicode Program"

I have PRKST which is Amount field in LS_STRUCTURE, which causes this problem.

But if I change type of PRKST to CHAR15, then it doesn't give error.

But i want to use this field with type PRKST( CURR 11, decimal places 2).

Please help. Its urgent.

Thanks,

Mehul Lad

Moderator message - "Urgency" is not allowed in the forums. Read the RoE.

Message was edited by: Suhas Saha

4 REPLIES 4
Read only

Former Member
0 Likes
1,118

Hi,

Please declare LS_STRUCTURE same as of type LS_EDIDD-SDATA.

I am assuming LS_EDIDD-SDATA is a structure, so it should be having a line type, suppose XYZ.

So, declare LS_STRUCTURE of type XYZ.

Regards,

Ashish

Read only

0 Likes
1,118

Thanks for reply.

Btw i can not declare LS_STRUCTURE same as LS_EDIDD-sdata.

becuase it is used to fill IDOC, its standard. it accepts any structure.

SDATA has data element EDI_SDATA which is LCHR 1000

Read only

0 Likes
1,118

Hi,

LCHR field is not a standalone field. It is always preceded by a field of type INT2 which has the length of the data stored in LCHR field.

So, in structure LS_EDIDD there should be a INT2 type field just before the field SDATA which tells the length of the actual value in SDATA. Suppose the field name is LEN.

So,
assign the value like this :

LS_STRUCTURE = LS_EDIDD-SDATA(LS_EDIDD-LEN).

Regards,

Ashish

Read only

Former Member
0 Likes
1,118

Try this:

FIELD-SYMBOLS:

  <ls_structure> LIKE ls_structure. " put TYPE SOME_TYPE for better performance

ASSIGN ls_edidd-sdata to <ls_structure>.

IF sy-subrc = 0.

  ls_structure = <ls_structure>

ENDIF.

I did not test this in the editor so there might be some syntax errors.

regards