ITPub博客

首页 > 应用开发 > IT综合 > Examle for HSDB

Examle for HSDB

原创 IT综合 作者:seaman1978 时间:2008-07-11 13:49:31 0 删除 编辑

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博客 ” ,链接:https://blog.itpub.net/240510/viewspace-1007102/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2007-12-04

  • 博文量
    10
  • 访问量
    150180