Skip to Content
1

Adding colour to the ALV grid in COOIS output

Mar 19, 2017 at 06:15 AM

169

avatar image
Former Member

Hi,

I am trying to add conditional colouring to the coois ALV output.and using the BADI - workheader_infosystem

but not able to figure out, where to edit the layout in the code.
can anybody suggest me, how to resolve this issue.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member
Mar 20, 2017 at 05:35 AM
1

Hi Rajat,

If you are displaying the output in Standard Layout (000000000001) then the ALV grid is displayed from the class CL_COIS_DISP_LIST method IF_COIS_DISP_LIST~SET_TABLE_FOR_FIRST_DISPLAY.

You can make use of enhancement point EHP603_SET_TAB_F_F_DISPLAY_02, Where you have the layout, fieldcatalog and output table available and you can modify them accordingly to meet your requirement.

Thanks & Regards,

Rakshith Gore

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Rakshith,

I had already tried this.

The enhancement that you specified is SAP's internal enhancement point.
so, i can't use that.
If you have any other way to do this, Please share.
Thanks!

0
Former Member

Hi Rajat,

Sorry!!!

I didn't noticed the internal SAP option at the enhancement spot level. I was able to color the columns by modifying the fieldcatalog, You can follow the below steps to achieve the same.

1. Since the ALV display happens in the class CL_COIS_DISP_LIST and the fieldcatalog is a private attribute of this class, So you need to enhance this class and add a public instance method from which you can access the private attributes.

2. Now in the BAdI method IF_EX_WORKORDER_INFOSYSTEM~DETAIL_LIST_LAY, you need to populate the instantiated class in the field COIS_S_DETAIL_LIST-LIST

3. Now call the SET_INITIAL_DATA method to populate all the necessary attributes of the ALV grid. You can access the global variables of the report to pass the necessary parameters to this method.

4. Once the MT_FIELDCAT is populated, you can call your added method to modify the fieldcatalog accordingly.

Thanks & Regards,

Rakshith Gore

1

IMHO it's a bit too much effort (including long term maintenance) for what seems like a rather frivolous requirement. I'd urge OP to reconsider if it's really that important.

Thanks for sharing though.

0
Robert Stangel Jul 28, 2017 at 09:01 AM
0
is there any sample coding you can provide ?
Share
10 |10000 characters needed characters left characters exceeded