2009 Sep 11 7:51 AM
Hi,
Is there any way of passing the INCLUDE name dynamically?
Scenario is as follows
Requirement is to consolidate approx 6 enhancements (user exits) of the same name from 6 different systems into 1system . Objective is to put each of the code in an INCLUDE and then call the relevant INCLUDE based on some data maintained in a z-table
Z-table would have entries like this
Scenario Include
S1 I1
S2 I2
S3 I3
.......
Hence final enhancement code should read the entry from z-table and accordingly pass the relevant INCLUDE name
INCLUDE <include name from z-table>
Valuable suggestions are needed.
Poonam
Hi,
Is there any way of passing the INCLUDE name dynamically?
Scenario is as follows
Requirement is to consolidate approx 6 enhancements (user exits) of the same name from 6 different systems into 1system . Objective is to put each of the code in an INCLUDE and then call the relevant INCLUDE based on some data maintained in a z-table
Z-table would have entries like this
Scenario Include
S1 I1
S2 I2
S3 I3
.......
Hence final enhancement code should read the entry from z-table and accordingly pass the relevant INCLUDE name
INCLUDE <include name from z-table>
Valuable suggestions are needed.
Poonam
2009 Sep 11 8:02 AM
Hi Poonam,
<li> Create one function group.
<li> Write your 6 includes code in 6 function modules. function module is nothing but include in Function group.
<li>Try to give importing and exporting parameters are same.
<li>Try the below way.
Thanks
venkat.O
REPORT ZTEST_NOTEPAD.
DATA: BEGIN OF IT_FUNC OCCURS 0,
NAME TYPE RS38L-NAME,
END OF IT_FUNC.
"Build your it_func with function modules.
LOOP AT IT_FUNC.
CALL FUNCTION IT_FUNC-NAME "You can call fm dynamically
EXPORTING
DAY_IN = IMPORTING
LAST_DAY_OF_MONTH = EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2.
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.
2009 Sep 11 8:50 AM
Hello Poonam,
In your project we use this concept as well & we named it a sweet "User Exit Strategy" )
In the Z-Table instead of maintaining the INCLUDE names, maintain FM names as suggested by Venkat.
Scenario FMName
S1 FM1
S2 FM2
S3 FM3
Select the FM name based on the scenario & call the FM in your user-exit.
BR,
Suhas
Tip: The FM params have to be same as the SAP provided Exit Module.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |