Monday, May 23, 2011

Creating a Function Module

1. Open SE37 transaction.

Go to Goto à Function groups à Create group.

2. Give the function group name and short text. And click on Save.

3. Save this function group as local object.

4. Then open the transaction se80 and select the ‘Function group’ from the drop down list. Enter the function group name. Press Enter.

5. Right click on ZSSR and press activate.

6. Then you will get the following screen. Press Enter.

7. Go to the transaction se37 again and click on create.

8. Now it will ask for the function group. Enter the function group and give the short text. Press Save.

9. Click on the Attributes tab and give the short text.

10. Click on the Import tab and enter the Parameter name, Type and Reference type of variables A and B.

11. Click on Export tab and enter the Parameter name, Type and reference type of RES.

12. Click on Exceptions tab and enter the Exception and short text for that exception.

13. Now click on the Source code tab and write the following lines as shown bellow.

14. Press syntax check button or Ctrl+F2.

15. Now press on Activate button or press Ctrl+F3.

16. Press Enter.

17. Now Press on Test button or Press F8.

18. Enter values for A and B. And press Execute or F8.

19. The following screen will be displayed with result.

20. If you enter A value as 5. it will throw exception.

21. Output with Exception.

22. Now create and enjoy more Function Modules.

No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)


Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials