11-09-2006 5:00 PM
Hi
I have a Z table entry with the following
Compnay code
IN*
I need a select statement to check whether the given company code in screen is valid or not with this table. Like if user entered IN01 then its valid. If GB01 then invalid.
select single * from ztable where bukrs cp p_bukrs.
CP is allowed in select command..How can I use select statement here?
Hope I am clear, do let me know if in detail!
Regds
11-09-2006 5:02 PM
11-09-2006 5:02 PM
11-09-2006 5:08 PM
11-09-2006 5:11 PM
Rather than using a parameter on the select screen, use a select-option. This will allow you to write:
SELECT SINGLE * FROM ztable
WHERE bukrs IN s_bukrs.
Rob
11-09-2006 5:11 PM
Hi,
Try this..
TABLES: T001.
SELECT-OPTIONS: P_BUKRS FOR T001-BUKRS NO INTERVALS NO-EXTENSION.
AT SELECTION-SCREEN.
IF NOT P_BUKRS[] IS INITIAL.
SELECT SINGLE * FROM T001 WHERE BUKRS IN P_BUKRS.
IF SY-SUBRC <> 0.
MESSAGE E208(00) WITH 'NOT A VALID COMPANY CODE'.
ENDIF.
ENDIF.
Thanks,
Naren