0% found this document useful (0 votes)
14 views

abap sap

The document provides instructions on how to call a Smartform in an ABAP report using transaction SE38. It explains that SAP generates a function module for each Smartform at runtime, and outlines the steps to create a program that passes an employee ID to the Smartform. Additionally, it describes how to retrieve the function module name using the SSF_FUNCTION_MODULE_NAME function.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

abap sap

The document provides instructions on how to call a Smartform in an ABAP report using transaction SE38. It explains that SAP generates a function module for each Smartform at runtime, and outlines the steps to create a program that passes an employee ID to the Smartform. Additionally, it describes how to retrieve the function module name using the SSF_FUNCTION_MODULE_NAME function.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

ABAP

SMARTFORMS

Calling Smartform into Report


(SE38)

1. Introduction
Whenever we execute our Smartform, It directly navigates to SE37(Function Builder).

For Every Smartform, SAP will automatically generate a function module at the runtime.

Note :-

Contact: +91-9354575041 E: [email protected] W: www.srijaninstitute.com


If you change the contents of the smartform, then it is possible that the name of the
function module may change at the runtime, so it is not a good practice to use the same
function module of the smartform every time.

2. Calling Smartform into the Program


Step 1 :- Create a executable program in ABAP Editor ( SE38 ) transaction code.

Step 2 :- Since, we are passing employee id as an input to our smartform so, for that we will
create a parameter for the same.

Step 3 :- Since, we have already discussed that for our smartform, SAP automatically creates
a function module, so we can use it directly in our program.

Contact: +91-9354575041 E: [email protected] W: www.srijaninstitute.com


Execute the Program :-
Press F8 to execute the code and pass employee number = 103 as input and press f8.

Contact: +91-9354575041 E: [email protected] W: www.srijaninstitute.com


How can we know the name of our function
module using the name of the smartform ?
It is possible that someone can ask you that how can I know the name of my function
module, if I have the name of smartform.
For knowing the name of the function module, we use

SSF_FUNCTION_MODULE_NAME

Here, using FM_NAME we can import the name of our function module.

and we can pass it instead of the function module for our smartform.

Code

Contact: +91-9354575041 E: [email protected] W: www.srijaninstitute.com


PARAMETERS : p_emp_id type ZAR_EMP_ID.

DATA : lv_function_module type RS38L_FNAM.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'


EXPORTING
FORMNAME = 'ZSMARTFORM'
* VARIANT =''=''
* DIRECT_CALL
IMPORTING
FM_NAME = LV_FUNCTION_MODULE
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS =3
.

CALL FUNCTION LV_FUNCTION_MODULE


EXPORTING
* ARCHIVE_INDEX =======
* ARCHIVE_INDEX_TAB = = 'X' =
* ARCHIVE_PARAMETERS P_EMP_ID
* CONTROL_PARAMETERS
* MAIL_APPL_OBJ
* MAIL_RECIPIENT
* MAIL_SENDER
* OUTPUT_OPTIONS
* USER_SETTINGS
P_EMP_ID
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
EXCEPTIONS

Contact: +91-9354575041 E: [email protected] W: www.srijaninstitute.com


FORMATTING_ERROR = 1
INTERNAL_ERROR = 2 SEND_ERROR = 3
USER_CANCELED = 4 OTHERS = 5 .

Output

Contact: +91-9354575041 E: [email protected] W: www.srijaninstitute.com


Contact: +91-9354575041 E: [email protected] W: www.srijaninstitute.com
M: +91 9354575041 / +91 8497059090
E: [email protected]
W: www.srijaninstitute.com

Contact: +91-9354575041 E: [email protected] W: www.srijaninstitute.com

You might also like