Dear
smartforms have facility to write abap pgm
smartforms have the facility to write the abap code
you have to do the right clik on any window
and create --- > program lines...
then it will give you an option to write the abap code
then you have to give the input and output parameters
at the top
this will be just like the using and changing parameters in sub routines
and you have to declare a global variable to display the data
May this solve your problem
Regards