Barış Batch Içinzbdcrecx1include
Barış Batch Içinzbdcrecx1include
Barış Batch Içinzbdcrecx1include
*----------------------------------------------------------------------*
* data definition
*----------------------------------------------------------------------*
* Batchinputdata of single transaction
data: bdcdata like bdcdata occurs 0 with header line.
* messages of call transaction
data: messtab like bdcmsgcoll occurs 0 with header line.
* error session opened (' ' or 'X')
data: e_group_opened.
* message texts
tables: t100.
*----------------------------------------------------------------------*
* open dataset *
*----------------------------------------------------------------------*
form open_dataset using p_dataset.
open dataset p_dataset in text mode.
if sy-subrc <> 0.
write: / text-e00, sy-subrc.
stop.
endif.
endform.
*----------------------------------------------------------------------*
* close dataset *
*----------------------------------------------------------------------*
form close_dataset using p_dataset.
close dataset p_dataset.
endform.
*----------------------------------------------------------------------*
* create batchinput session *
* (not for call transaction using...) *
*----------------------------------------------------------------------*
form open_group.
*----------------------------------------------------------------------*
* end batchinput session *
* (call transaction using...: error session) *
*----------------------------------------------------------------------*
form close_group.
*----------------------------------------------------------------------*
* Start new transaction according to parameters *
*----------------------------------------------------------------------*
form bdc_transaction using tcode.
* batch input session
call function 'BDC_INSERT'
exporting
tcode = tcode
tables
dynprotab = bdcdata.
refresh bdcdata.
endform.
*----------------------------------------------------------------------*
* Start new screen *
*----------------------------------------------------------------------*
form bdc_dynpro using program dynpro.
clear bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
append bdcdata.
endform.
*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
form bdc_field using fnam fval.
clear bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
append bdcdata.
endform.