2010 Jan 16 10:55 AM
Hi Guys,
I have a text box on a screen with input not possible (greyed box). But the value of that text box can be changed by clicking a button in the same screen. Now, I wrote a code to give a pop-up upon exiting the screen, if the user didn't save the data. I got this fuctionality using keyword ON CHAIN-REQUEST.
But it is getting triggered, if the user changes the value on the white text box. But I changed the value of greyed text box using the button on the screen. For that, ON CHAIN-REQUEST is not getting triggered. Please help me out to solve this problem.
PROCESS AFTER INPUT.
CHAIN.
FIELD: zmm_spa_item-uptby_tc, " Greyed text box
zmm_spa_item-rmrk1_tc,
zmm_spa_item-rmrk2_tc,
zmm_spa_item-rmrk3_tc,
zmm_spa_item-rmrk4_tc.
MODULE get_changed_data ON CHAIN-REQUEST.
ENDCHAIN.
MODULE user_command_2300.
MODULE get_changed_data INPUT.
DATA: lv_answer TYPE c .
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Exit Review'
text_question = 'Do you wish to save your data?'
text_button_1 = 'Yes'
text_button_2 = 'No'
IMPORTING
answer = lv_answer
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF lv_answer EQ '1'.
MODIFY zmm_spa_header FROM zmm_spa_header.
MODIFY zmm_spa_item FROM zmm_spa_item.
IF sy-subrc EQ 0.
MESSAGE s001 WITH 'Saved'.
ENDIF.
ELSEIF lv_answer EQ 'A'.
CLEAR ok_code.
LEAVE SCREEN.
ENDIF.
ENDMODULE. " GET_CHANGED_DATA INPUTRegards,
Yasin.
2010 Jan 16 11:17 AM
Hi,
Try using the following
CHAIN.
FIELD: zmm_spa_item-uptby_tc, " Greyed text box
zmm_spa_item-rmrk1_tc,
zmm_spa_item-rmrk2_tc,
zmm_spa_item-rmrk3_tc,
zmm_spa_item-rmrk4_tc.
MODULE get_changed_data ON CHAIN-INPUT. "CHAIN-REQUEST.
ENDCHAIN.
Or take a flag in the User Command of button where you are making this field Grey
if that flag is = 'X' or Check sy-datar
Then call the Function Module POP UPCheerz
Ram
Hi Guys,
I have a text box on a screen with input not possible (greyed box). But the value of that text box can be changed by clicking a button in the same screen. Now, I wrote a code to give a pop-up upon exiting the screen, if the user didn't save the data. I got this fuctionality using keyword ON CHAIN-REQUEST.
But it is getting triggered, if the user changes the value on the white text box. But I changed the value of greyed text box using the button on the screen. For that, ON CHAIN-REQUEST is not getting triggered. Please help me out to solve this problem.
PROCESS AFTER INPUT.
CHAIN.
FIELD: zmm_spa_item-uptby_tc, " Greyed text box
zmm_spa_item-rmrk1_tc,
zmm_spa_item-rmrk2_tc,
zmm_spa_item-rmrk3_tc,
zmm_spa_item-rmrk4_tc.
MODULE get_changed_data ON CHAIN-REQUEST.
ENDCHAIN.
MODULE user_command_2300.
MODULE get_changed_data INPUT.
DATA: lv_answer TYPE c .
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Exit Review'
text_question = 'Do you wish to save your data?'
text_button_1 = 'Yes'
text_button_2 = 'No'
IMPORTING
answer = lv_answer
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF lv_answer EQ '1'.
MODIFY zmm_spa_header FROM zmm_spa_header.
MODIFY zmm_spa_item FROM zmm_spa_item.
IF sy-subrc EQ 0.
MESSAGE s001 WITH 'Saved'.
ENDIF.
ELSEIF lv_answer EQ 'A'.
CLEAR ok_code.
LEAVE SCREEN.
ENDIF.
ENDMODULE. " GET_CHANGED_DATA INPUTRegards,
Yasin.
2010 Jan 16 11:17 AM
Hi,
Try using the following
CHAIN.
FIELD: zmm_spa_item-uptby_tc, " Greyed text box
zmm_spa_item-rmrk1_tc,
zmm_spa_item-rmrk2_tc,
zmm_spa_item-rmrk3_tc,
zmm_spa_item-rmrk4_tc.
MODULE get_changed_data ON CHAIN-INPUT. "CHAIN-REQUEST.
ENDCHAIN.
Or take a flag in the User Command of button where you are making this field Grey
if that flag is = 'X' or Check sy-datar
Then call the Function Module POP UPCheerz
Ram
2010 Jan 16 11:38 AM
Hello Ram,
Thanks for your input. But I have 10 screen with many buttons and based on the button clicked, I change the value of the grey text box. So I want some generic thing like ON CHAIN-REQUEST. I can even compare the old value from PBO and new value from PAI, if they are not same, I can give a pop-up. But I am just wondering, is there anyother way to do this.
thanks
Yasin.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |