4.93103448276 1 1 1 1 1 Rating 99% (29 Votes)

This time the problem which I solved was not an ABAP problem, although at the beginning I thought it is, as while creating of deliveries without reference in standard transaction were done correctly without any issues, then when I tried to do it in ABAP, I always received the error VL473 - Copying is not poss.because an entry is missing in Table TVCPL. 

I thought that this is some kind of nonsense as with standard t-code it was working correctly, so I tried several FM to create deliveries without reference but always with the same result as you can see on picture bellow. 

Then I did what I should do from beginning. I used where used function to display where TVCPL table is used and I found two views V_TVCPLAK and V_TVCPLAP.

Add a comment
Read more ...

5 1 1 1 1 1 Rating 100% (10 Votes)
I've seen on SCN plenty of question about copying BOM from one plant to other, or from one material to other. Most of them were closed by using LSMW or direct input methods, but there is a really nice way to do it using CEWB function modules. I've been playing with CEWB modules for a long time so I'm not afraid to debug CEWB in case I cannot make it work by myself but when you look on the logic of the sample program to copy BOM then you'll see it's reasonable. 
 
  1. At the beginning let's clear Function Group memory using FM 'CP_CC_S_REFRESH_DATA'. Just for the safety reasons :-)
  2. Then let's load BOM header data to FG memory. If you want to do mass transaction then you would probably want to fill selection table i_cpsc_bom_sel with more than one BOM number, it will be then faster than calling FM 'CP_CC_S_LOAD_COMPLEX_BY_BOM' separately many times.
  3. But header data is not enough, we should do same thing for BOM items using FM 'CP_CC_S_LOAD_COMPLEX_BY_ITM', as Items belongs to different work area in CEWB.
  4. Once we loaded data to memory we can start copying, firstly we need to call 'CP_CC_S_BOM_PROVIDE_BY_MBM' to get source header data and then use its export parameters in FM 'CS_CL_S_MAT_BOM_CREATE_BY_COPY', which is doing copy of a header data.
  5. Once it's done we have to get source items from memory using 'CS_CL_P_ITM_PROVIDE', and then use it for copying items to our target BOM in 'CS_CL_S_ITM_CREATE_BY_COPY'.
  6. At the end, when everything is fine, use FM 'CP_CC_S_SAVEto save your changes and commit your work.

Work done!
Bellow and in the NUGG attachment you can find sample program which is using this technique for single BOM copy. It does not have error handling or built-in change number usage but you can do it yourself in your programs if this will be necessary.
 
Read more ...

5 1 1 1 1 1 Rating 100% (5 Votes)
When you use QM01/QM02/QM03/IQS1/IQS2/IQS3 transactions then you've noticed that when you have some task defined then you cannot directly go to attachments of notification. Following popup always appears:
 
But there is a way of getting rid of it. We can add new action box action to call directly attachments of notification.
So go to SPRO and find Define Action Box in QM node.
Read more ...

5 1 1 1 1 1 Rating 100% (10 Votes)
Today I've got a question from Custodio de Oliveira (hope you don't mind mentioning) about Dark Eclipse settings which I'm using. As I know that settings colors in Eclipse for ADT is a pain, then I want to share with you my settings and the steps to achieve the same look like I have on my installation. Of course you can update it by your own, but at least you have a starting point.
 
Probably this is how your Eclipse looks like, or if not then the default settings for ADT. White and eye-killing.
Read more ...

5 1 1 1 1 1 Rating 100% (10 Votes)
Many people still asks how to create field catalog for CL_GUI_ALV_GRID or REUSE_ALV_GRID_DISPLAY on a base of internal table. This is very easy since we have SALV classes, you could see it in my article Create XLSX/MHTML file from internal table in background and probably also somewhere in the net. To make it easier here are ready methods to create LVC and SLIS field catalogs from internal table using CL_SALV_CONTROLLER_METADATA and  CL_SALV_TABLE. Both methods are created with new ABAP 7.40 SP05 syntax.
 
LVC Field catalog definition

  class-methods lvc_fcat_from_internal_table
  importing
    it_table type any table
  returning value(rt_fcattype lvc_t_fcat.

LVC field catalog implementation

  method lvc_fcat_from_internal_table.
    datatable type ref to data.
    create data table like it_table.
    assign table->to field-symbol(<table>).
    try.
        cl_salv_table=>factoryimporting
                                  r_salv_table   data(salv_table)
                                changing
                                  t_table        <table>  ).
        rt_fcat cl_salv_controller_metadata=>get_lvc_fieldcatalog(
            r_columns      salv_table->get_columns" ALV Filter
            r_aggregations salv_table->get_aggregations" ALV Aggregations
    ).
      catch cx_root.
    endtry.
  endmethod.

Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
I was playing a bit with CL_GUI_TIMER some time ago and I thought that this would be good to use it somewhere to have idea how it works. So I've created then a small game Battleships, which you for sure know from analog version. 

Game is very simple, firstly you have to build your own map with ships. Just to remind you, there are 2 submarines, 2 destroyers, 1 cruiser, 1 battleship and 1 aircraft carrier. Map is created with CL_GUI_ALV_GRID. Once you click on status button to add one of the ships, map will show you in which place you can start ship. When you'll select position of the start it will show you possible fields for end.
After you build your map hit Join Game button and wait for second player to join you. 
Read more ...

1 1 1 1 1 Rating 0% (0 Votes)
If you imported NUGG file from previous article you could be surprised that there is one additional FM available called Z_AB_POPUP_GRID_MULTI_SEL. This FM can be used to call a popup with ALV grid which allows multiple row selects. 
1) In order to prepare such popup you'll need to firstly define some global variables in FG which you can find bellow:

constantsc_ccname_grid_popup type scrfname value 'CC_GRID_POPUP'.
datago_popup_custom_cont      type ref to cl_gui_custom_container.
datago_popup_grid             type ref to cl_gui_alv_grid.
datags_popup_layout           type lvc_s_layo.
datags_popup_variant          type disvariant.
datagt_popup_fcat             type lvc_t_fcat.
datag_popup_question          type char70.
field-symbols<gt_popup_outtab> type standard table.

2) Then you need to create GUI status with Cancel and Enter Buttons
Read more ...

5 1 1 1 1 1 Rating 100% (6 Votes)
This topic was raised many times, I always found it's not possible to (or at least to hard to try) to update components allocation for routing operations. Fortunately I had to do it somehow and I manage to do it in two ways : 
1) with BDC (yeah I know, creepy but possible)
2) using EWB FM's basing on the SAP note 488765 - "Do it yourself EWB programming".
Today I will present program which is using EWB, in future I will post an example of doing this by BDC.
 
 
This program reads data from Excel file with proper structure (you can find Excel template in attachment). After reading data it collects all routings which needs to be updated to be sure that each routing is updated only once. Then the most important part is done in following way:
1) We need to load each routing and connected BOM to memory with CP_CC_S_LOAD_COMPLEX_BY_TSK and CP_CC_S_LOAD_COMPLEX_BY_BOM,
2) Next step is to get the BOM into internal table using CP_CC_S_PROVIDE_ITM_BY_AS_PATH.  BOM table contains also a explosion of sub-assemblies which are not phantoms which at the beginning seem to be useless, but after a while you'll notice that we need all levels of multilevel BOM in order to calculate Path (PLMZ-KANTE) and order level (PLMZ-STLST).  If you have to do components allocation for single level BOM then reworking the table is not needed, but in my example I did it as I needed to allocate components from multi-level BOM. You'll find here a form ITEM_CHECK which do the manipulation of the table. 
3) After it's done we need load operation data (CP_CC_S_PROVIDE_COM_BY_OPR) and current allocation of components (CP_CL_P_OPR_ALLOCATION_PROVIDE). We need to do it in order to delete current allocation.
4) Deletion is done with CM_CL_P_COM_DELETE and saved with CP_CC_S_SAVE. Deletion is committed as in other case there is no possibility to create new allocation.
5) Allocation is deleted, so we can now recreate it with new values. Firstly we need to reload again operation data to memory with CP_CC_S_OPR_PROVIDE_BY_MTK and then create allocation with  CP_CC_S_CREATE_COM. Again we need to save allocation with CP_CC_S_SAVE.
 
Bellow you'll find the code of the program. You can download also NUGG file for it!.
 
Program works in two steps, firstly it displays reading log, if it is ok you have to press first button on the toolbar  to create allocation.
Read more ...

More Articles ...