Q and A


Michael Koch on customizing SAP Sales and Distribution with ABAP (Q&A transcript)

by Kristine Erickson

SAP mentor Michael Koch (@pixelbase) recently took questions in our SCM forum on ABAP techniques for customing SAP Sales and Distribution (SD). 

In this forum, moderated on November 8 by SAPexperts editor Antoine Cadot-Wood (@antoineWIS), Michael answered questions on topics such as adding custom fields and tabs to sales order headers,  as well as pricing conditions, APO checks, and pop-up messages.

You can review all the posts on the SCM Forum page, or read our edited transcript from the Forum discussion here:

Antoine Cadot-Wood: Welcome to today’s Forum!

Thanks for joining us today, and I’m delighted to have Michael Koch here, taking questions today on using ABAP to enhance your Sales & Distribution processes.

Michael Koch is an SAP mentor, consultant, and author of the new book: ABAP Development for Sales and Distribution in SAP: Exits, BAdIs and Enhancements.  Today, he’s taking your questions on this same topic.

Michael, welcome! I have some questions of my own, but I see there’s a question in the forum already, so we can get started right away.


Simonevanbroekho: What's the best way to add custom specific fields to one of the sales order header screens?

Michael Koch: Hi Simon,

To my knowledge, there are no immediate screen exits for the sales order header. For such an enhancement, there are some points to question and keep in mind:

- Would it be possible to move the additional field in the Additional Data B tab in VA01/02/03?

- Remember to include the field into the VBAK/VBAP structures, ie customer includes (CI), which will mean these are accessible in the code for you

- To some degree, you will have to make screen mods, even if you use the Additional Data A/B tabs, since screen flow is not part of the Enhancement Framework.

- If you choose to have the new field in the actual header tab area, then you will most likely be looking at some sort of modification. The coding for it (PAI, PBO) could be put into implicit enhancements though.

I hope this helps as a starter for 10.


Antoine: We all are fans here of the way you’ve set up the book, following an experienced consultant with limited ABAP understanding with a young but highly skilled ABAP developer.

First, let’s dispel any rumors: were you thinking of anyone in particular in your creation of Sean, the consultant? And more seriously, any pitfalls in these roles that you want SAP project teams to avoid?

Michael Koch: You don't know how many times people have asked me this now! :-)

Over the course of the years, you meet so many different types of consultants, I guess Sean and Christine are a mixture of many characters I have worked with professionally over the years.

But seriously, I think both characters show how much different types of consultants can work and learn from each other. I wanted to cross this geeks/suits divide a little bit and show, that you can only solve problems these days by working together and showing respect for functional and technical expertise, as both can be vast within SAP.


Phil: Is there a way to add your own tab to the header and or item in case Additional tab B has already been used? I see SAP has done this depending on the IS solution you install but wondering if this is possible by customers.

Michael Koch: Hi Phil,

My thinking is that this would have to be accomplished with a screen mod, I am afraid.

In terms of IS, if you are in the process of providing a framework of enhancements that you actually roll out to your clients (I know Healthcare can be an example for this), then it would make sense to create your own set of enhancements for such an additional "tab C". SAP's Enhancement Framework allows this.

WilliamTupy: Hello, I had a question related to pricing. We have some pricing conditions related to inco terms on a sales order. However when those inco terms change the pricing isn't being updated, even when you save the order. It appears the only way to update the pricing is to run update pricing from the conditions tab. Does that seem correct?  If so can you recommend an exit/bapi we could use to force pricing to update when saving the order?

Michael Koch: Hi William,

From what I remember, pricing has to be re-triggered from the conditions tab and that's "standard behaviour" (I hate that phrase, by the way :-) ) .

I am not sure whether you can trigger re-pricing from an exit. My guess is that you might have to save the order again or at least simulate it (there is a function module for it). However, let me get back to you on this one.


Option for entry of preconditions for carrying out pricing again (e.g. changes to the customer group or price group could be set as the preconditions for the system to carry out pricing again). Further information in MV45AFZB

In this user exit, you should be able to trigger re-pricing when Incoterms change.

Michael Koch: Excellent!

You might have to check for the actual change in INCOterms, but apart from that this user exit sounds as if it should be right for your requirement.

Thanks for the response!

MaggieAller: There is a user-exit to force pricing changes.  MV45AFZB


Michael Koch: I think this is brilliant and a really good example for something I am touching on in the book  - that is that "there is no silver bullet".

Some people sometimes ask me: "What do I need to do in scenario A, which exit should I use there?” Very often the answer is "it depends", as there are different Exits, BAdIs and Enhancements available to deal with a particular problem.

I think a good way, which I tried to describe in the book, is to search for packages via SE80 to find the actual range of enhancements that deal with the area you need to find a resolution for. Then, within this, you need to check whether i t will be called at the right point in time, i.e., before/after a database commit or before/after a message is given out to the user.

