cancel
Showing results for 
Search instead for 
Did you mean: 

GUID conversion

Former Member
0 Kudos

Hi All,

I am using RFC_READ_TABLE for reading values from a table.

While reading, I get 16 digit GUID for all records.

There is a function in SAP (CRM 4.0) which can convert 16 digit GUID into 32 digit GUID (actual).

I will have to use that function somewhere in Message Mapping.

Can someone tell me which is that function and how to use it in Message Mapping or somewhere else!!

Thanks,

Narendra.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Anand,

thanks for all the links. I am on SP12.

but I don't have access rights of CRM 4.0. So, I can't create any objects there.

Whatever I have is XI. I can play around there.

Any other way out there? there is some function called GUID_CONVERT. any way to use that function in message mapping?

Besides, RFC_READ_TABLE returns only WA, one value which concatenates all fields into one single field. How would I apply the function if at all I know the function.

!!

Thanks,

Narendra.

Former Member
0 Kudos

Hi

use user defined Function and add the value to resultset and just use split by vlue if you have 2 or more set of values.

Cheers

Piyush

Former Member
0 Kudos

Hi Narendra,

You call GUID_CONVERT from your mapping if it is RFC uisng the Jco code provided in this link..

If not check this...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guide... to perform sap data lookups within xi mappings.

If not you can consider writing a wrapper in CRM to RFC_READ_TABLE to get the converted GUID.

would like to know what exactly is the function of GUID_CONVERT is it just adding leading zeros to 16 characters to make it 32 characters or it is changing the value itself ?

If it is just addition of leading zeros or something then you can do the same in XI itself, without calling GUID_CONVERT.

Regards

Anand

Former Member
0 Kudos

Hi Anand,

GUID_CONVERT is also not useful as it just appends zeros to 16 characters to give 32 characters GUID. which is definitely not an actual GUID.

I just don't know how to go ahead. I can not write any wrappers in CRM, as I don't have access to the CRM 4.0.

Whatever I can do, I should do it in XI only!!

Someone suggested to use this function. As in CRM if I assign like fieldA=fieldB. If fieldA is of type GUID(32) and fieldB is of type GUID(16) (its a compressed GUID of the original GUID, returned by RFC_READ_TABLE as per that expert). This assignment will automatically gives the right GUID of 32 characters.

I can't make changes to the original RFC_READ_TABLE as well I can't create a new wrapper!! I don't know how to go ahead now!!

Narendra.

Message was edited by: Narendra Jadeja

Former Member
0 Kudos

Narendra,

>>GUID_CONVERT is also not useful as it just appends zeros to 16 characters to give 32 characters GUID. which is definitely not an actual GUID.

If it is just the addition of zeros and not the change in value of GUID then you can do this in XI message mapping itself. This also avoids making unecessary RFC call from performance point of view or writing an wrapper .

Check this thread on adding zeros to a field...

Also jsut would like to know why exactly you need to convert it to 32 cahr field are you sending it to a fixed lenght file or something ?

Regards

Anand

Former Member
0 Kudos

Hi Anand,

First,

I need the GUID (full 32 chars) of that entity in order to get the Details of that entity in my next step. As it is a required field in BAPI_OPPORTUNITY_GETDETAILMUL, which I use to get the details of an opportunity.

Second,

My problem is like this:

1. I need a list of some entity (Opportunity, to be specific).

2. There is no direct BAPI available for getting the list of that entity. I don't have rights to create custom BAPIs, wrapper BAPIs on the CRM 4.0.

3. I used RFC_READ_TABLE to get the GUIDs of that entity.

4. But, unfortunately RETURN Field Structure of RFC_READ_TABLE gives me only 16 characters of the GUID.

Its true with this RFC_READ_TABLE for any QUERYTABLE you pass as a import parameter.

Thanks,

Narendra.

Message was edited by: Narendra Jadeja

Former Member
0 Kudos

Hi Narendra,

As i said earlier If it is just the addition of zeros and not the change in value of GUID then you can do this in XI message mapping itself. You need not call GUID_CONVERT, just pad as many zeros you want for this field in message mapping and call BAPI_OPPORTUNITY_GETDETAILMUL. Refer the link which i had specified in my previous post for padding zeros.

Regards

Anand

Former Member
0 Kudos

Hi Anand,

do you think padding zeros in GUID will get me the right Opportunity record? Would it be a right Unique Identifier? I don't want to pad zeros in GUID. I want the correct GUID. I wanted to use GUID_CONVERT function becoz I thought it would help me get the right GUID of 32 characters from GUID of 16 characters I get using RFC_READ_TABLE.

Former Member
0 Kudos

Hi Narendra,

As I undersatnd from your post that GUID_CONVERT is jsut adding the zeros and not changing the value itself.

So if it is just adding the zeros then the same can be done in XI itself and your GUID should have the same value as returned by GUID_CONVERT . But if GUID_CONVERT is changing the value in some way internally then the option i can think of is wrapper(since GUID_CONVERT is not an RFC and hence cannot be called from XI message mapping without creating wrapper).

One more thing the GUID_CONVERT exists in XI system aswell. So if GUID_CONVERT in XI returns the same value as that of GUID_CONVERT in CRM then you can consider using ABAP Mapping and call your GUID_CONVERT in XI within your ABAP mapping instead of GUID_CONVERT from CRM.

But if GUID_CONVERT is just padding zeros then i feel the first solution is simple to implement.

Regards

Anand

Former Member
0 Kudos

Hi Anand,

last attempt:

1. Forget GUID_CONVERT, forget I want to append something.

2. I want a correct 32 bit GUID of opportunity.

3. RFC_READ_TABLE returns 16 characters of that GUID.

4. Is there a way to get all 32 characters of that GUID.

5. I need to get the correct GUID to use it into BAPI_OPPORTUNITY_GETDETAILMUL.

I hope this will clear the mess we indulged into.

Thanks,

Narendra.

Former Member
0 Kudos

Hi Narendra,

As i understand the GUID_CONVERT pads zero's to make it 32 cahracter. It does'nt really matter how it is done(through XI or GUID_CONVERT) as long as the end result(GUID value) is same , the BAPI_OPPORTUNITY_GETDETAILMUL should return the same resulsts in both the cases .

if my above understanding is wrong then you need to go for a wrapper or some other method to call GUID_CONVERT.

hope this clarify's your doubt.

Regards

Anand

Answers (0)