cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform pdf & preview problem

Former Member
0 Kudos

Hi Experts,

I am running a smartform through VF31 T-code. If I press print button in that, thesmartform should be saved as pdf file and if I press preview button, I should have smartform preview.

My problem is whatever I do first, it is coming successfully. My code will be like below in driver program.

If sy-ucomm = 'PROC'.

" Code for pdf file save in presentation server.

Elseif sy-ucomm = 'VIEW'.

" Code for print preview.

Endif.

Sometimes I am able to get both the results, which I want. But sometimes only one comes. If I see preview and coming back If I press print button, It says the message "All selected jobs are completed", but no save window comes. If I save pdf first and if I press preview button secondly, preview doesn't come. If I go in debug, in second time, sometimes sy-ucomm value is null. What can I do for this?

What may be the problem. I have cleared all the variables also, before running second time.

Regards,

Venkat

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Checked with wait up to 0 seconds and the sy-comm value got updated and got required result.

Former Member
0 Kudos

I have cleared all the variables also, before running second time.

Hi Venkat

Did u clear sy-ucomm value also

if you have cleared that then that might be the reason that you are not getting required output for the second time as you are clearing sy-ucomm value

Former Member
0 Kudos

Hi Vikas,

You are correct. I didn't clear sy-ucomm value. But When press different button(Print/Preview), It should automatically overwrite the previous value or if it is not overwriting also, I should get the result which I got last time( either preview/ pdf ). But it doesn't happen. I think, it would be tough to you to determine the problem, unless u see my code. Thank you for your consideration.

Regards,

Venkat

Former Member
0 Kudos

HI Venkat

Check the function code of buttons and can you post your code here