cancel
Showing results for 
Search instead for 
Did you mean: 

Printing Adobe Form in Webdynpro

former_member197828
Participant
0 Kudos


Hi Experts,

I need one help  from all of you , its quite urgent.

Actually I am trying to print Adobe form in webdynpro method like below:

   "----- Take the Adobe fprm -------------------"

      lv_form_name = 'ZHR_SAP_FORM'.
*----------------------------------------------"

      CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
        EXPORTING
          i_name     = lv_form_name
        IMPORTING
          e_funcname = lv_fm_name.

      lfs_output_params-nodialog = 'X'.
      lfs_output_params-getpdf   = 'X'.
      lfs_output_params-device   = 'TR5T'.
      lfs_output_params-connection   = 'ADS'.

      CALL FUNCTION 'FP_JOB_OPEN'
        CHANGING
          ie_outputparams = lfs_output_params
        EXCEPTIONS
          cancel          = 1
          usage_error     = 2
          system_error    = 3
          internal_error  = 4
          OTHERS          = 5.
      IF sy-subrc <> 0.
* Implement suitable error handling here
      ENDIF.

*---Form language
      lfs_doc_params-langu = 'E'.

*---Call Adobe form.
      CALL FUNCTION lv_fm_name  

        EXPORTING
         /1bcdwb/docparams         = lfs_doc_params
          gt_item                  = lit_zhrauth_item
          gs_hrauth                = lwa_zhrauth
       IMPORTING
         /1bcdwb/formoutput       lwa_output
       EXCEPTIONS
         usage_error              = 1
         system_error             = 2
         internal_error           = 3
         OTHERS                   = 4
                .
      IF sy-subrc <> 0.
* Implement suitable error handling here
      ENDIF.

*---Job Close
      CALL FUNCTION 'FP_JOB_CLOSE'
* IMPORTING
*   E_RESULT             =
       EXCEPTIONS
         usage_error          = 1
         system_error         = 2
         internal_error       = 3
         OTHERS               = 4
                .
      IF sy-subrc <> 0.
* Implement suitable error handling here
      ENDIF.

Here , the funtion module name is coming correctly.

But when calling function CALL FUNCTION 'FP_JOB_OPEN' ,

It is giving sy-subrc = 2 , i.e. usage error (An Exception).

Similarily , due to this i am getting same exception in 

CALL FUNCTION  lv_fm_name

So some one please help me , what should i do ,

am i supposed to pass some other parameter in  CALL FUNCTION 'FP_JOB_OPEN'

Hopefully , waiting for responds.

Thanks & Regards;

Gaurav Singh

Accepted Solutions (1)

Accepted Solutions (1)

nsikka
Active Participant
0 Kudos

Also you are passing wrong value to device parameter

it will be 'PRINTER'

and dest will be 4 char value which you are passing as TR5T

former_member197828
Participant
0 Kudos

HI Sikka,

Thanx for the reply ,

With your solution CALL FUNCTION 'FP_JOB_OPEN' is done.

but the same  problem is still happening with

CALL FUNCTION  lv_fm_name and it is giving sy-subrc = 2.

  

i.e.   system_error             2

Thanx !!!

nsikka
Active Participant
0 Kudos

Try commenting /1bcdwb/docparams         = lfs_doc_params, while calling the form

Also, check if you are passing the parameters correctly to the form

former_member197828
Participant
0 Kudos

Hi Sikka,

It is still coming.

nsikka
Active Participant
0 Kudos

just execute this program in se38 FP_PDF_TEST_00 and see what is the output.

Also, try commenting       lfs_output_params-connection   = 'ADS'.

former_member197828
Participant
0 Kudos

Hi Sikka.

I have already checked the program.

Its giving some Version Information.

And commenting this   lfs_output_params-connection   = 'ADS'.

is also not fruitfull.

Thanx for your consistantly reply Nitin.

Is there any other change or configuration , i need to do. ??

nsikka
Active Participant
0 Kudos

There can only be 2 reasons:

- Either it is a webdynpro issue

- Or check the parameters/data which you are passing to the form.

Thanks

former_member197828
Participant
0 Kudos

Hi Sikka,

I am also not sure, where the problem is happening.

Actully , in webdynpro..All the data i am taking , is correct.

Only the problem is in this Function Module.

So its very very less chance of error in webdynpro.

Atleast CALL FUNCTION  lv_fm_name , this should exporting the right data.

coz all the importing pratameters are containing right value , i have checked.

So There is surely some problem in paratmeters or something else.

Thanx Dear..!!

former_member197828
Participant
0 Kudos

Hi Guys,

All the things and settings are ok.

There was some issue related with Adobe form itself.

Some data mapping and the values of check box should be  either X or space.

This was the point , where this issue was occucring.

Now , it is resolved.

Thanks for your support.

Answers (1)

Answers (1)

nsikka
Active Participant
0 Kudos

you might also need to pass lfs_output_params--dest parameter