Calling custom developed Adobe Form from standard Transaction Code for Print Output in SAP ABAP
Introduction: Adobe Forms are used frequently in SAP to generate Portable Document Format(PDF) files of various business documents like Invoices, Order Confirmations, Account Statements etc. PDF files have got below advantages over other file formats.
- It is an Open Standard Universal File Format that ensures its appearance same independent of application and platform used to create it or display it.
- It provides security like Digital Signature Validation, Disable Save Button, Disable Select Option and Disable Print Option.
There are many cases we don’t want to display purchase order details in the format provided by standard Adobe Form attached to its standard print program. So in this article we are going to learn how to call or configure custom developed Adobe Form from standard T Code: ME23N (Purchase Order).
For this lets find out the standard print program for T Code ME23N (Purchase Order Display) with below steps:
- Go to T Code NACE ->select application ‘EF’ (Purchase Order) then click on ‘Output Types’.
- Select the output Type ‘NEU’ (Purchase order) and then double click on ‘Processing routines’.
- From the below screen you can come to know that driver program name is ‘SAPFM06P’.
- Go to T Code SE38 -> give program name as ‘SAPFM06P’ -> click on ‘Display’ button.
- Click on global find and find in Search Term ‘FP_FUNCTION_MODULE_NAME’.
- Double click on above program to go to source code.
- Find out all call function ls_function statements in include ‘FM06PE04’ and note down all its exporting parameters.
Note: We should pass all the above exporting parameters as importing parameters in our custom developing interface of Adobe Form.
8. Create an interface ‘YTEST’ with all above noted parameters as importing parameters and active using T Code SFP.
9. Now create Form ‘YTESTFORM’ by giving interface name as ‘YTEST’.
10. Here for demo purpose i am going to show few header fields only in output, considering this drag and drop import parameter ‘HEADER’ from ‘YTEST’ to ‘YTESTFORM’ and click on ‘SAVE’ button.
11. Deactivate all the fields under ‘HEADER’ node which are giving errors as below and correct other issues if any exists.
12. Click on ‘Layout’ Tab ->click on ‘Master Pages’->click on ‘Data View’ Tab.
13. Select field ‘EBELN’ and drag and drop into Main Pages ->check in Preview PDF -> click on ‘Save’ icon then ‘Activate’ icon. Here for demo purpose, only one field is selected.
14. To Configure the custom developed Adobe Form ‘YTESTFORM’ to standard print program ‘SAPFM06P’ of application ‘EF’ (Purchase Order) , Go to T Code NACE->Select application ‘EF’ ->Click on ‘Output Types’.
15. Select Existing Standard Output Type ‘NEU’ -> Click on ‘Details’ ->Click on ‘Storage System’ Tab
->Give Storage Mode as ‘Print Only’ and Document Types as ‘MEOORDER’->Click on ‘Save’.
16. Double click on ‘Processing routines’ ->Replace the existing values with new values and save.
Note: Here we have replaced Form routine field value ‘ENTRY_NEU’ to ‘ADOBE_ENTRY_NEU’, removed Form field value ‘MEDRUCK’ , gave PDF/SmartForm Form value as ‘YTESTFORM’ and gave Type field value as ‘PDF’.
17. Go to T Code ME23N -> Open any purchase order ->click on ‘Print Preview’
18. Select our newly created output type ‘NEU’ and click on ‘Print Preview’ (Ctrl_Shift+F1), then it will call out custom developed Adobe Form for preview only.
19. To give the print, click on ‘Messages’ ->click on new entries then give output type as ‘NEU’, medium as ‘Print output’, valid Function, valid Partner and Language.
20. select new entry and click on communication method and select appropriate details and go back (F3).
21. click on ‘Further Data’ then select Dispatch time as ‘Send Immediately’ and go back (F3).
22. Finally select the new entry and click on ‘Save’ button then it will be dispatched to configured printer successfully.
Conclusion: So from the above result we can say we have configured our custom developed Adobe Form to standard print program of T Code ME21N/ME22N/ME23N successfully.
Hi Suman Kolatum,
thanks a lot for this detailed explanation. It was very easy to follow.
One thing that interests me: You wrote in your introduction, that there are possibilities to disable the save and print function of PDFs. How would that be possible?
We can disable print option for generated Adobe Form output by passing structure field SFPOUTPUTPARAMS-NOPRINT value as ‘X’.
Hi Suman, very helpful article, I have a question, what about if the main program doesn't have a FP_FUNCTION_MODULE_NAME, example, in NACE, E1: Inbound Delivery, how cant I build the main program ?.
Thanks in advance for your help.
For inbound delivery E1 in NACE, If main program does not have FP_FUNCTION_MODULE_NAME, check is there any OPEN_FORM and CLOSE_FORM that will call SAP Script.
If you still want to use only ADOBE Form, you need to create your own custom program, routine and abobe form. Then you have to configure for a specified output type of E1 in NACE.
I am working on the same topic. Could you please eloberate how to proceed when 'OPEN_FORMS' exists instead of 'FP_FUNTION_MODULE_NAME'?
CALL FUNCTION 'OPEN_FORM'
EXPORTING form = xformular
language = ekko-spras
OPTIONS = itcpo
archive_index = toa_dara
archive_params = arc_params
* ARCHIVE_PARAMS = ALARC_PAR1
device = xdevice
dialog = xdialog
EXCEPTIONS canceled = 01.
I dont see any ls_function exporting parameters in Z_F* custom program.
In this case how should i proceed further? Your guidance will help me .
Thanks in advance.
Please try to create a new output type.There you get option to call a Form. Then configure it to your required standard tcode.