Application Development 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: 

table control

Former Member
0 Kudos

Hi all,

Can anyone explain me very clearly the concept of table-control in bdc... please explain me with a recording example step by step.. it would be very useful if you could explain me with the very start of shdb transaction onwards and also tell me the concept behind this. and also tell me where this table-control comes into use.

With thanks

karthi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Subramanian,

Table Control is used in Module Pool Programming.

Table Control is used to display data of any internal table of ur program or the data from dictionary table directly ino a table format. Using table control with the help of screen painter, data can be easily displayed.It can be created manually through coding or using Table Control Wizard given in the sreen painter.

Table Controls are labeled screen elements to display and process table-type data on dynpros. In a table control, a maximum of 255 screen elements is summarized in a table control row, which can be repeated multiple times within the table control on the screen. The fields of a row have to be created only once as dynpro fields in the dynpro and as global data objects in the ABAP program. Table controls provide an area on the screen for editing the displayed table control rows which offers column headers, marking of rows and columns, horizontal and vertical scrolling with scroll bars, the definition of lead columns and saving of the current settings (see DEMO_DYNPRO). Parts of the user actions in table controls are processed on the presentation server. Vertical scrolling, saving of settings, and changes of screen size (if the resizing properties have been set accordingly when defining the table controls) trigger the event PAI.

A column of the table controls can be defined as marking column , in which the screen element is displayed like a pushbutton and treated like a checkbox (see the first column of the table control in DEMO_DYNPRO). A checked selection key sets the content of the assigned dynpro-field to "X", an unchecked key sets the content to " ". The state of the selection key is transported at the event PAI to a data object of the same name in the ABAP-program and at PBO, you can set the marker via the content of the data object.

Table Controls encapsulate step loops and make their independent use obsolete. The processing of table controls in the dynpro flow logic accordingly bases on the step loop technique using the statement LOOP. In contrary to the processing of independent step loops, the loops of the dynpro flow logic are linked with the addition WITH CONTROL with the table controls of the dynpros during the processing of table controls.

In the ABAP-program, table controls must be declared with the statement CONTROLS, whereat a special structure for handling of table controls is created.

PROGRAM ZTABLECON.

TABLES: LFA1, EKKO.

DATA: OKCODE1 LIKE SY-UCOMM,

OKCODE2 LIKE SY-UCOMM.

CONTROLS TABC TYPE TABLEVIEW USING SCREEN 1001.

DATA: BEGIN OF ITAB OCCURS 0,

MANDT LIKE EKKO-MANDT,

EBELN LIKE EKKO-EBELN,

BSTYP LIKE EKKO-BSTYP,

BSART LIKE EKKO-BSART,

END OF ITAB.

MODULE USER_COMMAND_1000 INPUT.

CASE OKCODE1.

WHEN 'BACK'.

SET SCREEN 0.

WHEN 'NEXT'.

SET SCREEN 1001.

SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE

LIFNR = LFA1-LIFNR.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 INPUT

MODULE MOVE_DATA OUTPUT.

EKKO-MANDT = ITAB-MANDT.

EKKO-EBELN = ITAB-EBELN.

EKKO-BSTYP = ITAB-BSTYP.

EKKO-BSART = ITAB-BSART.

ENDMODULE. " MOVE_DATA OUTPUT

MODULE USER_COMMAND_1001 INPUT.

CASE OKCODE2.

WHEN 'BACK'.

SET SCREEN 1000.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 OUTPUT

MODULE STATUS_1001 OUTPUT.

SET PF-STATUS 'MENU'.

SET TITLEBAR 'TIT'.

ENDMODULE. " STATUS_1001 OUTPUT

MODULE STATUS_1000 OUTPUT.

SET PF-STATUS 'DMENU'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_1000 OUTPUT

FORM ON_CTMENU_FORM1 USING CMENU TYPE REF TO CL_CTMENU.

