Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in calling FM

Former Member
0 Likes
1,191

I try to call the FM GET_PRINT_PARAMETERS, but is raised an run time error.

Runtime Errors CALL_FUNCTION_UC_STRUCT

Except. CX_SY_DYN_CALL_ILLEGAL_TYPE

Date and Time 02/07/2009 10:37:23

My Code :

*-- Setup the Print Parmaters

call function 'GET_PRINT_PARAMETERS'

exporting

authority = space

copies = '1'

cover_page = space

data_set = space

department = space

destination = space

expiration = '1'

immediately = space

in_archive_parameters = space

in_parameters = space

layout = space

mode = space

new_list_id = 'X'

no_dialog = 'X'

user = sy-uname

importing

out_parameters = loc_mstr_print_parms

valid = loc_mc_valid

exceptions

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

others = 4.

Wating ur reply.

BR,

Ali

Edited by: Ali Saleh AlAbbad on Feb 7, 2009 8:42 AM

9 REPLIES 9
Read only

Former Member
0 Likes
1,077

hi,

Check the data declaration whcih you have passed to the Fm

DATA:
   l_text        TYPE pri_params-plist,
    l_valid       TYPE c,                 " Flag
    wa_param      LIKE pri_params.     

l_text = i_vdetails_line-objid.
  CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
      copies                 = '1'
*      destination            = sy-pdest
      line_count             = sy-linct
      line_size              = sy-linsz
      list_name              = l_text
      new_list_id            = 'X'
      no_dialog              = 'X'
    IMPORTING
      out_parameters         = wa_param
      valid                  = l_valid
    EXCEPTIONS
      archive_info_not_found = 1
      invalid_print_params   = 2
      invalid_archive_params = 3
      OTHERS                 = 4.

Read only

0 Likes
1,077

I see no error or mistak in the parameter

Read only

0 Likes
1,077

what type you have taken for:

out_parameters = loc_mstr_print_parms --is it pri_params

valid = loc_mc_valid

Read only

0 Likes
1,077

Hi,

I have copied your code and tested but i did not get any runtime error...Check the copied code..

DATA:
    loc_mc_valid      TYPE c,                 " Flag
    loc_mstr_print_parms      LIKE pri_params.


call function 'GET_PRINT_PARAMETERS'
     EXPORTING
          authority              = space
          copies                 = '1'
          cover_page             = space
          data_set               = space
          department             = space
          destination            = space
          expiration             = '1'
          immediately            = space
          in_archive_parameters  = space
          in_parameters          = space
          layout                 = space
          mode                   = space
          new_list_id            = 'X'
          no_dialog              = 'X'
          user                   = sy-uname
     IMPORTING
          out_parameters         = loc_mstr_print_parms
          valid                  = loc_mc_valid
     EXCEPTIONS
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          others                 = 4.
IF sy-subrc eq 0.
ENDIF.

Read only

0 Likes
1,077

I put this FM1 inside form Form1 and the soubroutine in side FM2

FM2

perform FORM1.

ENDFM2

Form FORM1

call FM1.

ENDFORM2.

that is mean i call my function module inside a function module , Is it possible.

Read only

Former Member
0 Likes
1,077

hi bro....

you have to chec in if the parameter you have passed to function module has exactly same data type as that of parameter in function module...

and if so move the data which is not having exactly sane data type or field width to a data variable having that thing same as in func module.... and the use that variable to be passed to function module....

your problem will be solved

regards

Read only

dev_parbutteea
Active Contributor
0 Likes
1,077

Hi,

loc_mstr_print_parms should be of type PRI_PARAMS.

Regards,

Dev.

Read only

Former Member
0 Likes
1,077

Hi Ali,

Could you please tell me what is the type of the variable

loc_mc_valid

regards,

Ravi

Read only

Former Member
0 Likes
1,077

Thanks all