Skip to Content

Installation

ATTENTION!
Due to size limit of single Weblog, I had to put source code of programs in parts II, III and IV of the blog.

The first part: ZICDOC – HTML documentation generator for ABAP programs – part I

 

This post is the second part of WeBlog describing ZICDOC – generator of HTML description of ABAP program.

I tried not to use any nonstandard dictionary objects. You can even find, that I haven’t used program text for HTML tags, but created them as constants. So, it should be enough just to create all ABAP programs and then activate them. If you want to understand what fields are on selection screen of the main program, copy texts from source code (they are at the beginning ) to selection texts.

Additionally, you have to create local file ZIcDocStyle.css and paste into it content from the field below:

 

You should create the following programs:

  • ZICDOC – the main program (type ‘1′) of the generator. It is ready-to-use program or just example how to call generator from other programs.
  • ZICDOC_CL_HTML – include (type ‘I’) with class supporting creation of HTML file
  • ZICDOC_CL_CODE_ANALYSIS – include containing class for source code analysis
  • ZICDOC_CL_CODE_ANALYSIS_HTML – include with class analyzing code and creating HTML documentation

 

 

‘ ). ENDMETHOD. METHOD str_a_href. e_str = str2html( i_text ). CONCATENATE ‘‘ e_str ‘‘ INTO e_str. ENDMETHOD. “str_a_href METHOD str_a_name. e_str = str2html( i_text ). CONCATENATE ‘‘ e_str ‘‘ INTO e_str. ENDMETHOD. “str_a_name METHOD add_a_href. DATA: str TYPE string. str = str2html( i_text ). CONCATENATE ‘‘ str ‘‘ INTO str. CALL METHOD add_string_raw( str ). ENDMETHOD. “add_a_href METHOD add_a_name. DATA: str TYPE string. str = str2html( i_text ). CONCATENATE ‘‘ str ‘‘ INTO str. CALL METHOD add_string_raw( str ). ENDMETHOD. “add_a_name METHOD start_document. DATA: l_str TYPE string. CALL METHOD add_string_raw( ” ). CALL METHOD flush_buffer. CALL METHOD add_string_raw( ” ). CALL METHOD flush_buffer. CONCATENATE ” INTO l_str. CALL METHOD add_string_raw( l_str ). CALL METHOD flush_buffer. IF i_css_file_name IS NOT INITIAL. CONCATENATE ” INTO l_str. CALL METHOD add_string_raw( l_str ). CALL METHOD flush_buffer. ENDIF. IF i_comment IS NOT INITIAL. CALL METHOD add_string_raw( i_comment ). CALL METHOD flush_buffer. ENDIF. CALL METHOD add_tag EXPORTING tag = ‘title’ str = i_title. CALL METHOD add_string_raw( ” ). CALL METHOD flush_buffer. CALL METHOD add_string_raw( ” ). CALL METHOD flush_buffer. ENDMETHOD. “start_document METHOD end_document. CALL METHOD add_string_raw( ” ). CALL METHOD flush_buffer. CALL METHOD add_string_raw( ” ). CALL METHOD flush_buffer. ENDMETHOD. “end_document METHOD write_file. CALL METHOD flush_buffer. CALL FUNCTION ‘GUI_DOWNLOAD’ EXPORTING filename = file_name TABLES data_tab = gt_content EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. ret_code = sy-subrc. ENDMETHOD. “write_file ENDCLASS. “zcl_ic_html IMPLEMENTATION 

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply