{"id":67,"date":"2008-03-09T00:16:09","date_gmt":"2008-03-09T04:16:09","guid":{"rendered":"http:\/\/www.prglab.com\/blog\/p\/67"},"modified":"2008-03-14T22:37:07","modified_gmt":"2008-03-15T02:37:07","slug":"sap-abap-%e6%80%a7%e8%83%bd%e4%bc%98%e5%8c%96%e6%8a%80%e5%b7%a7-%e6%80%a7%e8%83%bd%e5%88%86%e6%9e%90%e7%9a%84%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"https:\/\/www.prglab.com\/blog\/p\/67","title":{"rendered":"SAP ABAP \u6027\u80fd\u4f18\u5316\u6280\u5de7 &#8212;  \u6027\u80fd\u5206\u6790\u7684\u5de5\u5177"},"content":{"rendered":"<p class=\"MsoNormal\"><span lang=\"EN-US\"><font face=\"Arial\"><font size=\"2\">\u4ee5\u4e0b\u662fSAP\u63d0\u4f9b\u7684\u5404\u79cd\u5bf9ABAP\u5bf9\u8c61\u8fdb\u884c\u6027\u80fd\u5206\u6790\u7684\u5de5\u5177\uff1a<\/font><\/font><\/span><\/p>\n<p><font face=\"Arial\">\t\t\t<\/font><\/p>\n<ol style=\"margin-top: 0cm; margin-bottom: 0cm\" start=\"1\" type=\"1\">  <font face=\"Arial\"><\/p>\n<li class=\"MsoNormal\"><span lang=\"EN-US\"> \t\t\t\t<font face=\"Arial\" size=\"2\">\u8fd0\u884c\u5b9e\u65f6\u5206\u6790 transaction SE30<\/font><\/span><\/li>\n<p><\/font><\/ol>\n<p><font face=\"Arial\">\t\t\t<\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin-left: 36pt\"><span lang=\"EN-US\"> <font face=\"Arial\">\t\t\t<font size=\"2\">\u8fd9\u4e2a transaction \u53ef\u4ee5\u7ed9\u51fa\u5bf9\u4e00\u4e2aABAP\u7a0b\u5e8f\u7684\u6240\u6709\u5206\u6790\uff0c\u5305\u62ec\u6570\u636e\u5e93\u548c\u975e\u6570\u636e\u5e93\u5904\u7406\u64cd\u4f5c\u3002 <\/font><\/font><\/span><\/p>\n<p><font face=\"Arial\">\t\t\t<\/font><\/p>\n<ol style=\"margin-top: 0cm; margin-bottom: 0cm\" start=\"2\" type=\"1\">  <font face=\"Arial\"><\/p>\n<li class=\"MsoNormal\"><span lang=\"EN-US\"> \t\t\t\t<font face=\"Arial\" size=\"2\">SQL \u8ffd\u8e2a transaction ST05<\/font><\/span><\/li>\n<p><\/font><\/ol>\n<p><font face=\"Arial\">\t\t\t<\/font><\/p>\n<blockquote><p> <font face=\"Arial\">\t\t\t\t<\/font><\/p>\n<p class=\"MsoBodyTextIndent2\"><span lang=\"EN-US\"><font face=\"Arial\"><font size=\"2\"> \t\t\t\t\u8ffd\u8e2a\u5217\u8868\u6709\u5f88\u591a\u884c\u4e0d\u662f\u5173\u4e8e SELECT  \t\t\t\t\u8bed\u53e5\u7684\uff0c\u56e0\u4e3a\u4efb\u4f55ABAP\u7a0b\u5e8f\u7684\u6267\u884c\u90fd\u4f1a\u9700\u8981\u5f88\u591a\u9644\u52a0\u7684\u7ba1\u7406\u6027SQL\u8c03\u7528\u3002\u53ef\u4ee5\u4f7f\u7528\u8fc7\u6ee4\u5668\u6765\u663e\u793a\u8ffd\u8e2a\u5217\u8868\u7684\u8f93\u51fa\u6765\u53ea\u663e\u793a\u6709\u5173\u7684\u884c\u3002  <\/font><\/font><\/span><\/p>\n<p><font face=\"Arial\">\t\t\t<\/font><\/p><\/blockquote>\n<p><font face=\"Arial\">\t\t\t<\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin-left: 36pt\"><span lang=\"EN-US\"> <font face=\"Arial\">\t\t\t<font size=\"2\">\u8ffd\u8e2a\u5217\u8868<\/font><\/font><\/span><span lang=\"EN-US\"><font face=\"Arial\"><font size=\"2\">\u540c\u65f6<\/font><\/font><\/span><span lang=\"EN-US\"><font face=\"Arial\"><font size=\"2\">\u5305\u542b\u4e0e\u4e00\u4e2aSELECT\u8bed\u53e5\u76f8\u5173\u7684\u591a\u4e2a\u4e0d\u540c SQL \u547d\u4ee4\uff0c\u56e0\u4e3a R\/3 \u6570\u636e\u5e93\u63a5\u53e3 &#8212; R\/3\u5e94\u7528\u670d\u52a1\u5668\u7684\u4e00\u4e2a\u590d\u6742\u7684\u7ec4\u6210\u90e8\u5206 &#8212; \u5c06\u6bcf\u4e00\u4e2a  \t\t\tOpen SQL \u547d\u4ee4\u6620\u5c04\u4e3a\u4e00\u4e2a\u6216\u4e00\u7cfb\u5217\u7684\u7269\u7406\u6570\u636e\u5e93\u8c03\u7528\u6307\u4ee4\u5e76\u6267\u884c\u8fd9\u4e9b\u6307\u4ee4\u3002\u8fd9\u79cd\u6620\u5c04\u4f9d\u8d56\u4e8e\u5177\u4f53\u7684\u8c03\u7528\u548c\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u5bf9R\/3\u7684\u6027\u80fd\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4f8b\u5982\u5728<\/font><\/font><\/span><span lang=\"EN-US\"><font face=\"Arial\"><font size=\"2\">\u6211\u4eec\u7684\u6d4b\u8bd5\u7a0b\u5e8f\u4e2d\uff0cSPFLI\u8868\u4e0a\u7684<\/font><\/font><\/span><span lang=\"EN-US\"><font face=\"Arial\"><font size=\"2\">\tSELECT-ENDSELECT \u5faa\u73af\u88ab\u6620\u5c04\u6210\u4e3a\u4e00\u8fde\u4e32Oracle\u73af\u5883\u4e0b\u7684 PREPARE-OPEN-FETCH \u7684\u7269\u7406\u8c03\u7528\u3002 <\/font><\/font><\/span><\/p>\n<p><font face=\"Arial\">\t\t\t<\/font><\/p>\n<blockquote><p> <font face=\"Arial\">\t\t\t\t<\/font><\/p>\n<p class=\"MsoBodyTextIndent2\" style=\"line-height: 11pt\">  <font face=\"Arial\"><span lang=\"EN-US\"><\/span><\/font><font face=\"Arial\"><span lang=\"EN-US\"><font size=\"2\">\u8ffd\u8e2a\u5217\u8868\u4e2d\u7684SQL\u8bed\u53e5\u7684W<\/font><\/span><\/font><font face=\"Arial\"><span lang=\"EN-US\"><font size=\"2\">HERE\u6761\u4ef6\u4e0eABAP\u8bed\u53e5\u4e2d\u7684 WHERE \u662f\u4e0d\u540c\u7684\u3002\u56e0\u4e3a\u5728 R\/3 \u7cfb\u7edf\u4e2d\uff0c\u5ba2\u6237\u662f\u4e00\u4e2a<\/font><\/span><\/font><font face=\"Arial\"><span lang=\"EN-US\"><font size=\"2\">\u5177\u6709\u81ea\u5df1\u7684\u4e3b\u8bb0\u5f55(master records)\u548c\u81ea\u5df1\u7684\u4e00\u7ec4\u6570\u636e\u8868\u7684<\/font><\/span><\/font><font face=\"Arial\"><span lang=\"EN-US\"><font size=\"2\">\u72ec\u7acb\u5355\u5143\u3002\u4f7f\u7528ABAP\uff0c\u6bcf\u4e00\u4e2a Open SQL \u7684\u547d\u4ee4\u90fd\u4f1a\u81ea\u52a8\u5728\u76f8\u5e94\u7684\u5ba2\u6237\u73af\u5883\u4e2d\u8fd0\u884c\u3002\u56e0\u6b64\uff0c\u5982\u679c\u88ab\u67e5\u627e\u7684\u8868\u6709\u5ba2\u6237(client)\u5b57\u6bb5\u7684\u8bdd\uff0c\u6bcf\u4e00\u4e2aWHERE\u8bed\u53e5\u90fd\u4f1a\u81ea\u52a8\u6dfb\u52a0\u4e00\u4e2a\u6761\u4ef6\u5305\u542b<\/font><\/span><\/font><font face=\"Arial\"><span lang=\"EN-US\"><font size=\"2\">\u5b9e\u9645\u7684\u5ba2\u6237\u4ee3\u7801<\/font><\/span><\/font><font face=\"Arial\"><span lang=\"EN-US\"><font size=\"2\">\u3002 \t\t\t\t<\/font><\/span><\/font><\/p>\n<p><font face=\"Arial\">\t\t\t<\/font><\/p><\/blockquote>\n<p>\u8981\u67e5\u770b\u4e00\u4e2a\u8bed\u53e5\u7684\u6267\u884c\u8ba1\u5212\uff08execution plan\uff09\uff0c\u53ea\u9700\u8981\u5c06\u5149\u6807\u653e\u5728<font face=\"Arial\"><span lang=\"EN-US\"><font size=\"2\"> PREPARE \u8bed\u53e5\u4e0a\uff0c\u7136\u540e\u9009\u62e9  \t\t\tExplain SQL\u3002\u5177\u4f53\u7684\u6267\u884c\u8ba1\u5212\u7684\u89e3\u91ca\u53d6\u51b3\u4e8e\u4f7f\u7528\u7684\u6570\u636e\u5e93\u3002 <\/font><\/span><\/font><\/p>\n<hr \/>\n<p> <center><font size=\"2\"><a href=\"http:\/\/www.prglab.com\/blog\/p\/53\">\u8fd4\u56de\u6587\u7ae0\u76ee\u5f55<\/a><\/font><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u662fSAP\u63d0\u4f9b\u7684\u5404\u79cd\u5bf9ABAP\u5bf9\u8c61\u8fdb\u884c\u6027\u80fd\u5206\u6790\u7684\u5de5\u5177\uff1a \u8fd0\u884c\u5b9e\u65f6\u5206\u6790 transaction SE30 \u8fd9\u4e2a transaction \u53ef\u4ee5\u7ed9\u51fa\u5bf9\u4e00\u4e2aABAP\u7a0b\u5e8f\u7684\u6240\u6709\u5206\u6790\uff0c\u5305\u62ec\u6570\u636e\u5e93\u548c\u975e\u6570\u636e\u5e93\u5904\u7406\u64cd\u4f5c\u3002 SQL \u8ffd\u8e2a transaction ST05 \u8ffd\u8e2a\u5217\u8868\u6709\u5f88\u591a\u884c\u4e0d\u662f\u5173\u4e8e SELECT \u8bed\u53e5\u7684\uff0c\u56e0\u4e3a\u4efb\u4f55ABAP\u7a0b\u5e8f\u7684\u6267\u884c\u90fd\u4f1a\u9700\u8981\u5f88\u591a\u9644\u52a0\u7684\u7ba1\u7406\u6027SQL\u8c03\u7528\u3002\u53ef\u4ee5\u4f7f\u7528\u8fc7\u6ee4\u5668\u6765\u663e\u793a\u8ffd\u8e2a\u5217\u8868\u7684\u8f93\u51fa\u6765\u53ea\u663e\u793a\u6709\u5173\u7684\u884c\u3002 \u8ffd\u8e2a\u5217\u8868\u540c\u65f6\u5305\u542b\u4e0e\u4e00\u4e2aSELECT\u8bed\u53e5\u76f8\u5173\u7684\u591a\u4e2a\u4e0d\u540c SQL \u547d\u4ee4\uff0c\u56e0\u4e3a R\/3 \u6570\u636e\u5e93\u63a5\u53e3 &#8212; R\/3\u5e94\u7528\u670d\u52a1\u5668\u7684\u4e00\u4e2a\u590d\u6742\u7684\u7ec4\u6210\u90e8\u5206 &#8212; \u5c06\u6bcf\u4e00\u4e2a Open SQL \u547d\u4ee4\u6620\u5c04\u4e3a\u4e00\u4e2a\u6216\u4e00\u7cfb\u5217\u7684\u7269\u7406\u6570\u636e\u5e93\u8c03\u7528\u6307\u4ee4\u5e76\u6267\u884c\u8fd9\u4e9b\u6307\u4ee4\u3002\u8fd9\u79cd\u6620\u5c04\u4f9d\u8d56\u4e8e\u5177\u4f53\u7684\u8c03\u7528\u548c\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u5bf9R\/3\u7684\u6027\u80fd\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4f8b\u5982\u5728\u6211\u4eec\u7684\u6d4b\u8bd5\u7a0b\u5e8f\u4e2d\uff0cSPFLI\u8868\u4e0a\u7684 SELECT-ENDSELECT \u5faa\u73af\u88ab\u6620\u5c04\u6210\u4e3a\u4e00\u8fde\u4e32Oracle\u73af\u5883\u4e0b\u7684 PREPARE-OPEN-FETCH \u7684\u7269\u7406\u8c03\u7528\u3002 \u8ffd\u8e2a\u5217\u8868\u4e2d\u7684SQL\u8bed\u53e5\u7684WHERE\u6761\u4ef6\u4e0eABAP\u8bed\u53e5\u4e2d\u7684 WHERE \u662f\u4e0d\u540c\u7684\u3002\u56e0\u4e3a\u5728 R\/3 \u7cfb\u7edf\u4e2d\uff0c\u5ba2\u6237\u662f\u4e00\u4e2a\u5177\u6709\u81ea\u5df1\u7684\u4e3b\u8bb0\u5f55(master records)\u548c\u81ea\u5df1\u7684\u4e00\u7ec4\u6570\u636e\u8868\u7684\u72ec\u7acb\u5355\u5143\u3002\u4f7f\u7528ABAP\uff0c\u6bcf\u4e00\u4e2a Open SQL \u7684\u547d\u4ee4\u90fd\u4f1a\u81ea\u52a8\u5728\u76f8\u5e94\u7684\u5ba2\u6237\u73af\u5883\u4e2d\u8fd0\u884c\u3002\u56e0\u6b64\uff0c\u5982\u679c\u88ab\u67e5\u627e\u7684\u8868\u6709\u5ba2\u6237(client)\u5b57\u6bb5\u7684\u8bdd\uff0c\u6bcf\u4e00\u4e2aWHERE\u8bed\u53e5\u90fd\u4f1a\u81ea\u52a8\u6dfb\u52a0\u4e00\u4e2a\u6761\u4ef6\u5305\u542b\u5b9e\u9645\u7684\u5ba2\u6237\u4ee3\u7801\u3002 \u8981\u67e5\u770b\u4e00\u4e2a\u8bed\u53e5\u7684\u6267\u884c\u8ba1\u5212\uff08execution plan\uff09\uff0c\u53ea\u9700\u8981\u5c06\u5149\u6807\u653e\u5728 PREPARE \u8bed\u53e5\u4e0a\uff0c\u7136\u540e\u9009\u62e9 Explain SQL\u3002\u5177\u4f53\u7684\u6267\u884c\u8ba1\u5212\u7684\u89e3\u91ca\u53d6\u51b3\u4e8e\u4f7f\u7528\u7684\u6570\u636e\u5e93\u3002 \u8fd4\u56de\u6587\u7ae0\u76ee\u5f55<\/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\/67"}],"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=67"}],"version-history":[{"count":0,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}