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: 

Howto geht smartform-name via FM-name?

Former Member
0 Kudos

Hi there,

how can I get the name of a smartform if I have only its generated FM-name?

Can you give me a hint?

Thanks a lot

Kind regards

Markus

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

try like this..


DATA: fm_name TYPE rs38l_fnam.


  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname                 = '<your form name>'
*   VARIANT                  = ' '
*   DIRECT_CALL              = ' '
   IMPORTING
     fm_name                  = fm_name
   EXCEPTIONS
     no_form                  = 1
     no_function_module       = 2
     OTHERS                   = 3
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  CALL FUNCTION fm_name
* EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
*   CONTROL_PARAMETERS         =
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
* IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
*   JOB_OUTPUT_INFO            =
*   JOB_OUTPUT_OPTIONS         =
    TABLES
      it_final                   = <your final table>
   EXCEPTIONS
     formatting_error           = 1
     internal_error             = 2
     send_error                 = 3
     user_canceled              = 4
     OTHERS                     = 5
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Arunima

3 REPLIES 3

Former Member
0 Kudos

Hi,

try like this..


DATA: fm_name TYPE rs38l_fnam.


  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname                 = '<your form name>'
*   VARIANT                  = ' '
*   DIRECT_CALL              = ' '
   IMPORTING
     fm_name                  = fm_name
   EXCEPTIONS
     no_form                  = 1
     no_function_module       = 2
     OTHERS                   = 3
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  CALL FUNCTION fm_name
* EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
*   CONTROL_PARAMETERS         =
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
* IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
*   JOB_OUTPUT_INFO            =
*   JOB_OUTPUT_OPTIONS         =
    TABLES
      it_final                   = <your final table>
   EXCEPTIONS
     formatting_error           = 1
     internal_error             = 2
     send_error                 = 3
     user_canceled              = 4
     OTHERS                     = 5
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Arunima

Former Member
0 Kudos

hmmm, quite a peculiar requirement.

Just open tcode SE37 and enter the generated FM name and press display.

See the attributes tab and you can see the smartform name in Shorttext.

Also you can get it from the source code of the function module, just look in the data declaration, you will find something like;

BEGIN OF %FULLNAME,
        FORM TYPE TDSFNAME VALUE 'Your smartform name here',  "here comes the smartform name
        VARI TYPE TDVARIANT,
        ACTV TYPE TDBOOL VALUE 'X',
      END OF %FULLNAME.

@Arunima

Hope you haven't read the question carefully

Regards

Karthik D

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Markus,

Please check the table STXFADMI.

Here put the numeric part of the FM-name to the field FMNUMB.

If you give me the FM-name i can make my suggestion more clear.

Else you can make use of the technique as suggested by Karthik )

BR,

Suhas

Edited by: Suhas Saha on Dec 22, 2008 12:14 PM