Doubt in table control
I have a table control on a custom screen containing several rows of data depending on the user input on the selection screen . This table control has 5 columns .
The first column name is KEY . it contains value of a number of fields concatenated together forming a key .
For eg : the fields are matnr mblnr xblnr , so the value in this column would be something like : value of all 3 fields together without any space . My problem is that i do not know the number of these fields till run time , so i do not know whether the key field will contain data from 5 fields or 4 fields ..
My question is this : I want to make the column heading dynamic for this field ..for eg if there is data for 2 fields like matnr and xblnr ,then the heading shud be material number - xblnr or if there are 4 fields ..then the heading shud be the description of those 4 fields ..
Is this possible . Can i make the column header of a table control dynamic .
Kindly help me out as it is urgent ..
I will duly reward all ..
Thanks in advance
Ankit
Hi Ankit,
I dont think its possible in Table Control to change the column headings dynamically.
But this is possible in ALV. You just need to put a If condition in the field catalog.
Will suggest you to go for ALV.
Best regards,
Prashant
Pls. mark points for helpful answers
Similar Messages
-
Doubt in table control in wd abap
Hi experts,
In webdynpro abap i can able to insert a single row in a table control, but how i can able to insert multiple lines in the webdynpro. If possible send me a piece of code to implement this. It will be very helpful for me.
Regards...
Arun.Hi,
Let you internal table be lt_user , LV_USERNODE be the corresponding context node where you want the binding.You need to append empty rows if you need to have multiple rows where user can enter values.
Like follows
DO 5 TIMES.
Append ls_user to lt_user. ( here ls_user in initial )
ENDDO
CALL METHOD LV_USERNODE->BIND_TABLE
EXPORTING
NEW_ITEMS = lt_user
SET_INITIAL_ELEMENTS = ABAP_TRUE
INDEX =
Thanks
Anzy -
Doubts in table control.
Hi All.
I need to create ALV report with check box and add push buttons on appilcation toolbar like selectall, deselect.
If press selectall all check box need to be checked, if I press deselect all check boxes need to deselected .how to do the logic, please help me resolve this problem.
Regards.
Jay
Edited by: Jay on Sep 17, 2008 2:04 PMHi,
In ur internal table there must be a field of type C let it be line_sel, if it holds value X, record is selected and vice-versa.
When u press select all button.
loop at itab where line_Sel <> 'x'.
itab-line_sel = 'x'.
modify itab index sy-tabix.
endloop.
and vice-versa for deselect -
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. -
Doubt in smartform table control
hi,
in my smartform i want to display the table control, i got that normal table control, but i want to change the table control format, that means in write side in the tabs column no need of calculation i need event tab, how to make that?
Thanks and regards,
Gowri.Hi Gowri,
You cannt display Table control in smartform output. As it is reporting tool. Not Dialog Module.
In data tab of table control you can have events.
Reward if useful. -
I have given my code here, I dont know why the data from the table is not displayed in the table control.
table control name - TABLE_CONTROL
internal table name - TCTRL
Flow logic:
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP at tctrl into zalvrg_cx_fcat WITH CONTROL TABLE_CONTROL.
LOOP AT tctrl with control table_control cursor
table_control-current_line.
ENDLOOP.
MODULE TAB_CONT.
PROCESS AFTER INPUT.
module exit_program at exit-command.
field rs38m-programm module check_programm.
module init_controls.
module pop_tblnam.
loop at tctrl.
MODULE PAI_TAB_CONT.
endloop.
MODULE USER_COMMAND_0100.
in module pai_tab_cont-
LOOP AT T_FIELDS.
MOVE: T_FIELDS-TABNAME TO TCTRL-TABNAM,
T_FIELDS-FIELDNAME TO TCTRL-FIELDNAME,
T_FIELDS-POSITION TO TCTRL-COLPOS,
T_FIELDS-OUTPUTLEN TO TCTRL-OUTLEN,
T_FIELDS-FIELDTEXT TO TCTRL-COLHEAD.
APPEND TCTRL.
ENDLOOP.
I have the data in t_fields internal table. I have to display in table control.HI
GOOD
go through these links, which ll give you brief idea about the table control, that you can implement in your requirement,
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb381a358411d1829f0000e829fbfe/content.htm
http://abap4.tripod.com/SAP_Functions.html
thanks
mrutyun^ -
Reg:How to delete the column in table control also from database table.
Hi Experts,
Once again thank u all for giving the responses.
one more doubt is how to delete the columns of table control and also the record shold delete from ztable.
With Regards,
Saroja.P.Hi,
If you want to delete the rows in the table control and simultaneously delete it from the database table, then you can implement a 'DELETE' functionality specific to your table control. Have a MARK field (you will find that in the screen attributes of the table control -> give a name for the MARK field, you will find an additional MARK column at the beginning of your table control). You can check whatever rows you want to delete from the table control, call the delete module.
"This portion of code inside the LOOP...ENDLOOP.
IF sy-ucomm eq 'F_DELETE'.
gt_itab2-check = mark. " Store the MARK field status into your internal table's correspoding field 'check'
MODIFY gt_itab INDEX tabcontrol-current_line.
ENDIF.
iF sy-ucomm eq 'DELETE1'.
DELETE gt_itab WHERE check eq 'X'. "Your internal table does not have rows that you want to delete
ENDIF.
Now you can modify your database table using the MODIFY statement.
MODIFY ZDB FROM TABLE gt_itab. -
Drop down list in Table Control - Value disappeared after pressing ENTER
Dear Gurus,
I have a problem in one of my development where I used a table control in which one field is a drop down list.
I used VRM_SET_VALUES and VRM_GET_VALUES for populating the values from the programand not use any domain level value table for that field.
My problem is when I select one value from this list , and pressing enter , the value get disappeared. But if I use a domain for this field with value table then everything working properly.
My doubt is am I doing some miss coding or using the VRM_ function modules improperly ?
I am sharing some code with you
in PAI :
CALL FUNCTION 'VRM_GET_VALUES'
EXPORTING
id = 'ITAB-FIELD3' "This is drop down list element on screen
IMPORTING
values = values[] " even it is not the expor parameter...it will work..
EXCEPTIONS
id_not_found = 1
OTHERS = 2.
IF sy-subrc NE 0.
No sy-subrc check required.
ENDIF.
IN PBO
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'IVBAP-ERNAM'
values = values[].
Can you please help me.
Thanks .HI,
The link contains the list box creation, just check if this might help.
Re: Getting values back from a listbox.
Regards and Best wishes. -
Dear Friends!
How are you,
I am having one doubt to ask. I have developed one table control application, With the help of table control I am changing the record of table, and saves it to the internal table this what i am supposed to do.
what I am doing is:
I have fiil the table control from the internal table like this way:
name -
number
abc 23423
efg 56456
jgf 64564
now i want to change the number column and save it again to internal table this way:
name -
number <- on save event or ok_code = save.
abc 22222
efg 55555
jgf 66666
i have dont this flow logic programing.
process before output.
*&spwizard: pbo flow logic for tablecontrol 'MY_TAB'
module my_tab_change_tc_attr.
*&spwizard: module MY_TAB_change_col_attr.
loop at it_item
into wa_item
with control my_tab
cursor my_tab-current_line.
module my_tab_get_lines.
*&spwizard: module MY_TAB_change_field_attr
endloop.
module status_0100.
module set_curson.
module get_date.
module ok_code.
process after input.
*&spwizard: pai flow logic for tablecontrol 'MY_TAB'
loop at it_item.
chain.
field wa_item-item_no.
field wa_item-material_code.
field wa_item-description.
field wa_item-unit_of_measure.
field wa_item-quantity.
field wa_item-rflag.
module my_tab_modify on chain-request.
endchain.
endloop.
module my_tab_user_command.
*&spwizard: module MY_TAB_change_tc_attr.
*&spwizard: module MY_TAB_change_col_attr.
module user_command_0100.
module get_vendor_name.
module move_data_from_table. <----- here i m copying the data from table control to internal table.
process on value-request.
field mseg-mblnr module get_mat_doc.
module move_data_from_table input. <---PAI code.
to move the data from the table control to internal table.
it_item-name = my_tab-name.
it_item-number = my_tab-number.
append it_name.
clear it_name.
endmodule. " move_data_from_table INPUT
now i m receiving the error.. data object my_tab doesnot have the componet called it_item.
here my_tab is table control name.
apparently my code is not perfect as i dont know how to do processes over Table control please help me to develop such application
Any help would be appreciated.
Regards
NaeemHi,
Your code should be in loop endloop of PAI
MODIFY <internal table> INDEX <table control>-CURRENT_LINE. -
Closing INDIVIDUAL lines for input in a table control
Right, hopefully I can explain my issue clearly enough to get an answer that will help me resolve this pain in the *** issue.
My table control has a delete function but the client doesn't want the line removed from the control table they simply want the line in question to be greyed out (closed for input). Has anyone achieved this in the past? I know it's possible to grey out columns but I can't see any way of doing individual lines.
For all answers that help me I will shout a beer provided you are in either Sydney or Adelaide.Hi,
>
Neil Gardiner wrote:
> Right, hopefully I can explain my issue clearly enough to get an answer that will help me resolve this pain in the *** issue.
>
> My table control has a delete function but the client doesn't want the line removed from the control table they simply want the line in question to be greyed out (closed for input). Has anyone achieved this in the past? I know it's possible to grey out columns but I can't see any way of doing individual lines.
>
> For all answers that help me I will shout a beer provided you are in either Sydney or Adelaide.
Refer:-
it_zekpo is my internal table w/o header line,
wa_zekpo is work area.
Name of input/output fields on screen are:-
wa_zekpo-field1,
wa_zekpo-field2, and so on...
Add a field as flag(1) type c in the internal table and work area
And keep a name of SELCOL in the attributes of table control as wa_zekpo-flag
Take the group1 for all textboxes as 'ABC' in the table control
Try using code:-
At screen logic:
PROCESS BEFORE OUTPUT.
* MODULE status_8003.
LOOP WITH CONTROL po_tb.
MODULE read_data.
ENDLOOP.
PROCESS AFTER INPUT.
* MODULE user_command_8003.
LOOP WITH CONTROL po_tb.
MODULE modify_data.
ENDLOOP.
In PBO
*& Module READ_DATA OUTPUT
MODULE read_data OUTPUT.
READ TABLE it_zekpo INTO wa_zekpo INDEX po_tb-current_line. "po_tab is table control name
data : line_count type i.
describe it_zekpo
lines line_count.
po_tb-lines = line_count + 10.
"to increase the number of lines in table control dynamically
if sy-ucomm = 'DELETE'. "<--when user click delete button
if wa-zekpo-flag = 'X'. "<--if record selected
if screen-group1 = 'ABC'.
loop at screen.
screen-input = 0. "disable
screen-active = 0.
endloop.
modify screen.
endif.
else. "<--if record not selected
if screen-group1 = 'ABC'.
loop at screen.
screen-input = 1. "enable
screen-active = 1.
endloop.
modify screen.
endif.
endif.
endif.
ENDMODULE. " READ_DATA OUTPUT
In PAI
*& Module MODIFY_DATA INPUT
MODULE MODIFY_DATA INPUT.
MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tb-currentline.
"this will insert a new line
"and will modify the contents of existing line
ENDMODULE. " MODIFY_DATA INPUT
Hope this helps you.
Let mw know if you have any doubts.
Regards,
Tarun -
How to add rows in table control for data recording BDC?
hello,
pl tell me the way to upload data through BDC in table control of screen .
how to add fields inrecording of table control?
Please give some code in this regard.
I am generous in giving points..pl help!Hi,
While doing code under recording first you need to do the recording with sample data under a particular transaction like T-code XK01 (Vendor creation).
Take an example of create vendor using T-code XK01:
Go to t-code 'SHDB' under make recording for XK01 with sample data and once if you complete the recording means after vendor creation check the source code bye by pressing the button 'Program', it shows the total coding for recording of what you entered the test data.
Then you will create one program and copy that source code of recording into your program, and now you have to remove the values at perform statement and give the internal table field name.
Like that you can develop your own code along with your validations.
my best suggestion is dont see the example code of recording method because any one for standard t-code should get the code from recording with sample data, so first tryout with your own recording method and you can understand the code step by step.
With these I hope you will get some idea of recoding method.
Let me know for further doubts.
Regards,
Vijay. -
Restricting rows in table control.
I only want 4 rows in my table control but it is coming as a number of rows...I want to restrict row in my table control,Please tell me how do that?
Hi priya
I am sending the code which i used in my screen see weather it will suite you.if any doubts let me know as well this is for 10 lines
MODULE COUNT_UPDATE INPUT.
data cnt(10).
DESCRIBE TABLE itab1 lines cnt.
append itab1 TO ITAB2.
LOOP AT itab2.
IF itab2-srno is INITIAL.
cnt = cnt + 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = cnt
IMPORTING
OUTPUT = itab2-srno
itab2-srno = cnt.
ENDIF.
READ TABLE itab1 WITH TABLE KEY srno = itab2-srno aufnr = itab2-aufnr." vbeln = itab2-vbeln.
IF sy-subrc eq 0.
MOVE-CORRESPONDING itab2 to itab1.
MODIFY itab2.
MOVE itab2[] to itab1[].
else.
MOVE-CORRESPONDING itab2 to itab1.
append itab1.
ENDIF.
ENDLOOP.
PERFORM operations.
REFRESH CONTROL 'TCL' FROM SCREEN '1000'.*
tcl-lines = 10. " for 10 lines
clear itab2.
CLEAR itab2[].
ENDLOOP.
ENDMODULE. -
Hi,
Could anybody tell me how to add a n number of blank lines to the table control UI element on some event. I have tried with the method CREATE_ELEMENT but its clearing the table control.
I have two nodes called "lines" and "table". "Lines" node contains attribute "Count". and this attribute is binded to inputfiled "INP".
When i click on button , based on inputfield value (INP) that many blank rows should get appended to the table control.
Can anybody advice me how can i get this ?
Can anybody send me the sample code of CREATE_METHOD if its correct approach.
Thanks and Regards
Sireesha.Hi Saurav,
Thanks a lot for your reply. I am very Sorry to miss one point in my first thread. With the CREATE_ELEMENT its adding the blank rows to the table control but its adding in the second page. I thought its clearing the table control entries but in fact the blank rows are getting added in the second page.
My doubt is how to add blank rows only in the first page. I have unchecked the "footerVisible" property for the table control. so when i add rows to the table i cannt see the new rows.
How to add blank rows only in the first page...?
Thanks for your help.
Regards
Sireesha. -
Hi All,
I am facing Problems here ;-
I have developed a table control in WDA4 application i have 3 dropdowns which are dependent on each other i.e. when i select the entry in the first one then corresponding to that entry the data should be shown in next drop down and same goes for the third one .I am using dropdown by index here .
Thnks ,
SahilHello Sahiil,
You need to bind the table to a context node and the three drop downs separately to three context nodes. when you click one one of the drop downs, populate the the other nodes.
I hope this works for you.
Please feel free to ask if you have any further doubts.
Regards,
Ritwik. -
Selection of records in TABLE CONTROL.
hello friends, this is venkat.
I have been using a table contrlo to display the contents of a custom table.
my table control can display 10 records in one shot and my custom table had more than that. vertical scroll bar has been working properly so i can see all the records in the table control area.
now my problam is after i selecting one record, to select another record i am using the vertical scroll bar. but the moment i am scrolling the vertical scroll bar the previously selected one becomes non selected..
how can i select a record and still scroll down or up to select some more records..
another doubt i had is when ever i use vertical scroll bar PAI is geeting triggered but i am not gettig any information in SY-UCOM... how can i catch this event...
just like checking for function code when we click on PUSH BUTTON.
i will be very thanful if any one can give me some guidance.....
Venkat.Hi Venkat,
Basically there are 2 ways in which u can create a table control either for a internal table or for database table.
u can use the wizard from within the screen painter OR
create a table control manually adding individual fields and handling the table control on your own.
in the former method, SAP generates the code behind automatically which is not really comprehendable.
I prefer the later method where u code and have a lot of flexibility of changing the table control at a later stage.
For information on creating table controls, please refer SAP library under
ABAP Programming>ABAP User dialogs>Screens>Complex screen elements>Table controls
Maybe you are looking for
-
To run OHS at port 80 using solaris role based access control
Hi. I already know & have done setuid root to ohs/bin/.apachectl to allow ohs to listen to port 80. Now on a new OFM 11.1.1.4 install, I want to use Solaris Role Based Access Control (RBAC) instead. Is it possible? RBAC does work as I can run a home
-
Camera Raw in Bridge (CS3 for Mac) malfunctions
When processing DNG files in Bridge (CS3) neither Default nor Auto adjustments apply by default. And when choosing Auto the image becomes very dark. How can I correct this? Also where do I place newly downloaded Camera Raw Plugin? Does it need to be
-
What is IMAP SERVER DIRECTORY?
Please! TBIRD is great but its difficult to understand many things. Please in your next version bring back the old Context Help where i could drag an HELP??? arrow to (over) some feature and would get a simple explanation note.
-
HT1212 please help me unlock my ipod
please help me unlock my ipod touch 16gbs
-
I have a Macintosh and a PC. If I purchase a Creative Suite, can I load it on both computers?