Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Need to add Print functionality to a transaction

Former Member
0 Kudos

Hi all,

Please help me out with the above issue.

Need printing Capability for ZEDIR03. Currently the ZEDIR03 transaction does not have the capability to print an EDIR hard copy. Just need to enable the print functionality in the transaction.

Thanks in advance.

4 REPLIES 4

Former Member
0 Kudos

Hi,

On your GUI status add the print icon with the okcode of %PRI.

Darren

0 Kudos

Hi Darren,

Thanks for answering to my question.

I have added the icon but when i click on it nothing happens,please help me on how to proceed further.

But can you please tell me how to find the Okcodes for different icons.

Thanks,

Bhanu.

0 Kudos

in the user_command module (PAI module) you have to handle that button. you want to print script/smartform..?

accordingly you have to call the functions/code the logic.

prince_isaac
Active Participant
0 Kudos

after doin the above mentioned steps u need to code the fnctionality of the button. have a look at the below code snippet which calls a sapscript form...

*this function calls the user print interface

CALL FUNCTION 'OPEN_FORM'

EXPORTING

device = 'PRINTER'.

IF sy-subrc <> 0.

ENDIF.

*start working on the form by specifying the sapscript form name

CALL FUNCTION 'START_FORM'

EXPORTING

form = 'ZUPDC_PURCHASE'.

IF sy-subrc <> 0.

ENDIF.

*write data on the form window

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'MAIN_01'.

IF sy-subrc <> 0.

ENDIF.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'MAIN_02'.

IF sy-subrc <> 0.

ENDIF.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'FOOTER'.

IF sy-subrc <> 0.

ENDIF.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'LOGO'.

IF sy-subrc <> 0.

ENDIF.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'LINES'.

IF sy-subrc <> 0.

ENDIF.

*end working on the form

CALL FUNCTION 'END_FORM'.

IF sy-subrc <> 0.

ENDIF.

*close the form and exit

CALL FUNCTION 'CLOSE_FORM'.

IF sy-subrc <> 0.

ENDIF.

this should shed light on grey areas..

award points if useful