Sep 19, 2016

Colors in ALV List Using Function Module 'REUSE_ALV_LIST_DISPLAY'

By Haritha
From saptechnical.com


Colors in ALV List Using Function Module 'REUSE_ALV_LIST_DISPLAY'

Column and Row are colored with a coded color ‘Cxyz’.
    Where C: Color (coding must begin with C)
                 X: Color Number
                 Y: Bold
                 Z: Inverse.

The Selection Screen will be as follows.



In the Selection screen if we enter only the Column Number and color the whole column will be colored as follows.



In the Selection screen if we enter only the row Number and color, the whole column will be colored as follows.


 
 In the Selection screen if we enter both the Row number and the Column Number then that particular cell will be colored as follows (this color is not picked from selection screen, it is already written in the program itself)






Source Code:

REPORT yalvcol_list.

TABLESspfli.

TYPE-POOLSslis.

PARAMETERSp_col      TYPE i,
            p_row      
TYPE i,
            p_color
(4TYPE c.

DATA:
  t_fieldcat      
TYPE slis_t_fieldcat_alv,
  fs_fieldcat     
LIKE LINE OF t_fieldcat,
  fs_layout       
TYPE slis_layout_alv,
  w_color
(4) ,
  w_row           
TYPE i,
  w_fieldname
(20),
  w_prog          
TYPE sy-repid.

DATA:
  
BEGIN OF t_spfli OCCURS 0,
    
color(4),
    
checkbox ,
    cell     
TYPE slis_t_specialcol_alv,
    carrid   
TYPE spfli-carrid,
    connid   
TYPE spfli-connid,
    cityfrom 
TYPE spfli-cityfrom,
    cityto   
TYPE spfli-cityto,
    distance 
TYPE spfli-distance,
  
END OF t_spfli.

DATA:
fs_cell 
LIKE LINE OF t_spfli-cell.

SELECT *
FROM spfli
INTO CORRESPONDING FIELDS OF TABLE t_spfli.

w_color 
p_color.

t_spfli
-color p_color.
IF p_col IS INITIAL AND p_row GT 0.
  
MODIFY t_spfli INDEX p_row TRANSPORTING color.
ENDIF.

fs_fieldcat
-fieldname 'CARRID'.
fs_fieldcat
-ref_tabname 'SPFLI'.
fs_fieldcat
-col_pos 1.
fs_fieldcat
-key 'X'.
fs_fieldcat
-hotspot 'X'.
APPEND fs_fieldcat TO t_fieldcat.

CLEAR fs_fieldcat .
fs_fieldcat
-fieldname 'CONNID'.
fs_fieldcat
-ref_tabname 'SPFLI'.
fs_fieldcat
-col_pos 2.
fs_fieldcat
-key 'X'.
fs_fieldcat
-hotspot 'X'.
APPEND fs_fieldcat TO t_fieldcat.

CLEAR fs_fieldcat .
fs_fieldcat
-fieldname 'DISTANCE'.
fs_fieldcat
-ref_tabname 'SPFLI'.

fs_fieldcat
-col_pos 3.
fs_fieldcat
-key ' '.
fs_fieldcat
-edit 'X'.
APPEND fs_fieldcat TO t_fieldcat.

CLEAR fs_fieldcat.
fs_fieldcat
-fieldname 'CITYFROM'.
fs_fieldcat
-ref_tabname 'SPFLI'.
fs_fieldcat
-col_pos 4.
fs_fieldcat
-key ' '.
APPEND fs_fieldcat TO t_fieldcat.

LOOP AT t_fieldcat INTO fs_fieldcat.
  
IF fs_fieldcat-col_pos EQ p_col.
    fs_fieldcat
-emphasize p_color.
    w_fieldname 
fs_fieldcat-fieldname.
    
IF p_row IS INITIAL AND p_col GT 0.
      
MODIFY t_fieldcat FROM fs_fieldcat TRANSPORTING emphasize.
    
ENDIF.
  
ENDIF.
ENDLOOP.

fs_cell
-fieldname w_fieldname .
fs_cell
-color-col 6.
fs_cell
-nokeycol 'X'.
APPEND fs_cell TO t_spfli-cell.

IF p_row IS NOT INITIAL AND p_col IS NOT INITIAL.
  
MODIFY t_spfli INDEX p_row TRANSPORTING cell.
ENDIF.

fs_layout
-info_fieldname 'COLOR'.
fs_layout
-box_fieldname 'CHECKBOX'.
fs_layout
-coltab_fieldname 'CELL'.
fs_layout
-f2code '&ETA'.

w_prog 
sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
  
EXPORTING
    i_callback_program 
w_prog
    is_layout          
fs_layout
    it_fieldcat        
t_fieldcat
  
TABLES
    t_outtab           
t_spfli
  
EXCEPTIONS
    program_error      
1
    
OTHERS             2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Sep 15, 2016

How to Find SAPLOGON.INI Location



Under SAP Logon Options, choose Configuration Files. Type Connection gives the path of saplogon.ini file.




If you double click on Connection, the system will open the actual saplogon.ini file.

Source: Saphub.com


Related posts:


Aug 4, 2016

Master Data is not Updated in Database (SAP BPC)

Problem:
When processing the Dimensions, it is not updating into the Database. But in front end it is showing the process has been completed successfully.
In backend, don’t get any Runtime Errors.
Version: BPC 753.02 NW and service pack version is 12.


Solution:
  1. Try to run UJA_MIGRATE_MBR_SEQ from se38 to migrate all your dimension to add the new attribute. Note for your reference 1569986 - How to add the MBR_SEQ attribute to a dimension - BPC
  2. Could you please perform refresh of your dimension list through UJA_REFRESH_DIM_CACHE
  3. Take a back-up of your dimension member list and go to UJFS and delete XML of the dimension member.

Then perform the following steps...
  1. Logon to SAP Netweaver backend BW system.
  2. Execute transaction UJFS.
  3. Go to Root > Webfolders > Application set > adminapp.
  4. Rename the <dimension name>.xml and <dimension name>.xlt files.
  5. Also, rename the above 2 files in dimcache folder.
  6. There will be a folder called PC_NW in your "My Documents" folder.
  7. Try to take a back up of PC_NW folder in different location and then delete it,
  8. then login to Admin through connection wizard and then try again.

***As a best practice, try to maintain the same service pack levels on Client
side, Server side and ABAP side (i.e., same service pack on all the
components)

If this did not solve try to uninstall BPC AdminClient and Microsoft Office and install MS office and then BPC AdminClient.