cancel
Showing results for 
Search instead for 
Did you mean: 

Attaching a pdf file in the backend

Former Member
0 Kudos

Hi All,

I have the following requirement.

I have a certain Backend table and I am using a FM to send all the data from it to the middleware and then to the client.

Now I need to pass a pdf (or an image) file from the backend to the client.

Like one can add a file in some field of the table and when the client syncs, the file should go to the client.

Any Ideas how should I go about it?

Any suggesstions will be helpful.

Thanks a lot...

Ankur

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

This is not possible with MI7.0 out of the box. Unfortunately the longest dataset handable by a SyncBO is 255Chars - even a zipped PDF is longer

BUT: have a look into the solution for Signature Capturing in MAM - I know, this is Client to Server - but well, the other way round is working in the same way.

So: split the PDF on the Server into chunks of 255chars. Number these chunks and pack them as items in a syncBO.

On the client put that together and then you have the file completely again. Save it to the client _ Voila.

Wioth MI7.1 there is a solution out of the box I have heared - but because MI7.1 is not general available at the moment - I have not seen it so far.

Hope this helps to solve the issue.

Regards,

Oliver

Former Member
0 Kudos

Hi,

Thanks for the reply, Oliver.

My problem still stands the way it was.

In the Backend Adapter, we have something as Attachment Function Modules, which can help bring the attachments in binary form to the middleware, which can then be converted into the client into an image or something.

(Like a RawString field in the backend and may be a Binary field in the Middleware)

Do you people have some documents related to it where I can study the process... Or can somebody just tell me the steps to follow.

It will help a lot...

Thanks, Ankur

Former Member
0 Kudos

Hi,

well, if you have a method in the backend, you have two possible options:

No. 1 is to use the GENERIC sync, call this method and deliver the string itself.

The second one is the one I described above as well: Take the binary string, split it into pieces and store these pieces as items in a SyncBO. On the client, take these chunks, put them together to one bit and save it.

The only hint I can give you to see how this works is to check the MAM Signature capturing solution - this doies the same on the other way - take an image on the client, split it into chunks and send it to the backend.

Perhaps a little more in detail: There is no field in a syncBO that is able to take an object that is longer 255 characters. The longest thing we have to store values is the STRING method. And this is able to store about 255 chars.

So do the following: create a SyncBO. In the top structure zou store name, date, assigned user,.... all data you like to specify this Object. Then the BO has an item 010. This item has two fields: INDEX and ITEM. You have the PDF. Lets say as raw string you have a string of 290 chars. So you create a first instance of item 010, INDEX is 0, and the first 250Chars you store in ITEM. Then you create a new instance of 010, INDEX is 1 and the ITEM contains the last 40 chars. On the client, you just take the two items, put them into the right oder and then save the string with its 290chars to the HDD.

Just another thing to clarify: in the moment you have a file, you can read it and store it in a simple STRING. If you then take this string and save it again with its filename, then the informaiton is still complete. There is no special conversion necessary in 99.9% of the cases.

I hope this helps you to get the thing done. If not, please specify exactly where I have lost you, I try to explain that point then more in detail.

Regards,

Oliver

p.s.: Just to make it more simple: Long Text in MAM is handeled exactly the same way. They split the text into chunks of 132chars and store it in MAM010Item090

Edited by: Oliver Kaluscha on Jan 7, 2008 10:14 AM

Answers (0)