‎2009 May 20 10:00 AM
In my selection screen ,
there are plant(werks) and company code (bukrs).
I need to validate bukrs whether it is there in that plant or not on the selection screen.
How to write the logic ?
If I am not wrong t001w is the table - not sure hwo to validate the burks for that plant ?
Can you please help m e.
Thanks in advance.
‎2009 May 20 10:13 AM
the table is T001K- the valuation area is plant.
so validate plant from T001W, then for that plant give it as valuation area and validate bukrs from T001K
Edited by: Kartik Tarla on May 20, 2009 2:43 PM
‎2009 May 20 10:04 AM
Hi,
Try this code
PARAMETERS:
p_werks TYPE mast-werks.
AT SELECTION-SCREEN ON p_werks.
SELECT werks FROM mast UP TO 1 ROWS INTO p_werks
WHERE werks = p_werks.
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE 'No records found with this plant'(007) TYPE 'E' DISPLAY LIKE 'S'.
EXIT.
ENDIF.
Regards,
jaya
‎2009 May 20 10:07 AM
Hi sam kumar,
You can do it in event as
AT SELECTION-SCREEN ON p_plant.
SELECT SINGLE * FROM T001W
WHERE werks = p_plant.
IF sy-subrc <> 0.
MESSAGE e015(pm01) WITH p_plant.
ENDIF.
AT SELECTION-SCREEN ON p_bukrs.
SELECT SINGLE * FROM T001
WHERE werks = p_bukrs.
IF sy-subrc <> 0.
MESSAGE e015(pm01) WITH p_bukrs.
ENDIF.Regards,
Suneel G
‎2009 May 20 10:11 AM
Hi Sam,
validate the bukrs in AT SELECTION-SCREEN event
Ex code:
parameters p_bukrs like t001-bukrs.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_bukrs.
SELECT single bukrs from t001 into t001-bukrs
WHERE bukrs EQ p_bukrs.
if sy-subrc Ne 0.
Message 'BUKRS doesnot exits' type 'I'.
exit.
endif.
‎2009 May 20 10:13 AM
the table is T001K- the valuation area is plant.
so validate plant from T001W, then for that plant give it as valuation area and validate bukrs from T001K
Edited by: Kartik Tarla on May 20, 2009 2:43 PM