*----------------------------------------------------------------------*
FORM event_top_of_page USING p_dyndoc_id TYPE REF TO cl_dd_document.
* Design the Layout
PERFORM f_design_top_new USING p_dyndoc_id.
* populating data to html control
PERFORM f_html_header USING p_dyndoc_id.
ENDFORM. " EVENT_TOP_OF_PAGE
************************************************************************
FORM f_design_top_new USING p_dyndoc_id TYPE REF TO cl_dd_document.
DATA obj_area1 TYPE REF TO cl_dd_area.
DATA obj_area2 TYPE REF TO cl_dd_area.
DATA obj_table TYPE REF TO cl_dd_table_element.
DATA obj_col_key TYPE REF TO cl_dd_area.
DATA obj_col_info TYPE REF TO cl_dd_area.
DATA l_text TYPE sdydo_text_element.
DATA:l_ext_date TYPE char10."Date
* populating header to top-of-page
PERFORM f_date_to_external USING sy-datum
CHANGING l_ext_date.
* add gap
CALL METHOD p_dyndoc_id->add_gap
EXPORTING
width = 150.
MOVE 'Tree House Foods'(001) TO l_text.
"Add Text to Header
CALL METHOD p_dyndoc_id->add_text
EXPORTING
text = l_text
sap_style = cl_dd_area=>heading.
CALL METHOD p_dyndoc_id->underline.
* add gap
CALL METHOD p_dyndoc_id->add_gap
EXPORTING
width = 150.
MOVE sy-title TO l_text.
"Add Text to Header
CALL METHOD p_dyndoc_id->add_text
EXPORTING
text = l_text
sap_emphasis = 'Strong'.
CLEAR l_text.
CALL METHOD p_dyndoc_id->new_line.
* Report Type***********************
IF rb_md06 EQ c_x.
MOVE 'Report based on MRP (MD06)'(s04) TO l_text.
ELSEIF rb_md04 EQ c_x.
MOVE 'Report based on Stock Requirements (MD04)'(032) TO l_text.
ENDIF.
"Add Text to Header
CALL METHOD p_dyndoc_id->add_text
EXPORTING
text = l_text
sap_emphasis = 'Strong'
sap_style = 'SUCCESS'.
CLEAR l_text.
* split of document into up/below
CALL METHOD p_dyndoc_id->horizontal_split
EXPORTING
split_area = p_dyndoc_id
IMPORTING
below_area = obj_area1.
l_text = 'Selection Screen Parameters'(040).
CALL METHOD obj_area1->add_text
EXPORTING
text = l_text
sap_emphasis = 'Strong'
sap_style = 'TABLE_HEADING'.
* split of below into below_left/below_right
CALL METHOD p_dyndoc_id->horizontal_split
EXPORTING
split_area = obj_area1
IMPORTING
below_area = obj_area2.
CALL METHOD obj_area2->add_table
EXPORTING
no_of_columns = 2
with_heading = ' '
border = '0'
IMPORTING
table = obj_table.
CALL METHOD obj_table->add_column
IMPORTING
column = obj_col_key.
CALL METHOD obj_table->add_column
IMPORTING
column = obj_col_info.
CALL METHOD obj_table->new_row.
l_text = 'Exception message number:'(041).
CALL METHOD obj_col_key->add_text
EXPORTING
text = l_text
sap_emphasis = 'Strong'.
LOOP AT s_auskt.
CALL METHOD obj_col_info->add_gap
EXPORTING
width = 5.
CONCATENATE s_auskt-option s_auskt-low s_auskt-high c_colon INTO l_text
SEPARATED BY space.
CALL METHOD obj_col_info->add_text
EXPORTING
text = l_text.
ENDLOOP.
CALL METHOD obj_table->new_row.
l_text = 'Plant:'(042).
CALL METHOD obj_col_key->add_text
EXPORTING
text = l_text
sap_emphasis = 'Strong'.
LOOP AT s_plwrk.
CALL METHOD obj_col_info->add_gap
EXPORTING
width = 5.
CONCATENATE s_plwrk-option s_plwrk-low s_plwrk-high c_colon INTO l_text
SEPARATED BY space.
CALL METHOD obj_col_info->add_text
EXPORTING
text = l_text.
ENDLOOP.
CALL METHOD obj_table->new_row.
l_text = 'Material Number:'(043).
CALL METHOD obj_col_key->add_text
EXPORTING
text = l_text
sap_emphasis = 'Strong'.
LOOP AT s_matnr.
CALL METHOD obj_col_info->add_gap
EXPORTING
width = 5.
CONCATENATE s_matnr-option s_matnr-low s_matnr-high c_colon INTO l_text
SEPARATED BY space.
CALL METHOD obj_col_info->add_text
EXPORTING
text = l_text.
ENDLOOP.
CALL METHOD obj_table->new_row.
l_text = 'Number of Excp. per Material:'(044).
CALL METHOD obj_col_key->add_text
EXPORTING
text = l_text
sap_emphasis = 'Strong'.
CALL METHOD obj_col_info->add_gap
EXPORTING
width = 5.
IF p_numex EQ 0.
l_text = 'Unlimited'(045).
ELSE.
l_text = p_numex.
ENDIF.
CALL METHOD obj_col_info->add_text
EXPORTING
text = l_text.
CALL METHOD obj_table->new_row.
l_text = 'Procurement Type:'(046).
CALL METHOD obj_col_key->add_text
EXPORTING
text = l_text
sap_emphasis = 'Strong'.
LOOP AT s_beskz.
CALL METHOD obj_col_info->add_gap
EXPORTING
width = 5.
CONCATENATE s_beskz-option s_beskz-low s_beskz-high c_colon INTO l_text
SEPARATED BY space.
CALL METHOD obj_col_info->add_text
EXPORTING
text = l_text.
ENDLOOP.
CALL METHOD obj_table->new_row.
l_text = 'MRP Type:'(047).
CALL METHOD obj_col_key->add_text
EXPORTING
text = l_text
sap_emphasis = 'Strong'.
LOOP AT s_dismm.
CALL METHOD obj_col_info->add_gap
EXPORTING
width = 5.
CONCATENATE s_dismm-option s_dismm-low s_dismm-high c_colon INTO l_text
SEPARATED BY space.
CALL METHOD obj_col_info->add_text
EXPORTING
text = l_text.
ENDLOOP.
CALL METHOD obj_table->new_row.
l_text = 'MRP Controller:'(048).
CALL METHOD obj_col_key->add_text
EXPORTING
text = l_text
sap_emphasis = 'Strong'.
LOOP AT s_dispo.
CALL METHOD obj_col_info->add_gap
EXPORTING
width = 5.
CONCATENATE s_dispo-option s_dispo-low s_dispo-high c_colon INTO l_text
SEPARATED BY space.
CALL METHOD obj_col_info->add_text
EXPORTING
text = l_text.
ENDLOOP.
CALL METHOD obj_table->new_row.
l_text = 'Material Type:'(049).
CALL METHOD obj_col_key->add_text
EXPORTING
text = l_text
sap_emphasis = 'Strong'.
LOOP AT s_mtart.
CALL METHOD obj_col_info->add_gap
EXPORTING
width = 5.
CONCATENATE s_mtart-option s_mtart-low s_mtart-high c_colon INTO l_text
SEPARATED BY space.
CALL METHOD obj_col_info->add_text
EXPORTING
text = l_text.
ENDLOOP.
ENDFORM. " F_DESIGN_TOP_NEW
****************************************************************************
*----------------------------------------------------------------------*
FORM f_html_header USING p_dyndoc_id TYPE REF TO cl_dd_document.
* creating html control
IF obj_html_cntrl IS INITIAL.
CREATE OBJECT obj_html_cntrl
EXPORTING
parent = obj_parent_html.
ENDIF.
* reuse_alv_grid_commentary_set
CALL FUNCTION 'REUSE_ALV_GRID_COMMENTARY_SET'
EXPORTING
document = p_dyndoc_id
bottom = space.
* get top->htmobj_table ready
CALL METHOD p_dyndoc_id->merge_document.
* set wallpaper
CALL METHOD p_dyndoc_id->set_document_background
EXPORTING
picture_id = space.
* connect top document to html-control
p_dyndoc_id->html_control = obj_html_cntrl.
* display top document
CALL METHOD p_dyndoc_id->display_document
EXPORTING
reuse_control = c_x
parent = obj_parent_html
EXCEPTIONS
html_display_error = 1.
IF sy-subrc NE 0.
MESSAGE i000 WITH 'Error in displaying top-of-page'(035).
ENDIF.
ENDFORM. " F_HTML_HEADER
*****************************************************************
No comments:
Post a Comment