Application Development 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: 

batch -input

Former Member
0 Kudos

hi everyone caı anybody give me example about batch-input?

6 REPLIES 6

Former Member
0 Kudos

Regards

Vasu

Former Member
0 Kudos

Hi,

Check out the thread, where ur query have been discussed.

hope this helps.

paruchuri_nagesh
Active Contributor
0 Kudos

HI

batch input is nothing but session method

session method process record unsynchronouslly

update records synchronously

records cannot be updated until session gets process

it can have log file by default

it doesnt return sy-subrc

just go through these follwing code

&----


*& Report ZBDC1 *

*& *

&----


*& *

*& *

&----


REPORT ZBDC1.

TABLES: LFA1.

DATA: BEGIN OF ITAB OCCURS 0,

EMPNO LIKE ZEMP-EMPNO,

NAME1 LIKE ZEMP-NAME1,

ORT01 LIKE ZEMP-ORT01,

END OF ITAB.

DATA: BEGIN OF JTAB OCCURS 0.

INCLUDE STRUCTURE BDCDATA.

DATA: END OF JTAB.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'C:/NAG.TXT'

FILETYPE = 'ASC'

  • HAS_FIELD_SEPARATOR = ' '

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

DATA_TAB = ITAB

  • EXCEPTIONS

  • FILE_OPEN_ERROR = 1

  • FILE_READ_ERROR = 2

  • NO_BATCH = 3

  • GUI_REFUSE_FILETRANSFER = 4

  • INVALID_TYPE = 5

  • NO_AUTHORITY = 6

  • UNKNOWN_ERROR = 7

  • BAD_DATA_FORMAT = 8

  • HEADER_NOT_ALLOWED = 9

  • SEPARATOR_NOT_ALLOWED = 10

  • HEADER_TOO_LONG = 11

  • UNKNOWN_DP_ERROR = 12

  • ACCESS_DENIED = 13

  • DP_OUT_OF_MEMORY = 14

  • DISK_FULL = 15

  • DP_TIMEOUT = 16

  • OTHERS = 17

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

  • DEST = FILLER8

GROUP = 'YBDC1'

HOLDDATE = SY-DATUM

KEEP = 'X'

USER = SY-UNAME

  • RECORD = FILLER1

  • PROG = SY-CPROG

  • IMPORTING

  • QID =

EXCEPTIONS

CLIENT_INVALID = 1

DESTINATION_INVALID = 2

GROUP_INVALID = 3

GROUP_IS_LOCKED = 4

HOLDDATE_INVALID = 5

INTERNAL_ERROR = 6

QUEUE_ERROR = 7

RUNNING = 8

SYSTEM_LOCK_ERROR = 9

USER_INVALID = 10

OTHERS = 11

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT ITAB.

REFRESH JTAB.

PERFORM SUB USING 'YVTRANS' '0100'.

PERFORM SUB1 USING:

'ZEMP-EMPNO' ITAB-EMPNO,

'ZEMP-NAME1' ITAB-NAME1,

'ZEMP-ORT01' ITAB-ORT01.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'YVTRANS'

TABLES

DYNPROTAB = JTAB

EXCEPTIONS

INTERNAL_ERROR = 1

NOT_OPEN = 2

QUEUE_ERROR = 3

TCODE_INVALID = 4

PRINTING_INVALID = 5

POSTING_INVALID = 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.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'

EXCEPTIONS

NOT_OPEN = 1

QUEUE_ERROR = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

FORM SUB USING A B.

CLEAR JTAB.

JTAB-PROGRAM = A.

JTAB-DYNPRO = B.

JTAB-DYNBEGIN = 'X'.

APPEND JTAB.

ENDFORM.

FORM SUB1 USING C D.

CLEAR JTAB.

JTAB-FNAM = C.

JTAB-FVAL = D.

APPEND JTAB.

ENDFORM.

after that u have to process records by using tcode SM35

reward for use ful answers

regards

Nagesh.Paruchuri

0 Kudos

it doesnt work on my system?:(

0 Kudos

hi,

go to system -> services -> batchinput -> recorder.

Make a new recording with a transaction (e. g. iw21)

And then you can make a program automatically.

regards

Former Member