cancel
Showing results for 
Search instead for 
Did you mean: 

POWL ---SORTING AND FILTERING

Former Member
0 Kudos

Hi,

Can any one tell me how to change the column positions and column name .. of a powl table and how to add custom fields into that?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

To change column positions and column name, you need to enhance method GET_FIELD_CATALOG.

COLPOS and HEADER fields can be used to specify the the column position and column name.

To add custom fields, you need to enhance method GET_FIELD_CATALOG.

1. Create an append structure for the final POWL result table. You need to find the standard structure used by POWL for the final result table. This is generally found in method GET_OBJECTS_DEFINITION

2. Enhance method GET_FIELD_CATALOG to add the new fields from append structure to field catalog. Code would be something like this.


  data : l_wa type line of powl_fieldcat_tty.
  CLEAR l_wa.
  l_wa-colid = 'COLID'.
  l_wa-allow_filter = 'X'.
  l_wa-enabled = 'X'.
  l_wa-allow_sort = 'X'.
  l_wa-col_visible = 'X'.
  l_wa-header = 'Column Name Name'.
  l_wa-header_by_ddic = abap_false..
  INSERT l_wa INTO TABLE c_fieldcat.

Note colid is name of column added to append structure

3. To populate data in the newly added fields, add your logic to method GET_OBJECTS.