Examle for HSDB

Examle for HSDB

[@more@] report ZMM02
no standard page heading line-size 255.

include bdcrecx1.

parameters: dataset(132) lower case.
*** DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
*
* If it is nessesary to change the data section use the rules:
* 1.) Each definition of a field exists of two lines
* 2.) The first line shows exactly the comment
* '* data element: ' followed with the data element
* which describes the field.
* If you don't have a data element use the
* comment without a data element name
* 3.) The second line shows the fieldname of the
* structure, the fieldname must consist of
* a fieldname and optional the character '_' and
* three numbers and the field length in brackets
* 4.) Each field must be type C.
*
*** Generated data section with specific formatting - DO NOT CHANGE ***
data: begin of record,
* data element: MATNR
MATNR_001(018),
* data element: XFELD
* data element: WERKS_D
WERKS_003(004),
* data element: DZPLP1
ZPLP1_005(014),
* data element: DZPLD1
ZPLD1_006(010),
* data element: DZPLP2
ZPLP2_007(014),
* data element: DZPLD2
ZPLD2_008(010),
end of record.

data:gt_record LIKE record OCCURS 0 WITH HEADER LINE.

*** End generated data section ***

start-of-selection.

*perform open_dataset using dataset.
*perform open_group.

CALL FUNCTION 'UPLOAD'
EXPORTING
* CODEPAGE = ' '
* FILENAME = ' '
filetype = 'DAT'
* ITEM = ' '
* FILEMASK_MASK = ' '
* FILEMASK_TEXT = ' '
* FILETYPE_NO_CHANGE = ' '
* FILEMASK_ALL = ' '
* FILETYPE_NO_SHOW = ' '
* LINE_EXIT = ' '
* USER_FORM = ' '
* USER_PROG = ' '
* SILENT = 'S'
* IMPORTING
* FILESIZE =
* CANCEL =
* ACT_FILENAME =
* ACT_FILETYPE =
TABLES
data_tab = gt_record
* EXCEPTIONS
* CONVERSION_ERROR = 1
* INVALID_TABLE_WIDTH = 2
* INVALID_TYPE = 3
* NO_BATCH = 4
* UNKNOWN_ERROR = 5
* GUI_REFUSE_FILETRANSFER = 6
* OTHERS = 7
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


*read dataset dataset into record.
if sy-subrc <> 0. exit. endif.
loop at gt_record.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=AUSW'.
perform bdc_field using 'RMMG1-MATNR'
gt_record-MATNR_001.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=P+'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(05)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-WERKS'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
gt_record-WERKS_003.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.

perform bdc_field using 'BDC_CURSOR'
'MBEW-ZPLP2'.
perform bdc_field using 'MBEW-ZPLP1'
gt_record-ZPLP1_005.
perform bdc_field using 'MBEW-ZPLD1'
gt_record-ZPLD1_006.
perform bdc_field using 'MBEW-ZPLP2'
gt_record-ZPLP2_007.
perform bdc_field using 'MBEW-ZPLD2'
gt_record-ZPLD2_008.

perform bdc_transaction using 'MM02'.
ENDLOOP.


perform close_group.
perform close_dataset using dataset.

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

转载于:http://blog.itpub.net/240510/viewspace-1007102/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值