Skip to Content
0
Former Member
Dec 10, 2006 at 04:41 AM

BDC to upload DATA

36 Views

Hi,

This is my BDC Program to upload batch data into infotype 0006 ans subtype 0001 plz check the code and correct i am getting one error when i compile the error is:

Description ROW Type

Program ZBDCPA30 19 Red light

Statement is not accessible.

My Code is:

report ZBDCPA30 no standard page heading line-size 255.

include bdcrecx1.

*start

data:begin of i_table occurs 0,

pernr like pernr-pernr,

begda like p0006-begda,

name2 like p0006-name2,

stras like p0006-stras,

hsnmr like p0006-hsnmr,

posta like p0006-posta,

locat like p0006-locat,

ort01 like p0006-ort01,

ort02 like p0006-ort02,

busrt like p0006-busrt,

end of i_table.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'C/:data.txt'

FILETYPE = 'DAT'

  • HAS_FIELD_SEPARATOR = ' '

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

DATA_TAB = i_table

  • 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.

*end

start-of-selection.

loop at i_table.

perform open_group.

perform bdc_dynpro using 'SAPMP50A' '1000'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RP50G-PERNR'

i_table-pernr.

perform bdc_field using 'RP50G-TIMR6'

'X'.

perform bdc_field using 'BDC_CURSOR'

'RP50G-SUBTY'.

perform bdc_field using 'RP50G-CHOIC'

'Addresses'.

perform bdc_field using 'RP50G-SUBTY'

'2'.

perform bdc_dynpro using 'SAPMP50A' '1000'.

perform bdc_field using 'BDC_CURSOR'

'RP50G-PERNR'.

perform bdc_field using 'BDC_OKCODE'

'=INS'.

perform bdc_field using 'RP50G-PERNR'

i_table-pernr.

perform bdc_field using 'RP50G-TIMR6'

'X'.

perform bdc_field using 'RP50G-CHOIC'

'Addresses'.

perform bdc_field using 'RP50G-SUBTY'

'2'.

perform bdc_dynpro using 'MP000600' '2000'.

perform bdc_field using 'BDC_CURSOR'

'P0006-BUSRT'.

perform bdc_field using 'BDC_OKCODE'

'=UPD'.

perform bdc_field using 'P0006-BEGDA'

i_table-begda.

perform bdc_field using 'P0006-ENDDA'

'31.12.9999'.

perform bdc_field using 'P0006-NAME2'

i_table-name2.

perform bdc_field using 'P0006-STRAS'

i_table-stras.

perform bdc_field using 'P0006-HSNMR'

i_table-hsnmr.

perform bdc_field using 'P0006-POSTA'

i_table-posta.

perform bdc_field using 'P0006-LOCAT'

i_table-locat.

perform bdc_field using 'P0006-ORT01'

i_table-ort01.

perform bdc_field using 'P0006-ORT02'

i_table-ort02.

perform bdc_field using 'P0006-LAND1'

'IN'.

perform bdc_field using 'P0006-BUSRT'

i_table-busrt.

perform bdc_transaction using 'PA30'.

perform close_group.

endloop.

Plz tell me where i did the mistake ?

bye

kumar