ABAP Coding

Home / SAP / Archive by category "ABAP Coding"

SAP Service Management – User Exits – Maintenance Plans

Now, this is a section that I have not dug into.  I have yet to use user exits for the maintenance plans, but truly, I haven’t used maintenance plans a whole lot.  I tend to do prototypes for companies, and initially, they are interested, but don’t like the manual effort of getting them setup, especially if you have a large volume of equipment.  Anyway, it’s still good to have these user exits in your back pocket, just in case.  So I hope you can find these useful.

Enhancement Description
IPRM0002 Determine planned date info for maintenance plan
IPRM0003 User field: Maintenance plan
IPRM0004 Maintenance plan / item: Customer check for time “SAVE”
IPRM0005 Determine Offset for Performance-Based Strategy Plans

Thanks for reading,

SAP Service Management – User Exits – Service Orders

Well, the next set of user exits I wanted to document are the service orders.  I’ve used several of these in my time consulting (many of them I have never touched).  As always, you never know when you might need one.  So, without further typing…  Here are the user exits for service orders (IW31/IW32/IW33/etc…)

Enhancement Description
CNEX0013 Order: Cust. enhancement: Default item category comp. assgmt
CNEX0026 Customer enhancement for general inspection of material
CNEX0027 Customer enhancement: Plant, storage loc. finding for comp.
COI20001 Changing of person found
COI20002 Alternative procurement of HR availability data
COOM0001 Customer Functions for Overhead Percentages
COOPA_01 Customer check modules for internal orders
COOPA002 Customer function for master data maint. – internal orders
COOPA003 User-Defined Fields in the Order Master
COOPA004 Customer function: Print order master data
COOPA004 Customer function: Print order master data
COZF0001 Change purchase req. for externally processed operation
COZF0002 Change purchase req. for externally procured component
CYPP0001 Change sequence criteria and sequencing
ICSV0003 Partner selection
ICSV0004 Check PM object and display object information
ICSV0005 Determining reason for rejection – resource-related billing
ICSV0007 Serial Number Partner Transfer on Goods Issue and Returns
ICSV0008 Validation of additional partner types
IWMI0001 User exits for SM/PM IDOCs
IWO10001 Create a PM sub-order
IWO10002 PM maintenance order: Customer check for order release
IWO10004 Maintenance order: Customer check for order completion
IWO10005 Maintenance order: Cust.-specif. determination of profit ctr
IWO10006 Maint. order: Fcode exclusion through cust. enhancement
IWO10007 Maint.order: Customer enhancement – permits in the order
IWO10008 Cust. enhancement: Determination of tax jurisdiction code
IWO10009 PM Order: Customer Check for ‘Save’ Event
IWO10010 Maint. order: Cust. enhancement for determining WBS element
IWO10011 Maint. order: Customer enhancement for component selection
IWO10012 Maintenance order: Priority handling on central header
IWO10015 Maintenance order: F4 Help for user fields on operation
IWO10016 PM Order: Cust. enhancement to check operation user fields
IWO10017 Determine external order number by customer logic
IWO10018 Maintenance order: User fields on order header
IWO10018 Maintenance order: User fields on order header
IWO10020 Maintenance order: Automatically include task list
IWO10021 Automatic task list transfer when creating order from notif.
IWO10022 Determine calendar from user exit
IWO10023 Service order: Change header data for advance shipment doc.
IWO10024 Service order: Changes to items for advance shipment
IWO10025 PM/SM order: Finding responsible cost center
IWO10026 User check on setting status ‘Do not perform’
IWO10027 User exit: Generate user-defined settlement rule
IWO10029 Inclusion of bill of material in PM/SM order
IWO10030 Predefining the fields for the profitability segment
IWO10031 Hide personnel number in PM/SM order
IWO10033 Customer-Specific Authorization Check Maint./Service Order
IWO10034 Operation status based on the status of capacity reqs
IWO20001 PM order: User exit to pass routing to order
IWO20001 PM order: User exit to pass routing to order
IWOC0001 Create PM/SM notification: Determine reference object
IWOC0002 PM/SM notification: Check whether status change is allowed
IWOC0003 PM/SM authorization check of ref. object and planner group
IWOC0004 Change single-level list editing PM/QM/SM ALV settings
PPCO0001 Application development: PP orders

 

Thanks for reading,

SAP Service Mangement – User Exits – Notifications

