<?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 Comparing two structures in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992501#M1342864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an application where users enter texts which get stored in a structure. I want a funcitonaluty to tell users when they close the application to make sure that unsaved data is saved before exiting the application. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i will take the current structure and compare it with the data from the database and then prompt them to save the data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to compare two structures directly without checking for each field of the structure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sunil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jul 2009 23:48:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-30T23:48:59Z</dc:date>
    <item>
      <title>Comparing two structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992501#M1342864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an application where users enter texts which get stored in a structure. I want a funcitonaluty to tell users when they close the application to make sure that unsaved data is saved before exiting the application. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i will take the current structure and compare it with the data from the database and then prompt them to save the data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to compare two structures directly without checking for each field of the structure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sunil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 23:48:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992501#M1342864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-30T23:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992502#M1342865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;Hi Sunil, 
Try this way.
&lt;PRE&gt;&lt;CODE&gt;
CASE SY_UCOMM.
 WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
  IF structure_1 NE structure_2.
    MESSAGE w020(z7) WITH 'please save the data'.
  ELSE.
    LEAVE PROGRAM.
  ENDIF.
ENDCASE.
&lt;/CODE&gt;&lt;/PRE&gt;

Thanks
Venkat.O&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 00:48:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992502#M1342865</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2009-07-31T00:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992503#M1342866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data : itab type mara.&lt;/P&gt;&lt;P&gt;data : jtab type mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pass all the data to the structure jtab from the screen and earlier values will be in itab.&lt;/P&gt;&lt;P&gt;even pass the sy-mandt to the jtab if required.&lt;/P&gt;&lt;P&gt;now &lt;/P&gt;&lt;P&gt;if itab &amp;lt;&amp;gt; jtab.&lt;/P&gt;&lt;P&gt;message 'The data has been changed Please Save it'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;you can also use the FM &lt;STRONG&gt;POP_TO_CONFIRM&lt;/STRONG&gt; to get a pop in the standard way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ramchander Rao.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 03:04:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992503#M1342866</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T03:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992504#M1342867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make two internal tables using the strucures...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then compare those tables.. in th following way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_tab1] = it_tab2[.&lt;/P&gt;&lt;P&gt;" Tables contents are the same&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;" Tables contents are different&lt;/P&gt;&lt;P&gt;\give  message to save th data&lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 05:10:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992504#M1342867</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T05:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992505#M1342868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venkat has answered your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ShreeMohan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 05:28:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992505#M1342868</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T05:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two structures</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992506#M1342869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I guess this wont be the best approach to check out whether the user has save the data or not! It may happen that user will do some changes and then have the same entries while saving.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had a similar requirement. If you are writing dialog program, what you can do is set a flag..(say save_flag), whenever the user saves data. When user tries to exit from application, check the status of of flag. If its set, exit else pop up a message to prompt user to save it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please correct me if I am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PAI--&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MODULE USER_COMMAND_9009 INPUT.
 when 'BACK'.
      IF SY-TCODE = trans_chg.
        if save_flgh = 1 and save_flgi = 1.

          LEAVE Program.
          clear: save_flgh,save_flgi.
        else.
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              TITLEBAR              = 'Save Changes'
              TEXT_QUESTION         = 'The data is not saved, do you wish to save it?'
              TEXT_BUTTON_1         = 'YES'(001)
              TEXT_BUTTON_2         = 'NO'(002)
            IMPORTING
              ANSWER                = answer
            EXCEPTIONS
              TEXT_NOT_FOUND        = 1
              OTHERS                = 2.
          IF SY-SUBRC &amp;lt;&amp;gt; 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          if answer = 1.
            wrk_header-EMPNO = EMPNO.
            wrk_header-EMPCO = EMPCO.
            modify ZEMPHDR from wrk_header.
            if sy-subrc = 0.
              save_flgh = 1.
            endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;while saving--&amp;gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;wrk_header-EMPNO = EMPNO.
  wrk_header-EMPCO = EMPCO.
  wrk_header-EMPNAME = EMPNAME.
  modify ZEMPHDR from wrk_header.           
  if sy-subrc ne 0.
  else.
    save_flgh = 1.
    MESSAGE s000(ztest) WITH temp_empno .
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sumit Nene.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sumit Nene on Jul 31, 2009 8:05 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 05:51:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-two-structures/m-p/5992506#M1342869</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T05:51:51Z</dc:date>
    </item>
  </channel>
</rss>

