cancel
Showing results for 
Search instead for 
Did you mean: 

Can we download SAP Script to a word document ?

Former Member
0 Kudos

Is it possible to download the SAP Script to a local Word documnet . and then is it possible to upload the Wrd Doc back to SAP SCript with a new Script name ..?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi

good

it is not possible to download the script output to a word document ,neither you can download the word document into a sapscript screen;

thanks

mrutyun^

Former Member
0 Kudos

hi,

you can use RSTXSCRP program to uplaod or download script into word document format

Former Member
0 Kudos

i tried running that program , but it's showing some errors , i'm sending u the screen shots , just take a look on them .

Error: Invalid Start Marker : DI#a instead of SFORM .

Former Member
0 Kudos

Hi

Hope it will help you.

<REMOVED BY MODERATOR>

want to Insert SAP ICONS into from SAP into Word document (OLE) .

(1) Copy program DD_ADD_PICTURE into your own version called ZDD_ADD_PICTURE. Make sure

you select all the checkboxes (including GUI Status and screens).

(2) Paste the modified code at the end of this reply into your ZZ_ADD_PICTURE program.

(3) Run ZZ_ADD_PICTURE for a range of Icons (e.g. enter Icon name ICON_IN* on the selection screen)

(4) When you get the result list, type in ok-code EXPO directly in the ok-code

field (you could also add a button for this function in the GUI status).

(5) Download all the displayed icons as .gif files into a Windows folder

that you have created to hold the icon .gif files (e.g. C:SAPICONS)

(6) Now you can work with the icon files as you would any .gif file. (e.g. In a Word doc, use menu path

Insert -> Picture -> From file.)

Here is the code:

REPORT dd_add_picture.

TYPE-POOLS: sdydo.

DATA: do TYPE REF TO cl_dd_document.

DATA: is_displayed.

TABLES: icont.

DATA: BEGIN OF icontab OCCURS 0.

INCLUDE STRUCTURE icon.

DATA: END OF icontab.

select-options: s_icon for icontab-name obligatory.

SELECT * FROM icon INTO TABLE icontab WHERE locked NE 'X'

AND name in s_icon.

  • Event Handler Definition, handling changes of GUI fonts, colors,...

CLASS cl_my_event_handler DEFINITION.

PUBLIC SECTION.

METHODS:

use_new_resources FOR EVENT resources_changed OF cl_gui_resources.

ENDCLASS.

DATA: my_handler TYPE REF TO cl_my_event_handler.

CREATE OBJECT my_handler.

  • Call Screen

CALL SCREEN 100.

*&----


*

*& Module STATUS_0100 OUTPUT

*&----


*

MODULE status_0100 OUTPUT.

IF is_displayed IS INITIAL.

SET PF-STATUS 'BRP'.

SET HANDLER my_handler->use_new_resources.

  • create document

CREATE OBJECT do.

  • fill document

PERFORM dd_add_icon USING do.

  • merge document

CALL METHOD do->merge_document.

  • display document .

CALL METHOD do->display_document

EXPORTING container = 'HTML'

EXCEPTIONS html_display_error = 1.

" do some exception handling ...

is_displayed = 'X'.

ENDIF.

ENDMODULE. " STATUS_0100 OUTPUT

*&----


*

MODULE user_command_0100 INPUT.

CASE sy-ucomm.

WHEN 'BACK'. "Beenden

LEAVE PROGRAM.

WHEN 'PRN'.

CALL METHOD do->print_document

EXPORTING reuse_control = 'X'.

WHEN 'PRN_NEW'.

DATA text TYPE sdydo_text_element.

CALL METHOD do->initialize_document.

text = 'Dies Dokument wurde speziell fürs Drucken erstellt!' &

' Druckdatum: '(500).

CALL METHOD do->add_text EXPORTING

text = text

sap_fontsize = cl_dd_area=>large.

WRITE sy-datum TO text DD/MM/YYYY.

CALL METHOD do->add_text EXPORTING text = text .

CALL METHOD do->new_line EXPORTING repeat = 2.

PERFORM dd_add_icon USING do.

CALL METHOD do->merge_document.

CALL METHOD do->print_document.

WHEN 'EXPO'.

CALL METHOD do->export_document EXPORTING to_filesystem = 'X'.

ENDCASE.

CLEAR sy-ucomm.

ENDMODULE. " USER_COMMAND_0100 INPUT

*&----


*

*& Form DD_ADD_ICON

*&----


*

  • text

*----


*

FORM dd_add_icon USING p_do TYPE REF TO cl_dd_document.

DATA ta TYPE REF TO cl_dd_table_element.

DATA col1 TYPE REF TO cl_dd_area.

DATA col2 TYPE REF TO cl_dd_area.

DATA col3 TYPE REF TO cl_dd_area.

DATA text TYPE sdydo_text_element.

  • set Heading

text = ' Bilder in Dynamischen Dokumenten'(001).

CALL METHOD p_do->add_text EXPORTING text = text

sap_style = 'heading'.

CALL METHOD p_do->new_line.

CALL METHOD p_do->new_line.

CALL METHOD p_do->add_table EXPORTING with_heading = 'X'

no_of_columns = 3

width = '100%'

IMPORTING table = ta.

  • set columns

text = 'Ikone'(011).

CALL METHOD ta->add_column EXPORTING heading = text

IMPORTING column = col1.

  • fill table

LOOP AT icontab.

SELECT SINGLE * FROM icont WHERE langu = sy-langu

AND id = icontab-id.

CALL METHOD col1->add_icon EXPORTING sap_icon = icontab-name

sap_color = 'LIST_GROUP'.

ENDLOOP.

ENDFORM. " DD_ADD_ICON

  • CLASS cl_my_event_handler IMPLEMENTATION.

CLASS cl_my_event_handler IMPLEMENTATION.

METHOD use_new_resources.

IF is_displayed EQ 'X'.

  • initialize document

CALL METHOD do->initialize_document.

  • fill document

PERFORM dd_add_icon USING do.

  • merge document

CALL METHOD do->merge_document.

  • display document

CALL METHOD do->display_document

EXPORTING reuse_control = 'X'

reuse_registration = 'X'.

ENDIF.

ENDMETHOD.

ENDCLASS.

Edited by: Alvaro Tejada Galindo on Feb 18, 2008 6:22 PM