2007 Mar 07 8:34 AM
Hi all
I was requested to set a fields like company code to select screen.
And designer tell me, if the company code input by user does not exist in T001, then SAP system can automatically display the error message.
How to do it if you donnot write a select sentence to check it?
2007 Mar 07 8:40 AM
2007 Mar 07 8:35 AM
2007 Mar 07 8:37 AM
do this way
tables : T001.
at selection-screen.
select single bukrs from T001 into T001 where bukrs in s_bukrs.
if sy-subrc <> 0.
<Error Message>
endif.
2007 Mar 07 8:39 AM
parameters : p_bukrs like t001-bukrs.
at selection-screen.
if not p_bukrs is initial.
select single bukrs from T001 into t001-bukrs where bukrs eq p_bukrs.
if sy-subrc ne 0
set cursor field 'P_BUKRS'.
message e001(ZZ) with 'Please enter valid company code'.
endif.
endif.
2007 Mar 07 8:40 AM
2007 Mar 07 8:51 AM
at selection-screen on p_bukrs.
select single * from T001 where bukrs = p_bukrs.
if sy-subrc ne 0.
message 'no co code is there' type 'E'.
endif.
start-of-selection.
regards
shiba dutta
2007 Mar 07 8:55 AM
Hello Jack,
U can do like this:
tables : T001.
parameters: p_bukrs like t001-bukrs.
at selection-screen on P_Bukrs.
select single bukrs from T001 where bukrs eq p_bukrs.
if sy-subrc <> 0.
<Error Message>
endif.If useful reward.
Vasanth
2007 Mar 07 9:33 AM
Hi,
GOOD.
But SAP have given the provision to validate only by using select statement.
U need to check the entries in the table. Then only you can validate.
So you have to write the select statement for validation as others told.
<b>Please reward points if helpful.</b>
Regards,
Abir.
2007 Mar 07 9:42 AM
Actually the domain for BUKRS has a value table ,
This has to check automatically when that field is used,
but when i see the documentation for value table , it says
<b>Value table</b>
In some cases you already know when you define a domain that all the
fields referring to this domain should be checked against a certain
table. This information can be stored in the domain by entering a value
table.
The system proposes the value table as check table when you try to
define a foreign key for this field. You can override this proposal.
<b> Entering a value table does not implement a check. The check against the
value table only takes place when a foreign key is defined.</b>
so in this case may be foreign key is not defined as the value table is same as T001
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |