Skip to Content

Transaction IW2n (i.e. IW21-23) can be configured with a custom extra tab and multiple subscreens can be placed on this custom tab. 

The exits to bring data to and from these subscreens are in the XQQM function group.

SAP drives the update of QMEL and related tables from various global structures that can be modified by the code in the XQQM subscreen exits. (not the subscreen PBO’s and PAI’s – the ZXQQMU07 and ZXQQMU08 includes.)

For example, the global structure to update the QMEL table is defined off the SAP-delivered view VIQMEL, and this view includes all of the columns in QMEL.

Since SAP drives its QMEL update off VIQMEL, and since VIQMEL will include any custom QMEL columns added in an append structure to the QMEL table, SAP will automatically update QMEL correctly with any custom data on the custom subscreens, so long as the custom data from the subscreens is moved into the global structure variables i_viqmel and e_viqmel.  (I don’t think both are necessary – it’s probably one or the other, but I haven’t bothered to read the code to figure out which.)

So in effect, the exits in XQQM will allow you to do a custom update of an QMEL append structure directly in the IW2n transaction.

Call this Alternative I.

Alternative II is to implement the SAP-provided BAdI NOTIF_EVENT_SAVE, which is specifically provided to change notification data during any save.

Under this alternative, the custom data developed in the XQQM subscreens are exported to memory (shared buffer), and then imported by the BAdI, which then updates the custom append structure in QMEL.

So the following general and particular questions arise:

1) General: Which is “better” – Alternative I or Alternative II? (Please feel free to cite whatever reasons you like here, but to avoid repetition, please see the “particular” questions (2) and (3) below before answering this question.)

2) Particular: Since Alternative I is dependent on SAP keeping the IW2n mechanics what they are today, is it “safer” to use Alternative II (the BAdI approach) because SAP guarantees that it will keep this BAdI upward compatible with any changes it makes to transaction IW2n, whereas SAP doesn’t guarantee that it will keep customer exit code compatible with changes it makes to IW2n.

3) Particular: Since Alternative II is object-oriented (relies on an ABAP Objects implementation of a standard SAP interface via a custom class), isn’t it “better” to use Alternative II on general principles, e.g. the fact that SAP wants its customer base to move toward ABAP Objects wherever and whenever possible?

To report this post you need to login first.

15 Comments

