标签:from 图片 teacher _id ram res char class moudle
向数据库中添加数据 ztt_teacher
1: 创建一个 function moudle,设置该moudle类型为 update moudle
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 = 7. 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: 添加数据成功。
标签:from 图片 teacher _id ram res char class moudle
原文地址:https://www.cnblogs.com/liyafei/p/10592072.html