CALL METHOD CMENU->LOAD_GUI_STATUS

EXPORTING

PROGRAM = ' ZBHTCTRL'

STATUS = 'CMENU'

MENU = CMENU.

CALL METHOD CMENU->ADD_FUNCTION

EXPORTING

FCODE = 'RX'

TEXT = 'RECIEVE'.

ENDFORM.

FLOW LOGIC:

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

PROCESS BEFORE OUTPUT.

MODULE STATUS_1001.

LOOP AT ITAB WITH CONTROL TABC CURSOR TABC-TOP_LINE.

MODULE MOVE_DATA.

ENDLOOP.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1001.

LOOP AT ITAB.

ENDLOOP.

Useful Sites

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm

http://www.sapmaterial.com/tablecontrol_sap.html

<b>REWARD POINTS IF USEFUL</b>

Regards

Gokul

9 REPLIES 9

gopi_narendra
Active Contributor
0 Kudos

Check these programs

demo_dynpro_tabcont_loop

demo_dynpro_tabcont_loop_at

Regards

Gopi

thats the reason i gave you these examples. these are very basic examples related to table controls. they are easily understood. please go through this program also

RSDEMO_TABLE_CONTROL

check this link as well

<b></b>

Message was edited by:

Gopi Narendra

0 Kudos

but i don't even know the concept behind table-control.

Former Member
0 Kudos

Hi Subramanian,

Table Control is used in Module Pool Programming.

Table Control is used to display data of any internal table of ur program or the data from dictionary table directly ino a table format. Using table control with the help of screen painter, data can be easily displayed.It can be created manually through coding or using Table Control Wizard given in the sreen painter.

Table Controls are labeled screen elements to display and process table-type data on dynpros. In a table control, a maximum of 255 screen elements is summarized in a table control row, which can be repeated multiple times within the table control on the screen. The fields of a row have to be created only once as dynpro fields in the dynpro and as global data objects in the ABAP program. Table controls provide an area on the screen for editing the displayed table control rows which offers column headers, marking of rows and columns, horizontal and vertical scrolling with scroll bars, the definition of lead columns and saving of the current settings (see DEMO_DYNPRO). Parts of the user actions in table controls are processed on the presentation server. Vertical scrolling, saving of settings, and changes of screen size (if the resizing properties have been set accordingly when defining the table controls) trigger the event PAI.

A column of the table controls can be defined as marking column , in which the screen element is displayed like a pushbutton and treated like a checkbox (see the first column of the table control in DEMO_DYNPRO). A checked selection key sets the content of the assigned dynpro-field to "X", an unchecked key sets the content to " ". The state of the selection key is transported at the event PAI to a data object of the same name in the ABAP-program and at PBO, you can set the marker via the content of the data object.

Table Controls encapsulate step loops and make their independent use obsolete. The processing of table controls in the dynpro flow logic accordingly bases on the step loop technique using the statement LOOP. In contrary to the processing of independent step loops, the loops of the dynpro flow logic are linked with the addition WITH CONTROL with the table controls of the dynpros during the processing of table controls.

In the ABAP-program, table controls must be declared with the statement CONTROLS, whereat a special structure for handling of table controls is created.

PROGRAM ZTABLECON.

TABLES: LFA1, EKKO.

DATA: OKCODE1 LIKE SY-UCOMM,

OKCODE2 LIKE SY-UCOMM.

CONTROLS TABC TYPE TABLEVIEW USING SCREEN 1001.

DATA: BEGIN OF ITAB OCCURS 0,

MANDT LIKE EKKO-MANDT,

EBELN LIKE EKKO-EBELN,

BSTYP LIKE EKKO-BSTYP,

BSART LIKE EKKO-BSART,

END OF ITAB.

MODULE USER_COMMAND_1000 INPUT.

CASE OKCODE1.

WHEN 'BACK'.

SET SCREEN 0.

