Application Development and Automation 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: 
Read only

ALV report - Application toolbar

Former Member
0 Likes
2,038

Hi,

I am using an ALV report with check box field as the first field.There are totally 5 fields.

There are 2 buttons which i have created in application toolbar.

Button name : %OCC

In user command this sy-ucomm is displaying the button name and everything is fine till there.

The problem is,

After the report has been displayed,I have checked two rows using that check box field.Next i clicked this custom button in application toolbar,the execution is entering the user command subroutine.the internal table is not showing the records clicked.

the X value not coming in internal table.

but if i click a button in functional tool bar (Fuctional Keys) the check field in internal table is coming as X while debugging.

How to overcome this

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,980

Hi,

why do you use checkboxes? Can't you use the ALV standard way of selecting lines? Then you can use standard ALV methods to check which lines have been selected.

If you need to get the updated values from the table, you need a server roundtrip. Maybe use method dispatch or refresh_table_display?

Roy

13 REPLIES 13
Read only

Former Member
0 Likes
1,981

Hi,

why do you use checkboxes? Can't you use the ALV standard way of selecting lines? Then you can use standard ALV methods to check which lines have been selected.

If you need to get the updated values from the table, you need a server roundtrip. Maybe use method dispatch or refresh_table_display?

Roy

Read only

Former Member
0 Likes
1,980

Hi

Did you wrote the code for user command as

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

CASE R_UCOMM.

WHEN '&POSTING'.

PERFORM POST_DOC.

ENDCASE.

ENDFORM.

if you have written that then

in the subroutine you can directly write as

delete ifinal where sel ne 'X' . "sel indicates Check box

and then

if not ifinal[] is initial .

loop at ifinal.

endloop.

endif.

hope this helps..

Regards,

Vishwanath

Read only

0 Likes
1,980

I have given the code which you have mentioned.

But the check box field is not displaying X.

Read only

0 Likes
1,980

Hi

did you write the code as

ls_fieldcat-checkbox = 'X'.

modify gt_fieldcat from ls_fieldcat

transporting checkbox

where fieldname eq 'SEL'.

after declaring your field catalog.

Read only

0 Likes
1,980

I have given the fieldcatalog-checkbox = 'X'.

But where i need to give the modify command

can you guide me with a sample code

Read only

0 Likes
1,980

ls_fieldcat-col_pos = .

ls_fieldcat-fieldname = sel.

ls_fieldcat-tabname = ifinal.

ls_fieldcat-ref_fieldname = ''.

ls_fieldcat-ref_tabname = ''.

ls_fieldcat-seltext_l = ''.

ls_fieldcat-seltext_m =''.

ls_fieldcat-seltext_s = ''.

ls_fieldcat-reptext_ddic =''.

ls_fieldcat-ddictxt = 'L'.

ls_fieldcat-do_sum = ''.

ls_fieldcat-no_out = ''.

ls_fieldcat-emphasize = s300.

in this way you give a field catalog right?

after this declaration write the above code

Regards

Vishwanath

Read only

Former Member
0 Likes
1,980

Call the method check_changed_data as below: -

CALL METHOD gr_grid_db_200->check_changed_data

IMPORTING

e_valid = w_alv_changed.

Read only

Former Member
0 Likes
1,980

Hi,

fill the field catallog for the check box..

chebox = 'X' and edit = ' X' .

if you selected the check box then modify the final internal table ith the check box field as 'X'.

and place the above code..

hope this will be helpful...

Regards

Aravind.

Read only

0 Likes
1,980

Ya i have did as per your comments.

But it was only not working for application tool bar buttons.

working fine for Functional tool bar buttons

Read only

0 Likes
1,980

place the code in the class ...method user command..

ur internal table should be declared in global..

write above logic in the that method user command ... hope this will solved...

Regards

Aravind.

Read only

0 Likes
1,980

Hi

Which kind of ALV are you using?

OOP ALV or function ALV?

Max

Read only

0 Likes
1,980

Did you give

ps_layout-box_fieldname = 'SEL'.

in the layout structure?

Read only

ravi_lanjewar
Contributor
0 Likes
1,980

I think you are using Reuse_alv_grid_display function module. i don't know how to do in using function module, but i know using CL_gui_alv_grid, after updating data do following changes in program


CALL METHOD p_alv_grid->check_changed_data .

Kind Rgds

Ravi Lanjewar