Book Image

SAP ABAP Advanced Cookbook

By : Rehan Zaidi
Book Image

SAP ABAP Advanced Cookbook

By: Rehan Zaidi

Overview of this book

ABAP (Advanced Business Application Programming) is SAP's proprietary 4th Generation Language (4GL). SAP core is written almost entirely in ABAP.ABAP is a high level programming language used in SAP for development and other customization processes."SAP ABAP Advanced Cookbook"ù covers advanced SAP programming applications with ABAP. It teaches you to enhance SAP applications by developing custom reports and interfaces with ABAP programming. This cookbook has quick and advanced real world recipes for programming ABAP.It begins with the applications of ABAP Objects and ALV tips and tricks. It then covers Design Patterns and Dynamic Programming in detail.You will also learn the usage of quality improvement tools such as transaction SAT, SQL Trace, and the Code Inspector.Simple transformations and its application in Excel Downloading will also be discussed, as well as the newest topics of Adobe Interactive Forms and the consumption and creation of Web services. The book comes to an end by covering advanced usage of Web Dynpro for ABAP and the latest advancement in Floorplan Manager.
Table of Contents (22 chapters)
SAP ABAP Advanced Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Converting Smart Forms to PDF output


In this recipe, we will see how the form output may be suppressed and returned as internal table to our calling program and then how a PDF is generated within the program. We will set values to some fields in the control structure of the Smart Form and use it with the CONVERT_OTF_2_PDF function module.

How to do it...

For generating PDF output without showing the Smart Form on the screen, follow these steps:

  1. First, we define two structures cont_parameters and myoutput based on the dictionary structures ssfctrlop and ssfcrescl respectively.

  2. Then, we assign 'X' to the setotf and no_dialog fields of the control structure.

  3. The dynamic call of the Smart Form function module is then carried out.

  4. Appropriate variables are then defined. The most important is the internal table pdf_content used for storing the converted PDF output of the form. The filesize and doc_archive tables are necessary for calling the function module CONVERT_OTF_2_PDF.

  5. The function module CONVERT_OTF_2_PDF...