WHEN 'NEXT'.

SET SCREEN 1001.

SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE

LIFNR = LFA1-LIFNR.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 INPUT

MODULE MOVE_DATA OUTPUT.

EKKO-MANDT = ITAB-MANDT.

EKKO-EBELN = ITAB-EBELN.

EKKO-BSTYP = ITAB-BSTYP.

EKKO-BSART = ITAB-BSART.

ENDMODULE. " MOVE_DATA OUTPUT

MODULE USER_COMMAND_1001 INPUT.

CASE OKCODE2.

WHEN 'BACK'.

SET SCREEN 1000.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 OUTPUT

MODULE STATUS_1001 OUTPUT.

SET PF-STATUS 'MENU'.

SET TITLEBAR 'TIT'.

ENDMODULE. " STATUS_1001 OUTPUT

MODULE STATUS_1000 OUTPUT.

SET PF-STATUS 'DMENU'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_1000 OUTPUT

FORM ON_CTMENU_FORM1 USING CMENU TYPE REF TO CL_CTMENU.

CALL METHOD CMENU->LOAD_GUI_STATUS

EXPORTING

PROGRAM = ' ZBHTCTRL'

STATUS = 'CMENU'

MENU = CMENU.

CALL METHOD CMENU->ADD_FUNCTION

EXPORTING

FCODE = 'RX'

TEXT = 'RECIEVE'.

ENDFORM.

FLOW LOGIC:

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

PROCESS BEFORE OUTPUT.

MODULE STATUS_1001.

LOOP AT ITAB WITH CONTROL TABC CURSOR TABC-TOP_LINE.

MODULE MOVE_DATA.

ENDLOOP.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1001.

LOOP AT ITAB.

ENDLOOP.

Useful Sites

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm

http://www.sapmaterial.com/tablecontrol_sap.html

<b>REWARD POINTS IF USEFUL</b>

Regards

Gokul

0 Kudos

hi gokhul.

thanks for your elaborative reply... i appreciate you for the valuable time u spent in this issue.. my doubt is complately different. i'm not asking the table control in screen painter, i need information about table control in some transactions that will be recorded while updating data.. if u could give me details regarding this it will be of great use to me.

regards,

karthi

0 Kudos

Hi Subb,

Are you talkin abt Table Controls in tcode while doing the BDC recording method?

regards

Gokul

0 Kudos

Check this link

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

Regards

Gopi

0 Kudos

yes gokhul, i was asking wat u mentioned

0 Kudos

Hi Subbu,

BDC table control means here we can populate the data into the table control.

i.e.if you take VA01 for sales order creation in the belwo of VA01 screen there is table control for the filling of material details so here we will write the code to populate the data into the table control screen.

report ZBDC_TableControl

no standard page heading line-size 255.

include bdcrecx1.

start-of-selection.

perform open_group.

perform bdc_dynpro using 'SAPMSRD0' '0102'.

perform bdc_field using 'BDC_CURSOR'

'RSRD1-DDTYPE'.

perform bdc_field using 'BDC_OKCODE'

'=CHANGE_RADIO'.

perform bdc_field using 'RSRD1-TBMA'

''.

perform bdc_field using 'RSRD1-TBMA_VAL'

'EKPO'.

perform bdc_field using 'RSRD1-DDTYPE'

'X'.

perform bdc_dynpro using 'SAPMSRD0' '0102'.

perform bdc_field using 'BDC_CURSOR'

'RSRD1-DDTYPE_VAL'.

perform bdc_field using 'BDC_OKCODE'

'=ADD'.

perform bdc_field using 'RSRD1-TBMA_VAL'

'EKPO'.

perform bdc_field using 'RSRD1-DDTYPE'

'X'.

perform bdc_field using 'RSRD1-DDTYPE_VAL'

'ztest_Str'.

perform bdc_dynpro using 'SAPLSED1' '0100'.

