DATA lo_nd_t_chanl TYPE REF TO if_wd_context_node.
DATA lo_el_t_chanl TYPE REF TO if_wd_context_element.
DATA ls_t_chanl TYPE wd_this->element_t_chanl.
DATA lt_t_chanl TYPE wd_this->elements_t_chanl.
DATA text TYPE string.
DATA xtext TYPE xstring.
DATA lv_count TYPE i.
DATA lv_search TYPE string."代表#的个数
DATA new_text TYPE string.
DATA lv_pos TYPE i.
DATA new TYPE string.
data lv_begin_time type string.
data lv_end_time type string.
DATA: lv_hd_flag TYPE string ,
lv_type TYPE string,
lv_place TYPE string,
lv_status TYPE string,
lv_rate TYPE string,
lv_direction TYPE string.
lo_nd_t_chanl = wd_context->get_child_node( name = wd_this->wdctx_t_chanl ).
CALL METHOD lo_nd_t_chanl->get_static_attributes_table
IMPORTING
table = lt_t_chanl.
.
DESCRIBE TABLE lt_t_chanl LINES lv_count.
CLEAR text.
IF text IS INITIAL .
CONCATENATE
'频道代码'
'频道名称'
'频道简称'
'高清标识'
'频道类别'
'所属中心'
'开播日期'
'停播日期'
'首播比率'
'开始时间'
'结束时间'
'播出地点'
'频道状态'
'频道地域'
'频道语言'
'频道定位描述'
cl_abap_char_utilities=>newline INTO text
SEPARATED BY
cl_abap_char_utilities=>horizontal_tab.
ELSE.
CONCATENATE text
'频道代码'
'频道名称'
'频道简称'
'高清标识'
'频道类别'
'所属中心'
'开播日期'
'停播日期'
'首播比率'
'开始时间'
'结束时间'
'播出地点'
'频道状态'
'频道地域'
'频道语言'
'频道定位描述'
cl_abap_char_utilities=>newline INTO text
SEPARATED BY
cl_abap_char_utilities=>horizontal_tab.
ENDIF.
LOOP AT lt_t_chanl INTO ls_t_chanl.
IF ls_t_chanl-z_hd_flag EQ '0' .
lv_hd_flag = '标清'.
ELSE.
lv_hd_flag = '高清'.
ENDIF.
IF ls_t_chanl-z_chanl_type EQ '0' .
lv_type = '开路'.
ELSE.
lv_type = '付费'.
ENDIF.
IF ls_t_chanl-z_playsite EQ '0' .
lv_place = '现址'.
ELSE.
lv_place = '新址'.
ENDIF.
IF ls_t_chanl-z_chanl_status EQ '0' .
lv_status = '正常'.
ELSEIF ls_t_chanl-z_chanl_status EQ '1' .
lv_status = '停播'.
ELSE.
lv_status = '未启用'.
ENDIF.
lv_rate = ls_t_chanl-z_reply_rat .
CONCATENATE ls_t_chanl-z_begin_time+0(2) ':' ls_t_chanl-z_begin_time+2(2) ':' ls_t_chanl-z_begin_time+4(2)
into lv_begin_time.
CONCATENATE ls_t_chanl-z_close_time+0(2) ':' ls_t_chanl-z_close_time+2(2) ':' ls_t_chanl-z_close_time+4(2)
into lv_end_time.
CONCATENATE
ls_t_chanl-z_chanl_cd
ls_t_chanl-z_chanl_name
ls_t_chanl-z_chanl_brief
lv_hd_flag
lv_type
ls_t_chanl-z_dept_cd
ls_t_chanl-z_begin_date
ls_t_chanl-z_close_date
lv_rate
lv_begin_time
lv_end_time
lv_place
lv_status
ls_t_chanl-z_chanl_area
ls_t_chanl-z_chanl_langu
ls_t_chanl-z_direction
cl_abap_char_utilities=>newline
INTO lv_search SEPARATED BY cl_abap_char_utilities=>horizontal_tab .
CONCATENATE text lv_search into text.
clear lv_search .
ENDLOOP.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = text
encoding = '8400'
IMPORTING
buffer = xtext.
cl_wd_runtime_services=>attach_file_to_response( i_filename = 'wdp.xls'
i_content = xtext
i_mime_type = 'EXCEL' ).
阅读(2323) | 评论(1) | 转发(0) |