Skip to Content
0
Former Member
Mar 13, 2007 at 11:40 AM

Error in BDC

54 Views

Hi All

In T-code ME22, i want to change netprice. i am uploading the data from a flat file.

not good with BDC, its given me errro msg

Call_transcation M22 Returncode = 1,001 Record 0

E formatting error in the field RMO6e-EBELP see next msg

E input should be in the form _________

***********

My code is

report ZME22_BDC

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 occurs 0,

  • data element: BSTNR

BSTNR_001(010),

  • data element: AUFEP

EBELP_002(005),

end of record.

  • End generated data section ***

start-of-selection.

*perform open_dataset using dataset.

*perform open_group.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'C:\test.txt'

  • FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = ''

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • CHECK_BOM = ' '

  • NO_AUTH_CHECK = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

DATA_TAB = record

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.

*do.

*read dataset dataset into record.

loop at record.

if sy-subrc <> 0. exit. endif.

perform bdc_dynpro using 'SAPMM06E' '0105'.

perform bdc_field using 'BDC_CURSOR'

'RM06E-BSTNR'.

perform bdc_field using 'BDC_OKCODE'

'=AB'.

perform bdc_field using 'RM06E-BSTNR'

record-BSTNR_001.

perform bdc_dynpro using 'SAPMM06E' '0120'.

perform bdc_field using 'BDC_CURSOR'

'RM06E-EBELP'.

perform bdc_field using 'BDC_OKCODE'

'=BACK'.

perform bdc_field using 'RM06E-EBELP'

record-EBELP_002.

perform bdc_transaction using 'ME22'.

*enddo.

endloop.

*perform close_group.

perform close_dataset using dataset.