Skip to Content
author's profile photo Former Member
Former Member

How to export Graphical output to PDF or WORD or Excel

Hi Gurus, I have written code to display the Po amount for the respective vendors. the output is in Graphical format(Bar Chart).

How to export this Graph to PDF or WORD?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2012 at 12:03 PM

    Hi Swathi,

    Please check below code and change bold letter's value's accordingly.

    

    • SET PF-STATUS 'Y_PDF'. " Cretae PF Status as below Screen Shot and Activate
    • " User Command to generate PDF Form

    

    AT USER-COMMAND.
    CASE SY-UCOMM.
    WHEN 'PDF'.
    DATA: L_PARAMS TYPE PRI_PARAMS,
    L_VALID TYPE STRING,
    W_SPOOL_NR LIKE TSP01-RQIDENT.
    * TO GET PRINT PARAMETERS
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    IMPORTING
    OUT_PARAMETERS = L_PARAMS
    VALID = L_VALID.
    IF SY-SUBRC <> 0.
    ENDIF.
    * Internal table for Selection Screen
    DATA: BEGIN OF I_RSPARAMS OCCURS 0.
    INCLUDE STRUCTURE RSPARAMS.
    DATA: END OF I_RSPARAMS.
    * Store the current selection screen details
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
    CURR_REPORT = SY-REPID
    *IMPORTING
    * SP =
    TABLES
    SELECTION_TABLE = I_RSPARAMS
    *EXCEPTIONS
    * NOT_FOUND = 1
    * NO_REPORT = 2
    * OTHERS = 3
    .
    IF SY-SUBRC <> 0.
    *MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *SUBMIT TO GET THE SPOOL NUMBER
    SUBMIT YTEST123 WITH SELECTION-TABLE I_RSPARAMS

    " PUT your program name like m using my YTEST123 .


    TO SAP-SPOOL
    SPOOL PARAMETERS L_PARAMS
    WITHOUT SPOOL DYNPRO
    AND RETURN.
    * SELECT THE RECENTLY CREATED SPOOL
    SELECT MAX( RQIDENT ) INTO W_SPOOL_NR FROM TSP01
    WHERE RQCLIENT = SY-MANDT
    AND RQOWNER = SY-UNAME.
    * REPORT TO GENERATE SPOOL NUMBER FOR PDF CONVERT
    SUBMIT RSTXPDF5 WITH SPOOLNO = W_SPOOL_NR
    WITH DSTDEVIC = 'LP01' AND RETURN .

    " your output device name like LP01, LOCL

    '
    IF SY-SUBRC EQ 0.
    CLEAR W_SPOOL_NR.
    * SELECT THE RECENTLY CREATED SPOOL FOR PDF
    SELECT MAX( RQIDENT ) INTO W_SPOOL_NR FROM TSP01
    WHERE RQCLIENT = SY-MANDT
    AND RQOWNER = SY-UNAME.


    * REPORT TO DOWNLOAD PDF SPOOL TO GUI
    SUBMIT RSTXPDFT5 WITH SPOOLID = W_SPOOL_NR
    AND RETURN.
    ENDIF.
    ENDCASE.

    Regard's

    Smruti Ranjan

    


    PF STATUS.jpg (102.9 kB)
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.