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

want TBL CTRL NOTES

vallamuthu_madheswaran2
Active Contributor
0 Likes
768

hai friends

i want the table notes and also website link

thanks & regards

vallamuthu

6 REPLIES 6
Read only

Former Member
0 Likes
709

Hey,

Refer the transaction DWDM for sample programs on table control.

-Kiran

Read only

Former Member
0 Likes
709

Use serach forum option with search string as table Control.

Read only

Former Member
0 Likes
709

Hi,

Check this Document

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/table control in abap.pdf

it is really helpful.

Regards

vijay

Read only

Former Member
0 Likes
709

HI

GOOD

HERE IS SOME WEBSITE NAMES

WWW.SAPPOINT.COM

WWW.ABAP4U.COM

WWW.TRIPOD.COM

A table is a set of rows. Each row in a table has the same number of columns and contains a value for each column.

http://dev.mysql.com/doc/maxdb/en/fa/953c405865e801e10000000a155106/content.htm

THANKS

MRUTYUN

Read only

Former Member
0 Likes
709

Hai

Check the following

1) Screen tables

A table can be created in transaction. These tables, when designed on the screen are called as SCREEN TABLES.

These are of two types.

Table Controls and Step loops

These tables are treated as Loops.

2)Features of Table Controls

Data is displayed in the form of table.

Table control gives user the feeling of an actual table.

You can scroll through the table vertically as well as horizontally.

You can select rows and columns.

You can resize the with of columns.

You can have separator lines between rows and columns.

Automatic resizing of the table when the user resizes the window.

You can update information in the table control and it can be updated in the database table by writing code for it.

3)Steps for creating table control

Declaration of table control in module pool program.

Designing of table controls on the screen.

Passing data to table control in flow logic.

4)Declaration of TC in MPP

syntax:

controls <name of table control> type tableview using screen <‘screen no.’>.

5)Designing Table control on screen

Click on Table in Control bar and place it on the screen. You can adjust the length and width of the Table Control.

Name the table control.(same name as given in data declaration).

From dictionary object OR from program fields select the fields and place them in the table control

6)Passing data to table control

Usually transfer of data from program to screen is automatic.

In case of TC, you need to explicitly transfer the data to table control.

ABAP/4 provides Loop statement, which is associated with flow logic to transfer the data.

7)Passing of data contd.

PBO.

Loop at <name of internal table> with control <name of table control> cursor <scroll variable>.

module…….

Endloop.

PAI.

Loop at < name of internal table>.Endloop.

8)Scroll variables

Top_line : the row of table where the screen display starts.

Current_line : the row currently being processed inside a loop.

9)Transfer of data from prg to TC.

With ‘Loop at …’ statement, the first row is placed in the header of internal table.

If any module is specified between Loop and End loop, it will be executed. In this module, generally we will be assigning this internal table fields to table control screen fields.

The row in internal table is transferred to the TC as stated in the ‘Loop at…..’ statement.

The system encounters the ‘Endloop’ statement and control is passed back to the next line of internal table.

In the same way all the records of the internal table are passed to the TC.

Table Control in BDC

Check the following Code

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

Thanks & regards

Sreeni

Read only

vallamuthu_madheswaran2
Active Contributor
0 Likes
709

Solved myself