perform bdc_field using 'BDC_CURSOR'

'D_100-STRU'.

perform bdc_field using 'BDC_OKCODE'

'=GOON'.

perform bdc_field using 'D_100-DTEL'

''.

perform bdc_field using 'D_100-STRU'

'X'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-FIELDNAME(01)'.

perform bdc_field using 'DD03P_D-FIELDNAME(01)'

'bukrs'.

perform bdc_field using 'DD03P_D-ROLLNAME(01)'

'bukrs'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'=WB_LINE_INSERT'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-FIELDNAME(01)'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-ROLLNAME(01)'.

perform bdc_field using 'DD03P_D-FIELDNAME(01)'

'kostl'.

perform bdc_field using 'DD03P_D-ROLLNAME(01)'

'kostl'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'=WB_LINE_INSERT'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-FIELDNAME(01)'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-ROLLNAME(01)'.

perform bdc_field using 'DD03P_D-FIELDNAME(01)'

'wrbtr'.

perform bdc_field using 'DD03P_D-ROLLNAME(01)'

'wrbtr'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'=WB_SAVE'.

perform bdc_field using 'DD02D-DDTEXT'

'test'.

perform bdc_field using 'BDC_CURSOR'

'DD03P_D-ROLLNAME(01)'.

perform bdc_dynpro using 'SAPLSTRD' '0100'.

perform bdc_field using 'BDC_CURSOR'

'KO007-L_DEVCLASS'.

perform bdc_field using 'BDC_OKCODE'

'=TEMP'.

perform bdc_field using 'KO007-L_AUTHOR'

'VARUN'.

perform bdc_dynpro using 'SAPLSD41' '2100'.

perform bdc_field using 'BDC_OKCODE'

'/EWB_CANCEL'.

perform bdc_dynpro using 'SAPMSRD0' '0102'.

perform bdc_field using 'BDC_OKCODE'

'/EABR'.

perform bdc_field using 'BDC_CURSOR'

'RSRD1-DDTYPE_VAL'.

perform bdc_transaction using 'SE11'.

perform close_group.

http://www.sapmaterial.com/tablecontrol_sap.html

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm

<b>Reward Points if Useful</b>

<b>Please Close the Thread if you have the answer</b>

Regards

Gokul

Former Member
0 Kudos

How to deal with table control / step loop in BDC?

Steploop and table contol is inevitable in certain transactions. When we run BDC for such transactions, we will face the situation: how many visible lines of steploop/tablecontrol are on the screen? Although we can always find certain method to deal with it, such as function code 'NP', 'POPO', considering some extreme situation: there is only one line visible one the screen,

our BDC program should display an error message. (See transaction 'ME21', we you resize your screen to let only one row visible, you can not enter mutiple lines on this screen even you use 'NP')

Now, I find a method with which we can determine the number of visible lines on Transaction Screen from our Calling BDC program. Maybe it is useless to you, but I think it will give your some idea.

Demo ABAP code has two purposes:

1. how to determine number of visible lines and how to calculte page number; (the 'calpage' routine has been modify to meet general purpose usage)

2. using field symbol in BDC program, please pay special attention to the difference in Static

ASSIGN and Dynamic ASSIGN.

Now I begin to describe the step to implement my method:

(I use transaction 'ME21', screen 121 for sample, the method using is Call Transation Using..)

Step1: go to screen painter to display the screen 121, then we can count the fixed line on this screen, there is 7 lines above the steploop and 2 lines below the steploop, so there are total 9 fixed lines on this screen. This means except these 9 lines, all the other line is for step loop.

Then have a look at steploop itselp, one entry of it will occupy two lines.

(Be careful, for table control, the head and the bottom scroll bar will possess another two fixed lines, and there is a maximum number for table line)

Now we have : FixedLine = 9

LoopLine = 2(for table control, LoopLine is always equal to 1)

