Application Development 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: 

how to convert raw data type to char

Former Member
0 Kudos
3,881

Hi Experts,

i have a problem will any one plz give me the solution

in report select quary i am checking in the where condition crmd_partner table , partner_no field  should compare with but000 partner_guid

for all entries in internal table

where partner_guid = internal table belongs to crmd_partner with partner_no field

i am getting a error like data type is mismatch

because in crmd_parter table partner_no field DATA TYPE is RAW 16

but in but000 table partner_guid field DATA TYPE is char 36

because of data type miss match i am getting error

( i am working on CRM Server)

how to convert this any body please tell me the solution 

4 REPLIES 4

Former Member
0 Kudos
291

Hi,

FOR ALL ENTRIES will work only if the data types match. Define another internal table (or another field in the same internal table) which has the field similar to the DB table you are querying on. Copy the data to the new internal table and use it in your query.

Regards,

Shravan

0 Kudos
291

Hi Thank u very much,

is it possible to give one example on that

0 Kudos
291

Define an internal table say it_crmd_partner with partner_no field (raw16) and partner_guid field (char36).

After you select the data from crmd_partner into it_crmd_partner.

loop at it_crmd_partner.

it_crmd_partner-partner_guid = it_crmd_partner-partner_no.

modify it_crmd_partner.

endloop.

selext  *

   from but000

    into it_but000

     for all entries in  it_crmd_partner

where partner_guid =  it_crmd_partner-partner_guid.

You can achieve something similar by defining a completely new internal table as well.

Regards,

Shravan

Clemenss
Active Contributor
0 Kudos
291

Hi vsre v,

build your own FOR ALL ENTRIES

table using conversion function

CALL FUNCTION 'GUID_CONVERT' "

* EXPORTING

*   iv_guid_x16 =               " sysuuid-x     UUID in X form (binary)

*   iv_guid_c22 =               " sysuuid-c22   UUID in compressed form (22 character UUENCODEd)

*   iv_guid_c32 =               " sysuuid-c     UUID in Character Format

  IMPORTING

    ev_guid_x16 =               " sysuuid-x     UUID in X form (binary)

    ev_guid_c22 =               " sysuuid-c22   UUID in compressed form (22 character UUENCODEd)

    ev_guid_c32 =               " sysuuid-c     UUID in Character Format

  EXCEPTIONS

    NO_UNICODE_SUPPORT_YET = 1  "

    PARAMETERS_ERROR = 2        "               Errors in passing parameters

    .  "  GUID_CONVERT

Regards,

Clemens