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

Function Module Call CONVERT_OTF_AND_FAX

Former Member
0 Likes
357

Hi,

Could someone please explain how to use this FM, it is unable to generate a fax for me and I always get a conversion error in SOST, following is the code. I have searched this forum and internet and usage in standard SAP includes but still could not find a good example for this function module with all the parameters explained.

So far I was able to get till this point, please let me know if I am missing anything -

REPORT y_bcs_example_6.

DATA:it_otf LIKE soli OCCURS 0 WITH HEADER LINE.

DATA: la_fax  TYPE itcpp,
      l_faxok,
      lt_otf  TYPE TABLE OF itcoo.

la_fax-tddevice = 'TELEFAX'.
la_fax-tdgetotf = 'X'.
la_fax-tdcover  = space.
la_fax-tdimmed  = 'X'.

la_fax-tdteleland = 'US'.
la_fax-tdtelenum  = 'XXX-XXX-XXXX'.


CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
  EXPORTING
    rqident              = '81228'
    desired_type         = 'OTF'
  TABLES
    buffer               = it_otf
  EXCEPTIONS
    no_such_job          = 1
    job_contains_no_data = 2
    selection_empty      = 3
    no_permission        = 4
    can_not_access       = 5
    read_error           = 6
    type_no_match        = 7
    OTHERS               = 8.

CALL FUNCTION 'CONVERT_OTF_AND_FAX'
  EXPORTING
    faxoptions         = la_fax
    user               = sy-uname
 IMPORTING
   fax_ok             = l_faxok
*   OFFICE_OBJID       =
*   MSGID              =
*   MSGNO              =
*   MSGV1              =
*   MSGV2              =
*   MSGV3              =
*   MSGV4              =
  TABLES
    otf                =  it_otf
          .

COMMIT WORK.

1 REPLY 1
Read only

Former Member
0 Likes
321

I have found that I cannot publish a spool to any printer and expect CONVERT_OTFAND_FAX to do the OTF conversion and fax. Only some specific printers can be used for FAX ( I am still a bit fuzzy on how this works), I used LP01 to generate the spool and then used the function module CONVERT_OTF_AND_FAX to generate the output.

The following code worked -

DATA: it_otf LIKE soli OCCURS 0,
      la_fax  TYPE itcpp,
      l_faxok.

la_fax-tddevice = 'TELEFAX'.
la_fax-tddest   = 'LP01'.
la_fax-tdcopies = 1.
la_fax-tdgetotf = ''.
la_fax-tdcover  = space.
la_fax-tdimmed  = 'X'.
la_fax-tddelete = 'X'.
la_fax-tdteleland = 'US'.
la_fax-tdtelenum  = 'XXX-XXX-XXXX'.

CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
  EXPORTING
    rqident              = XXXX
    desired_type         = 'OTF'
  TABLES
    buffer               = it_otf
  EXCEPTIONS
    no_such_job          = 1
    job_contains_no_data = 2
    selection_empty      = 3
    no_permission        = 4
    can_not_access       = 5
    read_error           = 6
    type_no_match        = 7
    OTHERS               = 8.

CALL FUNCTION 'CONVERT_OTF_AND_FAX'
  EXPORTING
    faxoptions         = la_fax
    user               = sy-uname
 IMPORTING
   fax_ok             = l_faxok
  TABLES
    otf                =  it_otf
          .

COMMIT WORK.