2015 Apr 01 12:10 AM
Hi guys,
I'm creating a program to load data into PA and OM infotypes from an Excel file. This is a dynamic program therefore, in the end it should display an ALV with first column as an icon (green for OK and red for NOK) and the last one as a long text, or maybe better a log object with double click to see all detail.
But the problem is, I'm trying to use OO programming as most as possible and therefore I'm using class SALV. As far as I know, the correct way to create the ALV instance is like this
cl_salv_table=>factory(
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = <fs_table> ).
my <fs_table> has type P0002 or HRP1000, or other it depends on the file I'm loading. How can I add the first column (icon) to this table?
Thanks in advance
2015 Apr 01 5:59 AM
Hi,
Refer displaying icons in alv using class cl_salv_table - Code Gallery - SCN Wiki , it might help you.
2015 Apr 01 5:59 AM
Hi,
Refer displaying icons in alv using class cl_salv_table - Code Gallery - SCN Wiki , it might help you.
2015 Apr 01 9:35 AM
Hi Tiki Patra,
the thing is, the structure is to be dynamic. Let's say we load information from infotype 0002,
then the structure should be like:
TYPES: BEGIN OF ty_out,
icon TYPE icon_d.
INCLUDE STRUCTURE p0002.
TYPES: log TYPE string,
END OF ty_out.
if it is infotype 1000, the structure should be like:
TYPES: BEGIN OF ty_out,
icon TYPE icon_d.
INCLUDE STRUCTURE hrp1000.
TYPES: log TYPE string,
END OF ty_out.
2015 Apr 01 1:15 PM
You can define your structure/internal table dynamically by using RTTC:
Dynamic Internal table - ABAP Development - SCN Wiki
Regards,
Ulrich