Well, back to my series on service management (and PM for that matter) user exits.  No need to go into a lot of explanations.  If you found this post, you were looking for a good user exit to solve some challenge.  Hope you find what you are looking for.

Enhancement Description
ICRP0201 Search Help CS_ORG_02: Authorization Check
ICRP0202 Search Help CS_ORG_02: Internally-Programmed Selection
ICRP0203 Search Help CS_ORG_02: Propose Task
ICSV0001 Display of geographic location data
ICSV0002 Automatic task determination for service notifications
ICSV0003 Partner selection
ICSV0004 Check PM object and display object information
ICSV0005 Determining reason for rejection – resource-related billing
ICSV0007 Serial Number Partner Transfer on Goods Issue and Returns
ICSV0008 Validation of additional partner types
IWOC0002 PM/SM notification: Check whether status change is allowed
QQMA0001 QM/PM/SM: User Subscreen for Notification Header
QQMA0008 QM/PM/SM: User Subscreen for Additional Data on Notif. Item
QQMA0010 QM/PM/SM: User Subscreen for Additional Data on Cause
QQMA0011 QM/PM/SM: User Subscreen for Additional Data on Task
QQMA0012 QM/PM/SM: User Subscreen for Additional Data on Activity
QQMA0014 QM/PM/SM: Checks before saving a notification
QQMA0015 QM/PM/SM: User-Exit before Call-Up of F4 Help on Catalogs
QQMA0016 QM/PM/SM: “User data” Function “Goto” –> “Task” Menu
QQMA0017 QM/PM/SM: “User data” Function “Goto” –> “Activity” Menu
QQMA0018 QM/PM/SM: Deadline setting based on entered priority
QQMA0019 QM/PM/SM: Default Partner when Creating a Notification
QQMA0021 QM/PM/SM: Function “User data” in “Goto” menu
QQMA0022 QM/PM/SM: “User data” function in “Goto -> Causes” menu
QQMA0023 QM/PM/SM: “User data” function in “Goto -> Item” menu
QQMA0024 QM/PM/SM Deactivate function codes in CUA menu
QQMA0025 PM/SM: Default values when adding a notification
QQMA0026 PM/SM: Auth. check when accessing notification transaction
QQMA0027 PM/SM: Default values when adding a task
QQMA0029 QM/PM/SM: Change Notification Type
QQMA0030 Check validity of status change

Thanks for reading,
Piehl

SAP Service Management – User Exits – Technical Objects

One of the things I never blogged about is the many user exits that service has to offer.  Like all good consultants, this is a last resort, but inevitably, you will need these from time to time.  So I’ll be putting out some posts with the user exits I have found for the different areas that service management touches.  Hope you find these as useful as i have.  Many of these I have not personally used, but just being to run through the list and get an idea of where to look has been invaluable in my career.

Thanks for reading,

Enhancement Description
ICSV0001 Display of geographic location data
ICSV0003 Partner selection
IEQM0001 Add. checks for equip. installation at functional locations
IEQM0002 Additional checks for definition of equipment hierarchies
IEQM0003 Additional checks before equipment update
IEQM0004 Object is allowed for contract partner (Order->MaintCont.)
IEQM0005 Object allowed for SD contract (MaintContract->MaintCont.)
IEQM0006 Object allowed for SD contract (Maintain maintenance cont.)
IEQM0007 Check/change manufacturer field in equipment master
IHCL0001 Create equipment using material template: Classes/chars
ILOM0001 Additional checks before saving a functional location
ILOM0002 User exit when checking structure of location numbers
IQSM0001 Automatic serial number assignment
IQSM0002 Check when copying object list
IQSM0003 Serial numbers, user exit for additional data
IQSM0004 Serial numbers, user exit after exiting the serial screen
IQSM0005 Serial numbers, user exit in the update
IQSM0007 Serial numbers, user exit for goods movements
IQSM0008 Serial number character string check
ITOB0001 PM: Customer include subscreen for techn. obj. master data
ITOB0002 ITOB: Field changes to copy model
ITOB0003 PM: Customer Include subscreen for fleet object data
ITOB0004 PM: Customer Exit fleet identification data: Checks

ABAP – Screen Design – adding a checkbox to a table control

So while building my new territory manager, I ran into a small piece that I forgot about.  Adding a checkbox to a table control.  Turns out, it’s pretty easy, but not exactly intuitive.  So, make sure you have a character based column, that is only 1 char in length.  Once you have that, you can do the following.

Right click on the column, select convert->checkbox-> either left or Right button.

