Quantcast
Channel: SCN: Message List - ABAP Development
Viewing all articles
Browse latest Browse all 10425

Re: SMARTFORMS

$
0
0

Happy,

 

You're almost there, you just need to call a second FM.  The FM 'SSF_FUNCTION_MODULE_NAME' does not print the smartform.  It returns the name of the FM that will print the smartform, data type rs381_fnam.  There is no difference between FM_NAME or FNAME, you can call the variable whatever you want.

 

Try this code:

 

 

TABLES : MARA.

 

DATA : ITAB LIKE MARA OCCURS 0 WITH HEADER LINE.

 

* Add this variable, it's the name of the FM to call

DATA:  G_FM_NAME TYPE RS381_FNAM. 

 

SELECT-OPTIONS : MATERIAL FOR MARA-MATNR.

 

SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE MATNR IN MATERIAL.

 

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

  EXPORTING

    FORMNAME                 = 'ZSFORM_HAPPY'

*   VARIANT                  = ' '

*   DIRECT_CALL              = ' '

IMPORTING

   FM_NAME                  = G_FM_NAME "Make sure and uncomment this!

* 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.

 

*This is the Second FM Call

CALL FUNCTION G_FM_NAME

  EXPORTING "Add the parameters of your smartform here

  TABLES "Add table parameters if you have them

*  EXCEPTIONS "Add exceptions if you want

.

 

 

This will print the smartform.

 

Best,

Eric


Viewing all articles
Browse latest Browse all 10425

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>