You must be Logged on to comment or reply to a post.

  1. Suresh Datti
    simply b’coz there is no guarantee how far the User exit will be supported.. When you can meet your reqt with either of them, it is better to go for the BAdI (especially if it is multiple-use) to get in sync with the OO approach.. I do remember reading somtime back that sooner or later all the USer Exits would be phased out with BAdIs.. Even with the BAdIs, you have the classic BAdIs & those in the all-new EnhancementFrameWork..
    (0) 
    1. David Halitsky Post author
      Suresh – you read my mind as usual.

      Those comments are exactly what the doctor ordered !!!

      Thank you very very much.

      Kind regards as usual
      djh

      (0) 
    2. David Halitsky Post author
      So in this particular case, if they phase-out the two customer exits that handle the subscreens, they’re gonna have to replace these with a “dialog” BAdI, just like the existing BAdI handles the update task side of the picture.

      Or do you think SAP will develop a non-BAdI approach for handling custom subscreens that is still object-oriented?

      (0) 
    3. Anonymous
      Typically we go for BADIs whenever possible.

      However I always like the comment that “xxx” technology will be phased out by SAP.  We can find countless examples where SAP is going to phase things out.  However as you get into the new versions (ERP 6.0) all of this technology still remains.

      We now have at least 4 supported “technologies” for User Exits/Enhancements.  Form Exits are still supported, CMOD/SMOD exits are still supported, classic BADIs are still supported and now we have the new enhancement framework.

      If we look at form technology, SAPScript is still around even though SAP has now moved onto Adobe Forms.

      I think anytime you have to decide between old and new ways of doing things, you should always lean to the new, however sometimes it might not make sense.  And the good news is that with CMOD/SMOD exits, and BADIs, SAP always provides a way to migrate to the new if they phase the old out.

      Best Regards,

      Chris H.

      (0) 
  2. Peter Inotai
    Hi David,

    In case of Badi you will have the possibility to migrate your existing Badis to the new Badis, which will improve performance.
    For details check page 36 from the presentation Enhancement Framework from the ABAP Online meetup sessions.

    Best regards,
    Peter

    (0) 
    1. David Halitsky Post author
      Peter –

      I’m sorry to seem lazy but I’m trying to establish a framework for discussion at the client AND code a custom PM IW2n tab at the same time.

      So could I ask you or anyone else for a link to the full “Enhancement Framework” presentation that you mention ?

      Again, sorry to seem lazy here.

      Thanks very much again for pointing out that customer exits are now TWO, not ONE, generation behind the current SAP direction.

      Best regards
      djh

      (0) 
      1. Peter Inotai
        Hi djh,

        It’s available here:
        SAP NetWeaver -> Application Server -> ABAP
        ABAP Knowledge Center -> Key Topics -> Enhancements and Modification  – New Enhancement Framework, BADIs, BTE
        Getting Started -> Enhancement Framework – The New Way to Enhance Your ABAP Systems (PDF 460.3 KB)
        Oliver Mayer presented this content to the ABAP Online Meetup.

        Direct link, hope it works:
        https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9cd334f3-0a01-0010-d884-f56120039915

        Have fun 🙂

        Best regards,
        Peter

        (0) 
        1. David Halitsky Post author
          Peter –

          Thank you very much.

          I believe this is a critically important document for my current client to read, and any client confronted with the “Old Hippie” issue. (If you’re not familiar with the US C&W song about the “Old Hippie”

          He turned 35 last Sunday
          In his hair he found some gray
          But he still ain’t changed his lifestyle
          He likes it better the old way.

          So he grows a little garden
          In the backyard by the fence
          He’s consuming what he’s growing
          Nowadays in self defense
          He gets out there in the twilight zone
          Sometimes when it just don’t make no sense.

          He gets off on country music
          ‘Cause disco left him cold
          And he’s got young friends and a new way
          But he’s just to frickin old.

          And he dreams at night of Woodstock
          And the day John Lennon died
          How the music made him happy
          And the silence made him cry
          Yeah, he thinks of John sometimes
          And he has to wonder why.

          Chorus:
          ‘Cause he’s an old hippie
          And he don’t know what to do
          Should he hang on to the old
          Should he grab on to the new.

          He’s and old hippie
          This new life is just a bust
          He ain’t trying to change nobody
          He’s just trying real hard to adjust.

          He was sure back in the sixties
          That everyone was hip
          Then they sent him off to vietnam
          On his senior trip.

          And they forced him to become a man
          While he was still a boy
          And behind each wave of tragedy
          He waited for the joy
          Now this world may change around him
          But he just can’t change no more.

          Chorus:
          ‘Cause he’s an old hippie
          And he don’t know what to do
          Should he hang on to the old
          Should he grab on to the new.

          He’s and old hippie
          This new life is just a bust
          He ain’t trying to change nobody
          He’s just trying real hard to adjust.

          Well, he stays away a lot now
          From the parties and the clubs
          And he’s thinking while he’s jogging round
          Sure is glad he quit the hard drugs.

          ‘Cause him and his kind
          Get more endangered everyday
          And pretty soon the species
          Will just up and fade away
          Like the smoke from that torpedo
          Just up and fade away.

          Chorus:
          ‘Cause he’s an old hippie
          And he don’t know what to do
          Should he hang on to the old
          Should he grab on to the new.

          He’s and old hippie
          This new life is just a bust
          He ain’t trying to change nobody
          He’s just trying real hard to adjust.

          Yeah, he ain’t trying to change nobody
          He’s just trying real hard to adjust…

          Thanks again and kind regards
          djh

          (0) 
          1. Peter Inotai
            David,

            I’m happy that you found this doc useful.

            Thanks for the song, it has a nice lyrics. Unfortunaltey the “Old Hippie” issue is quite common in the ABAP world 🙁

            Best regards
            Peter

            (0) 
  3. Christopher Solomon
    I will let other here discuss and debate over the “better” solution. My only bit to add to this is that over the years, I have all to often seen where SAP has at times moved the location of user exits with new versions, service packs, hot fixes, etc. More often than not, this leads to some highly undesirable effects (read as “developer has to hunt for a new user exit to stick their code in or modify the logic in the one being user”). So that is my only warning on relying to heavily on user exits. Other than that….continue on with the debate. =)
    (0) 
  4. Dirk Herzog
    First of all I don’t know the transaction but I’d go for the BAdI for a simple reason. Once SAP develops a replacement for the transaction (e.g. a service) it might likely support the BAdI but will probably not support the exit.

    Dirk

    (0) 
    1. David Halitsky Post author
      Dirk –

      Thanks for taking the time to reply!

      Agree 1000%.

      That’s why I keep boring everyone here at SDN with repeated posts about how the SOA mindset can and must be built in clients’ minds even before they can implement SAP ESOA – when they are still in the ABAP/OO-centric BAdI world (and the slightly newer Enhancment world mentioned by Peter in this thread.

      Best regards, as always.
      djh

      (0) 
  5. David Halitsky Post author
    As a result of the responses which SDN’ers were kind enough to take the time to post to this blog, I was able to post the following entry with confidence in the client’s DevLog regarding progresson an important emergency custom PM enhancement that the client needs done yesterday:

    **********************************************
    DJH 7/13: Estimated date in production now moved to 9/10 from 9/3, due to decision to use SAP-provided BAPI for update of notification “long texts” from changes made on new custom tab.   Use of this BAPI may result in less than a 5-day delay (e.g. only 1 or 2 days), but when working with SAP BAPI’s for the first time, it is always better to estimate conservatvely.

    See explanation below for rationale behind decision to handle longtext updates via SAP-provided BAPI. 

    Explanation:

    We will be calling the SAP-delivered BAPI BAPI_ALM_NOTIF_DATA_ADD  from within the the SAP-delivered BAPI Interface IF_EX_NOTIF_EVENT_SAVE (method CHANGE_DATA_AT_SAVE) in order to update notifications with all four kinds of changes to long texts that can be made when the SAPScript editor is invoked from our custom tab. That way, all updates to SAP (custom columns in QMEL and notification long texts) will be handled by SAP-approved processes with no subversion of SAP code.  This will minimize the risk of SAP refusing to provide support for PM transactions due to our customization.  (For example, [client] had to pay for SAP support to fix a recent problem involving Goods Receipt Slip printing, but did not have to pay for SAP support to identify a Functional Team config error resulting in a problem with QM Inspection Instruction print – the difference is that SAP code was subverted in the first case but was not subverted in the second case.)

    Additionally, it will give us familiarity with the correct BAPI to add long texts to notifications, so that in the future, we will not have to use BDC’s (as we did in the original and revised versions of the emergency maintenance order program.)

    Additionally, this will segregate all update functionality of our custom enhancement from the actual screen exits, thereby minimizing changes that will have to be made in the future if and when SAP changes theses exits (or eliminates them entirely when the PM transactions are rewritten as SOA services.)  According to expert advice received at SDN here:

    Which carries stronger SAP “guarantees”: BAdI’s or Exits?

    this is an extremely important consideration (under the assumption that [client] will be relying on this custom PM enhancement for a long time into the future.)

    So at this point, [client’s] only “exposure” from this PM custom enhancement is the exposure that would result if [client] decides to drive the text control of the first subscreen from the SAP-provided pushbotton that is off the custom tab, rather than a pushbutton on the custom-tab.
    ***********************************************

    Without the expert informed opinion I got from SDN, it would be much more likely that my point of view might be dismissed as just “one person’s opinion.”

    So to me, this illustrates the notion of “SDN community” in a true and meaningful way – a place where folks can find out if they’re thinking in the right way or the wrong way …

    Thanks again, folks.
    djh

    (0) 
  6. Kenneth Moore
    Use the BADI.  SAP is/has been migrating to BADI’s.  So naturally you will want to use the latest/greatest to keep up with the times.

    PS: You should try the KISS method when blogging sometime.  Keep It Simple Silly (or Stupid if you prefer).  Wrestling through your cluttered vocabulary and tech terms to get to the actual question is tiresome.  And trust me, that is not impressing anyone in this forum.  Just some straight-shooting, friendly advice ;-).

    (0) 
    1. David Halitsky Post author
      Ken –

      Thanks for taking the time to respond.

      Reagrding your last comment, if I am the elitist which the SDN “community” thinks I am (according to one of its chief moderators and several of its leading members), why would I want/need to impress anyone here?

      Ken – “trust me” on this – I don’t. 

      But here’s some “friendly advice” back at ya … it’s never a good idea to confuse style with substance … although many are getting rich in the IT business doing just that. 

      Regards
      djh

      (0) 

Leave a Reply