ABAP-SQL技巧 select WERKS, MATNR, sum(casewhen SHKZG='S' then MENGEwhen SHKZG='H' then( MENGE *-1)end) as MENGE from MSEGinto correspondingfieldsoftable @LT_MSEGS where MATNRin @SO_MATNR and WERKSin @SO_WERKS and BUDAT_MKPFin @R_FDAY and BWARTin('101','102','161','162','...
ABAP SELECT SUM函数用法 表MSEG中,根据物料号MATNR,对MENGE字段进行求和 。 当SHKZG = H ,MENGE*( -1 ); SHKZG = S, MENGE*1,,然后求和 参考ABAP SQL CASE 语法 代码语言:javascript 复制 SELECTmseg~matnr,SUM(mseg~menge*(CASEmseg~shkzgWHEN'H'THEN(-1)WHEN'S'THEN(1)END))ASslFROMmsegINTOTABL...
CASE <f>.WHEN <f1>.<statement block>WHEN <f2>.<statement block>WHEN <f3>.<statement block>WHEN ...WHEN OTHERS.<statement block>ENDCASE. 系统执行 WHEN 语句之后的语句块,如果<f>内容等于<fi>的内容,且继续处理 ENDCASE 语句后面的语句。如果<f>的内容不等于<fi>的内容,则执行选项 WHEN OTHERS ...
SELECT SUM( num1 ) FROM demo_expressions INTO (@DATA(sum)). ASSERT sum = ( n * ( n + 1 ) ) / 2. Variant 5 Effect Determines the product of the values of a columncolin a row set. The data type of the result is theexternal data typeof the column. The column must have a nu...
select 字段1,字段2,sum(求和字段)from 表 where 条件 group by 字段1,字段2into table 内表 实例 代码语言:javascript 复制 *&---tables:ZNAMETABLE2.data:gt_dataTYPETABLEofZNAMETABLE2.data:gs_dataTYPEZNAMETABLE2.data:num1TYPEi.TYPES:BEGINOFty_data,nameTYPEchar10,sexTYPEchar10,ageTYPEi,ENDOF...
CASE f. WHEN f11[OR f12OR ...]. <statement block> ... [WHEN OTHERS.] <statement block> ENDCASE. 其中,f为变量,fij可以是变量或者固定值. 4.4.2循环控制 1.无条件循环 DO [n TIMES]. <statement block> ENDDO. 说明:n为循环次数,可以是文字或变量,如果没有限定n值,则必须用EXIT,STOP或REJECT...
SELECTION-SET SELECTION-TABLE SELECT-OPTIONS SEND SEPARATED SET SHARED SHIFT SIGN SIN SINGLE SINGLEDISTINCT SINH SIZE SKIP SORT SORTABLE SPACE SPECIFIED SPLIT SQL SQRT STABLE STAMP STANDARD START STARTING STATICS STEP-LOOP STOP STRLEN STRUCTURE SUBMIT SUBTRACT SUBTRACT-CORRESPONDING SUFFIX SUM SUPPLY ...
会计学1ABAP开发基础基础内表select语句问题一个简单的例子ABAP基础内表的应用select数据选取数据库表查询输入输出销售订单report第1页/共61页最简单的Report(1)一个经典的入门例子通常在程序执行前,需要做以下三件事:1、对所写的代码进行语法检查,避免明显的语法错误。2、保存程序;在程序激活过程中,SAP也会自动对程...
When I do an inline Declaration of an internal table SELECT ... FROM ... INTO TABLE @data(lt_data). Is there also some way, to have this as a sorted / hashed table or at least add secondary keys?Former Member 2015 Nov 23 5:17 AM 0 Kudos Not that I'm aware of Jakob....
PERFORM show_item_sum USING l_temp2-zcashcode . ELSE . MESSAGE '该行没有科目明细' TYPE 'I' . ENDIF . endcase . 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. ...