Application Development 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: 

Can anyone tell me how to debug a smartform

Former Member
0 Kudos

Hi friends,

1)           I am getting an error in smartforms. The smartform was activated with out any errors. But after giving the value and executing it, when i select a print preview button it goes to screen and it show an exception error. So anyone tell me how to resolve this one.

2)          Some one suggested that after generating function module ->click on debugging and then click on display, there i can find a sub routine GLOBAL_INIT(it has all are variables which are used in that smartform). But when i did this procedure i did not find any sub routine like GLOBL_INIT. tell me how to debug a smartform.

3)         After generating the function module in smartforms in real time do we need to add any characters before that function module for ex: BL/001/5478/V2547. This function module is generated after completing of design and now if i want to use this FM in program can i directly use this one or SSF_BL/001/5478/V2547 like these characters are used. tell me why and what are those characters.

7 REPLIES 7

0 Kudos

Go to transaction SMARTFORMS, find the function module name for your smartform.

Go to transaction SE37, paste the function module name and go to attributes.

Double click on the "Program" field to navigate into the ABAP report of your smartform, go into the last include of this report.

You'll find the logic of your smartform on this include. You can put breakpoints on this code.

Finally, excecute the report that calls your smartform.

Regards,

Rubén Mircin

Former Member
0 Kudos

Hi,

Display your smartform and from menu go  to Environment / Function Module Name copy that name (eg: /1BCDWB/SF00000016) and display it with SE37.

After that go to menu: Goto / Main Program and double click last INCLUDE.

There you have FORM %GLOBAL_INIT and all the other code lines. You can set breakpoint here.


It's posible that you have to declare some variables in Global Definitions / "Currency/Quant. Fields", I don't know for sure as you didn't mentioned the error you got.


Adi.

0 Kudos

Hi again,

You can not use the name of the function because it will get changed every time.

Use function SSF_FUNCTION_MODULE_NAME to determine the name of the function (and store it in a variable - eg: FM_NAME) which gets generated and after call it like this:


DATA FM_NAME TYPE RS38L_FNAM.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
     EXPORTING
       FORMNAME                 = 'SMARTFORM_NAME'
     IMPORTING
       FM_NAME                  = FM_NAME
     EXCEPTIONS
       NO_FORM                  = 1
       NO_FUNCTION_MODULE       = 2
       OTHERS                   = 3.


* call smartform

CALL FUNCTION FM_NAME

* params go here

EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4
       OTHERS                     = 5.


Adi.

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi

Place the external debugging on the generated function module of your smartform in your print program.

Seems your startform is ok but when you clicks on print preview button you are getting the error means ,there should be something wrong with your print options like spool generation etc.

Debugging the smartform is same like debug the function module only.

Regards,

Sreeram

Former Member
0 Kudos

thank you one and all.

what about my 3rd question.

0 Kudos

Hi Ram,

Initially we can't develop program with the function module which is generated by smartform, because based on server function module name will be changed, so better to use SSF_FUNCTION_MODULE_NAME.

Adrian already posted above regarding this.

Thanks,

Ashok.

SatheeshKumara1
Participant
0 Kudos

This message was moderated.