Application Development and Automation 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: 
Read only

Greyed out fields not triggering ON CHAIN-REQUEST

former_member1292715
Participant
0 Likes
636

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  INPUT

Regards,

Yasin.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
526

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 UP

Cheerz

Ram

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 UP

Cheerz

Ram

2 REPLIES 2
Read only

Former Member
0 Likes
527

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 UP

Cheerz

Ram

Read only

0 Likes
526

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.