cancel
Showing results for 
Search instead for 
Did you mean: 

Custom button BADI CFX_BUTTONS

Former Member
0 Kudos

I am using BADI CFX_BUTTONS and I want to create a PDF behind this button. How would I go about doing this? I'm not sure how to display, or save, the PDF because you can't pass it back through the interface. The button is placed on a document and I want to create a PDF of the contents of that document.

Regards,

Davis

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member189058
Active Contributor
0 Kudos

Hi Davis,

I hope you have defined the button under cFolders customizing.

Let us assume that:

Button ID: ZZ_CREATE_PDF

Button Name: Create PDF

Object Type: doc

Now create an implementation, say ZCFX_CREATE_PDF for BAdI Definition CFX_BUTTONS.

In the method AFTER_BUTTON_PRESSED, use appropriate function module to get document details. Search by CFX_API_DOC

Once you get the function module, you will have to convert the data.. document contents to pdf format. I am sure there must be a function available for this, but I first need to know the format in which data is retrieved.

Then use FILE_SAVE method of CL_GUI_FRONTEND_SERVICES to save the pdf on the local PC.

Display message showing file name and location where the document data has been stored in pdf format.

Regards,

Reema.