erp abap程序设计题 求大神解答
2.定义一个内表itab,行类型为:sflight,表类型:标准表,表键:carrid和Connid ,把表Sflight中的Carrid为‘AA’的数据读取到内表中,并打印出表中的Carrid和Connid两列的所有数据。
3。创建一个ABAP程序ZMY_SUBR_TEST,用户在选择屏幕上输入两个整数,通过调用一个子程序求这两个整数之间的和。 展开
参考代码如下:
REPORT ztest.
PARAMETERS: iweek TYPE c.
CASE iweek.
WHEN '1'.
WRITE: / '星期一'.
WHEN '2'.
WRITE: / '星期二'.
WHEN '3'.
WRITE: / '星期三'.
WHEN '4'.
WRITE: / '星期四'.
WHEN '5'.
WRITE: / '星期五'.
WHEN '6'.
WRITE: / '星期六'.
WHEN '7'.
WRITE: / '星期日'.
WHEN OTHERS.
WRITE: / '星期错误'.
ENDCASE.参考代码如下:
REPORT ztest.
DATA: itab TYPE STANDARD TABLE OF sflight WITH HEADER LINE WITH KEY carrid connid.
SELECT *
into TABLE itab
from sflight
where carrid eq 'AA'.
loop at itab.
write: / itab-carrid, space, itab-connid.
ENDloop.参考代码如下:
REPORT ZMY_SUBR_TEST.
PARAMETERS: p_1 TYPE i,
p_2 TYPE i.
DATA: sum TYPE i.
PERFORM frm_get_sum USING p_1 p_2 CHANGING sum.
WRITE: sum.
*&---------------------------------------------------------------------*
*& Form frm_get_sum
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM frm_get_sum USING i1 TYPE i
i2 TYPE i
CHANGING e1 TYPE i.
e1 = i1 + i2.
ENDFORM. "frm_get_sum
2014-06-16