cancel
Showing results for 
Search instead for 
Did you mean: 

how to get the value of a cell if it is an input field in alv

Madhu2004
Active Contributor
0 Kudos

Hai experts,

I have a requirement as follows:I have an ALV table with 3 values as materilno,description,quantity.

I need to make the the complete ALV Editable and when i enter a value in material frield and press enter remaining 2 fields u shud get popultaeed.i have the method to populate the values but how to get th evalue of that cell.'

i am not able get using ON_CLICK EVENT.

Kindly help me as soon as possible.

Cheers ,

Madhu.

Accepted Solutions (1)

Accepted Solutions (1)

mohammed_anzys
Contributor
0 Kudos

ON_CLICK_EVENT...You will getting a parameter WDEVENT...from that you will be getting the current context element...The element wwhere you have performed the operation....

mohammed_anzys
Contributor
0 Kudos

Hi,

The parameter will be WDEVENT type CL_WD_CUSTOM_EVENT and in the class you will find a method GET_CONTEXT_ELEMENT ,which will return the current row where you clicked ( not lead selection ) .Which will give you the inputed value.

Thanks

Anzy

Award points if this solves your problem

Madhu2004
Active Contributor
0 Kudos

hai anzy,

thanks for the rely,

my requirement is u enter a value under material and press enter u need to read the value and get the remaining values based on the entered value.

sp here i want to retrieve the entered value.

i tried with on_click event but it works only for non-editable fields.

madhu.

mohammed_anzys
Contributor
0 Kudos

Hi

You can use ON Action event available in each of the column.

Thanks

Anzy

Former Member
0 Kudos

Hi Madhu,

Try the on_data_check action of ALV controls. I think this should be possible with that.

Regards,

Nithya

Madhu2004
Active Contributor
0 Kudos

hai nitya,

can u help me out with some sample code b'coz there is no variable in the method on data check to get the value.

madhu

Former Member
0 Kudos

Hi Madhu,

I will get back to you on this. I think I have some sample code, I will check and get back.

Regards,

Nithya

Former Member
0 Kudos

Hi Madhu,

I had a similar requirement sometime back and got it solved with user defined functions. I could not figure how to get an OnEnter event. You can check this and the links Rakesh has provided. They are very useful documents.

Hope this helps.

Regards,

Nithya

Madhu2004
Active Contributor
0 Kudos

Hi nitya,

I think u didnot get my requirement.

my requirement is i have an complete editable ALV with all fields as input fields.

now when i enter a value under material and press enter i need to capyure the

material value and based on the material value i need to get the details and populate all those values in the respective fields.

All i need to do is get the material number that is entered.

in the pdf of using ALV events it is such that editable cell editors trigger ON_DATA_CHANGED event and non-editable cell editors trigger ON_CLICK event.

But i couldnot find the ON_DATA_CHANGED event in the ALV events.

Help me out in finding the event.

Cheers,

Madhu

Former Member
0 Kudos

Hi Madhu,

To get the event handler to detect the data changes (i.e. the inputs you provide in a particular field), do the following:

1. In the methods tab, create a new method (say on_input) and change the method type to 'Event handler'.

2. Place your cursor in the event field and press F4. You will get a popup displaying the possible events.

3. In that popup, choose the line which has 'ON_DATA_CHANGE' or 'ON_DATA_CHECK'. Inside this event handler, you can read the value you have entered and do further processing.

Regards,

Ram

Answers (0)