Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

validating selection screen

Former Member
0 Likes
622

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
595

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.

5 REPLIES 5
Read only

Former Member
0 Likes
595

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

Read only

Former Member
0 Likes
595

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.

Read only

Former Member
0 Likes
595

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

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
595

Hi

Use the peace of code:

  • Checking for the input fields

CHAIN.

  • Sales Organisation

FIELD: x_100-vkorg.

MODULE check_so.

ENDCHAIN.

Regards,

Sreeram

Read only

Former Member
0 Likes
596

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.