Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7203103
  • 博文数量: 655
  • 博客积分: 10264
  • 博客等级: 上将
  • 技术积分: 8278
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-04 17:47
个人简介

ABAP顾问

文章分类

全部博文(655)

文章存档

2017年(2)

2014年(8)

2013年(3)

2012年(2)

2011年(18)

2010年(102)

2009年(137)

2008年(274)

2007年(134)

分类:

2007-09-04 17:51:59

REPORT Z_BARRY_LISTBOX .
TYPE-POOLS: vrm.
DATA: it_val1 TYPE vrm_values,
      it_val2 TYPE vrm_values,
      w_line LIKE LINE OF it_val1.
PARAMETERS: p_bukrs LIKE t001-bukrs AS LISTBOX VISIBLE LENGTH 25 OBLIGATORY,
            p_month LIKE t247-mnr AS LISTBOX VISIBLE LENGTH 12 OBLIGATORY.
INITIALIZATION.
  SELECT bukrs butxt FROM t001 INTO (w_line-key, w_line-text).
    APPEND w_line TO it_val1.
    CHECK p_bukrs IS INITIAL.
    p_bukrs = w_line-key.
  ENDSELECT.
  SELECT mnr ltx FROM t247 INTO (w_line-key, w_line-text) WHERE spras = sy-langu.
    APPEND w_line TO it_val2.
    CHECK p_month IS INITIAL.
    p_month = w_line-key.
  ENDSELECT.
AT SELECTION-SCREEN OUTPUT.
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id     = 'P_BUKRS'
      values = it_val1.
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id     = 'P_MONTH'
      values = it_val2.
END-OF-SELECTION.
  WRITE: / 'Company Code:', p_bukrs.
  WRITE: / 'Month:', p_month.
 
 
如果需要删除LISTBOX的项:
REPORT  z_barry_listbox    .
 
TYPE-POOLS: vrm.
DATA: it_val TYPE vrm_values WITH HEADER LINE .
PARAMETERS: p_month LIKE t247-mnr AS LISTBOX VISIBLE LENGTH 12 OBLIGATORY .
SELECTION-SCREEN PUSHBUTTON 52(12) p_butt1 USER-COMMAND pb01.
 
INITIALIZATION.
  p_butt1 = '删除LISTBOX的项'.
  SELECT mnr ltx FROM t247 INTO TABLE it_val WHERE spras = sy-langu.
 
AT SELECTION-SCREEN OUTPUT.
  READ TABLE it_val INDEX 1  .
  IF sy-subrc = 0 .
    p_month = it_val-key.
  ELSE.
    p_month = ''.
  ENDIF.
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id     = 'P_MONTH'
      values = it_val[].
 
AT SELECTION-SCREEN.
  CASE sy-ucomm .
    WHEN 'PB01'.
      DELETE it_val INDEX 1 .
  ENDCASE.
阅读(5206) | 评论(4) | 转发(0) |
给主人留下些什么吧!~~

nanyunjian2009-04-10 17:20:55

TYPE-POOLS: vrm. DATA:matno(8). DATA:f. DATA: it_val TYPE vrm_values WITH HEADER LINE . CALL SCREEN 100. MODULE status_0100 OUTPUT. SET PF-STATUS 'MAIN100'. IF f = ''. SELECT mnr ltx FROM t247 INTO TABLE it_val WHERE spras = sy-langu. f = 'X'. ENDIF. CALL FUNCTION 'VRM_SET_VALUES' EXPORTING id = 'MATNO' values = it_val[]. ENDMODULE. " STATUS_0100 OUTPUT MODULE user_command_0100 INPUT. CASE sy-ucomm. WHEN 'D

nanyunjian2009-04-10 16:57:30

白老师:下拉列表中单号在处理完后,如何在不退出的情况也自动的跟着消失 ??

chinaunix网友2009-03-19 20:49:17

REPORT z_barry_test122. TYPE-POOLS: vrm. TABLES sscrfields. DATA: it_val1 TYPE vrm_values, it_val2 TYPE vrm_values, w_line LIKE LINE OF it_val1. DATA: flag . PARAMETERS: p_bukrs LIKE t001-bukrs AS LISTBOX VISIBLE LENGTH 25 OBLIGATORY, p_month LIKE t247-mnr AS LISTBOX VISIBLE LENGTH 12 OBLIGATORY. SELECTION-SCREEN FUNCTION KEY 1." INITIALIZATION. SELECT bukrs butxt FROM t001 INTO (w_line-key, w_line-text). APPEND w_line TO it_val1. CHECK p

chinaunix网友2009-03-19 14:27:02

您好,想请问如何动态显示与隐藏listbox?谢谢。