Skip to Content
0
Former Member
Nov 24, 2006 at 10:46 AM

Call Transction - BDC

37 Views

Hi,

Can anyone tell me where should i write code(in following BDC program) for handling error messages in Call transction method using bdcmsgcoll?

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

LOOP AT ITAB.

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

ENDLOOP.

perform close_group.

Mahesh