{"id":147,"date":"2019-05-02T08:16:41","date_gmt":"2019-05-02T00:16:41","guid":{"rendered":"http:\/\/www.hefeiyu.com\/?p=147"},"modified":"2019-05-02T14:29:12","modified_gmt":"2019-05-02T06:29:12","slug":"%e7%ba%af%e8%8b%b1%e6%96%87excel%e6%95%b0%e6%8d%ae%e5%af%bc%e5%85%a5tiptop-erp-%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"https:\/\/www.hefeiyu.com\/?p=147","title":{"rendered":"\u7eaf\u82f1\u6587EXCEL\u6570\u636e\u5bfc\u5165TIPTOP ERP \u7cfb\u7edf"},"content":{"rendered":"<blockquote><p>\u524d\u6392\u63d0\u793a\uff0c\u5bfc\u5165\u65f6EXCEL\u53ef\u80fd\u9700\u8981\u5904\u4e8e\u6253\u5f00\u72b6\u6001\uff0c\u5e76\u4e14EXCEL\u5185\u5bb9\u4e0d\u80fd\u5305\u62ec\u4e2d\u6587\u6c49\u5b57\uff0c\u5426\u5219\u4f1a\u51fa\u73b0\u4e71\u7801\u3002\u540e\u9762\u6211\u4f1a\u518d\u4e3e\u4e24\u79cd\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5bfc\u4e2d\u6587\u7684\u548c\u9002\u5408\u5927\u6279\u91cf\u6570\u636e\u7684\u65b9\u6cd5\u3002<\/p><\/blockquote>\n<div id=\"content_views\" class=\"htmledit_views\">\n<p><span style=\"font-family: 'KaiTi_GB2312'; font-size: 18px; color: #000099;\"><strong>\u6d4b\u8bd5\u7cfb\u7edfTIPTOP GP 3.0<\/strong><\/span><\/p>\n<p><span style=\"font-family: 'KaiTi_GB2312'; font-size: 18px; color: #000099;\"><strong>\u4e3b\u8981\u7528\u5230DDE API<\/strong><\/span><\/p>\n<div class=\"table-box\">\n<table style=\"width: 637px;\" border=\"1\" width=\"637\" cellspacing=\"1\" cellpadding=\"1\">\n<tbody>\n<tr>\n<td><strong>\u51fd\u6570<\/strong><\/td>\n<td><strong>\u63cf\u8ff0<\/strong><\/td>\n<\/tr>\n<tr>\n<td>DDEConnect<\/td>\n<td>This function opens a DDE connection<\/td>\n<\/tr>\n<tr>\n<td>DDEExecute<\/td>\n<td>This function executes a command in the specified program<\/td>\n<\/tr>\n<tr>\n<td>DDEFinish<\/td>\n<td>This function closes a DDE connection<\/td>\n<\/tr>\n<tr>\n<td>DDEFinishAll<\/td>\n<td>This function closes all DDE connections, as well as the DDE server program<\/td>\n<\/tr>\n<tr>\n<td>DDEError<\/td>\n<td>This function returns DDE error information about the last DDE operation<\/td>\n<\/tr>\n<tr>\n<td>DDEPeek<\/td>\n<td>This function retrieves data from the specified program and document using the DDE channel<\/td>\n<\/tr>\n<tr>\n<td>DDEPoke<\/td>\n<td>This function sends data to the specified program and document using the DDE channel<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><span style=\"font-family: 'KaiTi_GB2312'; font-size: 18px; color: #000099;\"><strong>\u9996\u5148\u770bEXCEL\u6587\u6863\u5185\u5bb9\u5982\u4e0b\u56fe\uff1a<\/strong><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.hefeiyu.com\/wp-content\/uploads\/2019\/05\/1349677824_8988.jpg\" alt=\"\" width=\"700\" height=\"300\" \/><\/p>\n<p><span style=\"font-family: 'KaiTi_GB2312'; font-size: 18px; color: #000099;\"><strong>4gl\u7a0b\u5e8f\u5982\u4e0b\u56fe\uff1a<\/strong><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.hefeiyu.com\/wp-content\/uploads\/2019\/05\/1349677856_1172.jpg\" alt=\"\" width=\"720\" height=\"603\" \/><\/p>\n<p><span style=\"font-family: 'KaiTi_GB2312'; font-size: 18px; color: #000099;\"><strong>4gl\u7a0b\u5e8f\u4ee3\u7801\u5982\u4e0b\uff1a<\/strong><\/span><\/p>\n<pre class=\"pure-highlightjs\"><code class=\"null\">###20120406 BY FMX------LOAD FROM EXCEL-----------          \r\nFUNCTION load_from_excel()    \r\n DEFINE program  VARCHAR(128),   #Name of the DDE server program\r\n        document VARCHAR(128),   #Name of the DDE document\r\n        ls_file_path string, \r\n        row      SMALLINT,\r\n        cel      SMALLINT,\r\n        row_cel  STRING,\r\n        l_msg    VARCHAR(100),\r\n        l_len    SMALLINT,\r\n        l_n      SMALLINT,\r\n        l_excelseq SMALLINT,\r\n        Returns  SMALLINT,\r\n        l_ac     SMALLINT, \r\n        l_sl     SMALLINT   \r\n DEFINE l_tc_sfb RECORD LIKE tc_sfb_file.*    \r\n DEFINE cmd VARCHAR(500)\r\n DEFINE res SMALLINT\r\n DEFINE val STRING\r\n DEFINE ret SMALLINT\r\n DEFINE var STRING\r\n DEFINE var2    VARCHAR(40)\r\n DEFINE l_flag  VARCHAR(100)  #\u5224\u65ad\u5fc5\u8981\u680f\u4f4d\u662f\u5426\u6709\u8f93\u5165  #No.FUN-690028 CHAR(1)\r\n DEFINE l_sql   STRING\r\n \r\n LET l_ac=1\r\n LET l_sl=1\r\n LET program=\"EXCEL\"\r\n  \r\n  #\u5f00\u7a97\u9009\u62e9\u6863\u6848\r\n   OPEN WINDOW csfi002_load_w WITH FORM \"csf\/42f\/csfi002_load\" \r\n   CALL cl_ui_locale(\"csfi002_load\")\r\n   \r\n   INPUT ls_file_path WITHOUT DEFAULTS  FROM FORMONLY.doc_path              \r\n      ON ACTION open_file\r\n         CALL cl_browse_file() RETURNING ls_file_path\r\n         DISPLAY ls_file_path TO FORMONLY.doc_path\r\n      ON ACTION exit\r\n         EXIT INPUT\r\n   END INPUT\r\n   \r\n   IF INT_FLAG THEN\r\n      LET INT_FLAG = FALSE\r\n      CLOSE WINDOW csfi002_load_w\r\n      RETURN\r\n   END IF\r\n \r\n###\u5224\u65ad\u8def\u5f84\u662f\u5426\u4e3a\u7a7a\r\n   IF ls_file_path IS NULL  THEN\r\n      CLOSE WINDOW csfi002_load_w\r\n      RETURN\r\n   ELSE\r\n      LET document = ls_file_path\r\n      DISPLAY 'ls_file_path = ',document\r\n   END IF\r\n \r\n      LET l_len = LENGTH(document)\r\n      IF l_len&lt;=4 THEN\r\n          LET document= document CLIPPED,'.xls'\r\n        ELSE\r\n          IF DOWNSHIFT(document[l_len-3,l_len])!='.xls' THEN\r\n             LET document= document CLIPPED,'.xls'\r\n          END IF\r\n       END IF\r\n       \r\n    CALL ui.Interface.frontCall(\"WINDDE\",\"DDEConnect\",[ program, document ], Returns ) \r\n    LET row=2   ###\u4ece\u7b2c\u4e8c\u884c\u5f00\u59cb\r\n    WHILE TRUE\r\n            INITIALIZE l_tc_sfb.* TO NULL \r\n         #\u8bfb\u53d6\u5de5\u5355\u5355\u53f7 [tc_sfb01]\r\n            LET cel=1    ##\u7b2c\u4e00\u5217\r\n             LET row_cel='R',(row USING '&lt;&lt;&lt;&lt;&lt;'),'C',(cel USING '&lt;&lt;&lt;&lt;&lt;')\r\n             CALL ui.Interface.frontCall(\"WINDDE\",\"DDEPeek\", [program,document,row_cel], [Returns,val])\r\n              LET var2=val CLIPPED\r\n            IF (var2 IS NULL OR var2=' ') THEN\r\n            \t ERROR '\u5355\u53f7\u4e0d\u53ef\u4e3a\u7a7a'\r\n               EXIT WHILE\r\n            END IF\r\n            LET l_tc_sfb.tc_sfb01 = var2\r\n         #\u8bfb\u53d6\u6295\u4ea7\u671f [tc_sfb022]\r\n            LET cel=2   ##\u7b2c\u4e8c\u5217\r\n            LET row_cel='R',(row USING '&lt;&lt;&lt;&lt;&lt;'),'C',(cel USING '&lt;&lt;&lt;&lt;&lt;')\r\n             CALL ui.Interface.frontCall(\"WINDDE\",\"DDEPeek\", [program,document,row_cel], [Returns,val])\r\n             LET var2=val CLIPPED\r\n            IF (var2 IS NULL OR var2=' ') THEN\r\n            \tERROR '\u6295\u4ea7\u671f\u4e0d\u53ef\u4e3a\u7a7a'\r\n               EXIT WHILE\r\n            END IF\r\n            LET l_tc_sfb.tc_sfb022 = var2\r\n            \r\n         #\u8bfb\u53d6\u5b8c\u6210\u671f [tc_sfb023]\r\n            LET cel=3   ##\u7b2c3\u5217\r\n            LET row_cel='R',(row USING '&lt;&lt;&lt;&lt;&lt;'),'C',(cel USING '&lt;&lt;&lt;&lt;&lt;')\r\n             CALL ui.Interface.frontCall(\"WINDDE\",\"DDEPeek\", [program,document,row_cel], [Returns,val])\r\n             LET var2=val CLIPPED\r\n            IF (var2 IS NULL OR var2=' ') THEN\r\n            \tERROR '\u5b8c\u6210\u671f\u4e0d\u53ef\u4e3a\u7a7a'\r\n               EXIT WHILE\r\n            END IF\r\n            LET l_tc_sfb.tc_sfb023 = var2\r\n            \r\n         #\u8bfb\u53d6\u673a\u53f0\u751f\u4ea7\u7ebf [tc_sfb03]\r\n            LET cel=4   ##\u7b2c4\u5217\r\n            LET row_cel='R',(row USING '&lt;&lt;&lt;&lt;&lt;'),'C',(cel USING '&lt;&lt;&lt;&lt;&lt;')\r\n             CALL ui.Interface.frontCall(\"WINDDE\",\"DDEPeek\", [program,document,row_cel], [Returns,val])\r\n             LET var2=val CLIPPED\r\n#            IF (var2 IS NULL OR var2=' ') THEN\r\n#            \tERROR '\u673a\u53f0\u751f\u4ea7\u7ebf\u4e0d\u53ef\u4e3a\u7a7a'\r\n#               EXIT WHILE\r\n#            END IF\r\n            LET l_tc_sfb.tc_sfb03 = var2 \r\n         #\u8bfb\u53d6\u662f\u5426\u6392\u73ed [tc_sfb05]\r\n            LET cel=5   ##\u7b2c5\u5217\r\n            LET row_cel='R',(row USING '&lt;&lt;&lt;&lt;&lt;'),'C',(cel USING '&lt;&lt;&lt;&lt;&lt;')\r\n            CALL ui.Interface.frontCall(\"WINDDE\",\"DDEPeek\", [program,document,row_cel], [Returns,val])\r\n            LET var2=val CLIPPED\r\n            LET l_tc_sfb.tc_sfb05 = var2\r\n             \r\n         #\u8bfb\u53d6\u767d\u73ed [tc_sfb07]\r\n            LET cel=6  ##\u7b2c6\u5217\r\n            LET row_cel='R',(row USING '&lt;&lt;&lt;&lt;&lt;'),'C',(cel USING '&lt;&lt;&lt;&lt;&lt;')\r\n            CALL ui.Interface.frontCall(\"WINDDE\",\"DDEPeek\", [program,document,row_cel], [Returns,val])\r\n            LET var2=val CLIPPED\r\n            LET l_tc_sfb.tc_sfb07 = var2 \r\n            \r\n         #\u8bfb\u53d6\u591c\u73ed  [tc_sfb08]\r\n            LET cel=7   ##\u7b2c7\u5217\r\n            LET row_cel='R',(row USING '&lt;&lt;&lt;&lt;&lt;'),'C',(cel USING '&lt;&lt;&lt;&lt;&lt;')\r\n            CALL ui.Interface.frontCall(\"WINDDE\",\"DDEPeek\", [program,document,row_cel], [Returns,val])\r\n            LET var2=val CLIPPED\r\n            LET l_tc_sfb.tc_sfb08 = var2   \r\n                                  \r\n LET row=row+1 \r\n    SELECT COUNT(*) into l_n FROM tc_sfb_file \r\n    WHERE tc_sfb01 =l_tc_sfb.tc_sfb01 \r\n#   AND tc_sfb022 IS NULL \r\n#   AND tc_sfb023 IS NULL\r\n    IF l_n&gt;0 THEN\r\n     \tUPDATE tc_sfb_file SET tc_sfb022=l_tc_sfb.tc_sfb022,\r\n     \t                       tc_sfb023=l_tc_sfb.tc_sfb023,\r\n     \t                       tc_sfb03=l_tc_sfb.tc_sfb03,\r\n     \t                       tc_sfb05=l_tc_sfb.tc_sfb05,\r\n     \t                       tc_sfb07=l_tc_sfb.tc_sfb07,\r\n     \t                       tc_sfb08=l_tc_sfb.tc_sfb08 \r\n     \t                 WHERE tc_sfb01=l_tc_sfb.tc_sfb01    \t                 \r\n      IF STATUS OR SQLCA.SQLERRD[3] = 0 THEN\r\n         CALL cl_err3(\"upd\",\"tc_sfb_file\",l_tc_sfb.tc_sfb01,\"\",STATUS,\"\",\"upd tc_sfb01\",1) #TQC-660045\r\n         LET g_success = 'N' RETURN\r\n      END IF\r\n  ###\u5c06\u5bfc\u5165\u7684\u5f00\u5de5\u65e5\u548c\u5b8c\u5de5\u65e5\u66f4\u65b0\u5230\u5de5\u5355\u4e0a------\r\n      UPDATE sfb_file SET sfb13 = l_tc_sfb.tc_sfb022,\r\n                          sfb15 = l_tc_sfb.tc_sfb023\r\n                   WHERE  sfb01 = l_tc_sfb.tc_sfb01\r\n     IF STATUS OR SQLCA.SQLERRD[3] = 0 THEN\r\n        CALL cl_err3(\"upd\",\"sfb_file\",l_tc_sfb.tc_sfb01,\"\",STATUS,\"\",\"upd sfb01\",1) #TQC-660045\r\n        LET g_success = 'N' RETURN\r\n     END IF               \r\n   END IF                  \r\n  ###END------------------------\r\n            CONTINUE WHILE\r\n            IF row&gt;20000 THEN\r\n               ERROR '\u53ea\u80fd\u663e\u793a20000\u884c!\u73b0\u53ea\u4ea7\u751f\u524d20000\u884c\u8d44\u6599!'\r\n               EXIT WHILE\r\n            END IF\r\n            LET l_ac=l_ac+1\r\n            LET l_sl=l_sl+1\r\n    END WHILE\r\n \r\n--   CALL DDEFinishAll()\r\n     CALL cl_end2(1) RETURNING l_flag \r\n     \r\n     CALL i002_b_fill('1=1')                 #\u5355\u8eab\r\n     CLOSE WINDOW csfi002_load_w  \r\n                                \r\nEND FUNCTION\r\n###END*******************************************<\/code><\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"https:\/\/www.hefeiyu.com\">\u8d6b\u975e\u57df<\/a> &raquo; <a href=\"https:\/\/www.hefeiyu.com\/?p=147\">\u7eaf\u82f1\u6587EXCEL\u6570\u636e\u5bfc\u5165TIPTOP ERP \u7cfb\u7edf<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u524d\u6392\u63d0\u793a\uff0c\u5bfc\u5165\u65f6EXCEL\u53ef\u80fd\u9700\u8981\u5904\u4e8e\u6253\u5f00\u72b6\u6001\uff0c\u5e76\u4e14EXCEL\u5185\u5bb9\u4e0d\u80fd\u5305\u62ec\u4e2d\u6587\u6c49\u5b57\uff0c\u5426\u5219\u4f1a\u51fa\u73b0\u4e71\u7801\u3002\u540e\u9762\u6211\u4f1a\u518d\u4e3e\u4e24\u79cd\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5bfc\u4e2d\u6587\u7684\u548c\u9002\u5408\u5927\u6279\u91cf\u6570\u636e\u7684\u65b9\u6cd5\u3002 \u6d4b\u8bd5\u7cfb\u7edfTIPTOP GP 3.0 \u4e3b\u8981\u7528\u5230DDE API \u51fd\u6570 \u63cf\u8ff0 DDEConnec [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[67,36],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-4gl","tag-excel","tag-tiptop"],"_links":{"self":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=147"}],"version-history":[{"count":0,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=\/wp\/v2\/posts\/147\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hefeiyu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}