Step2: go to transaction itself(ME21) to see how it roll page, in ME21, the first line of new page is always occupied by the last line of last page, so it begin with index '02', but in some other case, fisrt line is empty and ready for input.

Now we have: FirstLine = 0

or FirstLine = 1 ( in our case, FirstLine is 1 because the first line of new page is fulfilled)

Step3: write a subroutine calcalculating number of pages

(here, the name of actual parameter is the same as formal parameter)

global data: FixedLine type i, " number of fixed line on a certain screen

LoopLine type i, " the number of lines occupied by one steploop item

FirstLine type i, " possbile value 0 or 1, 0 stand for the first line of new

" scrolling screen is empty, otherwise is 1

Dataline type i, " number of items you will use in BDC, using DESCRIBE to get

pageno type i, " you need to scroll screen how many times.

line type i, " number of lines appears on the screen.

index(2) type N, " the screen index for certain item

begin type i, " from parameter of loop

end type i. " to parameter of loop

*in code sample, the DataTable-linindex stands for the table index number of this line

form calpage using FixedLine type i (see step 1)

LoopLine type i (see step 1)

FirstLine type i (see step 2)

DataLine type i ( this is the item number you will enter in transaction)

changing pageno type i (return the number of page, depends on run-time visible line in table control/ Step Loop)

changing line type i.(visible lines one the screen)

data: midd type i,

vline type i, "visible lines

if DataLine eq 0.

Message eXXX.

endif.

vline = ( sy-srows - FixedLine ) div LoopLine.

*for table control, you should compare vline with maximum line of

*table control, then take the small one that is min(vline, maximum)

*here only illustrate step loop

if FirstLine eq 0.

pageno = DataLine div vline.

if pageno eq 0.

pageno = pageno + 1.

endif.

elseif FirstLine eq 1.

pageno = ( DataLine - 1 ) div ( vline - 1 ) + 1.

midd = ( DataLine - 1 ) mod ( vline - 1).

if midd = 0 and DataLine gt 1.

pageno = pageno - 1.

endif.

endif.

line = vline.

endform.

Step4 write a subroutine to calculate the line index for each item.

form calindex using Line type i (visible lines on the screen)

FirstLine type i(see step 2)

LineIndex type i(item index)

changing Index type n. (index on the screen)

if FirstLine = 0.

index = LineIndex mod Line.

if index = '00'.

index = Line.

endif.

elseif FirstLine = 1.

index = LineIndex mod ( Line - 1 ).

if ( index between 1 and 0 ) and LineIndex gt 1.

index = index + Line - 1.

endif.

if Line = 2.

index = index + Line - 1.

endif.

endif.

endform.

Step5 write a subroutine to calculate the loop range.

form calrange using Line type i ( visible lines on the screen)

DataLine type i

FirstLine type i

loopindex like sy-index

changing begin type i

end type i.

If FirstLine = 0.

if loopindex = 1.

begin = 1.

if DataLine <= Line.

end = DataLine.

else.

end = Line.

endif.

elseif loopindex gt 1.

begin = Line * ( loopindex - 1 ) + 1.

end = Line * loopindex.

if end gt DataLine.

end = DataLine.

endif.

endif.

elseif FirstLine = 1.

if loopindex = 1.

begin = 1.

if DataLine <= Line.

end = DataLine.

else.

end = Line.

endif.

elseif loop index gt 1.

begin = ( Line - 1 ) * ( loopindex - 1 ) + 2.

end = ( Line - 1 ) * ( loopindex - 1 ) + Line.

if end gt DataLine.

end = DataLine.

endif.

endif.

endif.

endform.

Step6 using field sysbol in your BDC, for example: in ME21, but you should calculate each item will correponding to which index

form creat_bdc.

field-symbols: <material>, <quan>, <indicator>.

data: name1(14) value 'EKPO-EMATN(XX)',

name2(14) value 'EKPO-MENGE(XX)',

