Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Batch input

Former Member
0 Likes
300

Hi friends, please tell me what is batch input and the primary areas we meet with it.

Any code sample also would be very nice..

Thanks.

Deniz.

1 REPLY 1
Read only

Former Member
0 Likes
261

Hi,

check this link

inserting a group of data from non-sap to sap system is batch input.

REPORT ZBHVEND no standard page heading line-size 255.

*include bdcrecx1.

*

*start-of-selection.

*

*perform open_group.

DATA:BEGIN OF ITAB OCCURS 0,

LIFNR LIKE LFA1-LIFNR,

KTOKK LIKE LFA1-KTOKK,

NAME1 LIKE LFA1-NAME1,

SORTL LIKE LFA1-SORTL,

LAND1 LIKE LFA1-LAND1,

REGIO LIKE LFA1-REGIO,

END OF ITAB.

DATA BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'C:/BHARAT/VEND.TXT'

FILETYPE = 'ASC'

TABLES

DATA_TAB = ITAB.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

GROUP = 'VENDOR'

KEEP = 'X'

USER = SY-UNAME

PROG = SY-CPROG.

LOOP AT ITAB.

perform bdc_dynpro using 'SAPMF02K' '0107'.

perform bdc_field using 'BDC_CURSOR'

'RF02K-LIFNR'.

perform bdc_field using 'RF02K-LIFNR'

ITAB-LIFNR.

perform bdc_field using 'RF02K-KTOKK'

ITAB-KTOKK.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_dynpro using 'SAPMF02K' '0110'.

perform bdc_field using 'BDC_CURSOR'

'LFA1-NAME1'.

perform bdc_field using 'LFA1-NAME1'

ITAB-NAME1.

perform bdc_field using 'LFA1-SORTL'

ITAB-SORTL.

perform bdc_field using 'LFA1-LAND1'

ITAB-LAND1.

perform bdc_field using 'LFA1-REGIO'

ITAB-REGIO.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_dynpro using 'SAPMF02K' '0120'.

perform bdc_field using 'BDC_CURSOR'

'LFA1-KUNNR'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_dynpro using 'SAPMF02K' '0130'.

perform bdc_field using 'BDC_CURSOR'

'LFBK-BANKS(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_dynpro using 'SAPLSPO1' '0300'.

perform bdc_field using 'BDC_OKCODE'

'=YES'.

*perform bdc_transaction using 'MK01'.

*

*perform close_group.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'MK01'

TABLES

DYNPROTAB = BDCTAB.

REFRESH BDCTAB.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

FORM BDC_DYNPRO USING PROGRAM DYNPRO.

CLEAR BDCTAB.

BDCTAB-PROGRAM = PROGRAM.

BDCTAB-DYNPRO = DYNPRO.

BDCTAB-DYNBEGIN = 'X'.

APPEND BDCTAB.

ENDFORM.

FORM BDC_FIELD USING FNAM FVAL.

CLEAR BDCTAB.

BDCTAB-FNAM = FNAM.

BDCTAB-FVAL = FVAL.

APPEND BDCTAB.

ENDFORM.

rgds,

bharat.