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: 

CL_GUI_ALV_GRID --> Syntax check with uploaded data

Former Member
0 Kudos

Hello,

I have a internal table that I display with the class CL_GUI_ALV_GRID.

This list is editable. After editing the user can do a syntax check. All new entered rows or

Modified cell values will be checked using the object ER_DATA_CHANGED of method handle_data_changed. I check some logic and if there is something wrong I add an entry to the protocol by call method er_data_changed->add_protocol_entry etc.

Now I want to add a new feature to my list.

The user should be able to upload a .csv file from his presentation server.

Well…The upload works fine. I get all the uploaded data in my ALV. But…and this is my problem: I am not able any more to make a syntax check, because none of the uploaded data is in the object ER_DATA_CHANGED.

Do you have any idea how to solve this? I searched for a method to add inserted rows manually….

Kind regards,

Tobias

12 REPLIES 12

former_member188685
Active Contributor
0 Kudos

Hi,

if you do upload the data,and alv grid is editable then you should have some thing in ER_DATA_CHANGED.

and is the Full grid is editable.

Regards

Vijay

0 Kudos

Hello,

I have a editable Grid.

I do the following things in PAI (to upload data).

a) Refresh Internal table (that i show with ALV)

b) CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG

c) cl_gui_frontend_services=>gui_upload

d) Put all new rows in internal table that I show with ALV

e) call GRID->REFRESH_TABLE_DISPLAY

Now I have all uploaded rows in my ALV, but there is no entry in er_data_changed…

Due to this I am not able to do a syntax check.

Greetings,

Tobias

0 Kudos

Tobias,

I don't think the event is going to fire in this manner.

When you update the data in the front end (GRID), and then hit Enter, before updating the internal table, the event will fire.

What you are doing is the other way round - updating the table and then updating the front end using REFRESH.

Regards,

Ravi

Note : Please mark the helpful answers

0 Kudos

Hi Tobias,

you can try calling this method inside your PAI <b>CHECK_CHANGED_DATA</b>

and try to register event <b>EVT_MODIFIED</b> after your set_table_display method .

Regards

vijay

0 Kudos

Vijay,

How would the event fire, if the data is changed in the internal table and NOT on the GRID?

Regards,

Ravi

0 Kudos

Hi,

if he upload the new data to alv grid during run time , then the grid data will be changed in that case the event will be fired or not.

Regards

vijay

0 Kudos

Vijay,

I think he is uploading the data into the internal table and then refreshing the grid. Look at the steps he has described.

a) Refresh Internal table (that i show with ALV)

b) CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG

c) cl_gui_frontend_services=>gui_upload

d) Put all new rows in internal table that I show with ALV

e) call GRID->REFRESH_TABLE_DISPLAY

Regards,

Ravi

0 Kudos

ok,yep he need to change the steps.

then only that event can trigger.

Regards

vijay

0 Kudos

Tobias,

Now that we know, why is the event not firing, are you going to change the flow of the program?

Regards,

Ravi

0 Kudos

Hello,

first of all thanks a lot for all the answers.

@Vijay,

i still don't understand how you would change the steps in detail....

i tried the following:

a)REGISTER_EDIT_EVENT

b)CHECK_CHANGED_DATA

c)REFRESH_TABLE_DISPLAY

or

a)CHECK_CHANGED_DATA

b)REFRESH_TABLE_DISPLAY

c)REGISTER_EDIT_EVENT

...etc.

but it still doesnt work.

to be honest i thought that the event check_changed_data will be triggered automatically when i press the "syntax check-button" on the toolbar....

and i also don't understand why i need to register the register_edit_event in this case....

may you please explain more in detail where you would change which steps..?

Kind regards,

Tobias

0 Kudos

Tobias,

As the data is updated in the internal table and then to the grid, none of the events are going to fire.

I don't think you can import data directly on to the GRID without updating the table. There is only a export option of data from the GRID.

You will have to somehow force the user to check the data.

Quick thought :

Add a column, display as check box (Editable). Ask the user to check that box if all the data of that row is right, else ask him to modify the data and then mark the check box.

Then you take the data and consider only those rows where the check box is marked.

Regards,

Ravi

Note : please mark the helpful answers

rasmus_nikolaisen
Discoverer
0 Kudos

Hi Tobias,

I am facing the exact same problem. Did you find a solution?

Best regards

Rasmus