name3(15) value 'RM06E-SELKZ(XX)'.

assign: name1 to <material>,

name2 to <quan>,

name3 to <indicator>.

.

do pageno times.

if sy-index gt 1

*insert scroll page ok_code"

endif.

.

.

perform calrange using Line DataLine FirstLine sy-index

changing begin end.

.

.

loop at DataTable from begin to end.

perform calindex using Line FirstLine DataTable-LineIndex changing Index.

name1+11(2) = Index.

name2+11(2) = Index.

name3+12(2) = Index.

.

.

perform bdcfield using <material> DataTable-matnr.

perform bdcfield using <quan> DataTable-menge.

perform bdcfield using <indicator> DataTable-indicator.

.

.

.

endloop.

enddo.

Sample code

Following is a sample code of handling table control in BDC.

REPORT Y730_BDC5 .

*HANDLING TABLE CONTROL IN BDC

DATA : BEGIN OF IT_DUMMY OCCURS 0,

DUMMY(100) TYPE C,

END OF IT_DUMMY.

DATA : BEGIN OF IT_XK01 OCCURS 0,

LIFNR(10) TYPE C,

BUKRS(4) TYPE C,

EKORG(4) TYPE C,

KTOKK(4) TYPE C,

NAME1(30) TYPE C,

SORTL(10) TYPE C,

LAND1(3) TYPE C,

SPRAS(2) TYPE C,

AKONT(6) TYPE C,

FDGRV(2) TYPE C,

WAERS(3) TYPE C,

END OF IT_XK01,

BEGIN OF IT_BANK OCCURS 0,

BANKS(3) TYPE C,

BANKL(10) TYPE C,

BANKN(10) TYPE C,

KOINH(30) TYPE C,

LIFNR(10) TYPE C,

END OF IT_BANK.

DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,

IT_BDCMSGCOLL LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

FILENAME = 'C:\VENDOR.TXT'

FILETYPE = 'ASC'

TABLES

DATA_TAB = IT_DUMMY.

LOOP AT IT_DUMMY.

IF IT_DUMMY-DUMMY+0(2) = '11'.

IT_XK01-LIFNR = IT_DUMMY-DUMMY+2(10).

IT_XK01-BUKRS = IT_DUMMY-DUMMY+12(4).

IT_XK01-EKORG = IT_DUMMY-DUMMY+16(4).

IT_XK01-KTOKK = IT_DUMMY-DUMMY+20(4).

IT_XK01-NAME1 = IT_DUMMY-DUMMY+24(30).

IT_XK01-SORTL = IT_DUMMY-DUMMY+54(10).

IT_XK01-LAND1 = IT_DUMMY-DUMMY+64(3).

IT_XK01-SPRAS = IT_DUMMY-DUMMY+67(2).

IT_XK01-AKONT = IT_DUMMY-DUMMY+69(6).

IT_XK01-FDGRV = IT_DUMMY-DUMMY+75(2).

IT_XK01-WAERS = IT_DUMMY-DUMMY+77(3).

APPEND IT_XK01.

ELSE.

IT_BANK-BANKS = IT_DUMMY-DUMMY+2(3).

IT_BANK-BANKL = IT_DUMMY-DUMMY+5(10).

IT_BANK-BANKN = IT_DUMMY-DUMMY+15(10).

IT_BANK-KOINH = IT_DUMMY-DUMMY+25(30).

IT_BANK-LIFNR = IT_DUMMY-DUMMY+55(10).

APPEND IT_BANK.

ENDIF.

ENDLOOP.

LOOP AT IT_XK01.

REFRESH IT_BDCDATA.

perform bdc_dynpro using 'SAPMF02K' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RF02K-REF_LIFNR'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RF02K-LIFNR'

IT_XK01-LIFNR.

perform bdc_field using 'RF02K-BUKRS'

IT_XK01-BUKRS.

