04-09-2007 12:57 AM
In screen ,have a ALV object and a field object, after double click the ALV object,i want ot transfer the value from ALV to the field, so in the double click event,i set the field value equal the value in ALV,and i debug it that it's OK, but the value of the field is not refresh on the screen ,so i want to know after i double click the ALV, how to refresh the screen automatically?
Thanks!
04-09-2007 1:11 AM
You need to fire a PAI in the event handler. This is so you will get a round trip thru the screen.
In your event handler method for double click, add the method call below to the end of the method.
method handle_double_click.
........
* cause PAI
call method cl_gui_cfw=>set_new_ok_code
exporting
new_code = 'REFR'.
endif.
endmethod.
Regards,
RIch Heilman
04-09-2007 1:24 AM
First thanks for you!
I have tried it ,It is OK when i douck click the ALV in first time, but when i double click another row, the value of the screen is not changed,so......
04-09-2007 1:28 AM
04-09-2007 1:35 AM
the double click code as follows:
FORM DOUBLE_CLICK_B USING P_E_ROW TYPE LVC_S_ROW
P_E_COLUMN TYPE LVC_S_COL.
DATA:RC TYPE I.
DATA:NEW_CODE TYPE SYUCOMM.
PERFORM CLEAR.
READ TABLE I_STOCK INDEX P_E_ROW-INDEX.
IF SY-SUBRC = 0 AND I_STOCK-VERME > 0.
MATNR = I_STOCK-MATNR.
MENGE = I_STOCK-VERME.
CHARG = I_STOCK-CHARG.
LGPLA = I_STOCK-LGPLA.
FLDCUR = 'MENGE'.
ENDIF.
NEW_CODE = 'REFR'.
CALL METHOD CL_GUI_CFW=>SET_NEW_OK_CODE
EXPORTING NEW_CODE = NEW_CODE
IMPORTING RC = RC.
CLEAR:NEW_CODE.
ENDFORM. " DOUBLE_CLICK_A
PAI:
CALL METHOD CL_GUI_CFW=>DISPATCH.
CASE SY-UCOMM.
WHEN 'BACK'. LEAVE TO SCREEN 0.
WHEN 'SAVE'.
PERFORM SAVE.
WHEN 'ENTR'.
PERFORM PRESS_ENTR.
WHEN 'CLEAR'.
PERFORM CLEAR.
ENDCASE.
CALL METHOD CL_GUI_CFW=>FLUSH.
CLEAR SY-UCOMM.
04-09-2007 1:50 AM
04-09-2007 1:56 AM
Yes,i am sure , i debug it again
the value is changed and call the function but the screen is not refreshed
04-09-2007 2:00 AM
04-09-2007 2:12 AM
04-09-2007 2:24 AM
Ok, so then we know the problem probably lies in your existing code rather than the new method call that I suggest that you add. If the PAI is being fired that means that something may be preventing the field from being updated. Put in debug mode and check the value in the PBO and the PAI and try to figure out what is going on.
Regards,
RIch Heilman
04-09-2007 3:08 AM
I debug it and found that when in the the method double click, the value is changed to the new ,but when out of the method,the value was changed to the old value
04-09-2007 3:14 AM
04-09-2007 3:16 AM
04-09-2007 3:22 AM
04-09-2007 3:50 AM
before modification , i put the function in the double click method,
after your suggestion, i put the function and modify the value of field in PAI ,so it woks.