PDF sending from SAP through Business Connector

The link between SAP ECC 6.0 Unicode and SAP Business Connector non-unicode is okay. The test connection gives no errors.
The business connector has unicode listeners and transaction SM59, the unicode check is okay.

The problem:
We perform a function call from SAP to BC (4.6 SR8) and we submit some parameters.
All parameters can be read in the service flow of the business connector.

BUT: 1 of the parameters is a tabel type SOLIX_TAB (binary data from a PDF).
In Business connector this appears as a Record list of strings. We are now looking for a solution to transfer these strings to the BYTE values of the PDF.
The problem occurs since we migrated SAP to unicode.

Involved systems :
SAP SAP ECC 6.0 running on HP
BC 4.6 SR8 running on SUN

In SAP we execute function SX_OBJECT_CONVERT_OTF_PDF which generates binary context for a PDF document.
Table type SOLIX_TAB

Then a function call is made to the business connector (RFC destination to the Business connector registration - unicode).
The function call passes on the binary context.
Import parameter ‘PDF_DATA’ - type SOLIX_TAB (GBT: SOLIX as Table Type)


In The business connector we have imported the function definition and the flow receives a record list (PDF_DATA) containing strings (LINE).
There are some extra parameters passed on from SAP to BC but without any problem.
Problem :
The number of lines passed from one system to the other is the same.
The length of the lines is different.
SAP tableline holds 255 bytes
BC ‘LINE’ holds about 344 characters
I this moment I have no idea how to transform the ‘PDF_DATA’ back into the PDF binary context.

Extra info :
SAP debug mode breakpoint just before the call to Business Connector - display Table.
The first line that is passed contains

[COLOR=#000080]On business connector side the RFC trace is active.
Extract from the RFC trace file :
000510 | 00460201 02030002 00200203 3C020000 |.F… …<…|
000520 | 3C023C05 000A3C50 44465F44 4154413E |<.<…<PDF_DATA>|
000530 | 3C053C05 03FF3C69 74656D3E 3C4C494E |<.<…<LIN|
000540 | 453E4A56 42455269 30784C6A 4D4E4369 |E>JVBERi0xLjMNCi|
000550 | 58693438 2F544451 6F794944 41676232 |Xi48/TDQoyIDAgb2|
000560 | 4A714451 6F385041 304B4C31 52356347 |JqDQo8PA0KL1R5cG|
000570 | 55674C31 6850596D 706C5933 514E4369 |UgL1hPYmplY3QNCi|
000580 | 39546457 4A306558 426C4943 394A0A62 |9TdWJ0eXBlIC9J.b|
000590 | 57466E5A 51304B4C 305A7062 48526C63 |WFnZQ0KL0ZpbHRlc|
0005a0 | 69417A49 44416755 67304B4C 30786C62 |iAzIDAgUg0KL0xlb|
0005b0 | 6D643061 43413049 44416755 67304B4C |md0aCA0IDAgUg0KL|
0005c0 | 30356862 5755674C 7A41774D 44417944 |05hbWUgLzAwMDAyD|
0005d0 | 516F7656 326C6B64 4767670A 4E44637A |QovV2lkdGgg.NDcz|
0005e0 | 44516F76 53475670 5A326830 49444578 |DQovSGVpZ2h0IDEx|
0005f0 | 4D41304B 4C304A70 64484E51 5A584A44 |MA0KL0JpdHNQZXJD|
000600 | 62323177 6232356C 626E5167 4D51304B |b21wb25lbnQgMQ0K|
000610 | 4C306C74 5957646C 5457467A 61794230 |L0ltYWdlTWFzayB0|
000620 | 636E566C 44516F2B 0A506730 4B633352 |cnVlDQo+.Pg0Kc3R|
000630 | 795A5746 74445170 346E4F32 59555A4C |yZWFtDQp4nO2YUZL|
000640 | 6B4A6779 4752666D 68382B59 4C70454A |kJgyGRfmh8+YLpEJ|
000650 | 4F457136 536D3568 39797256 38464F63 |OEq6Sm5h9yrV8FOc|
000660 | 4735436B 38554362 36663047 376D656D |G5Ck8UCb6f0G7mem|
000670 | 65366647 6D0A4E70 5771706E 5948572B |e6fGm.NpWqpnYHW+|
000680 | 67546767 5A4A3362 572B3274 4E74486C |gTggZJ3bW+2tNtHl|
000690 | 394C6542 3764702F 45393C2F 4C494E45 |9LeB7dp/E9</LINE|
0006a0 | 3E3C2F69 74656D3E 3C697465 6D3E3C4C |><L|

One of the first actions in the flow is a SafePipelineToFile.
1° line (record) of the table data that is passed on

<?xml version="1.0" encoding="UTF-8"?>





Many thanks in advance.


Hi PeterPan,

The link between SAP ECC 6.0 Unicode and SAP Business Connector non-unicode is okay.

What makes you think, the BC is “non-Unicode”? :slight_smile: In fact the BC uses Java’s UCS2 format
for character representation and is therefore “Unicode”!

First question: if you go to the SAP DDIC and display the definition for SOLIX_TAB, what is
the data type of the LINE field? It must be RAW or XSTRING, otherwise this will never work…

If we assume, that it’s RAW or XSTRING, then the answer is easy: the Business Connector,
when converting binary data to Java Strings, converts the data to Base64. So in order to get
the original data in binary format, just loop over the table and convert every line using
pub.string:base64Decode. This will give you a byte for each LINE.
Then I recommend using a Java Service, which opens a java.io.ByteArrayOutputStream.
Write all those byte objects into this stream. Then at the end, when the loop over the
table is finished, that stream will contain the complete data and you can get it in a single
byte using ByteArrayOutputStream.toByteArray().

If the type is RAW, you may need some kind of indicator that tells you, up to which index
the last line of the table is filled. Otherwise you will get a number of unnecessary 0x00 bytes
at the end of the document…

Cheers, Lanzelot