hi how to call SapScript in Dialogue program..
for example i hv created a Print button in my screen and if i will click tat button it should cal my SAP script form(i.e,output of driver program).
Is there any function module to call my script????
Thanks in Advance..
Hi!
Heres a working example for SAPScript.
REPORT ZTESZT_2. DATA: gv_index LIKE sy-index. BREAK-POINT. CALL FUNCTION 'OPEN_FORM' EXPORTING DIALOG = 'X' FORM = 'Z_TEST' LANGUAGE = SY-LANGU EXCEPTIONS CANCELED = 1. IF SY-SUBRC <> 0. EXIT. ENDIF. CALL FUNCTION 'START_FORM' EXPORTING FORM = 'Z_TEST' LANGUAGE = sy-langu EXCEPTIONS FORM = 1. IF SY-SUBRC <> 0. EXIT. ENDIF. * print HEADER CALL FUNCTION 'WRITE_FORM' EXPORTING FUNCTION = 'SET' "set, append, delete WINDOW = 'HEADER' EXCEPTIONS ELEMENT = 1. IF SY-SUBRC <> 0. ENDIF. * print INFO CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'INFO_ELEM1' FUNCTION = 'SET' "set, append, delete WINDOW = 'INFO' EXCEPTIONS ELEMENT = 1. IF SY-SUBRC <> 0. ENDIF. * print INFO CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'INFO_ELEM2' FUNCTION = 'APPEND' "set, append, delete WINDOW = 'INFO' "info ablak EXCEPTIONS ELEMENT = 1. IF SY-SUBRC <> 0. ENDIF. * print FOOTER CALL FUNCTION 'WRITE_FORM' EXPORTING WINDOW = 'FOOTER' EXCEPTIONS ELEMENT = 1. IF SY-SUBRC <> 0. ENDIF. * print ADDRESS CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'ADDRESS_ELEM' FUNCTION = 'SET' "set, append, delete WINDOW = 'ADDRESS' EXCEPTIONS ELEMENT = 1. IF SY-SUBRC <> 0. ENDIF. * print ITEMS DO 100 TIMES. MOVE sy-index TO gv_index. CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'ELEM' FUNCTION = 'SET' "set, append, delete TYPE = 'BODY' "body, top, bottom WINDOW = 'MAIN' EXCEPTIONS ELEMENT = 1 FUNCTION = 2 TYPE = 3 UNOPENED = 4 UNSTARTED = 5 WINDOW = 6 BAD_PAGEFORMAT_FOR_PRINT = 7 SPOOL_ERROR = 8 CODEPAGE = 9 OTHERS = 10. IF SY-SUBRC <> 0. ENDIF. ENDDO. CALL FUNCTION 'END_FORM'. IF SY-SUBRC <> 0. ENDIF. CALL FUNCTION 'CLOSE_FORM'. IF SY-SUBRC <> 0. ENDIF.
Regards
Tamás
Message was edited by:
Tamás Nyisztor
Hi,
When you click the button, lets say the Function code is 'SCRIPT', then
IF SY-UCOMM = 'SCRIPT'.
here write the Driver program, i mean the open_form, Start_from, Write_from, Close-from and end_form. so when you click the button, the script will be called
ENDIF.
Regards
Sudheer
Add a comment