cancel
Showing results for 
Search instead for 
Did you mean: 

smart forms

Former Member
0 Kudos

Hi ,

iam having doubt in smartforn .. when we activate smartform automaticai will generate function module no or otherwise we call smartform by using SSF_FUNCTION_MODULE_NAME.

My doubt is what is diffrenece between them ... in real time we have to use which one ?

Regs ,

Murthy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

It is a good programming to use "SSF_FUNCTION_MODULE_NAME" this function module, it will return the function modulte generated for the smart form you created. You can directly call the function module created for the form, but every time you makes changes and activate the function module name will be different, so you need to hard code every time.

so by this "SSF_FUNCTION_MODULE_NAME" it will return the actual fm name generated when you make changes.

You use that returned parameter call the smart form.

Answers (1)

Answers (1)

Former Member
0 Kudos

When you activate your Smartform, SAP generates the actual function module and will assign it a name with some crazy numbers like /1BCDWB/SF00000033.

You could hard code this into your print program, but you shouldn't.

The reason is that when you transport your Smartform to your test or production environments the FM will be generated in the new environment and the name will probably change.

So you want to call SSF_FUNCTION_MODULE_NAME passing the name that you gave your Smartform. This will return the name that SAP gave to the smartform function module.

* Get the Function Module Name
  V_FORM_NAME = 'Z_MY_SMARTFORM'.

  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
       EXPORTING
            FORMNAME           = V_FORM_NAME
       IMPORTING
            FM_NAME            = V_FM_NAME
       EXCEPTIONS
            NO_FORM            = 1
            NO_FUNCTION_MODULE = 2
            OTHERS             = 3.
  IF SY-SUBRC <> 0.
    V_RETCODE = 1.
  ENDIF.

* Call the Smartform's Function Module
  CALL FUNCTION V_FM_NAME
       EXPORTING
.......