perform bdc_field using 'RF02K-EKORG'

IT_XK01-EKORG.

perform bdc_field using 'RF02K-KTOKK'

IT_XK01-KTOKK.

perform bdc_dynpro using 'SAPMF02K' '0110'.

perform bdc_field using 'BDC_CURSOR'

'LFA1-TELX1'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'LFA1-NAME1'

IT_XK01-NAME1.

perform bdc_field using 'LFA1-SORTL'

IT_XK01-SORTL.

perform bdc_field using 'LFA1-LAND1'

IT_XK01-LAND1.

perform bdc_field using 'LFA1-SPRAS'

IT_XK01-SPRAS.

perform bdc_dynpro using 'SAPMF02K' '0120'.

perform bdc_field using 'BDC_CURSOR'

'LFA1-KUNNR'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_dynpro using 'SAPMF02K' '0130'.

perform bdc_field using 'BDC_CURSOR'

'LFBK-KOINH(02)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

DATA : FNAM(20) TYPE C,

IDX TYPE C.

MOVE 1 TO IDX.

LOOP AT IT_BANK WHERE LIFNR = IT_XK01-LIFNR.

CONCATENATE 'LFBK-BANKS(' IDX ')' INTO FNAM.

perform bdc_field using FNAM

IT_BANK-BANKS.

CONCATENATE 'LFBK-BANKL(' IDX ')' INTO FNAM.

perform bdc_field using FNAM

IT_BANK-BANKL.

CONCATENATE 'LFBK-BANKN(' IDX ')' INTO FNAM.

perform bdc_field using FNAM

IT_BANK-BANKN.

CONCATENATE 'LFBK-KOINH(' IDX ')' INTO FNAM.

perform bdc_field using FNAM

IT_BANK-KOINH.

IDX = IDX + 1.

ENDLOOP.

perform bdc_dynpro using 'SAPMF02K' '0130'.

perform bdc_field using 'BDC_CURSOR'

'LFBK-BANKS(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_dynpro using 'SAPMF02K' '0210'.

perform bdc_field using 'BDC_CURSOR'

'LFB1-FDGRV'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'LFB1-AKONT'

IT_XK01-AKONT.

perform bdc_field using 'LFB1-FDGRV'

IT_XK01-FDGRV.

perform bdc_dynpro using 'SAPMF02K' '0215'.

perform bdc_field using 'BDC_CURSOR'

'LFB1-ZTERM'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_dynpro using 'SAPMF02K' '0220'.

perform bdc_field using 'BDC_CURSOR'

'LFB5-MAHNA'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_dynpro using 'SAPMF02K' '0310'.

perform bdc_field using 'BDC_CURSOR'

'LFM1-WAERS'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'LFM1-WAERS'

IT_XK01-WAERS.

perform bdc_dynpro using 'SAPMF02K' '0320'.

perform bdc_field using 'BDC_CURSOR'

'WYT3-PARVW(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_dynpro using 'SAPLSPO1' '0300'.

perform bdc_field using 'BDC_OKCODE'

'=YES'.

CALL TRANSACTION 'XK01' USING IT_BDCDATA

MODE 'A'

UPDATE 'S'

MESSAGES INTO IT_BDCMSGCOLL.

ENDLOOP.

FORM BDC_DYNPRO USING PROG SCR.

CLEAR IT_BDCDATA.

IT_BDCDATA-PROGRAM = PROG.

IT_BDCDATA-DYNPRO = SCR.

IT_BDCDATA-DYNBEGIN = 'X'.

APPEND IT_BDCDATA.

ENDFORM.

FORM BDC_FIELD USING FNAM FVAL.

CLEAR IT_BDCDATA.

IT_BDCDATA-FNAM = FNAM.

IT_BDCDATA-FVAL = FVAL.

APPEND IT_BDCDATA.

ENDFORM.

regards,

srinivas

<b>*reward for useful answers*</b>