Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BDC program

Hello,

I am working with BDC and I am getting error dump...

file1.txt consists of the following data with seperated tab...

1500-4322 Retail Samples Description CAR

report ZCALLTRANSACTION no standard page heading line-size 255.

                                                      • Defining the Source Internal Table

Data : BEGIN OF itab OCCURS 1,

f1 TYPE MATNR, "Material

f2 TYPE MBRSH, "Industry Sector

f3 TYPE MTART, "Material Type

f4 TYPE MAKTX, "Material Description

f5 TYPE MEINS, "Base Unit of Measure

END OF itab.

                                                  • Defining the Target Internal Table

DATA : jtab TYPE BDCDATA OCCURS 1 WITH HEADER LINE.

                                        • Upload Data from Flat file to Source Internal Table

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'C:\file1.txt'

FILETYPE = 'DAT'

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

*****************Verification

LOOP AT ITAB.

WRITE :/ ITAB-F1,ITAB-F2,ITAB-F3,ITAB-F4,ITAB-F5.

ENDLOOP.

lOOP AT itab.

REFRESH JTAB.

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-MTART'.

perform bdc_field using 'BDC_OKCODE'

'=AUSW'.

perform bdc_field using 'RMMG1-MATNR'

itab-f1.

perform bdc_field using 'RMMG1-MBRSH'

itab-f2.

perform bdc_field using 'RMMG1-MTART'

itab-f3.

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'MSICHTAUSW-KZSEL(01)'

'/00'.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'BDC_CURSOR'

'MAKT-MAKTX'.

perform bdc_field using 'MAKT-MAKTX'

itab-f4.

perform bdc_field using 'MARA-MEINS'

itab-f5.

perform bdc_field using 'MARA-MTPOS_MARA'

'/00'.

CALL TRANSACTION 'MM01' USING JTAB MODE 'A'.

ENDLOOP.

  • Start new screen *

----


FORM BDC_DYNPRO USING PROGRAM DYNPRO.

CLEAR jtab.

jtab-PROGRAM = PROGRAM.

jtab-DYNPRO = DYNPRO.

jtab-DYNBEGIN = 'X'.

APPEND jtab.

ENDFORM.

----


  • Insert field *

----


FORM BDC_FIELD USING FNAM FVAL.

IF FVAL <> SPACE.

CLEAR jtab.

jtab-FNAM = FNAM.

jtab-FVAL = FVAL.

APPEND jtab.

ENDIF.

ENDFORM.

And what will be the difference between ASC and DAT in above program

Please do reply

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question