ABAP DEMO 下拉框
效果展示:
*&---------------------------------------------------------------------* *& Report YCX_020 *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT ycx_020. TABLES: mcha. DATA: ls_id TYPE vrm_id, lt_list TYPE vrm_value OCCURS 0, ls_list LIKE LINE OF lt_list. DATA: ps_t(10) TYPE c. DATA: BEGIN OF str_charg, matnr LIKE mcha-matnr, werks LIKE mcha-werks, charg LIKE mcha-charg, END OF str_charg. DATA: lt_charg LIKE str_charg OCCURS 0, ls_charg LIKE str_charg. PARAMETERS:p_matnr LIKE mcha-matnr DEFAULT '000000000000000098', p_werks LIKE mcha-werks DEFAULT '1701'. PARAMETERS p_charg AS LISTBOX VISIBLE LENGTH 10. SELECT-OPTIONS: s_charg FOR mcha-charg. AT SELECTION-SCREEN OUTPUT. ls_id = 'P_CHARG'. REFRESH lt_list. LOOP AT lt_charg INTO ls_charg. ls_list-key = ls_charg-charg. ls_list-text = 'Line 1'. APPEND ls_list TO lt_list. ENDLOOP. ls_list-key = '10000000001'. ls_list-text = 'Line 1'. APPEND ls_list TO lt_list. CLEAR: ls_list. ls_list-key = '10000000002'. ls_list-text = 'Line 2'. APPEND ls_list TO lt_list. CLEAR: ls_list. CALL FUNCTION 'VRM_SET_VALUES' EXPORTING id = ls_id values = lt_list.
本人常年接收SAP运维和远程项目,ECC,S/4HANA,CRM,WDA.
远程人天可谈,终身售后,有活请联系V信:18925782767(问问题免费,欢迎交流!)
!!请关注本人技术分享公众号:SAP翔子(可扫头像二维码)
每天分享新知识,博客文章也会陆续整理并迁移至公众号,与您一起共同学习