Table Control - Input Enabling/Diabling of Rows based on Condition.
Hi,
In the TC, I want to Input Enable/Disable the rows based on Conditions. The First row is input enabled always. But the other rows, (2nd onwards) need to be Input Enabled/Disabled based on some conditions. It is possible to make this working. Can you please provide me a suitable solution for this?
Appreciate Your Help.
Thanks,
Kannan
Hi Kannan...
If we are talking about "Rows"...
then identify based on some conditions the row numbers and in PBO...loop at screen with screen name..set thier input properties and modify screen (make them input only)
If we are taking into consideration "columns"
There is an internal structure COLS where we can identify column number of screen name ...or we can take except for one particular column..
if some condition satisfied....
loop at screen where screen-name <> "Column which is input'.
Loop at screen...and make other columns display only.
modify screen
endif.
Regards
Byju
Similar Messages
-
To insert a new row in a table control without affecting the other rows
Halo experts,
I have a Table control TCTRL in a program .
The lt_tab contains two cols A and B
In change mode of the transaction Col A is in display mode and Col B is in change mode
When i press the + button to insert a new blank entry .I need a blank row with both col A and col B input enabled w/o affecting the display of above and below rows of table control
In PBO module of subscreen 101
LOOP AT lt_tab WITH CONTROL tctrl.
MODULE tctrl_status.
endloop.
In the user command of 0101
i am writn
When 'INS'.
INSERT INITIAL LINE INTO itab.
Inside MODULE tctrl_status.
IF lt_tab IS INITIAL.
LOOP AT SCREEN.
IF screen-name = 'COLA'.
screen-input = 1.
ENDIF.
ENDLOOP.
MODIFY SCREEN.
endif.
but the problem here is still the Col A is in display mode and Col B is in change mode after output
.Here modify statement is happening but it does not update the TCTRL-COLS-Screen structure for the col A ( which I have set statically while designing the screen ).I dont want to make the entire row in edit mode only the inserted row ( for both Col A and Col B) and the rest shud remain as it is
Thanks
Kalluhi Naveen
I have made my tctrl input disabled for both the columsn and
I have a module before the PBO loop where I set the like
module set_tctrl_status.
IF gv_ok_code NE gc_disp.
LOOP AT tctrl-cols INTO gs_cols.
IF gs_cols-screen-name = 'ColB'.
gs_cols-screen-input = 1.
MODIFY tctrl-cols FROM gs_cols INDEX sy-tabix.
ENDIF.
ENDLOOP.
This is just to set the Col B in edit mode when in change and create status.
But if i press the INS button for that change i am coding inside the loop endloop of the pBO like
if itab is initial.
LOOP AT tctrl-cols INTO gs_cols.
gs_cols-screen-input = 1.
MODIFY tctrl-cols FROM gs_cols INDEX sy-tabix.
endloop.
But the problems i it is setting the enite rows as input enabled . I want tos et only that row inpur enabled -
Search help for table control input value
Hi,
We have designed a GUI for supply invoice approval workflow with table control.
In the table control fields, we assigned one search help on one field.
We can enter the values(F4 Help) up 8 row in the default screen, which is having 8 row.
After scrolling down for 9th row, I am not getting any F4 help, which I am able to get upto 8 rows.
Please any one could help me in this...
BR,
ThirupathiHi,
Did you assign the search help to the <b>Search Help</b> of the <b>Attributes -> Dictionary</b> tab of the field?
Irrespective of scrolling, the F4 help should work for the field in table control.
Regards,
Raj -
Color the row based on condition
Hello all,
I am woring on an interactive adobe form being called by a web dynpro application.
The adobe form interface used is XML Schema based. The form displays some data at header level and item level.
The item details are displayed in a table. Now. my requirement is that i have a field 'STATUS' in the item table. I want to display the row with RED color if the STATUS = 'X' . How can i achieve this.. i tried using java script at Row initialze event but that didn' work.
Please let me know if you have some solutions.
Thanks & Regards,
Ravi AswaniTry this code
var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);
var custordertext;
for (var i=0; i <= fields.length-1; i++)
if (fields.item(i).name == "STATUS")
if(fields.item(i).rawValue == "X")
this.fillColor = "50, 50, 255";
use this event in calculate event
Thanks,
Rakesh -
Data Loading from one table to another in the Same Database based on conditions .
Hi ALL ,
I have 2 tables Products and Product_info .
Product_info table Product_id is Primary key but not an identity column so auto increment of number needs to be performed from the Package only .
Requirement is :
IF the Product_ID is = 20 and Date lies in the previous month not the current month in the Products table then
insert into the Product_info table based on below mentioned information .
1.If the Name has tap then ignore it completely don't perform any insert for it.
2.If the Name has Zork in it then perform 2 inserts in the Product_info table having Product_info_id's 1 and 2 .
3.If the Name doesn't contains Zork or tap insert it in the Product_info table having Product_info_id 4.
Very new to SSIS package development it will be helpful if you can provide detailed information .
Source Table (Products table )
ID
NAME
Product_ID
Date
Area_ID
1
P_tap_rus
20
13-01-2014
3
2
Enc_sap_top
10
15-01-2014
4
3
Yorl
20
05-02-2014
5
4
zork
20
20-01-2014
6
5
fadbt
10
22-01-2014
6
6
xyzzz_oprt
20
28-01-2014
5
7
def_type_ru
20
06-02-2014
2
8
acd_inc_tup
10
07-02-2014
3
9
bnf_dlk_fbg
20
03-02-2014
4
10
rtyui_vnmghj_sfdl
10
12-01-2014
5
11
wlwf_10103_123
10
04-02-2014
9
Destination table (Product_info)
Porduct_ID
ID
Area_ID
Product_info_ID
Column1
1
3
5
4
As NameString doesn’t contain Zork or Tap
2
4
3
1
As Id is 4 so 2 inserts one for 1 and other for 2 in the Product_info_id column
3
4
3
2
4
6
5
4
5
10
5
4
6
11
9
4
Please let me know if any other information is required .
Thanks
PriyaHi Priya,
You mentioned this was coming from two tables right? I believe I would try to perform the transformations with T-SQL in my source (If this is a possibility for you). Below is an example of something you could do.
WITH CTE
AS
SELECT ID, Product_ID, [Date], Area_ID,
CASE
WHEN Name like '%Zork%' THEN 1
ELSE 4
END AS Product_Info_ID
FROM [YourTable]
WHERE Product_ID = 20 and MONTH([DATE]) = MONTH(DATEADD(MM, -1, GETDATE())) AND NAME NOT LIKE '%tap%'
SELECT *
FROM CTE
UNION
SELECT ID, Product_ID, [Date], Area_ID, '2' AS Product_Info_ID
FROM CTE WHERE Product_Info_ID = 1
I hope this helps, Regards. -
Select rows based on condition of same row
Hello,
I have the following table structure and rows defind here
http://sqlfiddle.com/#!4/3f474/3
I would like to select rows if PRODUCT_NO is null then I need to select rows which are having IS_PAYABLE='Y'. If PRODUCT_NO is not null
then IS_PAYABLE will be 'N' or IS_PAYABLE will be null.
E.g.
For PRODUCT_REG HPO_FABRIC, one PRODUCT_NO null so I need select that row only, not the other two rows.
I can do
select * from SUPPLIER_DETAILS where IS_PAYABLE='Y', but what if there are many records with PRODUCT_NO having null or not null
How can I do this using sql?This simple query!!!
select *
from supplier_details
where (product_no is null
and is_payable = 'Y')
or (product_no is not null and is_payable is null);
PRODUCT_REG PRODUCT_SUPPLIER_CODE PRODUCT_NO START_DATE END_DATE IS_PAYABLE
HPO_FABRIC JP_008 01-AUG-01 31-AUG-01 Y
HPO_FABRIC JP_008 STGA-FABR1 16-AUG-01 31-AUG-01 --Edited:- Modified Query and Results for 2nd Requirement
Edited by: Purvesh K on Sep 17, 2012 4:55 PM
--Removed NVL
Edited by: Purvesh K on Sep 17, 2012 5:04 PM -
Duplicate rows based upon condition
Oracle 11.2.0.1
Windows
create table regsales (billno number,itemno number,paymode varchar2(10));
insert into regsales values (12345,10,'cash');
insert into regsales values (12345,11,'cash');
insert into regsales values (12346,11,'cash');
insert into regsales values (12347,10,'credit');
insert into regsales values (12348,14,'cash');
insert into regsales values (12348,15,'cash');
insert into regsales values (12345,12,'cash');
insert into regsales values (12349,10,'cash');
insert into regsales values (12345,10,'credit');
insert into regsales values (12350,11,'cash');
insert into regsales values (12351,12,'cash');
insert into regsales values (12352,11,'cash');
insert into regsales values (12350,11,'credit');
Required Output please :
BILLNO ITEMNO PAYMODE
12345 11 cash
12345 11 credit
12350 10 cash
12350 10 credit
i.e. in which same billnos same itemno has been sold in cash and credit.
Thank you.Hi,
So, you need to know how many different paymodes there are in a group of rows. That sounds like a job for COUNT (DISTINCT ...)
Here's one way:
WITH got_cnt AS
SELECT billno, itemno, paymode
, COUNT (DISTINCT paymode)
OVER ( PARTITION BY billno
, itemno
) AS cnt
FROM regsales
SELECT billno, itemno, paymode
FROM got_cnt
WHERE cnt = 2
ORDER BY billno, itemno, paymode
Can there be other paymodes besides 'cash' and 'credit'? If so, the same basic idea will still work, but the details may be a little messier, depending on your requirements. -
Display input field on selection screen based on condition
Hi,
I have a report with selection with no of input fields and a checkbox .I want to hide few i/p fileds based on checkbox i/p.
If the checkbox = 'X',then only those fields should apper on screen for input.
how do we get this on sel screen.
thanks in advance.Hi,
you can use this code as reference.
Here, depens on check box, in the next screen resepective select options will be displayed.
You can use this logic for your requirement.
REPORT Z50871_SELECTOPS_DYNAMIC.
PARAMETERS : CH_EBELN AS CHECKBOX,
CH_VBELN AS CHECKBOX.
DATA: V_EBELN TYPE EKKO-EBELN,
V_VBELN TYPE VBAK-VBELN.
SELECTION-SCREEN BEGIN OF SCREEN 100.
SELECT-OPTIONS : EBELN FOR V_EBELN MODIF ID G1,
VBELN FOR V_VBELN MODIF ID G2.
SELECTION-SCREEN END OF SCREEN 100 .
AT SELECTION-SCREEN OUTPUT.
IF SY-DYNNR = 100.
IF CH_EBELN = 'X' AND
CH_VBELN = ''.
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'G1'.
SCREEN-ACTIVE = '1'.
ELSE.
SCREEN-ACTIVE = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF CH_VBELN = 'X' AND
CH_EBELN = '' .
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'G2'.
SCREEN-ACTIVE = '1'.
ELSE.
SCREEN-ACTIVE = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF CH_EBELN = 'X' AND CH_VBELN = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 EQ 'G1'
OR SCREEN-GROUP1 EQ 'G2' .
SCREEN-ACTIVE = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDIF.
AT SELECTION-SCREEN.
IF SY-DYNNR = 1000.
IF CH_EBELN = 'X' OR CH_VBELN = 'X'.
CALL SELECTION-SCREEN 100.
ELSE.
MESSAGE I000(Z50871MSG) WITH 'Please select atleast one checkbox'.
ENDIF.
ENDIF.
Regards
Sandeep Reddy -
Add different UI in each row based on conditions in ALV
Hell All,
i am working on dynamic ALV in which i have created 3 methods 1. which creates the columns 2. Which sets the data into teh created columns. 3. which does teh alv customizations.
So now my requirement is based on some condition i want to change the UI element
eg
i have
column1 column2 column3
1 link_to_action name
2 link_to_url name2
so based on the condition i would like to display the ui elements as above.
I was able to do till this end so far..
1.in create_columns method i created a column call cell_varaint
2 when i was passing data into the columns
'when column1'
IF colum1 = 1.
<field> = 'link_to_url'
else.
<f_field> = ' '.
endif.
when 'column2'
CREATE OBJECT lr_link_to_actn.
<ls_column>-r_column->set_cell_editor( lr_link_to_actn ).
CREATE OBJECT l_cv.
l_cv->set_key( value = 'LINK_TO_URL').
l_cv->set_editor( value = lr_lnk_to_url ).
<ls_column>-r_column->add_cell_variant( r_cell_variant = l_cv ).
<ls_column>-r_column->set_sel_cell_variant_fieldname( 'cell_varaint).
so now i am able to get only empty column with no data into it ... and my cell varaint column shows me the values like LINK_to_URL or space.
I am sure tht some where i am missing something...
Please tell me the correct procedure to use it...
Regards,
Sana.I hope it is Hello not Hell
if i understand your question correctly, You want the first row of column to LinkToAction UI element and second row LinktoURL.
follow the link where it is nicely explained however he is making one row as text view and other as checkbox.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0e7461d-5e6c-2b10-dda9-9e99df4d136d?quicklink=index&overridelayout=true -
Planning Form: Suppress row based on condition
Dear All,
Is it possible to do this in hyperion planning. for example:
- i have member A
- in the data form, i want to show row only when member A have value equal to 1. other is suppressed.
- in another form, i want to show only when A = 2, other is suppresed.
did anybody have this experience, or is there any other way to do this?
Thanks in advance.
Regards,
FeriHi, i assumed as answered because in fact, the Planning dataform don't have that functionality, but in the new version (11.1.2.2) you might want to try the filter functionality.
It was a long time ago, but if i'm not mistaken, previously i solve this problem by separating the member for each condition.
example:
member A: have all data
(copy the data from member A to member B and C with condition)
member B: contain data for condition 1
member C: contain data for condition 2
then you can select which condition that you need to show. -
Give some hints that in a table control , first row will be editable and
pls,
give some hints that in a table control , first row will be editable and
rest of the rows will be non-editable.Hi,
Take the group1 for all the textboxes in table control as 'ABC'.
Use this code, its working:-
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...
At screen flow-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
"enable only first row and disable rest rows in table control.
IF sy-subrc EQ 0.
IF sy-tabix GE 2.
IF screen-group1 = 'ABC'.
LOOP AT SCREEN.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
ENDLOOP.
MODIFY SCREEN.
ENDIF.
ENDIF.
"disable empty rows
ELSE.
IF screen-group1 = 'ABC'.
LOOP AT SCREEN.
SCREEN-INPUT = 0.
SCREEN-ACTIVE = 0.
ENDLOOP.
MODIFY SCREEN.
ENDIF.
ENDIF.
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
ENDMODULE. " READ_DATA OUTPUT
In PAI
*& Module MODIFY_DATA INPUT
MODULE MODIFY_DATA INPUT.
MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tb-currentline.
ENDMODULE. " MODIFY_DATA INPUT
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
How to Enable and Disable column in Table Control.
Hi all,
I want to make certain column of Table control as Enable or Disable on Button action.
Enable means ready for input and Disable means not ready for input.
Please send me sample code.
Thanks in advance.Hi Vipin,
You have to loop through the table columns to set the properties in the PBO of your screen.
Here is the sample solution.
delcare a workarea for the columns in the table control in your top include.
Table Control .
CONTROLS: TAB1 TYPE TABLEVIEW USING SCREEN '0100'.
DATA: WA_COLS LIKE LINE OF TAB1-COLS.
in your screen
PROCESS BEFORE OUTPUT.
MODULE INTIALISE_100.
*& Module 0100_INTIALISE OUTPUT
MODULE INTIALISE_100 OUTPUT.
LOOP AT TAB1-COLS INTO WA_COLS.
WA_COLS-SCREEN-INPUT = 1.
MODIFY TAB1-COLS FROM WA_COLS TRANSPORTING SCREEN-INPUT.
ENDLOOP.
ENDMODULE. " 0100_INTIALISE OUTPUT
modify the screen-input property as required for the table control columns.
Please provide points if helpfull.....
Thanks,
Karthik
Message was edited by: Karthik
Karthikeyan K -
Hi Experts,
My Requirement is create a table control with 5 coloumns. The rows have to be displayed dynamically...
I created a screen , and placed a table control.
For eg :
if my internal table having 2 entries , then the table control should only have two rows....(no disable/greyout)
if internal table having say 40 entries , then the table control should have 40 rows...
Thanks,
Lakshmiraj.AHi,
Refer
table control dynamic rows
Dynamic rows increment according to user input in Table Control Module Pool
Hope this helps
Sumana -
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. -
Reg : Table control row settings to change mode
Hi geeks.
I am working on a requirement where the table control has to be in display mode at the time of prepopulating(initial display).This works fine and could get all columns in display mode for which i used column properties of table control. I could select a row from the table control and created a button above the table control for copy of the row which is added to the last row of the TC. I could get this with out any issues. They want the added row to be in changed mode whereas the other rows selected previously should remain in the display mode. Can anybody help me out to solve.Timely help will be appreciated <removed by moderator>
Regards ,
Kumar.
Edited by: Vinod Kumar on Aug 2, 2011 9:21 AMThis thread will assist you.
[Table control with non editable rows;
Make use of some flag for identifying the new records that will be appended in itab on the press of the button.
Then in PBO,
loop at itab with control tc cursor tc-current_line.
module editnewrow.
endloop.
module editnewrow output.
if itab-flag = 'X'.
loop at screen.
screen-input = 1.
modify screen.
endloop.
itab-flag = ' '. (resetting back to non-editable state for consequent press of the button)
modify itab index tc_4000-current_line.
endif.
endmodule.
Maybe you are looking for
-
I have repeatedly clicked repair just to have it reopen and then crash again.
-
I want to use a nas drive for my time machine back ups.
Hi, I'm pretty new to macs. I've set up time machine on my kids macs using a time capsule without problems. Ive now bought my own mac and want to use time machine to back it up but only have a network hard drive to do it on. When I go to choose disk,
-
Standard workflow for downpayment request approval
Hi, Is there any standard workflow for downpayment request approval? Please suggest.
-
No editable form fields in ABAP Web Dynpro
Hi, I created a form with layout type ZCI. The interface type is "ABAP Dictionary-Based Interface". This form I embedded in a abap web dynpro component. In the ABAP WD interactive form element I marked the enabled property. Unfortunately the displaye
-
Windows server 2003 Remote desktop over WAN problem.
Ok so problem is there is a 2003 windows server in my office. Any computer phone etc. can connect to it via Remote desktop if they are in the LAN network. I have port forwarded 3389 , disabled firewalls , there is no antivirus software on the server.