Can Table Control alternate on line color?
Is it possible to change line color on Table Control? I would like the lines on the Table Control to alternate in color as to make it easier to read the data. I tried using screen-intensifed but that changes the color on a column, I need to make every other row stand out.
Thanks
Edited by: Gary Morman on Mar 11, 2010 9:17 PM
ALV Grid is editable if using the CL_GUI_ALV_GRID class. See programs which start with BCALV_EDIT*
Regards,
Rich Heilman
Similar Messages
-
Table Controls: - Find selected line index
HI,
I have a table control . In tis 4 lines are visible at a time..1 field in this table comntrol is a button.
when the user clicks on a button, the details of the corresponding line should be used to trigger a new screen. If the no of lines in the table control is less than 4( o of visible lines) , i can use get cursor line, to get the index of the line selected. . but if i scrolled down and selected the button in the 15 th line, then get cursor line cannot be used as it will retrieve the no 3. CAn u please give me a solution.
thnx.declare two variables to get line count and line index
data: wrk_linecnt(10),
wrk_lineindx(10).
get cursor line wrk_linecnt.
wrk_lineindx = <table control name>-top_line + wrk_linecnt - 1.
read table <internal table used in table control> index wrk_lineindx. -
Problem with table control adding new line
Dear friends,
i am working with the VA01 upload program.
when i am uploading the multiple line items i am getting the error.
i resoved the error and successfully upload the data for 3 line items.
when i am upload the data for 10line items it was showing the error as the screen field doesn't exists.
here i am attaching the logic
DATA: V_MABNR(20) TYPE C,
V_KWMENG(20) TYPE C,
V_KBETR(20) TYPE C,
VAL(03) TYPE N VALUE 01.
include bdcrecx1.
start-of-selection.
perform open_group.
LOOP AT IT_FINAL INTO WA_FINAL.
perform bdc_dynpro using 'SAPMV45A' '0101'.
perform bdc_field using 'BDC_CURSOR' 'VBAK-AUART'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'VBAK-AUART' WA_FINAL-AUART."'OR'.
perform bdc_field using 'VBAK-VKORG' WA_FINAL-VKORG."'1000'.
perform bdc_field using 'VBAK-VTWEG' WA_FINAL-VTWEG."'12'.
perform bdc_field using 'VBAK-SPART' WA_FINAL-SPART."'00'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'BDC_CURSOR' 'VBKD-BSTDK'.
perform bdc_field using 'VBKD-BSTKD' WA_FINAL-BSTKD."'PO TEST'.
perform bdc_field using 'VBKD-BSTDK' WA_FINAL-BSTDK."'03.02.2012'.
perform bdc_field using 'KUAGV-KUNNR' WA_FINAL-KUNAG." '1033'.
perform bdc_field using 'KUWEV-KUNNR' WA_FINAL-KUNWE." '1033'.
LOOP AT IT_FINAL1 INTO WA_FINAL1.
CONCATENATE 'RV45A-MABNR(' '0' VAL ')' INTO V_MABNR.
CONCATENATE 'RV45A-KWMENG(' '0' VAL ')' INTO V_KWMENG.
CONCATENATE 'KOMV-KBETR(' '0' VAL ')' INTO V_KBETR.
perform bdc_field using 'BDC_CURSOR' V_KBETR."v_kwmeng.
perform bdc_field using v_mabnr WA_FINAL1-MATNR."wa_item-matnr.
perform bdc_field using v_kwmeng WA_FINAL1-KWMENG."wa_item-kwmeng.
perform bdc_field using v_kbetr WA_FINAL1-KBETR."wa_item-kwmeng.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE' '/00'.
VAL = VAL + 1.
endloop.
*VAL = 01.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE' '=SICH'.
ENDLOOP.
perform bdc_transaction using 'VA01'.
perform close_group.
i searched in SDN i found a lot of links but i can't find the proper document.
can any one explain me clearly about adding the N line items and screen resolution logic.
Thanks,
karunakarHi,
For screen resolution logic, you can pass the value 'X' into the variable CTU_PARAMS-DEFSIZE in the OPTIONS parameter of CALL TRANSACTION using BDC DATA.
CALL TRANSACTION TCODE USING BDCDATA
MODE CTUMODE
UPDATE CUPDATE
OPTIONS FROM OPT
MESSAGES INTO MESSTAB.
DEFSIZE - Selects whether the screens of the called transaction are displayed in the standard screen size. Values: "X" (standard size), " " (current size). -
Hi,
I have a proble in table control where my table control have 3 lines and when i enter three records i can see the records in table control scrren and when i want to add a 4 th line i need to press a BUTTON.when i press the button a new line inserted but i need to scroll to see the fourth record,but my req ments is to see the 4th record in the 3 rd line of the table control and 3 rd will be seen in the 2 nd line of the table control. Is there any good soultions to achieve this.
Thanks,
DeesanthHi Deesanth,
In the PBO of the screen just add code:-
tab_ctrl-lines = tab_ctrl-lines + 10. "tab_ctrl is name of table control
This will insert 10 extra line in the table control.
You can see these empty line when you scroll the vertical scroll bar of the table control.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
Custom Color required to table control in Standard transaction
Hi Expers,
I required to populate a table control row with custom color/s. The table control is belongs to SAP Standard transaction MF50.
Can you please suggest.
Thanks,
PrasadHello Madhu,
As indicated by u have have asked for the access key and have added a field. Where have u added this field. Secondly in which table are u going to update this material field once it starts getting displayed. Also have u put in code in ur PBO and PAI for the same. Please respond to the questions so that we can provide u with better option. -
How to view lines in table control after pressing vertical scroll bar
Hi Experts,
I created table control in MPP, While design my layout I design table control with 12 lines(Fixed), But I am moving my internal table values to table control. my internal table have more then 12 lines. My problem is I cant view my 13, 14th line in table control. Could you help me in solve this issue?Please make sure that you have used the following code in the PBO
DESCRIBE TABLE it_tab LINES tab_ctrl-lines. -
Issue while vertical scrolling in the table control
Hi,
i have my table control which can show 14 entries at a time. and i have almost 100 entries in table control.
now if i selected 2 entries in the visible part.
now scroll vertically.
again come back to see the selected records now they are unselected.
please respond soon.
Thanks
MalyaHi,
I have redone the scenario and follow the steps it will work....
STEP 1: Create an internal table with field for selection in table.
STEP 2: Assign the selection field in the table control for the line selection.
STEP 3: Now whenever the line is selected, the selection field will have a field 'X'.
STEP 4: In PAI Modify the table fields those are selected with 'X'.
STEP 5: Set a flag in PAI, flag = 'X'.
STEP 6: In PBO set a condition . " We set a flag so that we fetch the data only once.
If flag NE 'X'.
Fetch data.
endif.
Data:
begin of ztable,
ID type char4,
Name type char30,
Sel type c,
end of ztable.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP AT ITAB INTO FS WITH CONTROL EMP CURSOR W_I.
MODULE UPDATE.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT ITAB.
MODULE APPEND.
ENDLOOP.
MODULE USER_COMMAND_0100.
INCLUDE YMODTOP . " global Data
*& Module UPDATE OUTPUT
* text
MODULE UPDATE OUTPUT.
MOVE FS TO FS.
ENDMODULE. " UPDATE OUTPUT
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
IF FL_FLAG <> 1.
SELECT * FROM ZTABLE INTO CORRESPONDING FIELDS OF TABLE ITAB.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module append INPUT
* text
MODULE APPEND INPUT.
MODIFY ITAB INDEX SY-STEPL FROM FS TRANSPORTING SEL .
FL_FLAG = 1.
ENDMODULE.
Thanks&Regards
Sarves -
Issue in table control scroll bar
Hi experts,
In Table control I used the following code,
Refresh control 'TCDATA' from screen '200'.
If i use this code i cant able to scroll the data when the table control having multiple lines.
Can any one suggest me?. what i need to do for this..
Edited by: sai.bala on Sep 17, 2010 12:22 PMHi ,
try this...
Refresh control 'TCDATA' from screen '200'.
"write this statement below refresh table control
* Describe lines of internal table to extend the table control Vertical
* scroll bar
DESCRIBE TABLE <tablename> LINES TCDATA-lines.
prabhudas -
Problem related to display column's full length as default in table control
Hi Experts,
I have a screen in report program. In that a table control has been designed.
Now the issue is that when report program has been executed and the table control screen is called on a particular action then the table columns full length is not visible as default however when i checked the screen layout the default and visible length of colum header and column field is as per required.
For example - We have a Period field with default length as 6 and visible length as 15. Its column header is Period with both default length as 15 and visible length as 15.
The period field has an internal table field reference and its format is NUMC.
While column header Period is Text field created of type CHAR.
Please suggest. Any help or inputs will be highly appreciated.
Thanks,
AkashHi
set cursor field 'WA_CODFOD-C_NOTE_NO' line mline.
The value of MLINE can be from 1 and N, where N is the number of the lines shown in the table control, so if your table control can display 5 line, MLINE will be from 1 to 5.
Now you need to create the link between the line of the table control and the line of internal table, the rule is:
Internal Table Line = <table control>-TOP_LINE + <table control line> - 1.
Max -
Query about screen as a structure used in table control.
hi all,
plz explain the fields in screen(structure).
when and how it is used.
specialy i/o, o/p,active,
plz give example.hi,
The screen elements text field, input/output field, status icon, group box, radio button, checkbox, and
pushbutton all have general attributes, Dictionary attributes, program attributes, and display attributes.
The elements subscreen, tabstrip control, and table control have general attributes, and special
attributes relating to the respective type.
We can divide the attributes of an element into:
Statically definable attributes that cannot be changed dynamically
Statically definable attributes that can be changed dynamically
Attributes that can only be changed dynamically
At the beginning of the PBO, the runtime system reads the statically-created and dynamically-modifiable
attributes of each screen element on the current screen into a system table with the line type SCREEN.
Dynamic changes to the attributes of screen elements are temporary.
Using this technique to modify the attributes of a screen element (for example, to change whether an
input/output field is ready for input), you can replace long sequences of separate screens, which are
more costly in terms of both programming time and runtime.
The system table with line type SCREEN will be called SCREEN system table in the following unit.
When a screen is processed, the SCREEN system table contains an entry for each element created in
the Screen Painter for that screen.
The system table SCREEN is initialized at the start of the PBO event for the current screen. To do this, a
system program copies the statically defined attributes of the individual screen elements into the table.
You can then change the dynamically-modifiable attributes of the elements on the screen in a module at
PBO using the following statements: LOOP AT SCREEN.
MODIFY SCREEN.
ENDLOOP.
To do this, you use the structure SCREEN, which is created automatically by the system, and filled with
the values of each successive line of the system table in the loop. Set attributes have the value '1',
attributes that are not set have the value '0'. To change the system table, use MODIFY SCREEN. within
the loop.
To find the element whose attributes you want to modify, you can use a LOOP on the SCREEN table,
and query one of the following fields: SCREEN-NAME, SCREEN-GROUP1 to SCREEN-GROUP4.
You can change the attributes of several screen elements simultaneously at runtime, by including them
in a modification group in the Screen Painter. Assign all elements that will be changed within a single
processing step to a group in the Screen Painter.
To do this, enter a group name for each of the relevant elements in one of the fields GROUP1
GROUP4.
You can include each element in up to four modification groups. You can choose any three-character
sequence for the group name. You can assign elements to a modification group either in the element list
or the layout editor in Screen Painter.
You must program your screen modifications in a module that is processed during the PROCESS
BEFORE OUTPUT processing block.
You use a loop through the table SCREEN to change the attributes of an element or a group of
elements. (LOOP AT SCREEN WHERE . . . and READ TABLE SCREEN are not supported).
To activate and deactivate attributes, assign the value 1 (active) or 0 (inactive), and save your changes
using the MODIFY SCREEN statement.
Note that elements you have defined statically in the Screen Painter as invisible cannot be reactivated
with SCREEN-ACTIVE = 1. Instead, use the statement SCREEN-INVISIBLE = 0. However, elements
that you have statically defined as visible in the Screen Painter can dynamically be made invisible. This
has the same effect as the three statements SCREEN-INVISIBLE = 1, SCREEN-INPUT = 0, SCREENOUTPUT
= 0.
There are three steps involved in displaying buffered data from the internal table in the table control:
The system loops through the lines of the table control on the screen. The lines of the screen table are
processed one by one. For each line, the system carries out the following steps:
The current line of the internal table is placed in the work area of the internal table. (Note that it is
possible to scroll in the table on the screen).
The data from the work area of the internal table is copied into the relevant line of the table control.
When you use table controls on a screen, the automatic field transport sequence changes.
In the PBO processing block, data is transferred from the ABAP program to the screen after each loop
pass in the flow logic. The rest of the screen fields are filled, as normal, at the end of the PBO.
In the flow logic, the loop statement
LOOP AT <itab> INTO <wa_itab> WITH CONTROL <tc_name>
starts a loop through the screen table, and reads the line of the internal table corresponding to the
current line of the screen table, placing it in <wa_itab>.
<itab> is the name of the internal table containing the data, <wa_itab> is the name of the work area for
the internal table, and <tc_name> is the name of the table control on the screen.
If the fields in your table control have the same structure and name as those in the work area <wa_itab>,
the system can transport data between the ABAP program and the screen automatically (step 3).
If you are not using the same structure for the table control fields and the work area of the internal table,
you must call a module between LOOP and ENDLOOP that moves the data from the work area
<wa_itab> into the screen fields (MOVE-CORRESPONDING <wa_itab> TO ) .
The system calculates the value of <ctrl>-TOP_LINE when you scroll, but not when you scroll a page at
a time outside the table control.
In order to transfer changed values from the table control back to the internal table the following three
steps must be carried out:
The system loops through the lines of the table control. The lines of the screen table are processed
one by one. For each line, the system carries out the following steps:
The data from the current line of the table control is copied into the header line of the internal table.
The data in the work area must then be placed in the line of the internal table corresponding to the
line of the table control that is being processed. (Note that it is possible to scroll in the table on the
screen).
In the PAI processing block, all screen fields that do not belong to a table control and that are not listed
in a FIELD statement are transported back to the work fields in the ABAP program first.
The contents of the table control are transported line-by-line to the corresponding work area in the ABAP
program in the appropriate loop.
As usual, the fields that occur in FIELD statements are transported directly before that statement.
The structure of the screen tables contain.
NAME
GROUP 1
GROUP 2
GROUP 3
GROUP 4
OUTPUT
REQUIRED
LENGTH
INTENSIFIED
INVISIBLE
ACTIVE
Hope this helps, Do reward.
Edited by: Runal Singh on Mar 13, 2008 10:41 AM -
BDC- Inconsistancy in table control for t-code MR21
Hi all,
We are facing inconsistency in the table control (number of line items) for t-code MR21 in normal transaction screen and BDC screen.
In normal transaction run (MR21) we can see 12 line entries.
But for the same t-code while processing of a session created by BDC recording we can see only 9 entries.
Because of the mismatch in the lines, there will be a gap of 3 blank lines.
Kindly provide any input to solve the issue.
Thanks & Regards,
PrabhuHello,
You will have to use the OPTIONS addition of CALL TRANSACTION to set the default screen size
data: t_ctu type ctu_params.
t_ctu-defsize = 'X'.
t_ctu-dismode = 'N' . " Mode
t_ctu-upmode = 'S' " Update
call transaction 'MR21' using bdcdata options form t_ctu messages into t_messages.
Vikranth -
Hi Experts,
I have created a table control having 10 lines in it using screen painter.
the purpose of this table control is to get data from user and store that data in Database Table.
For Eg., if the user wants to add 15 rows into it..then how can the no of rows in table control increased? ANy option available?
Regars,
Greeshmabecause your always changing row 1 at the moment even if you think its 11 - you need to update the current row in your table control processing
pbo
loop at g_tc_bu_names_itab
into g_tc_bu_names_wa
with control tc_bu_names
cursor tc_bu_names-current_line.
g_tc_bu_names_lines = sy-loopc.
endloop.
pai
loop at g_tc_bu_names_itab.
" do some pai processing etc then do your modify when ready...
modify g_tc_bu_names_itab
from g_tc_bu_names_wa
index tc_bu_names-current_line.
endloop. -
Ok-code to scroll down in a table control on batch input
Hello,
I'm trying to create a batch input session for transaction VA02 (Change sales order) :
I need to go scroll down in the table control of the screen (item -> Conditions) 3 times to delete the a line; In the batch input (SHDB), i go scroll down by clicking on the scroll bar of the table control, mark the line of the page and delete it.
The recording show me the ok-code /00 to scroll down (with BDC_CURSOR in the second line), but in the program it don't work, the ok do nothing the 3 times and mark the incorrect line.
Can anyone tell an idea of what is the correct ok-code to scroll down?
Thanks in advance
Alvaro
PD: My SAP system is an ECC 6.0Hi Alvaro
One time i had to do similar work for Creation of General Task List in PM module and this is how i did it
'X' 'SAPLCMDI' '3500',
' ' 'BDC_CURSOR' 'RIHSTPX-DISP(01)',
' ' 'BDC_OKCODE' '=P+',
' ' 'RIHSTPX-IDNRK(01)' itab-idnrk,
' ' 'RIHSTPX-MENGE(01)' itab-menge,
' ' 'RIHSTPX-MEINS(01)' itab-meins,
' ' 'RIHSTPX-DISP(01)' itab-disp.
I had to select line 1 hence you can see the position number ( 01 ) in the field name. As you can see based on this positioning you can select the appropriate line and make modifications as you like and also use okcode of '=P+' to scroll done. Hope this helps. Reward if appropriate.
Best Regards
Sid Arora -
Check for a row in table control
I have a table control and on a click of a row in a particular column (vertically downwards) i want to check which row of that column is clicked because i want search help of that column different for every row.
how can i do ithi,
In the struicture having the table control fields add a field 'sel type c.
In the screen in table control consider single line selection and enter field name as sel. activate the screen layout.
In PAI,
loop atthe table control table and read the row where sel = 'X'.
Now write your serach help code for the corresponding column and row.
Thanks,
Kasiraman R -
Possible to code a Find/Find Next feature for use inside a Table Control
Hello,
I have a Table Control that displays many lines. Is it possible to code a Find/Find Next feature that would allow the user to enter a 'keyword' then search each line of the Table Control for existing matches?
I have provided the user with various Selection Criteria that will filter the table control results, but there are still too many lines to visually scan for the desired result.
I am guessing that I would place an input box and a 'Find' button onto my layout screen. Then in user command, I have to scroll through each line of the table control and check every value to see if the string contains 'keyword' When found, stop and display table control assigning current line as Top line?
Am I on the right track or is there a better solution already?
Kind Regards,
MPerssonI've done that. It works pretty well. You might want to allow the user to search only in selected column(s) as well.
Rob
Maybe you are looking for
-
Mac OS X Panther install/boot
Hello, I am from Germany and my english ist'n that good. I hope you can still understand me. I've got an iMag G3 Indigo, 350 mHz, 192 MB RAM. First it hat 64 MB RAM and I adeted 128 MB ram. Now I want to install Mac OS X Panther. Everything works fin
-
Hello, i have a macbook pro 13" and would like to use the audio in/out to record using the port for line in. However after much research i have found out that i do not have the line-in option, heres is a screen shot: /___sbsstatic___/migration-images
-
Can you use Iphone hotspot to wirelessly connect to apple TV
Can you use Iphone hotspot to wirelessly connect to apple TV. ie I have no router but am interested in playing music from phone to apple TV.
-
Reconnect MULTIPLE Folders to Offline Media?
In Lightroom 2.4 there is a "Find Missing Folders" command, but I've been able to use this only one folder at a time. It doesn't seem possible to reconnect a LR catalog to numerous relocated folders in a single operation. This becomes very tedious
-
How can i build a portlet with multi-record fields
Hi I am building an application and some of my forms need to capture multi-records fields,for example like Developer Forms does with Grids Can anybody send me an example to do this?. Thanks