Steps:
- Go to transaction code SE37.
- Enter the function module name start's with Y or Z<function module name> and click on create button.
- Enter the function group name.
- Enter the short description.
- Click on SAVE button.
- Pop-up will appear. Click on continue.
- Click on attribute tab and select Normal Function Module.
- Enter the import parameters.
- Enter the export parameters.
- Click on exception tab and enter the exceptions.
- Click on source code tab.
Source code
IF NUM1 IS INITIAL AND NUM2 IS INITIAL.
RAISE INITIAL_VALUE.
ELSEIF NUM2 IS INITIAL.
RAISE DIVIDE_BY_ZERO.
ELSE.
RES = NUM1 / NUM2.
ENDIF.
RAISE INITIAL_VALUE.
ELSEIF NUM2 IS INITIAL.
RAISE DIVIDE_BY_ZERO.
ELSE.
RES = NUM1 / NUM2.
ENDIF.
Steps
- Go to transaction code SE38.
- Enter the program name start's with Y or Z<program name > and click on create button.
- Enter the Title.
- Select Attribute Type as Executable Program.
- Click on save button.
- Enter the source code ,
To call function module
- Click on Pattern .
- Pop-up will appear.
- Enter the function module name and click on create.
No comments:
Post a Comment