Application Development and Automation 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: 
Read only

Formatting error in Smartforms

Rushme
Product and Topic Expert
Product and Topic Expert
0 Likes
2,084

Hi Experts,

I have a function module XXX that calls a Smartforms report, converts it to PDF and sends an email with this PDF file as attachment. I execute the function module XXX and it simply works fine. I can open the email and attachment without any problem.

The actual problem is:

When this FM XXX is called in a Workflow step/method, the email is sent with PDF attachment. But when I try to open the PDF file it says format error while conversion.

I found out that Smartforms was returning 'Formatting error' when called through Workflow otherwise it worked fine with direct execution of FM XXX.

Has anyone come across such a problem. Can you please give your suggestions/solutions?

If you need any other info pls let me know.

Thanks n advance,

Rashmi

13 REPLIES 13
Read only

Former Member
0 Likes
1,783

Rashmi,

Do you have any special fonts in this?? Also, please mention which SAP version are you using.

There are some OSS notes e.g. 820106. Have you checked those?

Thanks,

Bipin

P.S. Pls. award points if you find this useful.

Read only

0 Likes
1,783

Pls check whether you are sending the attachement data in BIN format. Each record of the BIN data should not be more than 255 charcters. Pls check this.

Read only

Rushme
Product and Topic Expert
Product and Topic Expert
0 Likes
1,783

Hi,

I am using Helvetica font throughout my smartforms report and I am using SAP 4.6C version.

Formatting error occurs <b>only</b> during Smartforms being sent as PDF attachment through Workflow. Are there any limitations or special conditions to use smartforms in Workflows like no skipping of columns etc?

Please let me know.

Thanks & Regards,

Rashmi

Read only

0 Likes
1,783

Hi Rashmi,

check with t-code SCOT. This is to configure email server in SAP. Actually this is basis part. Here u check the conversion dropdowns. I think this will solve yr problem.

Regards,

Sagar

Read only

Rushme
Product and Topic Expert
Product and Topic Expert
0 Likes
1,783

Hi,

There is no problem with the basis settings. Everything has been set and just executing the FM XXX, the smartforms is sent as PDF attachment via email and it opens correctly also.

The problem is only when the same FM XXX is called in the Workflow step. Formatting error is returned by the smartforms FM and pdf attachment sent via Workflow email step is corrupted and hence cannot be opened.

Is there any compatibility problem between Workflow & Smartforms?

Or How to send PDF attachment in Workflow email step?

Any solutions please.....

Thanks & Regards,

Rashmi

Read only

0 Likes
1,783

Hi,

Make sure you are converting the smartform document into PDF format using function module 'CONVERT_OTF' and then converting the PDF file to Binary using function module 'QCE1_CONVERT'.

Thanks

sharmistha

Read only

0 Likes
1,783

Hi Rashmi,

Check if none of the windows created in the smartform have width more than the dimension specified by the page format. for example if the page format is LETTER the size of the page is 8.5 * 11 inches. If any of the windows in the smart form has a width more than 8.5 then, your preview will show up properly but special operations like printing and converting into PDF will give errors. There are many other reasons why you could be getting this error, but this is one more option to check.

Regards

Yuvaraj Mani

Read only

Rushme
Product and Topic Expert
Product and Topic Expert
0 Likes
1,783

Hi,

The Page format i have used is DINA4. So width can be 21cm & Ht can be 29.7cm. Page and window sizes are perfectly matching.

Standalone execution of my program converts Smartforms to pdf & prints it successfully. Absolutely no problem.

Only when used in Workflow step there is formatting error from smartforms FM.

Workflow & Smartforms integration problem

Any solution please....

Thanks & regards,

Rashmi

Read only

0 Likes
1,783

Have you tried to denug the workflow and see if parameters are passed to samrtform correctly as you are doing in standalone mode. Also what is the error . Can you elaborate more on the error.

Cheers.

Sanjay

Read only

Rushme
Product and Topic Expert
Product and Topic Expert
0 Likes
1,783

All the structures and tables are being passed correctly to SForm FM.

The error is that otf-data has no lines at all. Zero lines are being returned & so actually there is nothing to convert to pdf.

When run standalone otf-data has more than 200 lines.

help!!

Thanks,

Rashmi

Read only

0 Likes
1,783

In The workflow are you passing CONTROL_PARAMETER-GETOTF

= 'X'. And does this mean that your smartform Function module is running perfect and the only problem is it is not returning any data in OTF . Earlier you mentioned that smartform is giving formatting error. What is the SY-SUBRC after the call to smartform function module in workflow.

Cheers.

Sanjay

Read only

Rushme
Product and Topic Expert
Product and Topic Expert
0 Likes
1,783

Hurray.... the problem is solved..

Actually the default output device for the <b>Workflow batch user</b> was not set up and thats why the smartform FM was not returning any otf-data, was returning SY-SUBRC = 1.

ufff........ just one parameter in SU01 solved it.

Thanks for all of you who scratched their head for me...

Regards,

Rashmi

Read only

Former Member
0 Likes
1,783

Quite possible that FM XXX parameters are different when you call directly and when it is called through workflow. Check if parameters are exactly the same. I guess you are using SE37 to test the FM XXX directly . There are screen conversions if you have fields with conversion exit in FM interface . Check in debugging if all the parameters have the same value in FM call.

Cheers.