on 07-22-2011 5:11 AM
Hello All,
I have one query. I have developed a vendor aging report. In the SELECT-OPTIONS, there are 5 fields namely company code, business area, vendor group, vendor code and cash management group. What the user wants is if he enters any invalid value in any of the 5 fields, custom error message should be displayed like 'invalid company code' etc. I think we have to write these messages in 'at-selection-screen' event. Can u help me out with a sample code snippet w.r.t the above program? I have written the code as:
AT SELECTION-SCREEN.
IF S_BUKRS ne BSIK-BUKRS.
MESSAGE e000. 'invalid company code' TYPE 'E'.
ENDIF.
But not giving the correct output.i.e. even if I enter a valid company code, the error message is displayed. Can u help me in solving this problem?
Thanks and Regards,
Satvik
Edited by: Satvikpanchal on Jul 22, 2011 9:42 AM
answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
use AT SELECTION-SCREEN on S_BUKRS-low.
Use select query for checking the Company code in T001 table check the
Company code already exist or not? If it is not there show the message.
Code like
AT SELECTION-SCREEN on S_BUKRS-low.
select single bukrs into lv_bukrs
from T001 where bukrs = s_bukrs-low.
if sy-subrc NE 0.
MESSAGE e000. 'invalid company code' TYPE 'E'.
ENDIF.
i think you company code is select option so you have to check S_BUKRS-high also.
using the event AT SELECTION-SCREEN on S_BUKRS-high.
Regards,
DHina..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
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.