Thursday, 14 July 2016

Dynamic FM call with extra parameter

Use Case 


Consider the scenario in your development, you are reusing a standard FM in your program which is having 2 mandatory import parameters . And you shipped the solution to the customer. Now same FM in the customer system is having one more additional mandatory importing parameter. Now when your program runs and that calls the FM the dump appears in customer system. How to resolve this issue. This can be done by calling the FM dynamically with extra parameter that is not in your system but it is there in customer system. The below post tries to show the same.

The  FM ‘FPM_DEMO_FLIGHT_GET_CARRIER’ having below details as one import and one export parameter.

Dynamic FM call with extra parameter

Dynamic FM call with extra parameter

Dynamic FM call with extra parameter

Simple way of calling the FM.

Dynamic FM call with extra parameter

Output of program.

Dynamic FM call with extra parameter

In the simple call pass one more parameter like CONNID which is not declared as a import parameter in the FM definition.

Dynamic FM call with extra parameter

No activation error of the program but once you execute below error appears.

Dynamic FM call with extra parameter

Trying a dynamic call to the FM without any additional parameter.

Dynamic FM call with extra parameter

Program output:

Dynamic FM call with extra parameter

With dynamic FM call, added other parameter which is not there in the FM definition.

Imagine in your system CONNID parameter is not defined, but the FM call works fine without any error but if it is defined in the FM then surely there would not be any dump.

Dynamic FM call with extra parameter

Here is the output without any dump.

Dynamic FM call with extra parameter

No comments:

Post a Comment