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

Former Member
0 Likes
478

Hi Gurus,

I am developing smartform. For that am calling the smartform in the loop. So while printing it is coming one page and when i press back it is showing another page. Instead of that can i get all the pages at one time? Is there any option for that? For that we can do by passing all the internal table into the smartform and we can check there. But i dont want to modify the smartform. Here am attaching my code.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZPAY'

IMPORTING

FM_NAME = V_FORM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

***********CALLING THE FM TO DISPLAY PAYSLIP

LOOP AT IT_RT-ZPAY INTO ZPAYROLL1.

CALL FUNCTION V_FORM_NAME

EXPORTING

RT = ZPAYROLL1

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.

ENDLOOP.

Points will be awarded

Regards

Ravi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
444

Hi Ravi,

you have to use function module SSF_OPEN and SSF_CLOSE also with the same.

For complete help you can check the code of standard example program for Smartforms "SF_EXAMPLE_03".

reward points, if helpful,

Sandeep Kaushik

3 REPLIES 3
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
444

Hi,

This is because you are calling the smartform in loop.There you are passing only record each time.

***********CALLING THE FM TO DISPLAY PAYSLIP

LOOP AT IT_RT-ZPAY INTO ZPAYROLL1.

CALL FUNCTION V_FORM_NAME

EXPORTING

RT = ZPAYROLL1

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.

ENDLOOP.

Instead of that pass the entire table and get the entire in smartform and then loop the table in smartform for display.

Check this link.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501...

Read only

Former Member
0 Likes
445

Hi Ravi,

you have to use function module SSF_OPEN and SSF_CLOSE also with the same.

For complete help you can check the code of standard example program for Smartforms "SF_EXAMPLE_03".

reward points, if helpful,

Sandeep Kaushik

Read only

0 Likes
444

Hi Sandeep,

Thanks a lot for your valuable answer. Until now i dont know there is option for smartform like START_FORM in scripts. Thanks for your valuable answer.

Thanks

Ravi