sap技巧浅谈(一)

TYPES: BEGIN OF type_one_row,
   ;
  ;
  END OF type_one_row.
TYPES: type_one_table TYPE type_one_row OCCURS 0.
TYPES:BEGIN OF type_two_row,
   ;
  ;
END OF type_two_row.
TYPES: type_two_table TYPE type_two_row OCCURS 0. 
data: ptr_one type c , ptr_two  type c.
data: WA_one type TYPE_one_ROW,
          IG_one   type  TYPE_one_TABLE,
          WA_two      type   TYPE_two_ROW,
          IG_two        type   TYPE_two_TABLE.
PERFORM restor_buffer USING ptr_one CHANGING ig_one.
PERFORM restor_buffer USING ptr_two  CHANGING ig_two.
FORM restor_buffer USING typeid TYPE c CHANGING t TYPE table.
  IMPORT t FROM DATABASE indx(hk) ID typeid.
ENDFORM.  
                 
DEFINE savebuffer.
  perform save_to_buffer using &1 &2.
END-OF-DEFINITION.
DEFINE clearbuffer.
  perform clear_buffer using &1.
END-OF-DEFINITION.
FORM save_to_buffer USING t TYPE table typeid TYPE c.                      
  wa_indx-aedat = sy-datum.
  wa_indx-usera = sy-uname.
  wa_indx-pgmid = sy-repid.
  EXPORT t TO DATABASE indx(hk) ID typeid FROM wa_indx.
ENDFORM.  
FORM clear_buffer USING buffid type c.
  DELETE FROM DATABASE indx(hk) ID buffid.
ENDFORM.
;
FORM frm_display_data.
  DATA: onename(18) TYPE c .
  DATA: twoname(18)  TYPE c .
  CONCATENATE 'XXXX' sy-uzeit INTO onename.
  CONCATENATE 'XXXX' sy-uzeit INTO twoname.
  savebuffer ig_output_h[] onename.
  savebuffer ig_output_d[] twoname.
 CALL FUNCTION  YYY
    EXPORTING
      ptr_one = onename
      ptr_two  = twoname.
  clearbuffer onename.
clearbuffer twoname.
ENDFORM.  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值