Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Grid Exception field(Light)

Former Member
0 Kudos

Hi,

while displaying the report in the ALV format, Exception(light) field is getting displayed for everyline(Record). But exception(Light) is not required for every record in the ALV but required on the basis of group of records.

In my program i am doing the control level processing on the field and at the end of this field the value for the exception field is getting populated so for all records i dont want the grayed light. So is it there any way to hide the unnecessary light field?

Thanks

Prince

2 REPLIES 2

Former Member
0 Kudos

Hi Prince,

Refer this code .It will give u the logic that how to grup field according to light.

LOOP AT it_matstock.

d_name = it_matstock-matnr.

REFRESH it_lines.

CLEAR it_lines.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = 'GRUN'

language = 'E'

name = d_name

object = 'MATERIAL'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

lines = it_lines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT IT_LINES.

CONCATENATE TEMP '' IT_LINES-TDLINE INTO TEMP.

ENDLOOP.

IT_MATSTOCK-LONGTEXT = TEMP.

MODIFY IT_MATSTOCK.

CLEAR TEMP.

IF IT_MATSTOCK-LONGTEXT(9) = 'IMPORTANT' OR IT_MATSTOCK-LONGTEXT(9) = 'important'.

IT_MATSTOCK-V_LIGHTS = '3'.

ELSEIF IT_MATSTOCK-LONGTEXT = ''.

IT_MATSTOCK-V_LIGHTS = '1'.

ELSE.

IT_MATSTOCK-V_LIGHTS = '2'.

ENDIF.

MODIFY IT_MATSTOCK.

ENDLOOP.

Reward points if helpful.

Regards,

Hemant

0 Kudos

Hi Hemant,

Thanks for the answere, but i have to hide the light field for indivldual record and display this exception on the basis of group of field's value.

so in our example in my internal table there is a field called section and if it contains value 8 then there are for e.g. 10 records are in this section and i have to calculate the value of this 10 records if this is greater than 1lakhs then Light field for this section will be Green otherwise Red but for individual record should not contain any light not even Grayed.

Thanks

Prince