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: 

Handling line by line Processing in OPPS ALV

Former Member
0 Kudos
116

Hi All,

Could You please tell hwo to handle line by line processing in ALV using OPPS.

I want to make some fields editable and not editable based on some other field value and show in output.

Thanks in Advance.

Regards,

Deepak

3 REPLIES 3

Former Member
0 Kudos
88

using field style u can do it

refer this sample program

LOOP AT it_ekko INTO wa_ekko.

IF wa_ekko-netpr is initial.

ls_stylerow-fieldname = 'NETPR' .

ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.

"set field to disabled

APPEND ls_stylerow TO wa_ekko-field_style.

MODIFY it_ekko FROM wa_ekko.

ENDIF.

ENDLOOP.

Former Member
0 Kudos
88

Declare one of the field of output table as , celltab TYPE lvc_t_styl.

Types : begin of t_output,

field 1....

field 2....

celltab TYPE lvc_t_styl, " Cell Properties

end of t_output.

Data : i_output type standard table of t_output, "internal table to display output

wa_output like line of i_output.

i_celltab TYPE lvc_t_styl, "internal table to enable or disable the fields

wa_celltab TYPE lvc_s_styl.

According to your condtion fill the i_celltab table.

wa_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

wa_celltab-fieldname = g_field. "Here pass the name of the field you want to disable

INSERT wa_celltab INTO TABLE i_celltab.

MOVE i_celltab TO wa_output-celltab.

WHILE PREPARING A LAYOUT ,PUT

grid_layout-stylefname = 'CELLTAB'.

CALL METHOD grid1->set_table_for_first_display

EXPORTING

is_layout = grid_layout

is_variant = g_variant

i_save = 'A'

CHANGING

it_outtab = i_output[]

it_fieldcatalog = i_fieldcat.

uwe_schieferstein
Active Contributor
0 Kudos
88

Hello Deepak

You may have a look at sample report ZUS_SDN_ALV_GRID_EDIT_1 in thread

Regards

Uwe