on 05-03-2005 3:47 PM
A great idea for adding custom code to populate enhanced extractors via CMOD works like this. Get into the exit function and put the code below in. Any time you need to enhance a DataSource like 2LIS_11_VAITM, simply create a function module, ZBW1_2LIS_11_VAITM. This way, nobody needs to keep updating the CMOD function.
FUNCTION CODE SAMPLE:
data: wa like mc11va0itm.
loop at tab into wa.
logic to modify data
modify tab from wa.
endloop.
EXIT FUNCTION CODE SAMPLE
data : fm_name type rs38l_fnam.
data : fm_place_holder type rs38l_fnam.
clear fm_name.
concatenate 'ZBW1_' i_datasource into fm_name.
condense fm_name no-gaps.
Select single funcname
into fm_place_holder
from tfdir
where funcname = fm_name.
if sy-subrc is initial.
call function fm_name
tables
tab = c_t_data
exceptions
others = 1.
endif.
A reasonable mechanism, but two remarks from me, though:
1. Be careful in case you want to share variables (besides that vars in the interface) via COMMON PART logic: By your function call you are introducing a new program group, which may lead to strange effects regarding common part variables.
2. One drawback of dynamically calling function modules is, that you can not use the "Where used"-functionality of the ABAP tools with them.
Both points are no huge problems, but one should keep them in mind.
Best regards,
Bernd Sieger
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kenneth,
I am following the same procedure. But, the enhanced dataSource fields are not getting populated with data.
For calling the sub-routine from the exit, i am using PERFORM statement.
PERFORM Ffname in Pname tables I_T_DATA using I_DATASOURCE.
For form in program Pname,
FORM Fname tables I_T_DATA structure extractstr_name USING I_DATASOURCE.
Could someone help.
Thanks.
Message was edited by: Sachin Guptha
Hi Kennet,
does it really work? The idea is great according to me, because working in CMOD requires attention when developing different extractors enhancements ... in practice?
Best Regards
GFV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ken,
as explained in https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
only forum "answers" (or responses) are eligible for awards under the Contributor Recognition Program!
So it's true that the thread or "question" poster is responsible for awarding points but does not earn any for himself or herself.
What do you get out of it? You get answers, first and foremost. Furthermore, by taking the time to reward SDN members for their useful contributions, you foster the SDN community. It's a good-faith system that relies on you to reward points for helpful forum replies when you are the poster, and in turn you will be rewarded by others when they are doing the "asking."
About my suggestion (post it as a little weblog), take a look to https://www.sdn.sap.com/html/weblogs_about.htm
Bye,
Roberto
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.