DATA: P_DATE TYPE D .
P_DATE = SY-DATUM .
P_DATE+4(2) = '01' .
P_DATE+6(2) = '01' .
DATA: LT_RANGE_TABLE TYPE REF TO DATA.
* FREE LT_RANGE_TABLE.
** create a range table that consists of this new data element
LT_RANGE_TABLE = WD_THIS->SELECT_OPTIONS->CREATE_RANGE_TABLE( I_TYPENAME = 'ZCDM_T_CORETOPIC-Z_SUBMIT_DATE' ).
DATA: IT_RANGE_TABLE TYPE RANGE OF ZCDM_T_CORETOPIC-Z_SUBMIT_DATE .
DATA: LS_RANGE_TABLE LIKE LINE OF IT_RANGE_TABLE .
FIELD-SYMBOLS: LIKE IT_RANGE_TABLE .
* 为 LT_RANGE_TABLE 设默认值
ASSIGN LT_RANGE_TABLE->* TO .
LS_RANGE_TABLE-SIGN = 'I' .
LS_RANGE_TABLE-OPTION = '' .
LS_RANGE_TABLE-LOW = P_DATE .
LS_RANGE_TABLE-HIGH = SY-DATUM .
APPEND LS_RANGE_TABLE TO .
* add a new field to the selection
WD_THIS->SELECT_OPTIONS->ADD_SELECTION_FIELD(
I_ID = 'REPORT_DATE1'
* i_within_block = 'BL1'
I_DESCRIPTION = '申报日期'
* I_MEMORY_ID =
I_VALUE_HELP_STRUCTURE = 'ZCDM_T_CORETOPIC'
I_VALUE_HELP_STRUCTURE_FIELD = 'Z_SUBMIT_DATE'
IT_RESULT = LT_RANGE_TABLE ).
DATA lo_nd_s_aud TYPE REF TO if_wd_context_node.
DATA lo_el_s_aud TYPE REF TO if_wd_context_element.
DATA ls_s_aud TYPE wd_this->element_s_aud.
DATA lt_s_aud TYPE wd_this->elements_s_aud.
** get all declared attributes
* lo_el_s_aud->get_static_attributes(
* IMPORTING
* static_attributes = ls_s_aud ).
DATA lo_nd_s_feedback TYPE REF TO if_wd_context_node.
DATA lo_el_s_feedback TYPE REF TO if_wd_context_element.
DATA ls_s_feedback TYPE wd_this->element_s_feedback.
DATA lo_nd_s_file TYPE REF TO if_wd_context_node.
DATA lo_el_s_file TYPE REF TO if_wd_context_element.
DATA ls_s_file TYPE wd_this->element_s_file.
DATA lt_s_file TYPE wd_this->elements_s_file.
* navigate from to via lead selection
DATA lo_nd_t_feedback TYPE REF TO if_wd_context_node.
DATA lo_el_t_feedback TYPE REF TO if_wd_context_element.
DATA ls_t_feedback TYPE wd_this->element_t_feedback.
* navigate from to via lead selection
lo_nd_t_feedback = wd_context->get_child_node( name = wd_this->wdctx_t_feedback ).
* @TODO handle not set lead selection
IF lo_nd_t_feedback IS INITIAL.
ENDIF.
* get element via lead selection
lo_el_t_feedback = lo_nd_t_feedback->get_element( ).
* @TODO handle not set lead selection
IF lo_el_t_feedback IS INITIAL.
ENDIF.
* alternative access via index
* lo_el_t_feedback = lo_nd_t_feedback->get_element( index = 1 ).
* @TODO handle non existant child
* IF lo_el_t_feedback IS INITIAL.
* ENDIF.
* get all declared attributes
lo_el_t_feedback->get_static_attributes(
IMPORTING
static_attributes = ls_t_feedback ).
select * INTO CORRESPONDING FIELDS OF TABLE lt_s_aud
FROM zcdm_t_aud
where z_aud_id = ls_t_feedback-z_aud_id.
read table lt_s_aud into ls_s_aud with key z_aud_id = ls_t_feedback-z_aud_id.
if sy-subrc eq 0.
* navigate from to via lead selection
lo_nd_s_aud = wd_context->get_child_node( name = wd_this->wdctx_s_aud ).
** get element via lead selection
* lo_el_s_aud = lo_nd_s_aud->get_element( ).
lo_nd_s_aud->bind_structure( ls_s_aud ).
endif.
* navigate from to via lead selection
* lo_nd_s_aud = wd_context->get_child_node( name = wd_this->wdctx_s_aud ).
select * INTO CORRESPONDING FIELDS OF TABLE lt_s_file
FROM zcdm_t_file
where Z_PROGRAM_ID = 'ZCDM_AUDLET_MAINTAIN'
and Z_RECORD_ID = ls_t_feedback-z_aud_id.
read table lt_s_file into ls_s_file with key Z_RECORD_ID = ls_t_feedback-z_aud_id
Z_PROGRAM_ID = 'ZCDM_AUDLET_MAINTAIN' .
if sy-subrc eq 0.
lo_nd_s_file = wd_context->get_child_node( name = wd_this->wdctx_s_file ).
lo_nd_s_file->bind_structure( ls_s_file ).
else.
lo_nd_s_file = wd_context->get_child_node( name = wd_this->wdctx_s_file ).
lo_el_s_file = lo_nd_s_file->get_element( ).
CALL METHOD lo_el_s_file->SET_STATIC_ATTRIBUTES_NULL
.
ENDIF.
* navigate from to via lead selection
lo_nd_s_feedback = wd_context->get_child_node( name = wd_this->wdctx_s_feedback ).
* get element via lead selection
lo_el_s_feedback = lo_nd_s_feedback->get_element( ).
lo_nd_s_feedback->bind_structure( ls_t_feedback ).
data:
lr_component type ref to if_wd_component,
lr_window_manager type ref to if_wd_window_manager,
lr_window type ref to if_wd_window.
lr_component = wd_comp_controller->wd_get_api( ).
lr_window_manager = lr_component->get_window_manager( ).
lr_window = lr_window_manager->create_window( window_name = 'DETAIL_WINDOW'
TITLE = '详细信息' ).
*CALL METHOD LR_WINDOW->SET_WINDOW_SIZE
* EXPORTING
* WIDTH = '200'
* HEIGHT = '400'
* .
lr_window->open( ).
、、、、、、、、、、、、、、、、、、、、、
下面是给prameter 设置初值
DATA: lr_value TYPE REF TO data.
*DATA: m_handler TYPE REF TO if_wd_select_options.
FIELD-SYMBOLS: TYPE bukrs.
CONSTANTS: co_bukrs TYPE bukrs VALUE '0330'.
CREATE DATA lr_value TYPE bukrs.
ASSIGN lr_value->* TO .
= co_bukrs.
wd_this->select_options->add_parameter_field(
i_id = 'BUKRS_PRM'
i_value = lr_value ).
阅读(5758) | 评论(0) | 转发(0) |