cancel
Showing results for 
Search instead for 
Did you mean: 

Adaptive RFC - WD Java - Display Smartform in Interactive Form (PDF)

Former Member
0 Kudos

Hi everyone, i need your help. I get data type xstring from my backend function module. This data will use to fill property PDF Source from my Interactive Form UI Element in my iView. But before i get this data, my backend function module throw exception like this :

<b>"com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException: Please maintain an output device in your user master data., error key: RFC_ERROR_SYSTEM_FAILURE"</b>

And The print stack trace :

<b>com.sap.aii.proxy.framework.core.BaseProxyException: Please maintain an output device in your user master data., error key: RFC_ERROR_SYSTEM_FAILURE

at com.sap.aii.proxy.framework.core.AbstractProxy.send$(AbstractProxy.java:150)

at com.cnooc.performancemanagementsystem.model.getappraiseedetail.GetAppraiseeDetail.z_Hr_Pms_Display_Appr_Form(GetAppraiseeDetail.java:196)

at com.cnooc.performancemanagementsystem.model.getappraiseedetail.Z_Hr_Pms_Display_Appr_Form_Input.doExecute(Z_Hr_Pms_Display_Appr_Form_Input.java:137)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClassExecutable.execute(DynamicRFCModelClassExecutable.java:92)

at com.cnooc.performancemanagementsystem.Core.executeZ_Hr_Pms_Display_ApprForm(Core.java:1083)

</b>

I have search in this forum, but i cannot find similiar case. I suspect if the size of xstring (byte[] in Java) is too big (approximately 8 MB), is this the cause i get the exception ?

My code in custom controller like this :

<b> public void executeZ_Hr_Pms_Display_ApprForm( )

{

//@@begin executeZ_Hr_Pms_Display_ApprForm()

GetAppraiseeDetail model = (GetAppraiseeDetail)WDModelFactory.getModelInstance(GetAppraiseeDetail.class);

Z_Hr_Pms_Display_Appr_Form_Input inputDisplay = new Z_Hr_Pms_Display_Appr_Form_Input();

wdContext.nodeDisplaySmartForm().bind(inputDisplay);

Zappraisal_Param_Struc.Zappraisal_Param_Struc_List listForm = new Zappraisal_Param_Struc.Zappraisal_Param_Struc_List();

Zappraisal_Param_Struc elementForm = new Zappraisal_Param_Struc();

elementForm.setPernr("20071000");

elementForm.setBegda("20070101");

elementForm.setEndda("99991231");

elementForm.setOrgeh("");

elementForm.setPlans("");

elementForm.setStell("");

elementForm.setEname("");

elementForm.setPhase("C");

elementForm.setAtype("A");

elementForm.setSpras("EN");

listForm.addZappraisal_Param_Struc(elementForm);

inputDisplay.setT_Appraisal_Param(listForm);

wdContext.currentDisplaySmartFormElement().setP_Caller(" ");

wdContext.currentDisplaySmartFormElement().setP_Langu("E");

wdContext.currentDisplaySmartFormElement().setP_Type("A");

try

{

wdContext.currentDisplaySmartFormElement().modelObject().execute();

}

catch(WDDynamicRFCExecuteException e)

{

logger.traceThrowableT( Severity.ERROR, "executeZ_Hr_Pms_Display_ApprForm( )", "ERROR", e );

model.disconnectIfAlive();

e.printStackTrace();

throw new FeedbackException( e );

}

catch(WDRuntimeException e1)

{

logger.traceThrowableT( Severity.ERROR, "executeZ_Hr_Pms_Display_ApprForm( )", "ERROR", e1 );

model.disconnectIfAlive();

throw new FeedbackException( e1 );

}

wdContext.nodeReturnDisplayForm().invalidate();

wdContext.nodeOutputDisplayForm().invalidate();

model.disconnectIfAlive();

//@@end

}</b>

My context like this

<b>- DisplaySmartForm (model node)

--OutputDisplayForm (model node)

---ReturnDisplayForm(model node)

---T_Appraisal_Param_Output(model node)

---T_PDF_Lines (model node)

---Bin_File (model value)

---P_Bin_Size (model node) --> display size of bin_file (xstring)

--T_Appraisal_Param

--P_Caller

--P_Langu

--P_Type

</b>

My parameter FM like this :

<b>FUNCTION z_hr_pms_display_appr_form.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(P_CALLER) TYPE CHAR1 DEFAULT 'X'

*" VALUE(P_LANGU) TYPE SYLANGU DEFAULT SY-LANGU

*" VALUE(P_TYPE) TYPE CHAR1 DEFAULT 'A'

*" EXPORTING

*" VALUE(RETURN) TYPE BAPIRETURN

*" VALUE(BIN_FILE) TYPE XSTRING

*" VALUE(P_BIN_SIZE) TYPE I

*" TABLES

*" T_APPRAISAL_PARAM STRUCTURE ZAPPRAISAL_PARAM_STRUC

*" T_PDF_LINES STRUCTURE TLINE OPTIONAL

*"----


</b>

Please anyone, can you help me ? Thank you.

Regards,

Satria B

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi There!

