Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC Table control

Former Member
0 Likes
461

Hi experts can any one tell what is the significance of BDC Table control. if possible tell the procedure.

Regards

vamsi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
433

hi Vamshi,

Check

Table control in BDC

http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm

regards,

santosh

3 REPLIES 3
Read only

Former Member
0 Likes
434

hi Vamshi,

Check

Table control in BDC

http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm

regards,

santosh

Read only

0 Likes
433

Thanks a lot santhosh.

Read only

Former Member
0 Likes
433

Hi Vamsi Challa,

Go through the following Code for Table Control in BDC

report Z_TAB_CONTRL_01

no standard page heading line-size 255.

data : begin of it_kna1 occurs 0,

kunnr like RF02D-KUNNR,

D0130 like RF02D-D0130,

end of it_kna1.

data : begin of it_kna2 occurs 0,

kunnr like RF02D-KUNNR,

BANKS like KNBK-BANKS,

BANKL like KNBK-BANKL,

BANKN like KNBK-BANKN,

koinh like KNBK-koinh,

end of it_kna2.

data : V_Count(2) type n.

data : V_Val(15).

include bdcrecx1.

start-of-selection.

perform Get_Data1.

perform Get_Data2.

perform open_group.

loop at it_kna1.

V_Count = '04'.

perform bdc_dynpro using 'SAPMF02D' '0106'.

perform bdc_field using 'BDC_CURSOR'

'RF02D-D0130'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RF02D-KUNNR'

'10002103'.

perform bdc_field using 'RF02D-D0130'

'X'.

perform bdc_dynpro using 'SAPMF02D' '0130'.

perform bdc_field using 'BDC_OKCODE'

'=P+'.

perform bdc_dynpro using 'SAPMF02D' '0130'.

perform bdc_field using 'BDC_OKCODE'

'=P+'.

perform bdc_dynpro using 'SAPMF02D' '0130'.

loop at it_kna2 where kunnr = it_kna1-kunnr.

if v_count = '10'.

perform bdc_field using 'BDC_OKCODE'

'=P+'.

perform bdc_dynpro using 'SAPMF02D' '0130'.

v_count = '00'.

endif.

V_Count = V_Count + 1.

concatenate 'KNBK-KOINH(' V_Count ')' into V_Val.

perform bdc_field using 'BDC_CURSOR'

'KNBK-KOINH(09)'.

concatenate 'KNBK-BANKS(' V_Count ')' into V_Val.

perform bdc_field using V_Val

it_kna2-BANKS.

concatenate 'KNBK-BANKL(' V_Count ')' into V_Val.

perform bdc_field using V_Val

it_kna2-BANKL.

concatenate 'KNBK-BANKN(' V_Count ')' into V_Val.

perform bdc_field using V_Val

it_kna2-BANKN.

concatenate 'KNBK-KOINH(' V_Count ')' into V_Val.

perform bdc_field using V_Val

it_kna2-KOINH.

endloop.

perform bdc_field using 'BDC_OKCODE'

'=UPDA'.

perform bdc_transaction using 'FD02'.

clear : it_kna1,it_kna2.

endloop.

perform close_group.

&----


*& Form Get_Data1

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM Get_Data1 .

CALL FUNCTION 'UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = 'C:\tab_contl.txt'

FILETYPE = 'ASC'

  • ITEM = ' '

  • FILEMASK_MASK = ' '

  • FILEMASK_TEXT = ' '

  • FILETYPE_NO_CHANGE = ' '

  • FILEMASK_ALL = ' '

  • FILETYPE_NO_SHOW = ' '

  • LINE_EXIT = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • SILENT = 'S'

  • IMPORTING

  • FILESIZE =

  • CANCEL =

  • ACT_FILENAME =

  • ACT_FILETYPE =

TABLES

DATA_TAB = it_kna1

  • EXCEPTIONS

  • CONVERSION_ERROR = 1

  • INVALID_TABLE_WIDTH = 2

  • INVALID_TYPE = 3

  • NO_BATCH = 4

  • UNKNOWN_ERROR = 5

  • GUI_REFUSE_FILETRANSFER = 6

  • OTHERS = 7

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. " Get_Data1

&----


*& Form Get_Data2

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM Get_Data2 .

CALL FUNCTION 'UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = 'C:\tab_cont1.txt'

FILETYPE = 'ASC'

  • ITEM = ' '

  • FILEMASK_MASK = ' '

  • FILEMASK_TEXT = ' '

  • FILETYPE_NO_CHANGE = ' '

  • FILEMASK_ALL = ' '

  • FILETYPE_NO_SHOW = ' '

  • LINE_EXIT = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • SILENT = 'S'

  • IMPORTING

  • FILESIZE =

  • CANCEL =

  • ACT_FILENAME =

  • ACT_FILETYPE =

TABLES

DATA_TAB = it_kna2

  • EXCEPTIONS

  • CONVERSION_ERROR = 1

  • INVALID_TABLE_WIDTH = 2

  • INVALID_TYPE = 3

  • NO_BATCH = 4

  • UNKNOWN_ERROR = 5

  • GUI_REFUSE_FILETRANSFER = 6

  • OTHERS = 7

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. " Get_Data2

Regards

Sreeni