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

class or function module to check error in smartform

Former Member
0 Likes
1,939

Hello all,

Actual recently i got a very complex requirement.  i have to developed bulk smart forms syntax check program. but i did not find and standard class or functional module for this purpose in sap.

we already developed mass syntax check program for SE38 reports objects but current requirement for SAP smart forms.

Currently my requirement is just find out any class or functional module which can check syntax errors in smart forms .

So please guide me to achieve this scenario.

thanks in advance.

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
1,421

Smartform can be checked using the object for the class CL_SSF_FB_SMART_FORM.


  DATA: l_sform TYPE REF TO cl_ssf_fb_smart_form.

  data: check_ob_global type ref to cl_ssf_fb_check.

  datal_ex_check          type ref to cx_ssf_fb_check.

  CREATE OBJECT sform.

  formname = 'ZTEST_NP'.

  CALL METHOD sform->load

    EXPORTING

      im_formname = formname

      im_language = sy-langu.

      try.

          call method sform->check

               exporting global_check_flag = 'X'

               changing check_object = check_ob_global.

        catch cx_ssf_fb_check into l_ex_check.

          check_ob_global = l_ex_check->check_object.

          "l_ex_check->ERROR_TABLE would have all the errors

     endtry.

Regards,

Naimesh Patel

7 REPLIES 7
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,421

Did you look for "syntax check" or "FM generation" FM in package SMART or usable class related to SCI in  package S_CODE_INSPECTOR?

Regards,

Raymond

Read only

former_member206650
Active Participant
0 Likes
1,421

Hi Vipul,

can't you use the logic if the smartform is not active then there is error.for this u need to write code you can also search with tables STXF* to get the activation field..

just try it..if you get it do share...

vishnu

Read only

naimesh_patel
Active Contributor
0 Likes
1,422

Smartform can be checked using the object for the class CL_SSF_FB_SMART_FORM.


  DATA: l_sform TYPE REF TO cl_ssf_fb_smart_form.

  data: check_ob_global type ref to cl_ssf_fb_check.

  datal_ex_check          type ref to cx_ssf_fb_check.

  CREATE OBJECT sform.

  formname = 'ZTEST_NP'.

  CALL METHOD sform->load

    EXPORTING

      im_formname = formname

      im_language = sy-langu.

      try.

          call method sform->check

               exporting global_check_flag = 'X'

               changing check_object = check_ob_global.

        catch cx_ssf_fb_check into l_ex_check.

          check_ob_global = l_ex_check->check_object.

          "l_ex_check->ERROR_TABLE would have all the errors

     endtry.

Regards,

Naimesh Patel

Read only

0 Likes
1,421

thanks naimesh,

i will try it and let update u for the same.

Read only

0 Likes
1,421

thanks naimesh, its works

but how to read  l_ex_check->ERROR_TABLE into internal table. bec i have to generate  alv report on based on these errors

Read only

0 Likes
1,421

ERROR_TABLE would provide you all the information. You can get them like this.


datal_ex_check          type ref to cx_ssf_fb_check.

data: ls_error like line of l_ex_check->ERROR_TABLE.

loop at l_ex_check->ERROR_TABLE into ls_error.

"FORMNAME

lv_page_name = ls_error-page_node->get_name( ).

lv_element   = ls_error-node->get_name( ).

"NAME

"FIELDNAME

"CLASS - message class

"MSG

ENDLOOP.

Regards,
Naimesh Patel

Read only

0 Likes
1,421

Hello Naimesh,

thanks for ur help.

actually i have one more issue, i also required some way to check obsolete statement in the smart forms, so there is any way for this.