on 03-18-2012 8:54 PM
Hi,
I have created a smartfrom with a selection screen. I am checking some data in my smartform code. If I do not find the data then instead of coming across the print screen with no values I need to show a message on the selection screen 'No XXX data found'. I do not wan to lose the selection screen input data after displaying the error/warning message. It should come the same way as we show in a report.
I tried the way its done in a report but I get a blank screen with the error message. Please let me know how to get this done from within the smartfrom.
Thanks
Rakesh
Hi,
The issue is resolved. You can check Runtime Errors in http://help.sap.com/saphelp_470/helpdata/en/4b/83fb5bdf8f11d3969700a0c930660b/content.htm
OR
Follow as instructed below. It worked for me..
1) In the print program while calling the smartform add another Exception as my_error...
CALL FUNCTION gt_fmname
EXPORTING
gt_header = gt_header
gt_pernr = gt_pernr
p_qmnum = p_qmnum
p_date = p_date
p_aufnr = gs_pernr-aufnr
gt_ltext = gt_ltext
p_parnr = gs_pernr-parnr
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
my_error = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
2) Within the smartform in the Form Interface in the Exceptions tab, add a new exception as - MY_ERROR
3) Within the Program Lines of the smartform write
IF gv_tot_hrs = '0.0'.
CALL FUNCTION 'SSF_MESSAGE'
EXPORTING
i_msgid = '00'
i_msgty = 'S'
i_msgno = '208'
i_msgv1 = 'No work done'
* I_MSGV2 =
* I_MSGV3 =
* I_MSGV4 =
.
user_exception my_error.
Please note that I have taken Message Type as 'S', as I did not want to show any Pop-Up. It will only show the message.. You have your own choice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rakesh,
Read the value from the interface, Validate it in a Validation_window (use program lines and if the value is Initial then display msg .)
Or use Command . declare a variable Flag type c . raise it when fields validated or else your msg .. No data Available....
This might be helpful ......
Regards
Nagarjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.