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: 

In ALV grid need to default a cell's value based upon another editable cell

Former Member
0 Kudos

Hi,

I have an ALV grid as below with "Destination Strg Type" being Display only field and "Destination Bin" being editable field. Now when I enter a value in "Destination Bin" column and move to another cell/row or hit Enter key on the grid then the corresponding cell of "Destination Strg Type" should be populated based on the value entered in "Destination Bin" cell.

Check-box | Destination Strg Type | Destination Bin |

__________|<u><Display Only> </u>|<u>(Input) </u>|

Please let me know if there is a solution/sample program available in SAP for the above scenario.

Thanks in advance,

Saleem Chikodi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Thanks for the response, however for this suggestion to be incorporated the event should get triggered, control doesn't go into PAI module. I mean when user hits enter key the no event gets triggered.

Kindly help.

Saleem.

7 REPLIES 7

Former Member
0 Kudos

IN PAI MODULE.

case sy-ucomm.

when 'ENTR'.

CALL METHOD W_GRID1->CHECK_CHANGED_DATA

IMPORTING

E_VALID = L_VALID.

IF L_VALID = 'X'.

loop at itab.

l_index = sy-tabix.

select single Destination Strg Type

from ztable

into itab-Destination Strg Type

where Destination Bin = itab-Destination Bin.

modify itab index l_index.

endloop.

endcase

CALL METHOD W_GRID1->REFRESH_TABLE_DISPLAY.

Message was edited by: chandrasekhar jagarlamudi

Former Member
0 Kudos

Hi,

Thanks for the response, however for this suggestion to be incorporated the event should get triggered, control doesn't go into PAI module. I mean when user hits enter key the no event gets triggered.

Kindly help.

Saleem.

0 Kudos

Saleem,

You should register the EDIT event using the method REGISTER_EDIT_EVENT. After that the event will be triggered

Regards,

Ravi

Note : Please reward the post if it helps.

0 Kudos

as u r using custom control , there should be a screen right,say 100

try debugging to check the sy-ucomm for enter , and write in the PAI of screen 100.

0 Kudos

You right Chandrasekhar, however the event itself isn't getting triggered to check for the sy-ucomm.

Well I tried Ravikumar's suggesstion to register the event but this too isn't working and is not triggerring any event/PAI module.

Please help.

Thanks

Saleem Chikodi

0 Kudos

Saleem,

Have you registered a handler for the DATA_CHANGED event? If yes, can you post the code here.

I have done this so many times, this should work.

Regards,

Ravi

0 Kudos

Thanks Chandrasekhar, Ravikumar.

I appreciate your timely help, the issue is resolved.

Thanks and Regards,

Saleem