‎2006 Dec 17 2:58 PM
Hi.
I have implemented my own F4 for my ALV and now I get a problem since my DATA_CHANGED method is called BEFORE I change the cell content AND AFTER and this causes problems in my logic.
There is a demo program in SLIS ("BCALV_EDIT_03") but they use the default F4 that comes from the DDIC.
Another issue is that their MT_GOOD_CELLS always have the last cell that was changed, while my MT_GOOD_CELLS have all the cell I changed from previous visits to DATA_CHNAGED.
For example I change the value of FieldA and I visit the MY_DATA_CHANGED method and MT_GOOD_CELLS have 1 record with data on FieldA.
Than I change FieldB and when I visit MY_DATA_CHANGED method the MT_GOOD_CELLS have 2 record: 1 with data on FieldA and 1 with data on FieldB.
Any help will be appreciated.
ayal.
‎2006 Dec 17 8:03 PM
Hello Ayal
Sample report <b>BCALV_TEST_GRID_F4_HELP</b> explains most of the F4 help options in ALV lists. You can choose to check values before and after the F4 event.
If your event handler method for event DATA_CHANGED should be triggered only AFTER calling the F4 help then I guess you should have the following coding in your method:
* We are in the F4 event
IF ( e_onf4 = 'X' ).
* Event: after the F4 help value has been selected
IF ( e_onf4_after = 'X' ).
* valide values selected by F4 help
...
ELSE.
RETURN. " leave method my_data_changed
ENDIF.
ENDIF.Regards
Uwe
‎2006 Dec 18 7:40 PM
Hi Uwe.
Thanx for the reply but my problem is that if I compare my program behaviour to the demo program "BCALV_EDIT_03" I see that their DATA_CHANGED method is only visited when the Enter is pressed and <i>only after</i> a value was changed.
I copied this demo program code to the letter and still my method is visited twice !!
I have some Java experiance and I don't understand why this event should ever be called twice. I think that there should be an event of
before_data_changedand another
after_data_changed, but that's me.
Another issue I have is that my
mt_good_cellshave all the fields I touched while it should only have the last field.
thanx
ayal.