Skip to Content
author's profile photo Former Member
Former Member

Download or print a whole BSP application

Hello,

I have created my first BSP application on a test system.

I cannot use the correction & transport system "CTS" on this system.

Is there one button to download or print all pages of a BSP application ?

I have found a button to download each layout or event individually,

but I am looking for a PRINT-button that puts all my program entries into one file.

(The Business Object Types and the ABAP Classes do have such a feature)

Regards

Thomas Kosog

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 16, 2004 at 01:56 PM

    The only way I handle this is to jump to every page/view/fragment I created and press the print button or via menu->bsp-page-print.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 06, 2004 at 03:31 PM

    Hi Thomas,

    Please find enclose a simple program which is not finished yet ( just missing all the download ) . With this program you can donwload whole BSP Application.

    I hope that will help you

    Regards.

    Bertrand.

    DATA : w_pagelist TYPE o2pagelist ,

    w_pagekey TYPE o2pagkey ,

    w_page TYPE REF TO cl_o2_api_pages ,

    w_content TYPE o2pageline_table ,

    w_xml TYPE xstring ,

    w_guids TYPE bsp_guids ,

    w_event TYPE o2pagevh_tabletype ,

    w_attrib TYPE o2pagpar_tabletype ,

    w_type TYPE rswsourcet ,

    directory TYPE string ,

    w_dir TYPE string ,

    loc_dir TYPE string ,

    it_transf TYPE stringtab ,

    it_dir TYPE stringtab ,

    wa_transf TYPE string ,

    w_result(1) TYPE c ,

    long TYPE i ,

    w_pos TYPE sy-fdpos.

    FIELD-SYMBOLS : <page> TYPE o2pagattr ,

    <fs> TYPE o2pageline ,

    <event> TYPE o2pagevhs ,

    <string> TYPE string ,

    <attr> TYPE o2pagpars ,

    <type> TYPE string.

    DEFINE create_directory.

    call method cl_gui_frontend_services=>directory_exist

    exporting

    directory = &1

    receiving

    result = w_result.

    if w_result is initial.

    call method cl_gui_frontend_services=>directory_create

    exporting

    directory = &1

    changing

    rc = sy-subrc.

    endif.

    END-OF-DEFINITION.

    SELECTION-SCREEN BEGIN OF BLOCK b1.

    PARAMETERS : p_applna TYPE o2applname OBLIGATORY ,

    p_dir TYPE rlgrap-filename OBLIGATORY.

    SELECTION-SCREEN END OF BLOCK b1.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dir .

    w_dir = p_dir .

    CALL METHOD cl_gui_frontend_services=>directory_browse

    EXPORTING

    window_title = 'Repertoire de stockage'

    initial_folder = w_dir

    CHANGING

    selected_folder = w_dir.

    p_dir = w_dir.

    START-OF-SELECTION.

    • method to get all pages of BSP application

    CALL METHOD cl_o2_api_pages=>get_all_pages

    EXPORTING

    p_applname = p_applna

    p_version = 'A'

    p_mod_langu = sy-langu

    p_master_langu = sy-langu

    p_with_texts = 'X'

    IMPORTING

    p_pages = w_pagelist.

    • create directory corresponding to the architecture of the application

    • for each page one folder will be create .

    LOOP AT w_pagelist ASSIGNING <page>.

    CLEAR w_dir.

    CASE <page>-pagetype.

    WHEN space.

    CONCATENATE p_dir p_applna 'FlowLogic' <page>-pagename INTO w_dir SEPARATED BY '\'.

    WHEN 'X'.

    CONCATENATE p_dir p_applna 'Fragment' <page>-pagename INTO w_dir SEPARATED BY '\'.

    WHEN 'C'.

    CONCATENATE p_dir p_applna 'Controller' <page>-pagename INTO w_dir SEPARATED BY '\'.

    WHEN 'V'.

    CONCATENATE p_dir p_applna 'Vue' <page>-pagename INTO w_dir SEPARATED BY '\'.

    ENDCASE.

    REPLACE ALL OCCURENCES OF '/' IN w_dir WITH '\'.

    w_pos = 0.

    BREAK-POINT.

    long = STRLEN( w_dir ) .

    FIND '\' IN SECTION OFFSET w_pos LENGTH long OF w_dir MATCH OFFSET w_pos.

    WHILE sy-subrc EQ 0.

    loc_dir = w_dir(w_pos).

    create_directory loc_dir.

    add 1 to w_pos.

    long = STRLEN( w_dir ) - w_pos.

    FIND '\' IN SECTION OFFSET w_pos LENGTH long OF w_dir MATCH OFFSET w_pos.

    ENDWHILE.

    create_directory w_dir.

    • Creation of the object corresponding to the page .

    w_pagekey-applname = <page>-applname.

    w_pagekey-pagekey = <page>-pagekey.

    CALL METHOD cl_o2_api_pages=>load

    EXPORTING

    p_pagekey = w_pagekey

    p_version = <page>-version

    p_langu = sy-langu

    p_with_all_texts = 'X'

    IMPORTING

    p_page = w_page

    EXCEPTIONS

    object_not_existing = 1

    version_not_existing = 2

    OTHERS = 3.

    CHECK sy-subrc EQ 0.

    • Accessign to the page parameter.

    CALL METHOD w_page->get_parameters

    IMPORTING

    p_parameters = w_attrib

    EXCEPTIONS

    page_deleted = 1

    invalid_call = 2

    OTHERS = 3.

    CLEAR wa_transf.

    FREE it_transf.

    IF NOT w_attrib[] IS INITIAL.

    wa_transf = 'Nom;Attribut URL;typing;type;description'.

    APPEND wa_transf TO it_transf.

    LOOP AT w_attrib ASSIGNING <attr>.

    CLEAR wa_transf.

    wa_transf = <attr>-compname.

    • WRITE : / <attr>-compname .

    IF <attr>-pardecltyp = '0'.

    • WRITE : 'URL Parameter'.

    CONCATENATE wa_transf 'X' INTO wa_transf SEPARATED BY ';'.

    ELSE.

    CONCATENATE wa_transf space INTO wa_transf SEPARATED BY ';'.

    ENDIF.

    IF <attr>-typtype = '1'.

    CONCATENATE wa_transf 'TYPE' INTO wa_transf SEPARATED BY ';'.

    • WRITE 'TYPE' .

    ELSE.

    CONCATENATE wa_transf 'TYPE REF TO' INTO wa_transf SEPARATED BY ';'.

    • WRITE 'TYPE REF TO'.

    ENDIF.

    CONCATENATE wa_transf <attr>-type <attr>-text INTO wa_transf SEPARATED BY ';'.

    • WRITE : <attr>-type , <attr>-text .

    APPEND wa_transf TO it_transf.

    ENDLOOP.

    CONCATENATE w_dir 'Attribut.txt' INTO loc_dir SEPARATED BY '\'.

    CALL METHOD cl_gui_frontend_services=>gui_download

    EXPORTING

    filename = loc_dir

    filetype = 'ASC'

    confirm_overwrite = space

    no_auth_check = space

    CHANGING

    data_tab = it_transf.

    • ULINE .

    ENDIF.

    • Accessing type definition of the page

    CALL METHOD w_page->get_type_source

    IMPORTING

    p_source = w_type

    EXCEPTIONS

    page_deleted = 1

    invalid_call = 2

    OTHERS = 3.

    LOOP AT w_type ASSIGNING <type> .

    WRITE : / <type>.

    ENDLOOP.

    ULINE .

    • Accesing to the event_handler of the page

    CALL METHOD w_page->get_event_handlers

    IMPORTING

    p_ev_handler = w_event

    EXCEPTIONS

    page_deleted = 1

    invalid_call = 2

    OTHERS = 3.

    LOOP AT w_event ASSIGNING <event> .

    WRITE : / <event>-evhname .

    LOOP AT <event>-source ASSIGNING <string> .

    WRITE : / <string> .

    ENDLOOP.

    ENDLOOP.

    ULINE.

    • Accessing to the layout of the page

    CALL METHOD w_page->get_page

    IMPORTING

    p_content = w_content

    p_xml_source = w_xml

    p_otr_guids = w_guids

    EXCEPTIONS

    page_deleted = 1

    invalid_call = 2

    OTHERS = 3.

    LOOP AT w_content ASSIGNING <fs> .

    WRITE : / <fs>-line.

    ENDLOOP.

    SKIP 1.

    ENDLOOP.

    Add comment
    10|10000 characters needed characters exceeded