2010 Aug 06 10:53 AM
Hi Gurus,
I'm using SET_TABLE_FOR_FIRST_DISPLAY for displaying the data in GRID.
While displaying the header,Header Field Text is not displayed in right position when changing either screen size or font size.
Code: CALL METHOD im_ob_doc_id->add_text
EXPORTING
text = lv_text_hdr.
Could anyone kindly let me know what is the reason for this, Do I need to populate any extra parameters while calling this method.
Kindly provide the solution.
Thanks
Natasha SS.
2010 Aug 06 11:23 AM
FORM top_of_page_split USING lc_top TYPE REF TO cl_dd_document.
DATA: lt_tab TYPE sdydo_text_table,
lc_area TYPE REF TO cl_dd_area,
text TYPE sdydo_text_element.
TYPES: BEGIN OF tab_text,
text TYPE sdydo_text_element,
END OF tab_text.
DATA: lt_text TYPE TABLE OF tab_text.
DATA: w_text TYPE tab_text.
CALL METHOD lc_top->initialize_document.
CALL METHOD lc_top->vertical_split
EXPORTING
split_area = lc_top
split_width = '80%'
IMPORTING
right_area = lc_area.
CONCATENATE sy-datum+4(2) ' / ' sy-datum+6(2) ' / ' sy-datum(4) INTO date1.
CONCATENATE 'DATE' date1 INTO w_text-text SEPARATED BY ':'.
APPEND w_text TO lt_text.
lt_tab[] = lt_text[].
CALL METHOD lc_area->add_text
EXPORTING
text_table = lt_tab
fix_lines = 'X'
sap_fontsize = cl_dd_document=>medium
sap_emphasis = cl_dd_document=>strong.
CALL METHOD lc_top->add_gap
EXPORTING
width = 80.
text = 'REPORT HEADING'.
CALL METHOD lc_top->add_text
EXPORTING
text = text
sap_emphasis = 'STRONG'.
CALL METHOD lc_top->new_line.
ENDFORM. "TOP_OF_PAGE_SPLIT
Edited by: Bala Krishna on Aug 6, 2010 3:54 PM
2010 Aug 06 11:15 AM
Create table first by using methods add rows and add colums and then add the text in respective column
2010 Aug 06 11:23 AM
FORM top_of_page_split USING lc_top TYPE REF TO cl_dd_document.
DATA: lt_tab TYPE sdydo_text_table,
lc_area TYPE REF TO cl_dd_area,
text TYPE sdydo_text_element.
TYPES: BEGIN OF tab_text,
text TYPE sdydo_text_element,
END OF tab_text.
DATA: lt_text TYPE TABLE OF tab_text.
DATA: w_text TYPE tab_text.
CALL METHOD lc_top->initialize_document.
CALL METHOD lc_top->vertical_split
EXPORTING
split_area = lc_top
split_width = '80%'
IMPORTING
right_area = lc_area.
CONCATENATE sy-datum+4(2) ' / ' sy-datum+6(2) ' / ' sy-datum(4) INTO date1.
CONCATENATE 'DATE' date1 INTO w_text-text SEPARATED BY ':'.
APPEND w_text TO lt_text.
lt_tab[] = lt_text[].
CALL METHOD lc_area->add_text
EXPORTING
text_table = lt_tab
fix_lines = 'X'
sap_fontsize = cl_dd_document=>medium
sap_emphasis = cl_dd_document=>strong.
CALL METHOD lc_top->add_gap
EXPORTING
width = 80.
text = 'REPORT HEADING'.
CALL METHOD lc_top->add_text
EXPORTING
text = text
sap_emphasis = 'STRONG'.
CALL METHOD lc_top->new_line.
ENDFORM. "TOP_OF_PAGE_SPLIT
Edited by: Bala Krishna on Aug 6, 2010 3:54 PM
2010 Aug 06 12:18 PM
Hi Natasha,
Try like this
CALL METHOD im_ob_dyndoc_id->add_text
EXPORTING
text = lv_text
sap_style = cl_dd_area=>list_heading_int
sap_color = cl_dd_area=>list_heading_int
sap_emphasis = cl_dd_area=>heading.
Regards,
Pravin