11-12-2014 6:13 AM
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
11-12-2014 7:16 AM
11-12-2014 7:52 AM
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
11-12-2014 6:07 PM
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.
11-13-2014 4:38 AM
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
11-13-2014 4:43 AM
Hi Akriti,
You can put a check on the Idoc generation program and delete all the segments that contain only zeros.
Thanks.
Regards,
Rachit.
11-13-2014 5:13 AM
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
11-13-2014 5:25 AM
Hi Akriti,
Can you tell me the logic you have written to fill the segment?
Regards,
Rachit.
11-13-2014 5:35 AM
Hi Rachit ,
I am simply filling the segment by going in we19 and creating the idoc. this is for my testing.
11-13-2014 6:04 AM
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.
11-13-2014 6:36 AM
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
11-13-2014 6:42 AM
Hi Akriti,
When the zeros are getting filled in the partially filled segment, is there any impact on the output?
Regards,
Rachit.
11-13-2014 6:49 AM
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
11-13-2014 7:05 AM
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.
11-13-2014 7:12 AM
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