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: 

Binary data through IDOC

Former Member
0 Kudos

Hi Experts

I want to send binary data (TIF , PDF etc) through IDOC.

Which segment and type is to be used for this purpose? And what about the length of the segment. Will it take the whole length.

Please help

regards,

Akriti

14 REPLIES 14

0 Kudos

Hi Akriti,

Please refer to the thread ""

Do let me know in case you have any questions.

Regards,

Rachit.

Former Member
0 Kudos

Thanks for thew res[pose Rachit.:)

I have to send the binary data and fill that binary data in segment field.

I specified the field as string.

But as the data is long and sement will take only 1000 characters , how can i send such a long data ? Can you please help to find the solution

After receiving this data i have to store it in some table.

Regards,

Akriti

0 Kudos

Hi Akriti,

You can break the data and add as much segments as you need. So for eg: if you have the data of 400 characters then add the segment 4 times and break the data into four parts in the idoc generation program.

Do let me know in case you face any difficulties.

Regards,

Rachit.

Former Member
0 Kudos

Hi Rachit ,

Thanks,

I am doing this way .

But i am facing a problem now..for eg . if there are total 4 segments and the length of one segment is 1000 char but i am filling only 200 chars per segment , then it is filling the remmaining left space with 0.

How to deal with this?

Thanks once again for your response.

Regards,

Akriti

0 Kudos

Hi Akriti,

You can put a check on the Idoc generation program and delete all the segments that contain only zeros.

Thanks.

Regards,

Rachit.

Former Member
0 Kudos

Hi Rchit ,

I dont have to delete the whole zeroes. I want the delete the ending zeroes.

And as this is binary data iit mat be a posssibility that that there are 0000000000 in the end.

So how to delete those zeroes that are not needed or any way by which the extra zeroes are not added.

Regards,

Akriti

0 Kudos

Hi Akriti,

Can you tell me the logic you have written to fill the segment?

Regards,

Rachit.

Former Member
0 Kudos

Hi Rachit ,

I am simply filling the segment by going in we19 and creating the idoc. this is for my testing.

0 Kudos

Hi Akriti,

For testing purpose you can manually delete the segment or the entry in the segment. You will not face this issue while actually writing the code as the segment will not be taken into consideration if it is blank.

If you still face the issue after actually writing the code for the Idoc generation. it can be solved using either conversion exit "CONVERSION_EXIT_ALPHA_OUTPUT" or SHIFT DELETING FM's and commands.

Thanks.

Regards,

Rachit.

Former Member
0 Kudos

Hi Rachit ,

I am not taking any blank segment.

I am not filling the segment completely . for eg if the lenght is 1000 , i am filling only 200 char.

thanks for the help. I will test it in real scenario if it will fill the left space with zeroes or not.

Regards,

Akriti

0 Kudos

Hi Akriti,

When the zeros are getting filled in the partially filled segment, is there any impact on the output?

Regards,

Rachit.

Former Member
0 Kudos

yes Rachit,

It is impacting the output.

Suppose if in output i am getting a text file then the zeroes are taken as space and the output is getting effected.

Regards,

Akriti

0 Kudos

Hi Akriti,

In the Idoc generation program use the base64 encoding and while creating the PDF or TXT file use base64 decoding, then you should not face the  issue.

Please find an example below:

DATA: z       TYPE string,

      encode  TYPE string,

      decode  TYPE string .

DATA: obj  TYPE REF TO cl_http_utility,

      cref TYPE REF TO if_http_utility.

CREATE OBJECT : obj.

cref = obj.

z = 'what u have to encode'.

encode = obj->if_http_utility~encode_base64( z ) .

decode = obj->if_http_utility~decode_base64( encode ).

Regards,

Rachit.

Former Member
0 Kudos

Ok Rachit

I will try this. and let u know.

Thanks for the help. If i get any issue again i hope u will be there