‎2008 Aug 29 1:46 PM
Hi all,
I would like to print text on a printer from my ABAP program.
I know the NEW-PAGE PRINT ON/OFF syntax which, I think , send to the printer all the text used with a WRITE statement between the NEW-PAGE PRINT ON instruction and the NEW-PAGE PRINT OFF instruction.
My problem is that I want to use a fonction module (that I will create)
to print a text contained in a parameter, so, a varaiable text.
My question : is it possible to print a text contained in a structure/variable ? Or is it possible to print some text using a fonction module ?
Thanks a lot !
Regards,
--Yohann.
‎2008 Aug 29 2:11 PM
Yes but the text I want to print will come from the program that call the fonction module , this is my problem..
The program defines the text to print, the fonction module print it...and so i can reuse this fonction module.
‎2008 Aug 29 2:00 PM
Yes. You can use the NEW-PAGE ... syntax in the Function Module also.
Give a try..
Regards,
Naimesh Patel
‎2008 Aug 29 2:11 PM
Yes but the text I want to print will come from the program that call the fonction module , this is my problem..
The program defines the text to print, the fonction module print it...and so i can reuse this fonction module.
‎2008 Aug 29 2:26 PM
I don't think this is a problem.
I have created this test FM:
FUNCTION ZTEST_NP_WRITE.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_NAME1) TYPE CHAR30
*" REFERENCE(I_NAME2) TYPE CHAR30
*"----------------------------------------------------------------------
DATA: PRI_PARAMS TYPE PRI_PARAMS.
NEW-PAGE PRINT ON PARAMETERS PRI_PARAMS
NO DIALOG.
WRITE: / I_NAME1, I_NAME2.
NEW-PAGE PRINT OFF.
ENDFUNCTION.
Used it in the program.
DATA: L_NAME1 TYPE CHAR30,
L_NAME2 TYPE CHAR30.
L_NAME1 = 'Naimesh'.
L_NAME2 = 'Patel'.
CALL FUNCTION 'ZTEST_NP_WRITE'
EXPORTING
I_NAME1 = L_NAME1
I_NAME2 = L_NAME2.
It has generated the Spool, which I had expected.
Regards,
Naimesh Patel