‎2008 Aug 14 10:44 AM
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
‎2008 Aug 14 10:59 AM
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..
‎2008 Aug 14 10:46 AM
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.
‎2008 Aug 14 10:48 AM
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
‎2008 Aug 14 10:51 AM
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
‎2008 Aug 14 10:51 AM
hi,
Try this------
At selction-screen output.
<write the logic for validation>
If <not ok>.
<Display an error message>.
endif.
Regards,
Aleem.
‎2008 Aug 14 10:55 AM
Hi...
Just like normal validation validate client with account group in
AT SELECTION-SCREEN.
‎2008 Aug 14 10:56 AM
Hi,
In At selection-screen on event, the input validation should be done.
AT SELECTION-SCREEN ON <client_no>.
Regards,
Prem
‎2008 Aug 14 10:58 AM
Hi,
Try this statment.
at selection screen on value request.
check ( input is correct or not).
Hope it is helps,,
Regards,
T.D.M.
‎2008 Aug 14 10:59 AM
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..
‎2008 Aug 14 11:19 AM
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
‎2008 Aug 14 11:52 AM
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
‎2008 Aug 14 11:40 AM
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