‎2007 Dec 21 6:54 AM
Hi All,
Could someone help me define a select option field in my screen?
Thanks..
‎2007 Dec 21 6:59 AM
hi tin,
the following code may help you
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECT-OPTIONS:
s_vkorg FOR vbak-vkorg OBLIGATORY, " Sales Org.
s_auart FOR vbak-auart, " Sales order Type
s_vbeln FOR vbak-vbeln, " Sales Order Number
s_erdat FOR vbak-erdat NO-EXTENSION," Order create Date
s_ernam FOR vbak-ernam matchcode object
user_addr. " Created by
PARAMETERS : p_run TYPE BAPIVBRKTESTRUN-TESTRUN. " Test mode
SELECTION-SCREEN END OF BLOCK b1.
reward points if found helpful
‎2007 Dec 21 7:04 AM
hi that would be useful if i am just using the selection screen. but i need to define it inside my screen painter..
‎2007 Dec 21 7:14 AM
first define a field in your screen painter through the transcation se51 the field i have created u named it as zg8_ekko-ebeln. now you can use this field as selection screen and if you want ranges there is also an option provided in the screen painter itself and the validation for this field can be done as in the code provided below you can define any number of fields in the same way.
select single ebeln into zg8_ekko from zg8_ekko where
ebeln = zg8_ekko-ebeln.
if sy-subrc = 0.
message 'the purchase order no: already exists' type 'E'.
else.
leave to screen 200.
endif.