Can you point me to any examples of how to call a smartform from java webdynpro? Do you display it in a iFrame or a different control?

Former Member
0 Kudos

Hi ,

U can display a Smart form in portal.

In RFC Export add a field of type Binary and populate smart form into that binary field.

Insert UI of element IFrame and bind the Source property to pdfUrl value attribute of type string.

In Webdynpro view after Executing the RFC

byte[] pdfContent =

wdContext.current<output_node>.get<BinaryExport>();

IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent,WDWebResourceType.PDF);

try

{

/* PdfUrl is of type String */ wdContext.currentContextElement.setPdfUrl(pdfResource.getURL());

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);

}

Former Member
0 Kudos

Hi everyone, I solve this problem, just add one line, so silly

out_opt-tddest = 'LOCL'.

<b>out_opt-tdprinter = 'PDF1'.</b>

Regards,

Satria

Former Member
0 Kudos

Hi guys, I still not solve this problem. Strange that my RFC can call successfully when execute through R3 (SE37) but when i call this in my webdynpro application, i get exception "Please maintain output device" (this strange because i have set default output device in SU01 for user that execute this function in webdynpro)

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = v_form_name

IMPORTING

fm_name = v_funcname

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

CALL FUNCTION 'BALW_BAPIRETURN_GET'

EXPORTING

type = 'E'

cl = 'ZH'

number = '036'

IMPORTING

bapireturn = return.

EXIT.

ENDIF.

"Data used only by stream creation.

DATA: ctr_param TYPE ssfctrlop,

out_opt TYPE ssfcompop,

out_info TYPE ssfcrescl,

lt_pdf_lines TYPE STANDARD TABLE OF tline.

ctr_param-no_dialog = 'X'.

ctr_param-preview = space.

ctr_param-getotf = 'X'.

  • out_opt-tdnoprev = 'X'.

out_opt-tddest = 'JKT018MISLJB2-01'.

CALL FUNCTION v_funcname

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = ctr_param

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

output_options = out_opt

  • USER_SETTINGS = 'X'

v_year = v_year

v_ename = v_ename

v_pernr = v_pernr

v_position = v_position

v_department = v_department

v_jobfam = v_jobfam

v_last_promotion = v_last_promotion

v_appr_no = v_appr_no

v_appr_nm = v_appr_nm

v_evmy = v_evmy

v_evey = v_evey

v_evcc = v_evcc

v_evmc = v_evmc

v_evjf = v_evjf

v_eeio = v_eeio

v_eent = v_eent

v_eest = v_eest

v_eetd = v_eetd

v_ka_score = v_ka_score

v_ka_weight = v_ka_weight

v_cc_score = v_cc_score

v_mc_score = v_mc_score

v_jf_score = v_jf_score

v_weight = v_weight

v_tot_score = v_tot_score

v_cc_subtotal = v_cc_subtotal

v_mc_subtotal = v_mc_subtotal

v_jf_subtotal = v_jf_subtotal

ls_competency_cc_form1 = ls_competency_cc_form1

ls_competency_cc_form2 = ls_competency_cc_form2

ls_competency_cc_form3 = ls_competency_cc_form3

ls_competency_cc_form4 = ls_competency_cc_form4

ls_competency_cc_form5 = ls_competency_cc_form5

ls_competency_cc_form6 = ls_competency_cc_form6

ls_competency_cc_form7 = ls_competency_cc_form7

ls_competency_mc_form1 = ls_competency_mc_form1

ls_competency_mc_form2 = ls_competency_mc_form2

ls_competency_mc_form3 = ls_competency_mc_form3

ls_competency_jf_form1 = ls_competency_jf_form1

ls_competency_jf_form2 = ls_competency_jf_form2

ls_competency_jf_form3 = ls_competency_jf_form3

IMPORTING

  • document_output_info =

job_output_info = out_info

  • JOB_OUTPUT_OPTIONS =

TABLES

t_emp_strength = lt_emp_strength

t_emp_imprv_opp = lt_emp_imprv_opp

t_train_dev_need = lt_train_dev_need

t_emp_notes = lt_emp_notes

t_key_acct = lt_key_acct

t_evmy = lt_evmy

t_evey = lt_evey

t_competency = lt_competency

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

IF sy-subrc <> 0.

DATA: v_message1 TYPE SY-MSGV1,

v_message2 TYPE SY-MSGV2,

v_message3 TYPE SY-MSGV3,

v_message4 TYPE SY-MSGV4.

<b> v_message1 = sy-msgid.

v_message2 = sy-msgno.

v_message3 = v_department.

v_message4 = v_jobfam.

CALL FUNCTION 'BALW_BAPIRETURN_GET'

EXPORTING

type = 'E'

cl = 'ZH'

number = '000'

par1 = v_message1

par2 = v_message2

par3 = v_message3

par4 = v_message4

IMPORTING

bapireturn = return.

EXIT.

ENDIF.</b>

When i print this bapi_return message in my iview,I get this <b>SSFCOMPOSER 010</b> which is "Please maintain output device" (SE91).

Can anyone help me ?

Thank you and Regards,

Satria B