4 1 1 1 1 1 Rating 80% (1 Vote)

This time it will not be about ABAP but about the way how to extend the time between installation of new license for you NPL instance that is run using Virtualbox and OpenSuse. 

 

Normally it's not a big deal to instal the license, but if you don't use your instance for a while and in the meantime the license has expired, the before you can do anything you need to login to your instance with SAP* user and update the license in SLICENSE transaction. This sometimes makes me a bit nervous. That's why I've setup my installation this way, that the time between OpenSuse and Windows host is not synchronized. This makes that instead of 3 months between installing new license you can extend this time even to year or more. 

Below you can find the way and prerequisites that are needed to achieve this.

Add a comment
Read more ...

5 1 1 1 1 1 Rating 100% (2 Votes)

You may saw before the article Create XLSX/MHTML file from internal table in background and you may have use it without any issues before, but it seems that in newer releases of SAP (definitelly >= 7.50) this way makes corrupted XLSX files. 

So I've rechecked again how it is done in ALV grid in the new NW releases and I've updated the code, so now the issue with corrupted file is solved.

The mothod is simplified as much as possible at the moment, at the end all you must pass to a method is your internal table, but you can also pass sorting, filter and layout criteria using ALV grid structures.

The definition of the method should look like this:

    class-methodscreate_xlsx_from_itab
      importing
                it_fieldcat      type lvc_t_fcat optional
                it_sort          type lvc_t_sort optional
                it_filt          type lvc_t_filt optional
                is_layout        type lvc_s_layo optional
                it_hyperlinks    type lvc_t_hype optional
        value(itdatatype standard table

      returning value(r_xstringtype xstring.

Add a comment
Read more ...

4.93103448276 1 1 1 1 1 Rating 99% (29 Votes)
To continue previous two posts about re-exploding and deleting subcontracting BOM of purchase requisition item, let me describe you how to do the same thing with subcontracting BOM of purchase order line.
 
The main part is again to use FM ME_COMPONENTS_MAINTAIN and ME_COMPONENTS_UPDATE_PREPARE , but this time there is no easy way to fill MDPA and MDLB structures which are needed here.
So I had to use CL_PO_HEADER_HANDLE_MM and IF_PURCHASE_ORDER_MM to fetch all data from purchase order and to move them to MDPA and MDLB structures. Once it was ready the rest was peanuts and I could get rid of using this two buttons :-)
 
 
Read more ...

4.93333333333 1 1 1 1 1 Rating 99% (30 Votes)
In previous post I've shown how to re-explode subcontracting components of purchase requisition using FM ME_COMPONENTS_MAINTAIN and ME_COMPONENTS_UPDATE_PREPARE . Using very similar code you can delete completly it's BOM. 
 
You may wonder why would need to delete subcontracting BOM? This is not possible in standard transaction ME52N and in most cases it makes no sense to have the subcontracting item without BOM. But in the case that you don't want that components are taken into consideration by MRP until you really need this then it could be helpful.
 
The code is 99% same like during the re-exploding the BOM, the difference is that FM ME_COMPONENTS_MAINTAIN is called with parameter i_vorga = 'D'  and message check at the end is bit different.
Read more ...

5 1 1 1 1 1 Rating 100% (32 Votes)
I faced lately a small issue in one of the process in our company, I needed to re-explode the BOM of subcontracting item in purchase requisition. Normally users goes to ME52N and press "Explode BOM" button, but I needed to do this from ABAP side. 
 
I started with IF_PURCHASE_REQUISITION but although there is a method "explode_bom" for item, then it was calling the screen with the results instead of selecting and updating components in the database. IF_BOM_MM didn't helped as well.
 
I started to dig in the standard transactions and local classes of ME52N and finally I have figure out how to do this in backgroud. The solution was to run FM ME_COMPONENTS_MAINTAIN and ME_COMPONENTS_UPDATE_PREPARE in correct way together with message handler to not interrupt whole process.
Read more ...

4 1 1 1 1 1 Rating 80% (2 Votes)
If you follow my blog, then you probably noticed that I'm not keen of SALV class, as it's not editable and you cannot handle all events that you can in cl_gui_alv_grid class. With a small trick you can make your SALV editable and you can handle all the events you want from underlying cl_gui_alv_grid object.
 
What you need to do, is to set handler for event after_refresh for all instances of cl_gui_alv_grid and to force refreshing of SALV just after creation of the object.  Then inside the handler for after_refresh event you can set up handlers for other events just for current instance and you can modify layout or field catalog settings to make it editable.
 
Please check following code to see example of usage:
Add a comment
Read more ...

5 1 1 1 1 1 Rating 100% (6 Votes)
Please be aware that accessing private or protected data may have unpredictible consequences! Use it at your own risk.
 
From time to time, it happens that you want to access private data or methods from CL_GUI_ALV_GRID, which is normally not possible.
 
When you look into the class definition you'll notice that there is only one global friend - interface IF_ALV_RM_GRID_FRIEND which has no attributes or methods declared. Quite strange, isn't it?
 
 
When you'll search were this interface is used then you'll notice that it's helping to get access to private grid data. So why not to use it the same way?
 
Read more ...

5 1 1 1 1 1 Rating 100% (11 Votes)
Everybody sends mails from SAP, some are still using old FM SO_NEW_DOCUMENT_ATT_SEND_API1 but some CL_BCS class. This class is really powerful but it has one disadvantage - it does commit work, and not only when sending emails but also during adding of attachments. In this case it's really not safe to use this class in BADIs or User-Exits, but there is one replacement for CL_BCS -> CL_BCS_MESSAGE. This class only collects the data, and when send method is run then calling a FM SBCS_SEND with destination NONE, or SBCS_SEND_UPDATE in update task, depending what attributes are passed to the class. It means you can use it also in BADIs or User-Exits where commits are not welcomed.
 
 
Read more ...
Page 1 of 4

ABAP Favorites Eclipse plugin

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client