cancel
Showing results for 
Search instead for 
Did you mean: 

error in the driver program of adobe form

Former Member
0 Kudos

Iam getting the following error

"LT_ATT_CONTENT_HEX" is not type-compatible with formal parameter "I_ATT_CONTENT_HEX".

The code i have written is below

Tables:usr03.

DATA: fm_name TYPE funcname.

data: begin of it_usr03 occurs 0,

bname like usr03-bname,

abtlg like usr03-abtlg,

regio like usr03-regio,

telnr like usr03-telnr,

telfx like usr03-telfx,

end of it_usr03.

selection-screen : Begin of block b1 .

parameter:p_bname like usr03-bname.

selection-screen : End of block b1 .

start-of-selection.

select bname abtlg regio telnr telfx

from usr03 into table it_usr03

where bname eq p_bname.

TRY.

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'

EXPORTING

I_NAME = 'ZVK_USER'

IMPORTING

E_FUNCNAME = fm_name.

CATCH cx_fp_api_usage.

CATCH cx_fp_api_repository.

CATCH cx_fp_api_internal.

ENDTRY.

DATA: FP_OUTPUTPARAMS TYPE sfpoutputparams.

*out put parameters are set and open spool job

FP_OUTPUTPARAMS-NODIALOG = 'X'.

FP_OUTPUTPARAMS-GETPDF = 'X'.

CALL FUNCTION 'FP_JOB_OPEN'

CHANGING

IE_OUTPUTPARAMS = FP_OUTPUTPARAMS

EXCEPTIONS

CANCEL = 1

USAGE_ERROR = 2

SYSTEM_ERROR = 3

INTERNAL_ERROR = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

DATA: FP_DOCPARAMS TYPE sfpdocparams .

DATA: FP_FORMOUTPUT TYPE fpformoutput .

  • CONSTANTS:C_CTRY(2) TYPE C VALUE 'AU'.

FP_DOCPARAMS-langu = 'E'.

FP_DOCPARAMS-country = 'AU'.

FP_DOCPARAMS-fillable = 'X'.

  • To Call the Generated Function Module

CALL FUNCTION FM_NAME

EXPORTING

/1BCDWB/DOCPARAMS/ = FP_DOCPARAMS

zvk_user = it_usr03

IMPORTING

/1BCDWB/FORMOUTPUT = FP_FORMOUTPUT

EXCEPTIONS

USAGE_ERROR = 1

SYSTEM_ERROR = 2

INTERNAL_ERROR = 3

OTHERS = 4.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • CLOSE SPOOL JOB

CALL FUNCTION 'FP_JOB_CLOSE'

EXCEPTIONS

USAGE_ERROR = 1

SYSTEM_ERROR = 2

INTERNAL_ERROR = 3

OTHERS = 4.

  • To Send the PDF to the concerned user.

*DATA: lt_att_content_hex type standard table of sdokcntbin.

DATA: lt_att_content_hex type standard table of soli.

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

EXPORTING

BUFFER = FP_FORMOUTPUT-PDF "pdf file from function module

TABLES

BINARY_TAB = lt_att_content_hex.

class cl_bcs definition Load.

data: lo_send_request TYPE REF TO cl_bcs value is initial.

lo_send_request = cl_bcs=>create_persistent( ).

  • *Message Body and Text

DATA:lt_message_body type bcsy_text value is initial,

lo_document type ref to cl_document_bcs value is initial.

append 'Dear User ,' To lt_message_body.

append ' ' to lt_message_body.

Append 'Please fill the attached form and send it back to us.'

to lt_message_body.

append ' ' to lt_message_body.

append 'Thank you ,' to lt_message_body.

lo_document = cl_document_bcs=>create_document(

i_type = 'RAW'

i_text = lt_message_body

i_subject = 'User Details Update Form' ).

DATA: lx_document_bcs type ref to cx_document_bcs value is initial.

TRY.

lo_document->add_attachment(

exporting

i_attachment_type = 'PDF'

i_attachment_subject = 'User Details Update Form'

i_att_content_hex = lt_att_content_hex ).

catch cx_document_bcs into lx_document_bcs.

endtry.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Venkat,

Define the variable like this:

DATA: lt_att_content_hex type solix_tab.

Hope this helps,

Amit

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Are you using ZCI Layout type?

Regards,

Arafat