As with the example with the re-triggering of pricing, there might be a difference in timing for these exits that the consultants have to establish first. Hence, "there is no silver bullet" and usually there are many options to achieve the same thing.


Isaiasvelazquezrey: Hi everyone,

Talking about user exits, do you know if there is one which can change the determination of the Request Delivery Data in the sales orders?

Michael Koch: Hi there,

What do you mean by "request delivery data"? Do you mean as in vendor delivery data, for example?

Isaiasvelazquezrey:  In the schedule line of an item position, it's the date when you are going to deliver the material. Is there a user exit to implement custom behavior in addition to the process of forward and backward scheduling?

Thank you

Michael Koch: OK, so you are looking for an enhancement or exit that allows you to trigger custom logic to determine the requested delivery date?

Isaiasvelazquezrey: Yes, Michael

Michael Koch: Isn't the requested delivery date something that was given to you by the customer? If I remember correctly, the redetermination would be done on a different field, but I could be wrong.. I think the redetermined date should come out of your ATP check, but that's just an idea on the top of my head.


Charles Folwell: When we create a sales order in batch, and APO is down for availability check, we get mixed results.  We would like to know a way to determine if APO is down programmatically before saving the order.

Michael Koch: Hi Charles,

I would solve this with a custom RFC function module between systems, which determines whether APO availability check is down or not.

Not an expert in APO, but there might actually be a Function Module for this in APO already that you could call from your ECC system. If it is not RFC enabled, you could wrap it in an RFC shell FM within APO.

Hope this helps,

Charles Folwell: Where would we make this call to a custom function module?

Michael Koch: I would do the call just before the sales order batch creation is committed to database, basically use of the exits that are run through before the commit, so you know whether you ATP check is using APO data or not. This will also help you with performance.


WilliamTupy: We have another question related to sales order messages that pop-up. Is there a way to trigger pop-ups in VA02?  These pop-ups are only showing up in VA01 but in the case of EDI orders we need them to appear in VA02 since that is the first time a person is viewing the order.    An example is material determination or order text.  Thanks!

Michael Koch: Hi William,

I am wondering about the reason why these are not triggered in VA02. What about the EDI processing that probably happens in the background? Couldn't you capture the messages there and display them to the user in a different way? Or potentially add them to an incompletion log?

Just thinking of actually sourcing the original messages from where they originated (ie the interface).

Hope this makes sense.

WilliamTupy: Thank you.  We are capturing the text messages and making them part of the incompletion log.  We were wondering if there was another way to approach this.

Is there a way to force material determination to re-run?

Michael Koch: I can't think of anything, really, but maybe worthwhile trying the Function Module to "simulate" a sales order, which basically does everything a sales order create/change does, but without the database commit.

This BAPI might be able to throw back the error messages for you. However, you would have to trigger this during normal sales order change processing (VA02), which could be a little costly in terms of performance.

Can't think of anything else right now - hope this helps :-)


Isaiasvelazquezreyes: In your experience, which skills you consider a "must have" for a good SAP consultant?

Michael Koch: "SAP Consultant" is probably a very broad description! In terms of skill sets you probably have to differentiate between end-user and consulting (at least).

Very generally speaking, I always value the ability to communicate and relate to people very high. The most successful consultants I have come across are able to sit down with users and key process owners and "talk their language" and empathise (very good workshop on that at SAP TechEd, by the way) with them. In other words, in order to be successful generally, you need to know more than code and applications. It's being good at "the glue" between people that is also a decider for a successful career, in my opinion.

Hope this assists a little.  :-)


Michael Koch: One thing I wanted to point people to are the more advanced chapters in the book regarding CRM BOL programming and SOA Webservices.

With these chapters, I wanted to push the envelope a little and show that SD can also reach other and use newer technologies and paradigms, yet still be enhanced using known extension frameworks (BAdIs, Enhancement Framework).

Go and check it out!


Antoine: We are at the close of the Forum and are wrapping up questions now. Thanks to all who posted questions and followed the discussion!

Thank you again to Michael Koch for the great advice and tips. You can continue to follow Michael at his blog and on Twitter @pixelbase. A full summary of all the questions will be available here in the SAP SCM Forum, and in Insider Learning Network’s SCM Group. If you have registered for this Q&A, you will receive an email alerting you when the transcript is archives past Q&As on SCM as well as ABAP, and we'll continue to update you on future live Forums. If you have a specific question, you can also post your own question for the entire community by selecting "New Thread" in the SCM Forum.

For more advice on SD enhancements and technical tips for SCM and CRM, I invite you to visit  If you ’re not yet a subscriber, you can sample an article here.

Thanks for joining us!

An email has been sent to:

More from SAPinsider


Please log in to post a comment.

No comments have been submitted on this article. Be the first to comment!