向数据库中添加数据  ztt_teacher

update moudle 调用方式-LMLPHP

1:  创建一个 function moudle,设置该moudle类型为  update moudle

update moudle 调用方式-LMLPHP

2: 向数据库添加数据的代码

FUNCTION ZFM_MOUDLE7.
*"----------------------------------------------------------------------
*"*"Update Function Module:
*"
*"*"Local Interface:
*"----------------------------------------------------------------------
  DATA: lv_teacher type LTT_TEACHER,
        lt_teacher TYPE TABLE of LTT_TEACHER.

*  PARAMETERS: lv_id TYPE i,
*              lv_dep(10) TYPE c,
*              lv_name(10) TYPE c.

  lv_teacher-id = .
  lv_teacher-department = 'zhaoliu'.
  lv_teacher-name = 'uestc'.

*  lv_teacher-department TYPE char,   "restriction value
*  lv_teacher-name TYPE char.

  APPEND lv_teacher to lt_teacher.

  insert LTT_TEACHER FROM TABLE LT_TEACHER.
ENDFUNCTION.

3: 在另外一个moudle 里面调用该 update moudle。 最后commit work.

FUNCTION ZFM_CALLMOUDLE7.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"----------------------------------------------------------------------

call FUNCTION 'ZFM_MOUDLE7' IN UPDATE TASK.
COMMIT WORK.

ENDFUNCTION.

4: 添加数据成功。

04-15 09:56
查看更多