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: Error calling add_protocol_entry

Former Member
0 Likes
841

Hi,

I want to avoid to call the fm 'POPUP_TO_INFORM' for showing an error message in my alv. I'd like to collect all errors and set the field in error (red). I am trying to follow the following steps:

1) DATA pr_data_changed type ref to cl_alv_changed_data_protocol.

2) call method pr_data_changed->add_protocol_entry

exporting

i_msgid = '0K' i_msgno = '000' i_msgty = 'E'

i_msgv1 = text-i03

i_fieldname = 'MATNR'

i_row_id = 1.

3) CALL METHOD pr_data_changed->display_protocol.

I receive this error when the step 2 is executed.

You attempted to use a 'NULL' object reference (access a component (variable: "PR_DATA_CHANGED").

Any help will be well appreciated.

Thanks in advance.

Regards,

Giovanni

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
648

Create the object PR_DATA_CHANGED before calling the methods of the class CL_ALV_CHANGED_DATA_PROTOCOL using the object PR_DATA_CHANGED.

2 REPLIES 2
Read only

Former Member
0 Likes
649

Create the object PR_DATA_CHANGED before calling the methods of the class CL_ALV_CHANGED_DATA_PROTOCOL using the object PR_DATA_CHANGED.

Read only

Former Member
0 Likes
648

Hi and thanks for the suggestion but is it possible ti have an example how to create the PR_DATA_CHANGED object?

Thanks.

Giovanni