Regarding table control handling in BDC
Hi,
how to Handle table control in BDC ,how to handle resolution of table control in BDC?
Pls send urgently
Hi,
chk this excellent link.
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Regards
Anver
if helped pls mark points
Similar Messages
-
Table control resolution in BDC
Hi
All
I have one doubt regarding table control resolution in BDC .I know how to handle table control like if i have 5 rows in my TABLE CONTROL.I write the logic according to this rows and if more than 5 rows are there in my flat file i extend the atble control.But this logic will fail in some other system if more than 5 rows are there in that syatem. But I have read from some where that we can use ctu_params structure and if we pass default size as 'x' then it automatically take cares in every sysem.But my doubt is while writing the code initially how can we write ie i mean how many rows i have to mention initially in my logic .
Please tell me the answer to this question if you have already face this type of problem.
Thanks and regards
VenkateswarHi,
The numeber of lines of table control for BDC depend on screen resolution, but It can't be managed by program.
So the better solution is to create a bdc doesn't depend on resolution.
It can do that using always the first two lines of table control.
When you start the simulation, first record has to be placed in first line of tc and the second in second one.
Before placing the third record, it needs to place the second record to the top and so the third record can be placed in the second line.
Before placing the next record, it needs to place the third record to the top and so the fourth record can be placed in the second line and so.
In this way your BDC'll use alwways the first two lines of tc and your program won't depend on resolution.
The problem is the transaction you need to simulate by BDC has to have a scroll functionality to allow to place the last record was elaborated to the top of tc, so the second line of tc can always be used to place the new record.
If there isn't this functionality, it's better to use a BAPI instead of BDC.
check these...
http://www.abaplearning.com/index.php?option=com_fireboard&Itemid=2&func=view&id=11&catid=8
BDC - standard screen resolution required?
https://forums.sdn.sap.com/click.jspa?searchID=739193&messageID=823953
Regards,
Omkaram. -
Dear abaper
Can u Pl let me to how to handle table control in ME51 BDC.
if u have program send it to [email protected]
rgds,
SimhaRegarding Table comtrols in BDC...
Normally all the screns with table controls will have buttons to add(Insert) a Row, Delete a Row etc..
After adding data to 1st Row (it will have index 1)... press that insert button so a new Row is inserted again at 1st row..so this will have index 1.
So in this way you can hard code the index to one.
The advantage is that if there are many rows then you will not have to keep a track of how many rows are inserted and when to press the page down button.
I am giving a small example.... Just copy paste this example and run it in all mode...
Run it in all mode so that you can see what I am trying to do...
Note : this is an relatively easy method.. not the only method to do...
report ZTEST_BDC
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.
I hope this helps.....
Please mark points if it helps.. -
Regarding table control in BDC
Hi,
How can we handle table control in BDC,If i have the transaction like
1>having scroll bar
2>having InsertButton for the tablle control
3>Even though if we have scroll bar or Insert button(+) , is there any limit for the number of rows in table control
or can we insert as many records as we want?
If there is limit how can we identify ,what is the limit of table control.
4>How can we know for table control ,how many records are inserted for each scroll down or Insert button.
i think it varies accroding to the resolution.How can we handle this
ThanksHi Rama Krishna,
While recording the scroll bar will not be recorded.
There is no limit for the number of records,depends on configuration
say suppose the visible lines are 16 then after pressing the new-page then again 16 lines will be available which includes one of the previous lines.
the logic can be as
loop at it_tab.(say 100 records are there)
steps to be executed for table control.
I hope u know hw to capture the line no into v_no.
if v_no = 16.(visible lines)
step for new-page.
endif,
endloop.
Example :
IF V_COUNT = '13'. "Counter reached visible lines
PERFORM BDC_FIELD USING 'BDC_OKCODE' " For New Document Number
'=FDPE'.
V_COUNT = 1.
Hope this will be helpful. -
Hi,
I have a BDC program ( Trasaction C202 - To assign operations to compoents in the material Tab) which has a table control.
Affter i do a P+ the record which becomes the first record in the table control is not constant. It keeps changing with different sets of data.
How can i handle this P+..?
Regards,
Sriram.Hi Srirama,
You follow your coding in that way:
LOOP AT i_itemdata INTO wa_itemdata. [IN I_ITEMDAT TABLE YOU WILL GET ITEM DETAILS]
l_index = l_index + 1.
IF l_index > 16 . [YOU CHECK DEFAULT NO OF TABLE CONTROL DURING RECORDING]
CLEAR l_index.
PERFORM bdc_dynpro USING 'SAPMM06E' '0320'.[YOU CHANGE PROGRAM NAME & SCREEN NO ]
PERFORM bdc_field USING 'BDC_OKCODE' '=P+'.
l_index = 1.
l_index = l_index + 1.
ENDIF.
WRITE DOWN BDC RECORDING
CONCATENATE 'EKPO-EMATN(' l_index ')' INTO l_field. [CHANGE FIELD NAME ACC YOUR REQUIREMENT]
PERFORM bdc_field USING 'BDC_CURSOR' l_field.
ENDLOOP.
Hope this can solve your problems.
Regards,
Tutun -
MAY ANY ONE SUGGEST ME THE IDEA OF TABLE CONTROL USED IN BDC
Table control in BDC
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
check the below link also u may find answers for all your q's
http://help.sap.com/saphelp_webas630/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm
<b>ex----</b>
*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. -
Help regarding 'table controls' and 'internal table' updation
Hi all.
Basically this is what i have done..... I have created a table control in module pool program. I declared an Internal table and also have populated it from a database table. I have also used insert statement to insert an blank record in the table control view and delete statements to delete any record, also in the table control view... .
But I am not able to update any new record into an Internal table or the original table ..
Any Ideas how to do it ,Gurus
ThanksHEllo,
Check thsi simple report.
REPORT ZTFH_TABLECONTROL .
TABLES : ZEMPTABLE.
DATA : SELLINE .
DATA : FLD(20).
DATA : LINNO TYPE I , OFF TYPE I.
DATA : ITAB LIKE ZEMPTABLE OCCURS 10 WITH HEADER LINE.
CONTROLS : CON_TAB TYPE TABLEVIEW USING SCREEN 100.
SELECT * FROM ZEMPTABLE INTO TABLE ITAB.
DESCRIBE TABLE ITAB LINES CON_TAB-LINES.
CALL SCREEN 100.
*& Module EXT_COMM INPUT
* text
MODULE EXT_COMM INPUT.
LEAVE PROGRAM.
ENDMODULE. " EXT_COMM INPUT
*& Module TAB_UPDATE INPUT
* text
MODULE TAB_UPDATE INPUT.
CASE SY-UCOMM.
WHEN 'DEL'.
IF SELLINE = 'X'.
DELETE ITAB WHERE EMPNO = ITAB-EMPNO.
MESSAGE I000(ZYF_DEL).
ENDIF.
WHEN 'UPD'.
IF SELLINE = 'X'.
MODIFY ITAB INDEX CON_TAB-CURRENT_LINE.
MESSAGE I001(ZYF_DEL).
ENDIF.
WHEN 'INS'.
IF SELLINE = 'X'.
GET CURSOR FIELD FLD LINE LINNO OFFSET OFF.
SET CURSOR FIELD FLD LINE LINNO OFFSET OFF.
IF FLD CP 'ITAB*' AND SY-SUBRC = 0.
IF LINNO >= 1.
LINNO = LINNO + CON_TAB-TOP_LINE - 1.
CLEAR ITAB.
INSERT ITAB INDEX LINNO.
CON_TAB-LINES = CON_TAB-LINES + 1.
ELSE.
CLEAR ITAB.
APPEND ITAB.
CON_TAB-LINES = CON_TAB-LINES + 1.
ENDIF.
ENDIF.
ENDIF.
WHEN 'SAV'.
MODIFY ITAB INDEX CON_TAB-CURRENT_LINE.
MESSAGE I002(ZYF_DEL).
ENDCASE.
ENDMODULE. " TAB_UPDATE INPUT
FLOW LOGIC
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP AT ITAB WITH CONTROL CON_TAB.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
MODULE EXT_COMM AT EXIT-COMMAND.
LOOP AT ITAB.
MODULE TAB_UPDATE.
ENDLOOP.
REgards,
Vasanth -
Regarding Table controls dialog programming
Hello Experts-
I have a requirement in which I need to identity the record selected on the table control.This is similar to At line slection.Can anyone help me out.Thanks in advance.
With regards,
Swarna..Hi Swarna,
Make use of CRIT_TABCNTRL-current_line to get the current line of the table control where CRIT_TABCNTRL is table control name.
Have A Good Day
Chaitanya. -
Hi experts,
please claer my doubts the below
1.what is a tableview?
2.how to capture a new record in table control?
3. what is a custom control?
and please let me know how to reward.
Thanks in advance
Regards
RangaHi srinivas,
1.
for table view plese refer to the thread:
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/collaboration">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/collaboration</a>
2. to capture a new record in table control write this code in pai
LOOP AT itab.
MODULE modify_itab.
ENDLOOP.
in the module modify_itab write the foolowing line
MODIFY itab INDEX tabcontrol-current_line.
this will pick all the values of table control into internal table itab.
3. for custom control refer to folloing link.
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/86/2d61d859c711d29bd90000e8a47b2e/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/86/2d61d859c711d29bd90000e8a47b2e/frameset.htm</a>
Hope it helps
And if you want to reward points mark this thread as 'Problem Solved' or with appropriate points on the side of ur post.
Regards
Gaurav
reward points accordingly. -
Regarding TABLE CONTROL IN MODULE POOL
Hi all,
I have implemented a table control in a custom transaction . In the PBO of the code I have moved the internal table data to the screen fields similarly in the PAI of the screen I have moved the screen data to the interanal table and iam modifying the internal table every thing is working fine till here but when I press the down arrow of the vertical scroll bar of the table control then the line item which the user has changed recently on the screen is overwriting the remaining records of the internal table and as a result the tablecontrol lines on the screen are also being overwritten by that record please help me in resolving this issue.....is there any solution to handle the scroll bar and as well the cursor position .Hi,
For the vertical scrool bar F.code is space..
so In pai of ur screen..
If sy-ucomm = ' ' or sy-ucomm = 'ENTER'.
modify it_data index tc-current_line.( so what evr u enter in the Table control ,correponding changes will be captured to ur internal table)
endif.
I hope this works for ur situation.. -
hi all,
Can any one send material related to table control...
points will be rewarded......
Regards,
Bhagya
[email protected]hi Bhagya,
There are many documents available for Table controls in SDN , please do a good search and you will get it . Else see the simple code provided below for assistance .
Creation of table controls in mpools
Here you go with the complete steps for creating module pool programs using table control:
open se51, choose the icon like a table for table control . drag it and then place it in your screen . click on F6 and you will get a screen where youi need to provide the table name / field name that ( fields ) you are going to use in the screen and table control. after giving the ztable name click on get it from dictionary . you will get the list of available fields in a table. next choose the fields you wish to place in the table control , and if you want to place all fields in your table control then select every fields . after this you will get a structure which you should drag place inside the table control area .
double click on the table control , set the proper attributes, tickmark the horizontal and vertical scroll bars to appear in your TC in the screen . save , check and activate ..
following are the sample code you should follow to display datas in your table control ..
write the following code in the flow logic of the screen ............
process before output.
module tc_01_init.
loop at g_tc_01_itab
into g_tc_01_wa
with control tc_01
cursor tc_01-current_line.
module tc_01_move.
module tc_01_get_lines.
endloop.
module status_0001.
process after input.
loop at g_tc_01_itab.
chain.
field sflight-carrid.
field sflight-connid.
field sflight-fldate.
module tc_01_modify on chain-request.
endchain.
endloop.
module tc_01_user_command.
Write the following code in your Zmodulepool program !!
program z_tst_mpool_tc_01.
data: begin of l_tab_sflight occurs 10,
carrid like sflight-carrid,
connid like sflight-connid,
fldate like sflight-fldate,
end of l_tab_sflight.
tables: sflight.
types: begin of t_tc_01,
carrid like sflight-carrid,
connid like sflight-connid,
fldate like sflight-fldate,
end of t_tc_01.
data: g_tc_01_itab type t_tc_01 occurs 0,
g_tc_01_wa type t_tc_01. "work area
data: g_tc_01_copied. "copy flag
controls: tc_01 type tableview using screen 0001.
data: g_tc_01_lines like sy-loopc.
data: ok_code like sy-ucomm.
include z_tst_mpool_tc_01_pbo .
include z_tst_mpool_tc_01_pai .
include z_tst_mpool_tc_01_incl01 .
include z_tst_mpool_tc_01_status_0001.
include Z_TST_MPOOL_TC_01_PBO .
inside include
module tc_01_init output.
if g_tc_01_copied is initial.
select * from sflight
into corresponding fields
of table g_tc_01_itab.
g_tc_01_copied = 'X'.
refresh control 'TC_01' from screen '0001'.
endif.
endmodule.
module tc_01_move output.
move-corresponding g_tc_01_wa to sflight.
endmodule.
module tc_01_get_lines output.
g_tc_01_lines = sy-loopc.
endmodule.
Else check for the sample programs in Txn ABAPDOCU
or search for prgrams in SE38 , you will get many more .
PS: Anytime you need a document do not post it as a thread until you dont get it in the SDN forum .
Regards,
Ranjita -
Hi all,
i want to give a color to a particular column in table control how i can achieve this? currently am using textbox for table control heading display is there any way to achieve this scenario, kindly help me regarding this scenario.You can just highlight it. No provision to set background color.
To highlight the field, you can follow this steps:
Open your table control in screen painter..
Double click on the field on which you want to make highlight.
This will bring you a popup screen for properties.
Select Display tab in the Attributes frame.
Check the BRIGHT checkbox on .
Regards,
Naimesh Patel -
Regarding Table Control in screen Painter
hi,
In my table control, one column is aceepting the UV Rate of the Material. But that particular column did not accept the Decimal Value . when i enter the decimal,
'Please enter the Numeric value' error is coming.
I am declared as Curr Data type for my table zuvrate-dmbtr.
how can i enter decimal value in that column?Neptune,
Lets start from the beginning -
Your custom table has a field called DMBTR (domain WERT7). The reference value for this field is T001-WAERS.
Hope its correct so far.
In the table control, your field DMBTR is called <customtablename>-DMBTR.
In the screen attributes of this field, you have the 'From Dict' ticked, Format is CURR and the reference field is specified. Correct?
If this is the case then the table control should not throw any errors, do let me know if there is any change.
Update: I just figured, probably the reason for your errors is that you have not used the domain in your custom table and have specified the CURR type as a direct type. The problem with this is that 2 decimal places will always be required by the system. Whereas if you use the data element (eg: DMBTR), the output length is 16, which would work fine.
Sudha
Message was edited by: Sudha Mohan -
Calrify this regarding table control?
hi,
while dealing with table control we must create global structure for that table control or we define structure using types or is there any other way of defining the table control structure.
ex:
*& Include ZSS_TABTOP Module Pool ZSS_TABSTRIP
PROGRAM ZSS_TABSTRIP.
CONTROLS: ZSUB1 TYPE TABLEVIEW USING SCREEN '2441',
SUB2 TYPE TABLEVIEW USING SCREEN '2442',
TABLE_TABSTRIP TYPE TABLEVIEW USING SCREEN '2444',
ZSS_TABSTRIP TYPE TABSTRIP.
TYPES: BEGIN OF S_VBAK,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
ERZET TYPE VBAK-ERZET,
ERNAM TYPE VBAK-ERNAM,
AUDAT TYPE VBAK-AUDAT,
VBTYP TYPE VBAK-VBTYP,
NETWR TYPE VBAK-NETWR,
WAERK TYPE VBAK-WAERK,
END OF S_VBAK.
TYPES: BEGIN OF S_VBAP,
VBELN TYPE VBAP-VBELN,
POSNR TYPE VBAP-POSNR,
MATNR TYPE VBAP-MATNR,
NETWR TYPE VBAP-NETWR,
WAERK TYPE VBAP-WAERK,
NTGEW TYPE VBAP-NTGEW,
GEWEI TYPE VBAP-GEWEI,
ERDAT TYPE VBAP-ERDAT,
ERNAM TYPE VBAP-ERNAM,
NETPR TYPE VBAP-NETPR,
KPEIN TYPE VBAP-KPEIN,
END OF S_VBAP.
DATA: I_VBAK TYPE TABLE OF S_VBAK,
I_VBAP TYPE TABLE OF S_VBAP,
W_VBAK TYPE S_VBAK,
W_VBAP TYPE S_VBAP,
OK_CODE TYPE SY-UCOMM,
G_LINES TYPE I,
H_LINES TYPE I.
I WANT TO DISPLAY THESE INTERNAL TABLE DATA IN TABLE PLZ PROVIDE FURTER CODEHi,
TABLE CONTROL
These are the screen elements used to display tabular data they can be called
as screen tables( like STEP LOOP).To use table control we have to create it on the screen using SCREEN PAINTER(SE51) and declare a control variable of TYPE TABLEVIEW using CONTROLS statement in the ABAP program. We have to use LOOP .. ENDLOOP statement in both PBO and PAI with or without AT int_table parameter. IF AT int_table parameter is not used than we have to place a MODULE call between the LOOP...ENDLOOP statement to fill the screen table rows from the ABAP program in PBO and program our own scrolling functions
using OK_CODE field.
Having a parallel loop(at screen table rows & int table rows) by using parameter
AT int_table makes the ABAP code simple.
A special structure of type CXTAB_CONTROL is used to set/get various
attributes of table control at runtime like CURRENT_LINE ,TOP_LINE.
ABAP declaration
CONTROLS: tab_con TYPE TABLEVIEW USING SCREEN nnnn
Here tab_con is the same name we used in screen for the table control.
This ABAP statement will declare a control variable that will be used to access
the table control , and set it's various attributes like number of fixed columns(tab_con-FIXED_COLS) ,total number of records it will display(tab_con-LINES).It is of type CXTAB_CONTROL and is a deep structure(structure containing structures).
REFRESH CONTROL tab_con FROM SCREEN nnnn
This ABAP statement will initialize the table control on the screen nnnn to its initial values.
PBO processing
In PBO we have to use the screen LOOP ...ENDLOOP statement , with or without
intenal table.
LOOP WITH CONTROL tab_con.
MODULE fill_tab_con.
ENDLOOP.
Here a module should be called between the loop endloop statement to transfer
data from th ABAP program to the screen table through a structure.This module
should use the CURRENT_LINE attribute of the table control variable to get the
current screen table record index to read the data from the internal table into a work area.
e.g.
READ TABLE int_table INDEX tab_con-CURRENT_LINE
The record read will be placed in the header line of the internal table and will be available to the similarly named screen fields or if these are different it can be written explicitly. e.g.
screen_field_name = int_table-field_name
LOOP AT int_table INTO workarea WITH CONTROL tab_con CURSOR i FROM
n1 TO n2.
ENDLOOP.
Here the module call is not required to fill the screen table.The CURSOR parameter is a integer of type I indicating which absolute internal table line
should be the first to display on the table control .FROM n1 TO n2 can be used
to restrict the starting line and ending line number of the internal table , they are of type SY-TABIX.
In both cases before the LOOP statement a module should be called which
is generally for setting of status ,in which we should fill the LINES attribute
(tab_con-LINES ) of the control with the total number of internal table records,doing this ensures correct and automatic scrolling.
The ABAP statement DESCRIBE TABLE int_table LINES lines can be used
to get the total lines in an int table.
PAI Processing
We have to use LOOP ... ENDLOOP in PAI so that data can transfer fro table control to ABAP program. If we want to write changes to the data we should
call a module between the LOOP ... ENDLOOP. The MODULE call to process user commands (SY-UCOM) should be called after the ENDLOOP statement.
e.g.
PROCESS AFTER INPUT
MODULE mod AT EXIT-COMMAND.
LOOP AT itab_table or LOOP "depending on whether we are using AT int_table
MODULE modify_int_table.
ENDLOOP.
MODULE user_command.
In the MODULE call modify_int_table we can use
MODIFY int_table FROM workarea INDEX tab_con-CURRENT_LINE
or we can use
int_table-field_name = screen_field_name.
The steps to create a table control is given in this link.
http://members.aol.com/skarkada/sap/table_control/table_control.htm -
Problem with Table control in BDC
Hi Experts,
I have dought regarding Table control i.e How to handle Table control in BDC? i need explanation for handling TC and senario for using T C in BDC?
regards,
Sudha.Hello,
This is the bdc to update the XK01 transaction code (Vendor Creation).
Here we will use table controls for bankings. Here Iam sending the coding and text files.
Coding
REPORT zprataptable2
NO STANDARD PAGE HEADING LINE-SIZE 255.
DATA : BEGIN OF itab OCCURS 0,
i1 TYPE i,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
anred LIKE lfa1-anred,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
END OF itab.
DATA : BEGIN OF jtab OCCURS 0,
j1 TYPE i,
banks LIKE lfbk-banks,
bankl LIKE lfbk-bankl,
bankn LIKE lfbk-bankn,
END OF jtab.
DATA : cnt(4) TYPE n.
DATA : fdt(20) TYPE c.
DATA : c TYPE i.
INCLUDE bdcrecx1.
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\first1.txt'
filetype = 'DAT'
TABLES
data_tab = itab.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\second.txt'
filetype = 'DAT'
TABLES
data_tab = jtab.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RF02K-LIFNR'
itab-lifnr.
PERFORM bdc_field USING 'RF02K-BUKRS'
itab-bukrs.
PERFORM bdc_field USING 'RF02K-EKORG'
itab-ekorg.
PERFORM bdc_field USING 'RF02K-KTOKK'
itab-ktokk.
PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFA1-LAND1'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LFA1-ANRED'
itab-anred.
PERFORM bdc_field USING 'LFA1-NAME1'
itab-name1.
PERFORM bdc_field USING 'LFA1-SORTL'
itab-sortl.
PERFORM bdc_field USING 'LFA1-LAND1'
itab-land1.
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-BANKN(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
cnt = 0.
LOOP AT jtab WHERE j1 = itab-i1.
cnt = cnt + 1.
CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-banks.
CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankl.
CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
PERFORM bdc_field USING fdt jtab-bankn.
IF cnt = 5.
cnt = 0.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LFBK-BANKN(02)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
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'
itab-akont.
PERFORM bdc_field USING 'LFB1-FDGRV'
itab-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'
itab-waers.
PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF02K-LIFNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
PERFORM bdc_transaction USING 'XK01'.
ENDLOOP.
PERFORM close_group.
Intial screen data file.
1 63190 0001 0001 0001 mr bal188 b in 31000 a1 inr
2 63191 0001 0001 0001 mr bal189 b in 31000 a1 inr
Table control Data:
1 in sb 11000
1 in sb 12000
1 in sb 13000
1 in sb 14000
1 in sb 15000
1 in sb 16000
1 in sb 17000
1 in sb 18000
1 in sb 19000
1 in sb 20000
1 in sb 21000
1 in sb 22000
2 in sb 21000
2 in sb 22000
Thanks,
Vasanth
Maybe you are looking for
-
How do I use my backup machine to check what is available
I have permanently connected to my Mac laptop computer a Maxtor 500 GB backup machine so all my important file etc. are saved. I have never tried to utilise and look at the content of this Maxtor machine - but would like to know how to do this, also,
-
When signing on to my gmail account the two dialog boxes, one for account name and the other for the password are already filled in. The password box has dots for the password but anyone who clicks on the sign in box can read my mail. How do I change
-
White border around full-size applet
I try to display an applet which spreads over the complete size of the browser window using a script element like this: <body> <script src="http://www.java.com/js/deployJava.js"></script> <script> var attributes = { code:'MyApplet.class', width:'100%
-
Serial Port not accessible until I run MAX
Hi! On my machine I can access all Serial ports perfectly. I put a Vias Resource in my VI and get a drop down menu with all my serial ports. But on other machines (Runtime v7 and VISA runtime installed) I don´t get the names (e.g. com1 com2) but only
-
Hi all I want to insert footnote at the end of text. When i run my java script give error object is invalid at line no 7. #target indesign var myDocument = app.documents.add(); var myTextFrame = myDocument.pages.item(0).textFrames.add(); myTextFrame.