‎2011 Feb 03 6:54 AM
Hi SAP ABAP Technical consultants,
Have a doubt in SAP standard script. The SAP Script driver program name -
Y_J1IPRNTARE and its Script form name --- Y_J1_I_ARE1.
I would be converting the standard script into as per my client requirement. I have modified in the SAP Script and added new titles and headings.
I copied all these into separately and its driver program name -
Z_J1IPRNTARE, script form name -- Z_J1_I_ARE1.
For basically we required three kinds of functional modules in SAP Script. They are open_form, write_form and close_form
Then I have to changed in the form name in start_form FM .
That means
CALL 'open_form'
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = 'Z_J1_I_ARE1'
LANGUAGE = SY-LANGU
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = element
function = fnction
type = 'BODY'
window = window
IMPORTING
PENDING_LINES =
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = RESULT
TABLES
OTFDATA =
exceptions
unopened = 1
OTHERS = 6
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
These are the functional modules i have used. And finally I have checked and activated. when executing the driver program it is not showing performing any action even it is not showing error message.
Why it is happening ? Can anyone help to me how to handle this?
Thanks
venkat
‎2011 Feb 03 8:13 AM
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'Z_J1_I_ARE1'.
CALL FUNCTION 'START_FORM'
EXPORTING
form = 'Z_J1_I_ARE1'.
PERFORM write_form USING 'TEST' 'MAIN'.
FORM write_form USING element TYPE c wind TYPE c.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = element
window = wind.
ENDFORM. " write_form
only write as follow don't pass any parameter.
CALL FUNCTION 'CLOSE_FORM'.
‎2011 Feb 03 8:39 AM
Have you assigned your print program (Z Print Program) and your Script ( Z script ) in NACE Transaction?
Regards
Ganesh Reddy
‎2011 Feb 03 8:42 AM
Hi,
You can check the following code.You can get the idea.
call function 'OPEN_FORM'
exporting
application = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
device = 'PRINTER'
dialog = 'X'
form = 'Zformname'
language = sy-langu
* OPTIONS =
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
* SPONUMIV =
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
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
codepage = 11
others = 12
.
if sy-subrc <> 0.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
call function 'WRITE_FORM'
exporting
element = 'DATA1'
function = 'SET'
type = 'BODY'
window = 'MAIN'
* IMPORTING
* PENDING_LINES =
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.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
call function 'CLOSE_FORM'
* IMPORTING
* RESULT =
* RDI_RESULT =
* TABLES
* OTFDATA =
exceptions
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
others = 6
.
if sy-subrc <> 0.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
‎2011 Feb 03 8:51 AM
Hi,
AM not understanding that why you copied the standard Driver program into Custom Driver Program.
You can enhance the Standard program by adding Subroutine statement in the Scripts.
Just think you are having many forms for one Standard T-codes.
At that time we are using the Start form . Means that which form needs to printed at that time.
With Regards,
Sumodh.P