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

at selection-screen

Former Member
0 Likes
1,127

Hi guyz,

i got client number on selection screen and validate if the enterd client number corresponds to the account group ( table-field = '0001')

plz advise..

regds

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,097

thanks for ur replies

i know that should be written in atselection screen event...i wanna know how to do it programaticly

for eg:

client number entered should be within the account group(kna1-kotkd = 00001)

plz advise..

11 REPLIES 11
Read only

Former Member
0 Likes
1,097

at selection-screen output.

write ur validation here.

if ok continue else pass on an message and use stop so that it stops in the selection screen.

Read only

Former Member
0 Likes
1,097

Hi Friend,

Fetch client value against account group from table T077D.

Write logic at * AT SELECTION-SCREEN ON <FIELD NAME>*.

Hope it will help you.

Regards

Krishnendu

Read only

Former Member
0 Likes
1,097

Hi Friend,

AT SELECTION-SCREEN ON (Screen Field).

put the select stmt to check the client and account group

Hope it will help you.

Regards

deva

Read only

Former Member
0 Likes
1,097

hi,

Try this------

At selction-screen output.

<write the logic for validation>

If <not ok>.

<Display an error message>.

endif.

Regards,

Aleem.

Read only

Subhankar
Active Contributor
0 Likes
1,097

Hi...

Just like normal validation validate client with account group in

AT SELECTION-SCREEN.

Read only

Former Member
0 Likes
1,097

Hi,

In At selection-screen on event, the input validation should be done.

AT SELECTION-SCREEN ON <client_no>.

Regards,

Prem

Read only

Former Member
0 Likes
1,097

Hi,

Try this statment.

at selection screen on value request.

check ( input is correct or not).

Hope it is helps,,

Regards,

T.D.M.

Read only

Former Member
0 Likes
1,098

thanks for ur replies

i know that should be written in atselection screen event...i wanna know how to do it programaticly

for eg:

client number entered should be within the account group(kna1-kotkd = 00001)

plz advise..

Read only

0 Likes
1,097

Hi,

Client number, u meant here is Customer No. or SY-MANDT?

If it is Customer no., then follow the code..

AT SELECTION-SCREEN ON <client_no> .

SELECT SINGLE * FROM KNA1

WHERE kunnr = client_no AND

kotkd = '00001' .

IF sy-subrc <> 0 .

MESSAGE 'Entered customer not corresponds to the account group 00001' type 'E' .

ENDIF.

Regards,

Prem

Read only

0 Likes
1,097

Hi,

I think here you mean client no is field KUNNR in kan1.

Suppose the selection screen field is p_client.

Now write:

Parameters:p_client type kna1-kunnr.

Data: w_client type kna1-kunnr.

AT SELECTION-SCREEN ON p_client.
 
select single kunnr from kna1 into w_client
where kunnr = p_client and KTOKD = '00001'.

if sy-subrc NE 0.
 message 'Please enter valid client no' type 'E'.
Endif.

Regards,

Sujit

Read only

Subhankar
Active Contributor
0 Likes
1,097

Hi..

Please try this way..

TYPES : BEGIN OF x_data,

mandt TYPE mandt,

ktokd TYPE ktokd,

END OF x_data.

DATA: i_data TYPE STANDARD TABLE OF x_data INITIAL SIZE 0.

PARAMETERS: p_mandt TYPE mandt.

PERFORM sub_validate_client.

START-OF-SELECTION.

WRITE: p_mandt.

&----


*& Form sub_validate_client

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM sub_validate_client .

SELECT mandt

ktokd

FROM kna1

INTO TABLE i_data

WHERE ktokd = '001'.

DELETE i_data WHERE mandt = p_mandt.

IF sy-subrc <> 0.

Write: / 'Invalid client'.

ENDIF.

ENDFORM. " sub_validate_client