首页 > 代码库 > SAP IDES中SPFLI表中生成数据
SAP IDES中SPFLI表中生成数据
安装好IDES后,发现SPFLI表中竟然没有数据,百度了一下,网友给出一段代码,运行以后,SPFLI中就有数据了,代码如下:
*&---------------------------------------------------------------------**& Report ZLIU_008*& www.qiqubaike.com*&---------------------------------------------------------------------**& 生成SPFLI表的测试数据*&*&---------------------------------------------------------------------*REPORT ZLIU_008.DATA: BEGIN OF ET_SPFLI OCCURS 0. INCLUDE STRUCTURE SPFLI.DATA: END OF ET_SPFLI.DATA: BEGIN OF ET_SFLIGHT OCCURS 0. INCLUDE STRUCTURE SFLIGHT.DATA: END OF ET_SFLIGHT.DELETE FROM SPFLI.*WRITE: / ‘Delete records:‘,SY-DBCNT.DELETE FROM SFLIGHT.*WRITE: / ‘Delete records:‘,SY-DBCNT.CLEAR sy-SUBRC.CALL FUNCTION ‘BCALV_GENERATE_TEST_DATA‘ EXPORTING I_AMOUNT_SPFLI = 100 I_AMOUNT_SFLIGHT = 100 TABLES ET_SPFLI = ET_SPFLI ET_SFLIGHT = ET_SFLIGHT.INSERT SPFLI FROM TABLE ET_SPFLI ACCEPTING DUPLICATE KEYS.*WRITE: / ‘Insert records:‘,SY-DBCNT.IF sy-SUBRC = ‘0‘. WRITE:/‘表SPFLI已经成功生成数据。‘.else. WRITE:/‘恭喜你,表SPFLI没成功成数据。‘.ENDIF.CLEAR sy-SUBRC.INSERT SFLIGHT FROM TABLE ET_SFLIGHT ACCEPTING DUPLICATE KEYS.*WRITE: / ‘Insert records:‘,SY-DBCNT.IF sy-SUBRC = ‘0‘. WRITE:/‘表SFLIGHT已经成功生成数据。‘.else. WRITE:/‘恭喜你,表SFLIGH没成功成数据。‘.ENDIF.CLEAR sy-SUBRC.*DATA scarr_wa TYPE scarr.**scarr_wa-carrid = ‘FF‘.*scarr_wa-carrname = ‘Funny Flyers‘.*scarr_wa-currcode = ‘EUR‘.*scarr_wa-url = ‘http://www.funnyfly.com‘.**INSERT INTO scarr VALUES scarr_wa.DATA: BEGIN OF MY_DATA, MANDT LIKE SCARR-MANDT, "WB 培训数据模型 BC_Travel 的集团 CARRID LIKE SCARR-CARRID, "航线承运人ID CARRNAME LIKE SCARR-CARRNAME, "航班名称 CURRCODE LIKE SCARR-CURRCODE, "航班的本地货币 URL LIKE SCARR-URL, "Airline URL END OF MY_DATA.DATA: IT_DATA LIKE MY_DATA OCCURS 0.DELETE FROM SCARR.*WRITE: / ‘Delete records:‘,SY-DBCNT.SELECT ALV_T_T2~MANDT ALV_T_T2~CARRID ALV_T_T2~AIRPTO ALV_T_T2~CURRENCY AS CURRCODEINTO CORRESPONDING FIELDS OF TABLE IT_DATA FROM ALV_T_T2.INSERT SCARR FROM TABLE IT_DATA ACCEPTING DUPLICATE KEYS.*WRITE: / ‘Insert records:‘,SY-DBCNT.IF sy-SUBRC = ‘0‘. WRITE:/‘表SCARR已经成功生成数据。‘.else. WRITE:/‘恭喜你,表SCARR没成功成数据。‘.ENDIF.CLEAR sy-SUBRC.SKIP 5.WRITE:/‘请去表spfli、sflight、scarr看看,有时候spfli有数据了也会提示没有更新。╮(╯▽╰)╭‘.SKIP 3.WRITE:/‘ (()__(()‘.WRITE:/‘ / \‘.WRITE:/‘ ( / \ \‘.WRITE:/‘ \ o o /‘.WRITE:/‘ (_()_)__/ \‘.WRITE:/‘ / _,==.____ \‘.WRITE:/‘ ( |--| )‘.WRITE:/‘ /\_.|__|-- __/\_‘.WRITE:/‘ / ( / \‘.WRITE:/‘ \ \ ( /‘.WRITE:/‘ ) \______) /‘.WRITE:/‘ (((____.--(((____/ ‘.WRITE:/ sy-uLINE.
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。