<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unable to save current data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-save-current-data/m-p/8299468#M1635494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;I am badly stuck , I have a form that contain 2 button, one is edit and the other is exit, when I press edit button and input apartment no (its  akey field)  then system read data and fill the screen and if i change some data and press exit button then system show me a dialog box data has been changed by using ask_save builten function and when i press yes then system leave the screen and cannot  save my current data means updated data, please advice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MODULE exit_0100 INPUT.
  CASE ok_code.
    WHEN 'EXIT'.
      IF sy-datar IS INITIAL AND flag IS INITIAL.
* no changes on screen 100
        LEAVE PROGRAM.
*        MOVE-CORRESPONDING ZUT_APARTMENT TO ls_newapartment.

      ELSE.
*        ls_newapartment  = ZUT_APARTMENT.
*        MOVE-CORRESPONDING ZUT_APARTMENT TO ls_newapartment.
*       IF  ls_newapartment  NE ls_oldapartment.
*        PERFORM check_for_updation_100.
        MOVE-CORRESPONDING zut_apartment TO ls_newapartment.
        IF  ls_newapartment  NE ls_oldapartment.
          PERFORM ask_save_0100 USING answer.
          CASE answer.
            WHEN 'J'.
              ok_code = 'SAVE&amp;amp;EXIT'.
            WHEN 'N'.
              LEAVE PROGRAM.
            WHEN 'A'.
              CLEAR ok_code.
              SET SCREEN 100.

          ENDCASE.


        ENDIF.
        LEAVE PROGRAM.
      ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Nov 2011 21:29:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-11-09T21:29:59Z</dc:date>
    <item>
      <title>Unable to save current data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-save-current-data/m-p/8299468#M1635494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;I am badly stuck , I have a form that contain 2 button, one is edit and the other is exit, when I press edit button and input apartment no (its  akey field)  then system read data and fill the screen and if i change some data and press exit button then system show me a dialog box data has been changed by using ask_save builten function and when i press yes then system leave the screen and cannot  save my current data means updated data, please advice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MODULE exit_0100 INPUT.
  CASE ok_code.
    WHEN 'EXIT'.
      IF sy-datar IS INITIAL AND flag IS INITIAL.
* no changes on screen 100
        LEAVE PROGRAM.
*        MOVE-CORRESPONDING ZUT_APARTMENT TO ls_newapartment.

      ELSE.
*        ls_newapartment  = ZUT_APARTMENT.
*        MOVE-CORRESPONDING ZUT_APARTMENT TO ls_newapartment.
*       IF  ls_newapartment  NE ls_oldapartment.
*        PERFORM check_for_updation_100.
        MOVE-CORRESPONDING zut_apartment TO ls_newapartment.
        IF  ls_newapartment  NE ls_oldapartment.
          PERFORM ask_save_0100 USING answer.
          CASE answer.
            WHEN 'J'.
              ok_code = 'SAVE&amp;amp;EXIT'.
            WHEN 'N'.
              LEAVE PROGRAM.
            WHEN 'A'.
              CLEAR ok_code.
              SET SCREEN 100.

          ENDCASE.


        ENDIF.
        LEAVE PROGRAM.
      ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 21:29:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-save-current-data/m-p/8299468#M1635494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-09T21:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to save current data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-save-current-data/m-p/8299469#M1635495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are simply trying to change the value of the OK_CODE in a CASE statement. I'm not sure if this would work or not. But you have to actually do the SAVE if the answer is yes, not change the OK_CODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 21:38:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-save-current-data/m-p/8299469#M1635495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-09T21:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to save current data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-save-current-data/m-p/8299470#M1635496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you change code as,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;......
.....
PERFORM ask_save_0100 USING answer.
          CASE answer.
            WHEN 'J'.
              ok_code = 'EXIT'. "Or LEAVE PROGRAM.
            WHEN 'N'.
              LEAVE PROGRAM.
            WHEN 'A'.
              CLEAR ok_code.
              SET SCREEN 100.
...
....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And perform ask_save_0100 does this subroutine saves the record?? &lt;/P&gt;&lt;P&gt;and where you put your code for saving&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 00:32:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-save-current-data/m-p/8299470#M1635496</guid>
      <dc:creator>surajarafath</dc:creator>
      <dc:date>2011-11-10T00:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to save current data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-save-current-data/m-p/8299471#M1635497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply, I thought the ask_save function can takecare of my code, but, When i refer to your answers then I realize that I need to define subroutine for save or update . Please advice me that can i put my saving or updation code like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PERFORM ask_save_0100 USING answer.
          CASE answer.
            WHEN 'J'.
              ok_code = 'SAVE&amp;amp;EXIT'.
*modify zut_apartment from zut_apartment*
            WHEN 'N'.
              LEAVE PROGRAM.
            WHEN 'A'.
              CLEAR ok_code.
              SET SCREEN 100.
 
          ENDCASE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Really need your expert advise because i am new in Abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: muzokh on Nov 10, 2011 5:27 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 00:33:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-save-current-data/m-p/8299471#M1635497</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-10T00:33:50Z</dc:date>
    </item>
  </channel>
</rss>

