Skip to Content
0
Former Member
Nov 23, 2006 at 11:38 AM

BDC Problem

27 Views

Hi,

I have created a transction in which i am entering employee number, salary, department and name. First screen have only employee number as an edit field and create, display as push button. When we click on create second screen will be displayed where we can enter rest of the details (salary, department and name).

And i have created BDC program on this, but when i execute the program...it asks for the path of data file.... and after selecting proper file...in status bar system shows message "Uploading data from data file" and after about 20 minutes it shows "time-out" error message.

BDC Code:

report ZBDC_EMPN

no standard page heading line-size 255.

include bdcrecx1.

TABLES: ZTRGEMP, ZTRGDEPT, ZTRGTXN.

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,

  • data element:

IEMP_001(006),

  • data element:

INAME_002(010),

  • data element:

ISAL_003(010),

  • data element:

IDPT_004(020),

end of record.

  • End generated data section ***

DATA : BEGIN OF ITAB OCCURS 0,

EMPNO LIKE ZTRGEMP-EMPNO,

EMPNAME LIKE ZTRGEMP-EMPNAME,

EMPDPT LIKE ZTRGDEPT-EMPDPT,

SALARY LIKE ZTRGTXN-SALARY,

END OF ITAB.

start-of-selection.

CALL FUNCTION 'UPLOAD'

EXPORTING

FILENAME = 'C:\EMP.TXT'

FILETYPE = 'ASC'

TABLES

DATA_TAB = ITAB.

*perform open_dataset using dataset.

perform open_group.

LOOP AT ITAB.

do.

*read dataset dataset into record.

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

perform bdc_dynpro using 'ZASS_6' '0100'.

perform bdc_field using 'BDC_OKCODE'

'=CRT'.

perform bdc_field using 'BDC_CURSOR'

'IEMP'.

perform bdc_field using 'IEMP'

ITAB-EMPNO.

perform bdc_dynpro using 'ZASS_6' '0200'.

perform bdc_field using 'BDC_OKCODE'

'=CRT'.

perform bdc_field using 'BDC_CURSOR'

'IDPT'.

perform bdc_field using 'INAME'

ITAB-EMPNAME.

perform bdc_field using 'ISAL'

ITAB-SALARY.

perform bdc_field using 'IDPT'

ITAB-EMPDPT.

perform bdc_dynpro using 'ZASS_6' '0200'.

perform bdc_field using 'BDC_OKCODE'

'=C'.

perform bdc_field using 'BDC_CURSOR'

'INAME'.

perform bdc_transaction using 'ZEMPN'.

enddo.

ENDLOOP.

perform close_group.

Mahesh