Skip to Content
avatar image
Former Member

sap crm ADOBE form print

**Local Structure

  DATA: ls_outputparams   TYPE sfpoutputparams,

        ls_docparams      TYPE sfpdocparams,

        ls_formoutput     TYPE fpformoutput,

        ls_control_params TYPE ssfctrlop,

        ls_result         TYPE sfpjoboutput.

Kindly let me know what else

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

      formname = lc_form_name" Adobe form name

*     VARIANT  = ' '

*     DIRECT_CALL            = ' '

    IMPORTING

      fm_name  = lv_fm_name

   EXCEPTIONS

     NO_FORM                = 1

     NO_FUNCTION_MODULE     = 2

     OTHERS                 = 3



  ls_outputparams-getpdf = 'X'.



  CALL FUNCTION 'FP_JOB_OPEN'

    CHANGING

      ie_outputparams = ls_outputparams

    EXCEPTIONS

      cancel          = 1

      usage_error     = 2

      system_error    = 3

      internal_error  = 4

      OTHERS          = 5.

  IF sy-subrc <> 0.

    RETURN.

  ENDIF.



  ls_docparams-langu = 'X'.

  ls_docparams-country = 'US'.

  ls_docparams-fillable = 'X'.



  CALL FUNCTION lv_fm_name

    EXPORTING

*     /1bcdwb/docparams  = ls_docparams

      control_parameters = ls_control_params

      output_options     = ls_output_options

      user_settings      = space

      i_zscrm_rma_header = is_rma_header

    IMPORTING

*     /1bcdwb/formoutput = ls_formoutput

      job_output_info    = ls_job_info

    EXCEPTIONS

      usage_error        = 1

      system_error       = 2

      internal_error     = 3

      OTHERS             = 4.

  IF sy-subrc <> 0.

    RETURN.

  ENDIF.

  CALL FUNCTION 'FP_JOB_CLOSE'

    IMPORTING

      e_result       = ls_result

    EXCEPTIONS

      usage_error    = 1

      system_error   = 2

      internal_error = 3

      OTHERS         = 4.

  IF sy-subrc <> 0.

    RETURN.

  ENDIF.

Kindly let me know what else code i have to write so that adobe form will get print out .

Regards,

Raju Prasad.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jan 08, 2015 at 02:55 PM

    Hi Raju,

    there are lots of blogs available go through that you will get to know and one more thing elaborate your requirement once..

    http://wiki.scn.sap.com/wiki/display/CRM/Print+an+Adobe+Form+from+CRM+Web+UI

    http://scn.sap.com/people/satishkumar.palyam2/blog/2011/07/07/adobe-forms-in-webui

    Thanks & Regards,

    Srinivas.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Srinivas,

      Now the badi  DOC_PERSONALIZE_BCS is triggering and i had written below code.

      METHOD if_ex_doc_personalize_bcs~personalize_pdf_doc_pdfif.

      *****************Data declaration********************

      **Local Reference

      DATA : lo_appl_object TYPE REF TO cl_doc_crm_order_h.

      **Local Variable

        DATA:lv_ref_kind TYPE crmt_object_kind,

             lv_ref_guid TYPE crmt_object_guid.

      ** Local Structure

        DATA: ls_rma_header        TYPE zscrm_rma_header.

      **lOCAL Internal Table

        DATA : lt_rma_item        TYPE TABLE OF zscrm_rma_itemdata.



      lo_appl_object ?= io_appl_object.



      TRY.

      CALL METHOD lo_appl_object->get_crm_obj_guid

      RECEIVING

      result = lv_ref_guid.

      CATCH cx_os_object_not_found .

      ENDTRY.

      IF lv_ref_guid IS INITIAL.

      RETURN.

      ENDIF.



      CALL METHOD zcl_rma_process=>fetch_order_details

            EXPORTING

              iv_guid       = lv_ref_guid

            IMPORTING

              es_rma_header = ls_rma_header

              et_rma_item   = lt_rma_item.



      *CALL FUNCTION 'ZCRM_PRINT_ADOBE_FORM'

      *      EXPORTING

      *        is_rma_header  = ls_rma_header

      *        IV_FORM_NAME   =

      *        it_rma_item    = lt_rma_item

      *      IMPORTING

      *        et_content_hex = lt_att_content_hex.



      CALL FUNCTION 'FP_JOB_OPEN'

      CHANGING

      ie_outputparams = is_outputparams

      EXCEPTIONS

      cancel = 1

      usage_error = 2

      system_error = 3

      internal_error = 4

      OTHERS = 5.

      IF sy-SUBRC <> 0.

      EXIT.

      ENDIF.



      CALL FUNCTION ip_function_name

      EXPORTING

      /1bcdwb/docparams = cs_docparams

      i_zscrm_rma_header = ls_rma_header

      IMPORTING

      /1bcdwb/formoutput = es_formoutput

      EXCEPTIONS

      usage_error = 1

      system_error = 2

      internal_error = 3

      OTHERS = 4.



      IF sy-subrc <> 0.

      RETURN.

      ENDIF.



      CALL FUNCTION 'FP_JOB_CLOSE'

      IMPORTING

      e_result = es_joboutput

      EXCEPTIONS

      usage_error = 1

      system_error = 2

      internal_error = 3

      OTHERS = 4.





      ENDMETHOD.

      While debuging i am not getting error but still print out is not coming.

      in importing parameter values are.

      IS_OUTPUTPARAMS-DEVICE = PRINTER.

      IS_OUTPUTPARAMS-NODIALOG = 'X'.

      IS_OUTPUTPARAMS-GETPDF = 'X'

      please let me know what i am missing.

      Regadds,

      Raju Prasad.