如何在从select查询中绘制的选择屏幕上写入变量值

时间:2016-11-28 20:33:09

标签: sap abap

大家好我选择了查询

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.

在select-options之前我想向用户显示消息“请输入购物车范围”lv_num_from(我从上面的选择查询中获取)到lv_num_to(我从选择查询上面得到)

我如何才能实现这一目标。请帮忙。

谢谢和问候, 彩

2 个答案:

答案 0 :(得分:2)

我得到了答案。以下是我的代码。

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.

答案 1 :(得分:0)

您可以使用SELECTION-SCREEN - LINE来实现此目的,有关更多详情和示例,请参阅SAP help