{"id":283,"date":"2014-09-17T15:07:14","date_gmt":"2014-09-17T19:07:14","guid":{"rendered":"http:\/\/www.prglab.com\/blog\/?p=283"},"modified":"2014-09-17T15:07:14","modified_gmt":"2014-09-17T19:07:14","slug":"abap-%e7%a8%8b%e5%ba%8f%e4%b8%ad%e7%9a%84%e9%80%80%e5%87%ba%e6%93%8d%e4%bd%9ccheck-exit-return-leave-program","status":"publish","type":"post","link":"https:\/\/www.prglab.com\/blog\/p\/283","title":{"rendered":"ABAP \u7a0b\u5e8f\u4e2d\u7684\u9000\u51fa\u64cd\u4f5c(CHECK, EXIT, RETURN, LEAVE PROGRAM&#8230;)"},"content":{"rendered":"<p>\u4ee5\u524d\u90fd\u662f\u5199C++\u6216\u8005Java \u7a0b\u5e8f\uff0c\u521a\u5f00\u59cb\u5b66ABAP\uff0c\u5bf9\u9000\u51fa\u64cd\u4f5c\u8fd8\u4e0d\u592a\u4e60\u60ef\uff0c\u5f88\u5bb9\u6613\u6df7\u6dc6\u3002\u8fd9\u91cc\u603b\u7ed3\u4e00\u4e0b\u51e0\u4e2a\u5e38\u7528\u7684\u9000\u51fa\u64cd\u4f5c\uff1a<\/p>\n<p><strong>CHECK.<\/strong><br \/>\n1\uff09CHECK \u540e\u9762\u8981\u8ddf\u4e00\u4e2a\u8868\u8fbe\u5f0f\uff0c\u5f53\u8868\u8fbe\u5f0f\u503c\u4e3a\u5047(false)\u65f6\uff0cCHECK\u53d1\u751f\u4f5c\u7528\uff0c\u9000\u51fa\u5faa\u73af(LOOP)\u6216\u5904\u7406\u7a0b\u5e8f\uff08Processing Block\uff09\u3002<br \/>\n2\uff09\u5982\u679cCHECK\u51fa\u73b0\u5728\u5faa\u73af\u4e2d\uff0c\u5219\u53d1\u751f\u4f5c\u7528\u65f6\uff0c\u9000\u51fa\u7684\u662f\u5f53\u524d\u4e00\u6b21\u5faa\u73af\u64cd\u4f5c\uff0c\u7a0b\u5e8f\u4f1a\u7ee7\u7eed\u6267\u884c\u4e0b\u4e00\u6b21\u5faa\u73af\u64cd\u4f5c\uff0c\u5176\u4f5c\u7528\u7c7b\u4f3c\u4e8eContinue \uff08Java \u6216C++\u4e2dcontinue\u4e5f\u662f\u5982\u6b64\uff09.<br \/>\n3\uff09\u5982\u679cCHECK\u51fa\u73b0\u5728\u5faa\u73af\u4ee5\u5916\uff0c\u5219\u53d1\u751f\u4f5c\u7528\u65f6\uff0c\u9000\u51fa\u7684\u662f\u5f53\u524d\u6267\u884c\u7684\u7a0b\u5e8f\u5757(processing block)\uff0c\u4f8b\u5982\u4e00\u4e2aFORM\uff0cMETHOD\uff0c\u6216EVENT\u3002<\/p>\n<p><strong>EXIT.<\/strong><br \/>\n1) EXIT\u5982\u679c\u51fa\u73b0\u5728\u5faa\u73af\u4e2d\uff0c\u9000\u51fa\u7684\u662f\u6574\u4e2a\u5faa\u73af\u64cd\u4f5c\uff0c.\u7a0b\u5e8f\u4f1a\u4ece\u5faa\u73af\u7ed3\u675f\u5904\u5f00\u59cb\u7ee7\u7eed\u6267\u884c\uff0c\u5176\u4f5c\u7528\u76f8\u5f53\u4e8eJava\u4e0eC++\u4e2d\u7684break\u3002<br \/>\n2\uff09EXIT\u5982\u679c\u51fa\u73b0\u5728\u5faa\u73af\u4e4b\u5916\uff0c\u9000\u51fa\u7684\u662f\u5f53\u524d\u6267\u884c\u7684\u7a0b\u5e8f\u5757(processing block)\uff0c\u4f8b\u5982\u4e00\u4e2aFORM\uff0cMETHOD\uff0c\u6216EVENT\uff0c\u5176\u4f5c\u7528\u4e0eRETURN\u7c7b\u4f3c\u3002<\/p>\n<p><strong>RETURN.<\/strong><br \/>\nRETURN\u7528\u6765\u9000\u51fa\u5f53\u524d\u6267\u884c\u7684\u7a0b\u5e8f\u5757(processing block)\uff0c\u4f8b\u5982\u4e00\u4e2aFORM\uff0cMETHOD\uff0c\u6216EVENT\uff0c\u4e0d\u7ba1\u662f\u5426\u51fa\u73b0\u5728\u5faa\u73af(LOOP)\u4e2d\uff0cRETURN\u90fd\u4f1a\u9000\u51fa\u5f53\u524d\u6267\u884c\u7684\u7a0b\u5e8f\u5757\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u9000\u51fa\u5faa\u73af\u3002<\/p>\n<p>\u867d\u7136ABAP\u4e2dEXIT \u548cRETURN\u90fd\u53ef\u4ee5\u7528\u6765\u5b9e\u73b0\u9000\u51fa\u5f53\u524d\u6267\u884c\u7684\u8bed\u53e5\u5757\uff08processing block\uff09\uff0c\u4f46SAP\u7684\u5e2e\u52a9\u6587\u4ef6\u5efa\u8bae\u53ea\u5728\u5faa\u73af\u4e2d\u4f7f\u7528EXIT \uff0c\u5176\u4ed6\u60c5\u51b5\u4e0b\u8981\u9000\u51fa\u5f53\u524d\u6267\u884c\u8fdb\u7a0b\uff0c\u4f7f\u7528RETURN \u3002<\/p>\n<p><strong>LEAVE PROGRAM.<\/strong><br \/>\nLEAVE PROGRAM\u4f1a\u76f4\u63a5\u9000\u51fa\u4e3b\u7a0b\u5e8f\uff0c\u7c7b\u4f3cC++\u4e2d\u7684exit\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u524d\u90fd\u662f\u5199C++\u6216\u8005Java \u7a0b\u5e8f\uff0c\u521a\u5f00\u59cb\u5b66ABAP\uff0c\u5bf9\u9000\u51fa\u64cd\u4f5c\u8fd8\u4e0d\u592a\u4e60\u60ef\uff0c\u5f88\u5bb9\u6613\u6df7\u6dc6\u3002\u8fd9\u91cc\u603b\u7ed3\u4e00\u4e0b\u51e0\u4e2a\u5e38\u7528\u7684\u9000\u51fa\u64cd\u4f5c\uff1a CHECK. 1\uff09CHECK \u540e\u9762\u8981\u8ddf\u4e00\u4e2a\u8868\u8fbe\u5f0f\uff0c\u5f53\u8868\u8fbe\u5f0f\u503c\u4e3a\u5047(false)\u65f6\uff0cCHECK\u53d1\u751f\u4f5c\u7528\uff0c\u9000\u51fa\u5faa\u73af(LOOP)\u6216\u5904\u7406\u7a0b\u5e8f\uff08Processing Block\uff09\u3002 2\uff09\u5982\u679cCHECK\u51fa\u73b0\u5728\u5faa\u73af\u4e2d\uff0c\u5219\u53d1\u751f\u4f5c\u7528\u65f6\uff0c\u9000\u51fa\u7684\u662f\u5f53\u524d\u4e00\u6b21\u5faa\u73af\u64cd\u4f5c\uff0c\u7a0b\u5e8f\u4f1a\u7ee7\u7eed\u6267\u884c\u4e0b\u4e00\u6b21\u5faa\u73af\u64cd\u4f5c\uff0c\u5176\u4f5c\u7528\u7c7b\u4f3c\u4e8eContinue \uff08Java \u6216C++\u4e2dcontinue\u4e5f\u662f\u5982\u6b64\uff09. 3\uff09\u5982\u679cCHECK\u51fa\u73b0\u5728\u5faa\u73af\u4ee5\u5916\uff0c\u5219\u53d1\u751f\u4f5c\u7528\u65f6\uff0c\u9000\u51fa\u7684\u662f\u5f53\u524d\u6267\u884c\u7684\u7a0b\u5e8f\u5757(processing block)\uff0c\u4f8b\u5982\u4e00\u4e2aFORM\uff0cMETHOD\uff0c\u6216EVENT\u3002 EXIT. 1) EXIT\u5982\u679c\u51fa\u73b0\u5728\u5faa\u73af\u4e2d\uff0c\u9000\u51fa\u7684\u662f\u6574\u4e2a\u5faa\u73af\u64cd\u4f5c\uff0c.\u7a0b\u5e8f\u4f1a\u4ece\u5faa\u73af\u7ed3\u675f\u5904\u5f00\u59cb\u7ee7\u7eed\u6267\u884c\uff0c\u5176\u4f5c\u7528\u76f8\u5f53\u4e8eJava\u4e0eC++\u4e2d\u7684break\u3002 2\uff09EXIT\u5982\u679c\u51fa\u73b0\u5728\u5faa\u73af\u4e4b\u5916\uff0c\u9000\u51fa\u7684\u662f\u5f53\u524d\u6267\u884c\u7684\u7a0b\u5e8f\u5757(processing block)\uff0c\u4f8b\u5982\u4e00\u4e2aFORM\uff0cMETHOD\uff0c\u6216EVENT\uff0c\u5176\u4f5c\u7528\u4e0eRETURN\u7c7b\u4f3c\u3002 RETURN. RETURN\u7528\u6765\u9000\u51fa\u5f53\u524d\u6267\u884c\u7684\u7a0b\u5e8f\u5757(processing block)\uff0c\u4f8b\u5982\u4e00\u4e2aFORM\uff0cMETHOD\uff0c\u6216EVENT\uff0c\u4e0d\u7ba1\u662f\u5426\u51fa\u73b0\u5728\u5faa\u73af(LOOP)\u4e2d\uff0cRETURN\u90fd\u4f1a\u9000\u51fa\u5f53\u524d\u6267\u884c\u7684\u7a0b\u5e8f\u5757\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u9000\u51fa\u5faa\u73af\u3002 \u867d\u7136ABAP\u4e2dEXIT \u548cRETURN\u90fd\u53ef\u4ee5\u7528\u6765\u5b9e\u73b0\u9000\u51fa\u5f53\u524d\u6267\u884c\u7684\u8bed\u53e5\u5757\uff08processing block\uff09\uff0c\u4f46SAP\u7684\u5e2e\u52a9\u6587\u4ef6\u5efa\u8bae\u53ea\u5728\u5faa\u73af\u4e2d\u4f7f\u7528EXIT \uff0c\u5176\u4ed6\u60c5\u51b5\u4e0b\u8981\u9000\u51fa\u5f53\u524d\u6267\u884c\u8fdb\u7a0b\uff0c\u4f7f\u7528RETURN \u3002 LEAVE PROGRAM. LEAVE PROGRAM\u4f1a\u76f4\u63a5\u9000\u51fa\u4e3b\u7a0b\u5e8f\uff0c\u7c7b\u4f3cC++\u4e2d\u7684exit\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/posts\/283"}],"collection":[{"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/comments?post=283"}],"version-history":[{"count":1,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/posts\/283\/revisions"}],"predecessor-version":[{"id":284,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/posts\/283\/revisions\/284"}],"wp:attachment":[{"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/media?parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/categories?post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/tags?post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}