‎2007 May 25 6:42 AM
hi
i am working with a module pool
i have a selection screen with 6 fields all are of type select-options
consider this example
s_kunnr (sold-to-party) from vbak
s_kundi (ship-to-party) from vbfa
s_vkorg (sales org) from vbak
s_vtweg (distribution channel) from vbak
s_spart (division) from vbak
instead of entering valid input say user enters some invalid data(xxxxx)
i need to say this is invalid data
how can i do this
regards
vamsi
‎2007 May 25 6:58 AM
hi,
in pbo module
chain
field s_kundi-fldname module check_input.
field s_spart-fldname module check_1
..............
........
endchain.
in code.
in global declaration part create tables that u r using.
module check_input.
select single fldname from s_kundi where fldname = s_kudi-fldname.
if sy-subrc ne 0.
message E000(messclasname) with ' invalid data'.
endif.
endmodule.
module check_input1.
select single fldname from s_spart where fldname = s_spart-fldname.
if sy-subrc ne 0.
message E000(messclasname) with ' invalid data'.
endif.
endmodule.
...............
.............
if helpful reward some points.
with regards,
suresh babu.
‎2007 May 25 6:47 AM
Hi
I am giving a example of a single field of VKORG (sales orgn) similalrly check other fields
In FLow logic write
Checking for the input fields
CHAIN.
Sales Organisation
FIELD: x_100-vkorg.
MODULE check_so.
ENDCHAIN.
double click on CHECK_SO and write the code
&----
*& Module check_so INPUT
&----
Validate the Sales Organisation Value
----
MODULE check_so INPUT.
Check if Sales Orgn is entered on the screen
IF okcode = 'ENTE'.
IF x_100-vkorg IS INITIAL.
MESSAGE e051 WITH
'Please enter Sales Organisation'(001).
ELSE.
Check Sales Organisation Value in table TVKO
SELECT SINGLE vkorg
INTO x_100-vkorg
FROM tvko
WHERE vkorg = x_100-vkorg.
IF sy-subrc <> 0.
MESSAGE e051 WITH
'Sales Organisation does not exist'(002).
ENDIF.
ENDIF.
ENDIF.
ENDMODULE. " check_so INPUT
Reward points if useful
Regards
Anji
‎2007 May 25 6:49 AM
HI,
You can use chain,end chain statements in PAI.In between chain and end chain use field statement and you can write ur code to validate.
ex:
chain.
field s_matnr s_ebeln mobule m_module.
endchain.
In m_module u write ur code.
regards,
ram.
‎2007 May 25 6:50 AM
AT SELECTION-SCREEN.
IF S_KUNNR-LOW NE <VALUE WHICH U WANT TO CHK> OR S_KUNNR-HIGH = <CHECKING VALUE>.
MESSAGE 'Pls enter correct value' TYPE 'E'.
ENDIF.
SAME FOR ALL OTHER SELECT OPTION..
REGARDS
SHIBA DUTTA
‎2007 May 25 6:50 AM
Hi
Use the peace of code:
Checking for the input fields
CHAIN.
Sales Organisation
FIELD: x_100-vkorg.
MODULE check_so.
ENDCHAIN.
Regards,
Sreeram
‎2007 May 25 6:58 AM
hi,
in pbo module
chain
field s_kundi-fldname module check_input.
field s_spart-fldname module check_1
..............
........
endchain.
in code.
in global declaration part create tables that u r using.
module check_input.
select single fldname from s_kundi where fldname = s_kudi-fldname.
if sy-subrc ne 0.
message E000(messclasname) with ' invalid data'.
endif.
endmodule.
module check_input1.
select single fldname from s_spart where fldname = s_spart-fldname.
if sy-subrc ne 0.
message E000(messclasname) with ' invalid data'.
endif.
endmodule.
...............
.............
if helpful reward some points.
with regards,
suresh babu.