cancel
Showing results for 
Search instead for 
Did you mean: 

SUP 2.0.1 - Binary data from SAP RFC

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

I'm getting a JPG image from SAP via RFC.

I've designed the MBO to use the RFC, it returns 2 parameters, mime type (image/jpeg) and the binary data into an XSTRING data type field.

Then I've created a Mobile Workflow to show this image, and the call to the RFC works OK because I'm getting the mime type value, but the binary data field arrives empty to SUP... How can I solve this problem?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi guys,

Might I ask you a follow up question to this thread. If you were to look for information regarding SAP backend and SUP best practices such as these, where would you expect to find this information.

Any and all suggestions are welcome.

Cheers,

Annette

koehntopp
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Annette,

I suggest to put those as a series of blogs on SCN.

The plain API SDK information should be in the docs, but examples and HowTos work well here and also allow for discussions and customer feedback.

Frank.

Former Member
0 Kudos

Thanks Frank,

I've made note of your preference.

Abhirami, Marshall, feel free to reply to this post as well.

Cheers,

Annette

Former Member
0 Kudos

Annette,

Where you displayed the employee image

Regards,

Abhi

Former Member
0 Kudos

Hi Marshal ,

Ultimately , i need to display an employee image outside of SAP .

I did the following :

1) I am using the BAPI , " /MIVE/EMPLOYEE_PHOTO " to display the image of an employee ( PERNR, residing in SAP ECC 6.0 ) outside of SAP .

But after consuming the BAPI in a Simulator , its showing some unknown characters ( I dont know , whether the image format is not compatible ).

I dint get the photo .

2) I also tried using the BAPI . "HR_ESS_WHO_PROG_GET_PICT_URI" whoch returs only the URI of the image .

Both cases failed .

Could you please help me ?

Thanks,

Abhi

Former Member
0 Kudos

Hi Marshal .

I have got the image displayed

Thanks,

Abhi

Former Member
0 Kudos

Hi all,

I am trying to send an image from windows mobile (Thick client application) to an SAP backend. The image stored in byte[] which is then converted into a base64string format. Can i send this to SAP and this be convreted to xstring in SAP?

Regards,

Vivek

Former Member
0 Kudos

yeah vivek u r rite...

Former Member
0 Kudos

Thank you very much Sivakumar. Can you please let us know the procedure to convert base64 into xstring in SAP system?

Regards,

Vivek

Marçal_Oliveras
Active Contributor
0 Kudos

Vivek,

Use this function module: SSFC_BASE64_DECODE

Former Member
0 Kudos

Thank you Marshal,

Will try it out and update.

Regards,

Vivek

Marçal_Oliveras
Active Contributor
0 Kudos

I'm closing this thread adding the final solution that Sybase has given to the problem.

When you create an MBO from an RFC that contains an XSTRING, the MBO field is maped as a "BINARY" without specifying the length. If you modify the type specifying the length with a very large value, for example BINARY(320767). Then it works

Former Member
0 Kudos

hi marshal - myself facing the same problem could you pls tell the solution for it or mechanism of tackling this issue...

waiting for your reply

thanks

SK

Marçal_Oliveras
Active Contributor
0 Kudos

Hi Sivakumar,

It's a size error.

I tried to modify the image size and it started to work when the size was 400x400 pixels, I don't remember the size in KB but it was between 100 and 200KB. After the throughput the MBO transforms the xstring value to a NULL.

We opened an OSS note, because in the documentation you can read that you can attach data to a Mobile Workflow up to 4MB. But the problem is not between MBO and Workflow, it's between MBO and backend, so it's impossible to attach a 4MB file if the MBO is not capable to get the the data... We don't have a clear answer about the issue after a few weeks.

PD: I tried to store the image in the sample database to check if the problem is with the SAP JCO, but I got the same result.

Marçal_Oliveras
Active Contributor
0 Kudos

I have to say that I've designed a workaround to do this if there isn't a better option

I transform the image hexadecimal string to a base64 string. And then I split this string into a 255 char table.

Using this method I can get the image and use it into my mobile workflow application

Former Member
0 Kudos

thanks marshal...

we did the same as suggested and it worked fine....

SOLUTION--> converted the xstring data of the image file in SAP to base64 and then did the decoding process of base64 in iOS side.

regards

SK