04-16-2006 8:18 AM
Hi Kishan,
Thank you for your reply, the code works very smooth.
But I found one problem, how do we know if user click cancel in the printing window.
I dont want to execute the code when user click cancel button in the printing window.
Please I need help on this...
Thank you in advance.
Sandi
04-16-2006 9:18 AM
Sandi,
When the user presses CANCEL the R_UCOMM will be different, it will NOT be &PRN.
CASE R_UCOMM.
WHEN '&RNT'.
if rs_selfield-before_action = 'X'.
Here insert the code to set your data for print
endif.
WHEN OTHERS.
ENDCASE.
So it goes into the other WHEN condition and nothing happens, if you are using the above code.
Regards,
Ravi
Note : Please mark all the helpful answers
04-17-2006 1:18 AM
Hi Ravi,
It's not working, it always returns '&RNT' code.
Best regards,
Sandi
04-17-2006 4:03 AM
Are you saying that even if the user hits CANCEL, it still returns &RNT function code?
Regards,
Ravi
04-17-2006 6:19 AM
yes, it is.
In the menu painter (PF-STATUS) I put &RNT for print button.
Is that the cause of the problem ?
Best regards,
Sandi
04-17-2006 6:21 AM
Sandi,
Apart from the PRINT button you also have a CANCEL button in the PF-STATUS, right? What is the function code for that?
When you presse CANCEL, you should get that in your R_UCOMM.
In your code, When OTHERS, you do doing anything anyways, so how come its priting?
Regards,
Ravi
04-17-2006 6:29 AM
Please excuse me, I think you have misunderstood my question.
I meant not the Cancel button in the PF-STATUS.
When user click the print button, then the printing window will be shown (there will be 4 buttons, check, properties, cancel, and info button).
Then, let's say user cancel his/her intention to print the report (list). How to manage this event ?
PS. I am using ALV report
Thank you in advance
sandi