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

problem with check_changed_data

Former Member
0 Likes
2,861

hello

I have added a checkbox and a button to a ALV Grid report. When the checkbox is ckecked and the button is pushed, the record with the checkbox used for further processing. I have been searching thru the SDN and it looks like I need to use the "CHECK_CHANGED_DATA" statement. I have coded it like it mentions in the various threads and my process is short dumping. I have this coded in my program, not in the PAI screen. I have seen this coded at both places but when I try to code it in the PAI section of the screen, I get error on the DATA statement.

data: l_valid type c.

data: g_grid type ref to cl_gui_alv_grid.

call method g_grid->check_changed_data

importing

e_valid = l_valid.

I have coded it in the program in the user-command section an when I run the program in debug at display the g_grid , i get the following and the program short dumps with Access via 'NULL' object reference not possible."

I am not sure what I am doing wrong.

does anyone know what is causing this?

12 REPLIES 12
Read only

prabhu_s2
Active Contributor
0 Likes
2,142

try with:

  CALL METHOD g_alvgrid->check_changed_data
    IMPORTING
      e_valid = l_valid.

this provides the internal table on the check box being selected

Read only

Former Member
0 Likes
2,142

thanks for the replay.

this looks like the same as what I have coded othre that the different g_alvgrid.

is this correct?

Read only

Former Member
0 Likes
2,142

Have you instantiated g_grid?

Rob

Read only

Former Member
0 Likes
2,142

Hi,

Did you create the object reference.

After declaration,You have to create object.

data: l_valid type c.

data: g_grid type ref to cl_gui_alv_grid.

create object g_grid.

call method g_grid->check_changed_data

importing

e_valid = l_valid.

I think this solves your problem.

Thanks.

Ramya.

Read only

0 Likes
2,142

ramya

I put the create object g_grid in the program and did the check and recieved the following error

the obligatory parameter "I_PARENT" had no value assigned to it

Read only

0 Likes
2,142

Yes - you have to pass that parameter to it when you instantiate it. I believe it is your custom container.

Moderator message - Moved to the correct forum

Rob

Edited by: Rob Burbank on Apr 21, 2010 3:06 PM

Read only

0 Likes
2,142

Hi,

Check this.

data: l_valid type c.

data: g_grid type ref to cl_gui_alv_grid.

data:v_custom_container type ref to cl_gui_custom_container.

create object g_grid exporting i_parent = v_custom_container.

create object v_custom_container

exporting

container_name = <custom Container name>

  • style =

  • lifetime = lifetime_default

  • repid =

  • dynnr =

  • no_autodef_progid_dynnr =

exceptions

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5

others = 6

.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

CALL METHOD g_grid->check_changed_data

  • IMPORTING

  • e_valid =

  • CHANGING

  • c_refresh = 'X'

.

Thanks.

Ramya.

Read only

0 Likes
2,142

can you tell me where I would find the cutom container name.

the program that i am working on does not have any references to any of this.

I am using the program BCALV_EDIT_05 for examples of the create objects

data: g_container type scrfname value 'BCALV_GRID_DEMO_0100_CONT1',

g_grid type ref to cl_gui_alv_grid,

create object g_custom_container

exporting container_name = g_container.

create object g_grid

exporting i_parent = g_custom_container.

Read only

0 Likes
2,142

Hello Timothy

If you have placed a custom container on the dynpro where you want to display the ALV list then the name of this container is what you are looking for.

If the ALV list is the only displayed elements on your dynpro then I prefer to use a docking container instead of a custom container. Sample coding lookes like this:

Within routine MAIN the instances are created (see method INIT_CONTROLS). After that I just link the docking container instance to my dynpro '0100' which is empty.


*&---------------------------------------------------------------------*
*& START-OF-SELECTION                                                  *
*&---------------------------------------------------------------------*
START-OF-SELECTION.

  PERFORM main.

  gd_repid = syst-repid.
  CALL METHOD zcl_material_gdsn=>mo_docking->link
    EXPORTING
      repid                       = gd_repid
      dynnr                       = '0100'
*      CONTAINER                   =
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      lifetime_dynpro_dynpro_link = 3
      OTHERS                      = 4.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CALL SCREEN '0100'.



END-OF-SELECTION.


method INIT_CONTROLS.

* Create docking container
  CREATE OBJECT mo_docking
    EXPORTING
      parent                      = cl_gui_container=>screen0
      ratio                       = 90
    EXCEPTIONS
      others                      = 6.
  IF sy-subrc NE 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  CALL METHOD mo_docking->set_extension
    EXPORTING
      extension  = 99999
    EXCEPTIONS
      cntl_error = 1
      OTHERS     = 2.


* Create ALV grids
  CREATE OBJECT mo_grid
    EXPORTING
      i_parent          = mo_docking
    EXCEPTIONS
      others            = 5.
  IF sy-subrc NE 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  CALL METHOD set_handler( ).

endmethod.

Regards

Uwe

Read only

Former Member
0 Likes
2,142

Don't you have a data statement something like:

DATA:        my_container type ref to cl_gui_custom_container.

Rob

Read only

0 Likes
2,142

Rob

I have this statement

data:v_custom_container type ref to cl_gui_custom_container.

but I am not sure what goes in the value <custome container name> in this statement

container_name = <custom Container name>

Read only

0 Likes
2,142

I think you should spend some time trying to see how the BCALV* programs work.

Rob