ITPub博客

首页 > Linux操作系统 > Linux操作系统 > TABLE CONTROL中从实表中删除TABLE CONTROL中已删除的内容

TABLE CONTROL中从实表中删除TABLE CONTROL中已删除的内容

原创 Linux操作系统 作者:niuchao 时间:2019-06-24 21:45:06 0 删除 编辑

TABLE CONTROL中从实表中删除TABLE CONTROL中已删除的内容

 

1.

*data del_line like line of itab.
*data del_itab like itab occurs 0 with header line.

2.在标准的程序:

*form fcode_delete_row 中加

*loop at <table> assigning .

*&SPWIZARD: access to the component 'FLAG' of the table header         *
    assign component p_mark_name of structure  to .

    if  = 'X'.
      clear del_tabix.
      del_tabix = syst-tabix.
**************************=>  begin of added by nc
      clear del_line.
      move-corresponding  to del_line.

      append del_line to del_itab.
**************************=>  end   of added by nc

      delete <table> index syst-tabix.
      if sy-subrc = 0.
        -lines = -lines - 1.
      endif.
    endif.
  endloop.

4. 写个子程序

  *form delete_line.
  loop at del_itab.
    delete from zmarm where matnr = del_itab-matnr
                        and kunnr = del_itab-kunnr
                        and vsart = del_itab-vsart
                        and meinh = del_itab-meinh.
  endloop.
endform.    

 

5. 保存时调用4中的子程序

 

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/166523/viewspace-446997/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2004-11-04

  • 博文量
    141
  • 访问量
    136179