04-04-2006 1:20 PM
Hi all,
How to debug a SAPSCRIPT form?
What is the DB Start_form and Open_Form?
What is Control form?
How to do u convert form to PDF format?
Points will be awarded
04-04-2006 1:22 PM
hi jayasree,
to debug form here is the navigation
go with se71-utilities-activate debuger
i think this answer is bit helpful for u
Regards
naveen
04-04-2006 1:24 PM
Hi,
The Script can be debugged by SE71->UTILITIES->Activate debugger
Thanks,
Kalpana
04-04-2006 1:25 PM
jayasree
for ur third question u can refer this link below
https://www.sdn.sap.com/irj/sdn/collaboration
this link is also the same as u r question
thanks
naveen
04-04-2006 1:31 PM
<b> se71-utilities-activate debuger</b>
<b>OPEN_FORM</b> SAPscript: Open form printing
to only preview the form: options-tdpreview='X' (options- tdnoprint forbids print even from preview)
to get OTF data instead of printing: options-tdgetotf='X'
to output OTF data to memory buffer instead of printing: device='OTF_MEM'
<b>
CLOSE_FORM</b> SAPscript: End layout set printing
spool #: result-tdspoolid
OTF data: otfdata (when options-tdgetotf='X' in
OPEN_FORM)
<b>
WRITE_FORM</b> SAPscript: Output text element in form window
<b>CONTROL_FORM</b> SAPscript: Control form
output issue command to the form, e.g.
exporting command = 'NEW-PAGE'
<b>CONVERT_OTF_MEMORY</b> SAPscript: Convert OTF from memory into text format
output: table of structure TLINE (OTF saved to memory buffer by OPEN_FORM)
data: w_options type itcpo,
w_result type itcpp,
w_otf like itcoo occurs 0 with header line,
w_ascii like tline occurs 0 with header line,
w_device(40) type c,
w_num like sy-tabix.
parameters: printer like tsp03-padest lower case default 'locl',
layoutst like rsscf-tdform default 'MEDRUCK'.
selection-screen: begin of line.
parameters p_prn radiobutton group rad0.
selection-screen: comment 4(60) cmt_prn for field p_prn,
end of line.
selection-screen: begin of line.
parameters p_pre radiobutton group rad0.
selection-screen: comment 4(60) cmt_pre for field p_pre,
end of line.
selection-screen: begin of line.
parameters p_mem radiobutton group rad0.
selection-screen: comment 4(60) cmt_mem for field p_mem,
end of line.
selection-screen: begin of line.
parameters p_otf radiobutton group rad0.
selection-screen: comment 4(60) cmt_otf for field p_otf,
end of line.
initialization.
cmt_prn = 'Print to spool'.
cmt_pre = 'Only create form and preview, no print'.
cmt_mem = 'Output OTF to memory buffer and convert to ASCII'.
cmt_otf = 'Only get OTF data'.
start-of-selection.
perform: form_open,
print_item,
form_close.
case 'X'.
when p_prn. write: / 'See Spool#', w_result-tdspoolid,
'(', w_result-tdpages, ' pages )'.
when p_pre.
when p_otf. loop at w_otf.
write / w_otf.
endloop.
when p_mem. perform get_ascii.
endcase.
----
FORM FORM_OPEN *
----
Start of printing the form *
----
form form_open.
w_options-tddest = printer.
w_device = 'PRINTER'. "default
case 'X'.
when p_pre. w_options-tdpreview = 'X'.
w_options-tdnoprint = 'X'.
when p_prn.
when p_mem. w_device = 'OTF_MEM'.
when others. w_options-tdgetotf = 'X'.
endcase.
call function 'OPEN_FORM'
exporting
device = w_device
dialog = ' '
form = layoutst
options = w_options
exceptions
canceled = 1
device = 2
form = 3
options = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
spool_error = 10
others = 11.
write: / 'Form open. Return code =', sy-subrc.
if sy-subrc <> 0.
message id sy-msgid type 'I' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform.
&----
*& Form PRINT_ITEM
&----
Print form item *
----
form print_item.
call function 'WRITE_FORM'
exceptions
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
others = 9.
write: / 'Form print. Return code =', sy-subrc.
if sy-subrc <> 0.
message id sy-msgid type 'I' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " PRINT_ITEM
----
FORM FORM_CLOSE *
----
End of printing the form *
----
form form_close.
call function 'CLOSE_FORM'
importing
result = w_result
tables
otfdata = w_otf
exceptions
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
others = 5.
write: / 'Form close. Return code =', sy-subrc,
'Spool#', w_result-tdspoolid.
if sy-subrc <> 0.
message id sy-msgid type 'I' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
describe table w_otf lines w_num.
write: / 'OTF has', w_num, 'lines.'.
endif.
endform.
&----
*& Form get_ascii
&----
convert OTF from memory to ASCII text
----
form get_ascii.
call function 'CONVERT_OTF_MEMORY'
tables
lines = w_ascii
exceptions
memory_empty = 1
err_max_linewidth = 2
err_format = 3
err_conv_not_possible = 4
others = 5.
write: / 'Convert OTF memory. Return code =', sy-subrc.
if sy-subrc <> 0.
message id sy-msgid type 'I' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
describe table w_ascii lines w_num.
write: / 'OTF has', w_num, 'lines.'.
loop at w_ascii.
write: / w_ascii.
endloop.
endif.
endform. " get_ascii
******************************
regards
vinod
04-04-2006 1:32 PM
Hi,
They are two ways to debug the SAPScript.
1). Use Tools - Word Processing - Layout Set (SE71). Enter name of layout set and then Utilities - Activate Debugger.
It is of no consequence which layoutset you enter when selecting the SAPscript debugger. (Menu path: Tools-Wordprocessing - Forms, Utilities - Activate Debugger) The next layoutset called will invoke the debugger.
2). Another way to set the SAPScript debugger is to run program RSTXDBUG.
When you debug Print program it is same as you debug any other ABAP program. While when you debug SAPScript, you actually debug the code ( scripting) you have written SAPScript Form.
04-04-2006 1:33 PM
jayasree,
for u r other questions u can refer these below links
http://help.sap.com/saphelp_46c/helpdata/en/d6/0db303494511d182b70000e829fbfe/frameset.htm
http://www.sap-img.com/sapscripts.htm
http://www.thespot4sap.com/Articles/SAPscript_Introduction.asp
http://help.sap.com/saphelp_46c/helpdata/en/e1/8e51341a06084de10000009b38f83b/frameset.htm
http://www.allsaplinks.com/sap_scripts.html
i think these links will be helpful for u
u will get all the info what ever u want in these links i think
ok if u r problem is solved don't forget to reward the points
Regards
naveen
04-04-2006 1:34 PM
Hi,
Check this link for info. abt SAPscripts.
http://www.sappoint.com/abap.html
Kindly reward points by clikcing the star on the left of reply,if it is useful.
04-04-2006 1:34 PM
Hi
How to debug a SAPSCRIPT form?
Check this thread
What is the DB Start_form and Open_Form?
CHECK THIS THREAD
What is Control form?
To pass control statements, such as an unconditional page break, use function module CONTROL_FORM. Control statements are always directed to the main window of the form, where the system interprets and executes them immediately.
check this link its helpful
http://help.sap.com/saphelp_nw04/helpdata/en/d6/0dba1a494511d182b70000e829fbfe/frameset.htm
How to do u convert form to PDF format?
use the program RSTXPDFT4
HOPE THIS HELPS,
PRIYA