it will then convert your character column to a checkbox.

Thanks for reading,

ABAP – S/4 – If Line_exists

Here’s another new one I discovered.  How often you do write a few lines of code to check if something exists?  For example, a common thing I do is look for an entry in a table?  If it’s there, I need to do something, if not, I move on. For example:

read table Lt_test transporting no lines with key key1 = val1 key2 = val2.

if sy-subrc = 0.

else.

endif.

Well, in S/4, that has been condensed.

if line_exists( lt_test[key1 = val1 key2 = val2]).

else.

endif.

you get to skip the read statement.  Now, if you need the contents, this might not help as much, since you would need to extract that line anyway, but if you are purely looking for the existence, then it’s a lot cleaner.

Thanks for reading,

ABAP – S/4 Concatenate

Here’s another fun little tidbit for the new coding in S/4.  If you want to concatenate a string together you used need to do:

CONCATENATE ‘X’ ‘Y’ into lv_var.

now you can do:

lv_var = ‘X’ && ‘Y’.

Even better, you don’t run into type mismatches either.  For example, if you have a time stamp, the value is in a packed format.  This means that you must first concatenate things into a string, then copy them to the final value.  with the &&, you can skip all that and do it in a simple one line statement.

ABAP really is getting better 🙂

Thanks for reading,

SAP – Coding in S/4 – Data Statements

I recently had the opportunity to see some code in S/4.  While the old code works, there are certainly some new things that simplify coding life.  One of the fun ones I learned is how you do a smarter data statement.  Here is my first example.  You take in a customer number in the internal format, but you want to convert it to the external format.  Here’s how I do it today:

DATA: lv_kunnr_out TYPE char10.
CALL FUNCTION ‘CONVERSION_EXIT_ALPHA_OUTPUT’
EXPORTING
input = i_kunnr
IMPORTING
output = lv_kunnr_out.

Here’s how you can do it in S/4.

* DATA(lv_kunnr_out) = |{ i_kunnr ALPHA = OUT }|.

Pretty slick.  it’s not gonna change the world, but it nice to make things more readable 🙂

Thanks for reading,

ABAP – Code Inspector Results

I must say, I was pretty happy with the results of the code inspector.  I was fearing I would have a LOT of rework, but it turned out to be a manageable number of errors/warnings/information.

The only errors I had were all the same message:

Large table X: No WHERE condition

And these revolved around some search help functions that I built for my UI5 applications.  So it was a simple matter of finding an appropriate field to include in the WHERE statement.

Aside from that, all of my warnings/information messages were the same as well:

Possible use of <internal table> without prior content check.

This is the more important one for me.  This is an instance where I populated an internal table, but didn’t check to make sure it was populated before using it in a select statement FOR ALL ENTRIES IN.

I’ve run into this before, and it’s caused crazy long run times before it reads the entire table.  Short story… BAD.  So this is a great way to make sure that I fix any outstanding issues.  It’s a very simple fix.  Add an IF statement around the Select statement to check that it is NOT INITIAL.  Problem solved 🙂

I highly encourage running this, even if you don’t plan to upgrade to HANA anytime soon.  It’s a good method to make sure your code is following some simple standards.

Thanks for reading,

SAP – Preparing your Code for S/4

I recently listened to a presentation from some developers that talked about preparing your development objects to move to S/4.  This obviously got my attention, since I want to move my add-ons to be on S/4.  Here’s what I learned.

Apply OSS Note:  2185390

For me, this was a bit more time consuming that I expected.  Because my system is behind the times, it means I had to apply a lot of notes before I could finally apply this one.  So it took me a few hours to gather up all the notes I needed, get them applied.

Next up, you need to create an index.  Here’s what the OSS note tells you:

Before Custom Code Analyzer (program SYCM_DOWNLOAD_REPOSITORY_INFO) can analyze your custom code, an up-to-date where-used index for customer objects as well as SAP objects is required in your system. Custom Code Analyzer will check whether the where-used index is up to date as first processing step and will raise an error log entry if it has to be updated.

In order to update the where-used-index for customer and SAP objects, run program SAPRSEUB as background job in the system to be analyzed.

Currently, in my system, I’m running the index.  It’s been going for almost 12 hours now.  Certainly due to my hardware, but regardless, give it some time.  Once that’s done, you can run the download repository (listed above).  It will give you a zip file listing the areas you need to look at.  I’ll be doing a follow up post on some of the common things I need to fix once I can run the program.

Thanks for reading,