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

smartforms - function module

Former Member
0 Likes
862

Hi all!

I try to create a function module to call a smartform. And I have 2 questions with export parameters:

     1. Can I change parameters name when I call this module?

    


...          

     

PARAMETERS :
      aufnr_in
LIKE afpo-aufnr,
      prod_mng
like makt-maktx,
      fin_mng
like makt-maktx.
      prod_mng
= 'Mr.Anderson'.

      fin_mng = 'Mr.Smith'.

      ...

      CALL FUNCTION fm_name
     
EXPORTING
      aufnr_in
= aufnr_in
      prod_mng
= prod_mng
      fin_mng
= fin_mng

      ...

In module I get names of the fields: aufnr_in, prod_mng, fin_mng. How to change it? For example like this: number, product manager, financial manager.

Also, can I change this names to other language (to russian)?


2. some of the fields have deafult parameters:

      prod_mng = 'Mr.Anderson'.

      fin_mng = 'Mr.Smith'.

When I run the module, i can't change it. I type another value into this fields, but in report I get the same (Mr.Anderson, Mr.Smith)



Regards, Alexander.

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
833

@Deepak - question is about a Smartform, not about a function module, so the information provided is not relevant in this case.

@OP - well, Smartform essentially is a function module. Just like with any FM, the parameters have a certain name. Naturally, the same name is entered in the FM itself and in the calling program, otherwise these two would never be able to communicate.

If you must change this (keep it mind that we can't make changes in the standard forms), go to the Smartform Interface and make changes there.

The values could be in Russian or any language installed in your system. Just like in an FM, you can't change the input values that were passed to it, you can only return another value in another variable.

3 REPLIES 3
Read only

Former Member
0 Likes
833

hi Alex,

If i understand correctly, you have FM_CALL to call the smartform. For point one aufnr_in, prod_mng, fin_mng are the input fields of FM_CALL that you want to change. You can change that in tcode SE37 and rename it under the tab IMPORT and then use the new names whenever this FM is called. You can not leave space in the parameter name though.

You have an option to maintain translations as well.

For the second issue fields

prod_mng = 'Mr.Anderson'.

fin_mng = 'Mr.Smith'.

you need to remove these hard codings, i guess this is being done inside the FM_CALL, thus the value that you input is getting overwritten by values inside the FM (which are hardcoded).

Kindly let em know if this doesnt help or you still have doubts.

Regards,

DN.

Read only

Former Member
0 Likes
833

Hi Alex,

One more thing, that you would not want your end user to execute you FM, instead create a report program which can have input parameters for your FM, with exact LABELs (display name) as you require. This program will then call your FM and so on.

Regards,

DN.

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
834

@Deepak - question is about a Smartform, not about a function module, so the information provided is not relevant in this case.

@OP - well, Smartform essentially is a function module. Just like with any FM, the parameters have a certain name. Naturally, the same name is entered in the FM itself and in the calling program, otherwise these two would never be able to communicate.

If you must change this (keep it mind that we can't make changes in the standard forms), go to the Smartform Interface and make changes there.

The values could be in Russian or any language installed in your system. Just like in an FM, you can't change the input values that were passed to it, you can only return another value in another variable.