Skip to Content
author's profile photo Former Member
Former Member

Updating Extractors Suggestion-- What do you think?

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on May 03, 2005 at 03:29 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • Posted on May 06, 2005 at 12:28 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Sachin,

      You need not call a form routine. Simply call a FM dynamically with the convention I noted. In the FM:

      "loop at tab. do your thing. modify tab. endloop."

      TAB should be defined as an internal table like the transfer structure. Make sense?

      Ken

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.