2016-11-28 61 views
0

大家好我有選擇查詢如何寫選擇屏幕上的變量值,你已經從選擇查詢

select single number_range_int 
from BBPC_PROC_TYPE into lv_num_range 
where process_type = 'SHC'. 

select single fromnumber tonumber 
from nriv into (lv_num_from,lv_num_to) 
where object = 'REQREQ' 
and NRRANGENR = lv_num_range. 

之前選擇的選項我想顯示消息,用戶繪製「請輸入購物推車範圍」 lv_num_from(這我從上面的select查詢得到),以lv_num_to

(這我從上面的select查詢得到),我怎樣才能做到這一點。請幫忙。

感謝和問候, 帕裏

+0

你爲什麼要這麼做?標準行爲是與輸入字段向用戶呈現和條目後驗證數據。知識淵博的用戶將瞭解有效範圍反正... – vwegert

+1

@vwegert我想避免的選擇,選項和用戶可能不知道什麼是號碼範圍維持SC,所以我想實現這一目標是有可能的驗證?請幫忙。提前致謝。 – pari

回答

0

你可以做到這一點使用SELECTION-SCREEN - LINE,更多細節和例子見SAP help

2

我得到的answer.Following是我的代碼。

INCLUDE zsrmi_declarations1. 
DATA : lv_shc TYPE crmd_orderadm_h-object_id . 
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-111. 
SELECTION-SCREEN BEGIN OF LINE. 
SELECTION-SCREEN COMMENT 1(79) lv_text. 
SELECTION-SCREEN END OF LINE. 
SELECT-OPTIONS : s_shc FOR lv_shc . 
SELECTION-SCREEN END OF BLOCK a1. 

INITIALIZATION. 
    SELECT SINGLE number_range_int FROM bbpc_proc_type INTO lv_num_range WHERE process_type = 'SHC'. 
    SELECT SINGLE fromnumber tonumber FROM nriv INTO (lv_num_from,lv_num_to) WHERE object = 'REQREQ' AND nrrangenr = lv_num_range. 

    lv_text = text-222. 
    REPLACE '&1' IN lv_text WITH lv_num_from. 
    REPLACE '&2' IN lv_text WITH lv_num_to.