How to expand rows in a table by calculated value of a field
Hi,
I'm trying to set the rows of an expandable table to follow the calculated value of a field.
The calculated field comes from two date fields that calculate the number of days and I want my table/row to expand based on that number..
Is is possible? Right now I have a button that does add an instance "Admin_Use.Table3._Row1.addInstance(1);" but I want it to be triggered by the calculated field instead...
Thank you so much!!!!
Hi Niall,
Thank you for your reply. I'm still a bit puzzled as right now I have this code in my calculate field (see below) under the calculated event and I'm not sure how to insert the code you sent me as I keep getting syntax errors. Any help will be greatly appreciated!!!
if (HasValue(Nights.FirstNight) & HasValue(Nights.LastNight) ) then
if (Date2Num(Nights.LastNight, "YYYY-MM-DD", "en_IE") >= Date2Num(Nights.FirstNight, "YYYY-MM-DD", "en_IE")) then
$ = Date2Num(Nights.LastNight, "YYYY-MM-DD", "en_IE") - Date2Num(Nights.FirstNight, "YYYY-MM-DD", "en_IE") + 1
else
xfa.host.messageBox ("The first night cannot be after the last night", "Nights Covered", 0)
Nights.LastNight.rawValue = null
endif
else
endif
Similar Messages
-
Query to insert a row in a table with same values except 1 field.
Suppose I have a table with 100 columns(fields).
I want to insert a row with 99 fileds being the same as previous ones except one fileld being different.
The table doesn't have any constraints.
Kindly suggest a query to solve the above purpose..And for much more lazy people, a desc of table is shorter to write. :-)
Then copy & paste into any editor, then mode column to add a comma after every column name in one shot.Or have the system do it for you. Be lazy.
SELECT Column_Name || ',' FROM User_Tab_Columns where Table_Name = '';
Indeed, it can be converted to a script called desc(.sql)
SELECT Column_Name || ',' FROM User_Tab_Columns where Table_Name = '&1' ORDER BY Column_Id;
Then desc or @desc. -
Is it possible to duplicate a row in a table and the values entered by u
PDF LiveCycle Designer : Is it possible to duplicate a row in a table and the values entered by the user?
[Move to LiveCycle Designer]
-
In which table is the value of the field User-Status of trans IW22 stored?
I have changed the user status of a notification in transaction IW22, to APTC. Now i want to retrieve this value for further process in workflow.
Can anybody tell me in which table is the value of this field stored?Hi,
these tables do not contain user statuses against respective notification nos... -
How can we prevent a user from entering a value in Parameter Field?
how can we prevent a user from entering a value in Parameter Field and Select-options Field?
make it invisible, make it inactive, make it display only.
if the field is not there or not to be seen the user WILL have problems inputting data.
BUT once the field is there you can NOT prevent that the user fills it with data.
all you can do is on PAI check if the data the user inputted was good or bad, and clear his inputs, but you can NOT prevent him inputting something. -
How get all rows of a table with a BAPI
Hi,
how is it possible to get more then one row by calling a BAPI from the WD. In my Application I need the rows of a Table coming from the r/3 System. How is it possible to get all the rows after the first call? What is the logic behind it? My purpose is also to create an own BAPI.
regards,
Sharam
nullHi,
If I understand, you don't want display the result into a Web Dynpro Table. If so, after the execution, the result of your request is stored into the context. Then you don't really need to transfert the data from your context to an Java Array.
But if you want to do it, here is the code :
guess your result node called
nodeResult
Vector myVector = new Vector();
for (int i = 0; i < wdContext.nodeResult().size(); i++){
myVector.put(wdContext.nodeResult().getElementAt(i));
I hope this will answer to your question.
Regards -
How to convert rows of internal table to columns of another internal table?
Hi,
Experts,
test_data.xls:
one two three four five
one two three four
one two three
one two
one
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = 'c:/test_data.xls'
I_BEGIN_COL = '1'
I_BEGIN_ROW = '1'
I_END_COL = '10'
I_END_ROW = '10'
TABLES
INTERN = it_tab
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
output:
0001 0001 one
0001 0002 two
0001 0003 three
0001 0004 four
0001 0005 five
0002 0001 one
0002 0002 two
0002 0003 three
0002 0004 four
0003 0001 one
0003 0002 two
0003 0003 three
0004 0001 one
0004 0002 two
0005 0001 one
but i want this format:
one two three four five
one two three four
one two three
one two
one
i don't want this type of output display i want to display in ABAP report as in file format how can i achieve this post some ideas on it.
Thank U,
Shabeer ahmed.Hi,
Use this piece of code :
parameters: p_flname type rlgrap-filename.
data:
li_filecontent type standard table of alsmex_tabline ,
lwa_filecontent type alsmex_tabline ,
lv_begin_col type i value 1,
lv_begin_row type i value 1,
lv_end_col type i value 17,
lv_end_row type i value 65000,
li_fieldlist type lvc_t_fcat,
li_data type ref to data,
dy_line type ref to data.
field-symbols:<dyntable> type standard table,
<fs_data> type ref to data,
<fs_1>,
<dyn_wa>,
<dyn_field>.
*Transfer excel file contents to internal table
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = p_flname
i_begin_col = lv_begin_col
i_begin_row = lv_begin_row
i_end_col = lv_end_col
i_end_row = lv_end_row
tables
intern = li_filecontent
exceptions
inconsistent_parameters = 1
upload_ole = 2
error_message = 3
others = 4.
if sy-subrc = 0.
*Creating the list of fields in the table
perform f_create_tab_field tables li_fieldlist using 'BUKRS' 4 .
perform f_create_tab_field tables li_fieldlist using 'ZPOC_KUNNR' 10 .
perform f_create_tab_field tables li_fieldlist using 'RANL' 13.
perform f_create_tab_field tables li_fieldlist using 'ZPEDAT' 10 .
perform f_create_tab_field tables li_fieldlist using 'KWERT' 15 .
perform f_create_tab_field tables li_fieldlist using 'BONUS' 2 .
perform f_create_tab_field tables li_fieldlist using 'WAERS' 5 .
perform f_create_tab_field tables li_fieldlist using 'ZVAL' 15 .
perform f_create_tab_field tables li_fieldlist using 'ZQTY' 15 .
perform f_create_tab_field tables li_fieldlist using 'KMEIN' 3 .
assign li_data to <fs_data>.
*CREATING INTERNAL TABLE TO store data
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = li_fieldlist
importing
ep_table = <fs_data>
exceptions
generate_subpool_dir_full = 1
others = 2.
if sy-subrc = 0.
assign <fs_data>->* to <fs_1>.
assign <fs_1> to <dyntable>.
Create dynamic work area and assign to FS
create data dy_line like line of <dyntable>. " creating a line type of the table just created above
assign dy_line->* to <dyn_wa>. " creating the work area with reference to the line type
loop at li_filecontent into lwa_filecontent.
assign component lwa_filecontent-col "accessing corresponding field in the field catalog
of structure <dyn_wa> to <dyn_field>. "and assigning this field to a field symbol
if sy-subrc = 0.
<dyn_field> = lwa_filecontent-value. " filling value for this field
endif.
at end of row.
append <dyn_wa> to <dyntable>.
clear <dyn_wa>.
endat.
clear lwa_filecontent.
endloop.
i_input_file[] = <dyntable>.
endif.
elseif sy-subrc <> 0.
message s027 display like c_error with text-001.
stop.
endif.
form f_create_tab_field tables p_li_fieldlist structure lvc_s_fcat
using p_fname
p_lenght.
data:lwa_fieldlist type lvc_s_fcat.
lwa_fieldlist-fieldname = p_fname.
lwa_fieldlist-intlen = p_lenght.
append lwa_fieldlist to p_li_fieldlist.
clear lwa_fieldlist.
endform. " F_CREATE_TAB_FIELD
Regards,
Dev. -
How to increase row height in table control?
Hi experts,
We have a push button in table control created using screen painter. Since this is a touch screen transaction, the default height is very small for the worker in the plant to click on a specific row, i would like to know if there is any way to increase the row height in the table control. There is no attribute in Screen painter for increasing row height in table control. I did try "import dynpro", hoping to increase the row height and export the dynpro, but that doesn't seem to have row height attributes. Any help in this regard is highly appreciated. Thanks,
RajUsing a new technology means you have to recreate your screen: you may create an HTML using CL_DD_* classes (that's called "Dynamic Documents"). See [SAP Library - DD programming guide|http://help.sap.com/saphelp_nw2004s/helpdata/en/13/12284b019511d4a73e0000e83dd863/frameset.htm]. Demos are provided in SDYNAMICDOCUMENTS package. Or I think you may create web dynpro and define a CSS style to enlarge objects.
If you don't want to create everything, maybe you can find out a workaround with GuiXT, for example creating a big button in each row (for example, with BUTTONSIZE, but don't know if it changes the height of rows but that's worth trying).
Well, [Synactive documentation about table controls|http://www.synactive.com/docu_e/specials/tables.html] does not seem to allow that.
Maybe you can move your question to the "scripting" forum and ask about how to do it with GuiXT... -
How to find row changes in table
How can we find row changes in table and i want o find out any significant change in the row information in 11g db.
hi thanks for ur help
but i had one more problem
already i tried this one
at particular time i am getting that record
........................ col1 col2 col3 col4 col5
3/17/2012 11:55 AM 10 20 30 40 50
3/17/2012 12:00 PM 0 0 0 0 0
3/17/2012 12:05 PM 12 22 32 42 52
see here at 12:00 PM i got the null or zero values.so instead of null values i need consecutive record means below row like 12:05 row values i need
output is:
.......................... col1 col2 col3 col4 col5
3/17/2012 11:55 AM 10 20 30 40 50
3/17/2012 12:00 PM 12 22 32 42 52
3/17/2012 12:05 PM 12 22 32 42 52
its very urgent plz help to me.
Edited by: 913672 on Mar 17, 2012 6:35 AM
Edited by: 913672 on Mar 17, 2012 6:36 AM
Edited by: 913672 on Mar 17, 2012 6:36 AM -
Hi Experts,
Do someone know the way to expand the rows of dynamic table to the end of its content area, and that in any case ?
For example, the table could content only one row with data, but the table should continue to expand until the end of the page ?
That means that following rows could be empty.
Thanks for your reply,
T.Hi,
Thanks for your reply.
To be more clear, I've added a sketch :
And sometimes, we can have several pages, and other times the dynamic text can fill more than 1 page...
Thanks,
T. -
How to get row index in table?
I will show row no in table.
In help,I find a example and follow it,I test:
<bc4j:column attrName="Fdesc">
<columnHeader>
<bc4j:sortableHeader text="rowSetProperty"/>
</columnHeader>
<contents>
<bc4j:input readOnly="true">
<boundAttribute name="text">
<bc4j:rowSetProperty name="estimatedRowCount"/>
</boundAttribute>
</bc4j:input>
</contents>
</bc4j:column>
It's OK! But I couldn't get current row index.
I test:
<bc4j:column attrName="Fdesc">
<columnHeader>
<bc4j:sortableHeader text="rowSetProperty"/>
</columnHeader>
<contents>
<bc4j:input readOnly="true">
<boundAttribute name="text">
<bc4j:rowSetProperty name="currentRowIndex"/>
</boundAttribute>
</bc4j:input>
</contents>
</bc4j:column>
It's error! How can I do?Thanks
I try:
<bc4j:column attrName="Fdesc">
<columnHeader>
<bc4j:sortableHeader text="Seq No"/>
</columnHeader>
<contents>
<textInput readOnly="true">
<boundAttribute name="text">
<bc4j:rowSetIteratorProperty name="currentRowIndex"/>
</boundAttribute>
</textInput>
</contents>
</bc4j:column>
Nothing be showed in the table cells.
Here, I finished using Javabean:
public class ClsRowIndexBean
private int _counter=0;
public ClsRowIndexBean()
public int getCounter()
return _counter++;
public int getCurrentCounter()
return _counter;
public void setCounter(int counter)
_counter = counter;
} -
How to limit rows for a table?
Hi,
does anyone knows a good way to limit the number of rows for a table?
thanks
aldoYou can limit the number of rows using a trigger. Below is quick and dirty example that has not been fully tested.
test@ORCL> create table rowlimit (col1 number);
Table created.
Elapsed: 00:00:00.34
test@ORCL> create or replace trigger limit_rows
2 before insert
3 on rowlimit
4 declare
5 v_count number;
6 begin
7 select count(*)
8 into v_count
9 from rowlimit;
10
11 if v_count >= 4 then
12 raise_application_error(-20000, 'Table can have no more then 4 rows');
13 end if;
14 end;
15 /
Trigger created.
Elapsed: 00:00:00.09
test@ORCL> insert into rowlimit values(1);
1 row created.
Elapsed: 00:00:00.03
test@ORCL> insert into rowlimit values(2);
1 row created.
Elapsed: 00:00:00.00
test@ORCL> insert into rowlimit values(3);
1 row created.
Elapsed: 00:00:00.00
test@ORCL> insert into rowlimit values(4);
1 row created.
Elapsed: 00:00:00.00
test@ORCL> insert into rowlimit values(5);
insert into rowlimit values(5)
ERROR at line 1:
ORA-20000: Table can have no more then 4 rows
ORA-06512: at "TEST.LIMIT_ROWS", line 9
ORA-04088: error during execution of trigger 'TEST.LIMIT_ROWS'
Elapsed: 00:00:00.04
test@ORCL> commit;
Commit complete.
Elapsed: 00:00:00.00
test@ORCL> select count(*) from rowlimit;
COUNT(*)
4
Elapsed: 00:00:00.00
test@ORCL> -
How to fetch rows from a table like search engines do?
Is it possible to fetch rows from a table like Google does? I want to fetch row number 20-40 after the select has ordered the rows.
Pseudo code: select * from log where rownum > 20 and rownum < 40 order by date;
Rownum doesn't work with ordering so I tried:
select * from log where (select * from log order by date) and rownum <20;
But that still doesn't do what I want. I get the "top 20" rows but I can't get rows 20-40.
My real table has 70000 rows and I want to select 69000-70000 so I really need a SQL do fetch only the rows I need.
Any help would be very appreciated!
Best regards,
Christer NordvikSELECT alias_for_rownum, column_names
FROM (SELECT ROWNUM AS alias_for_rownum, column_names
FROM (SELECT column_names
FROM table_name
ORDER BY columns_to_order_by)
WHERE ROWNUM <= last_row_you_want)
WHERE alias_for_rownum >= first_row_you_want
Example:
-- (This example uses the Oracle dept demo table.
SET AUTOTRACE ON EXPLAIN
SELECT rn, deptno, dname, loc
FROM (SELECT ROWNUM AS rn, deptno, dname, loc
FROM (SELECT deptno, dname, loc
FROM dept
ORDER BY deptno)
WHERE ROWNUM <= 3)
WHERE rn >= 2
RN DEPTNO DNAME LOC
2 20 RESEARCH DALLAS
3 30 SALES CHICAGO -
How to populate the calculated value into screen field.
I am doing one enhancement in QM.I have added one custom screen to notification transaction ( QM01/QM02/QM03) transaction tab strip control using the enhancement QQMA0001.The Details of the calling and called screens as shown bellow
The Calling screen: SAPLIQS0
Screen Number: 7790
Screen Area :USER0001
Called Screen: SAPLXQQM
Screen Number: 0101
I have developed the Custom Screen in screen 0101 and called in PBO of program SAPLIQS0 7790 screen.
The Screen in calling perfectly .The Custom screen having different fields like Raw cost, Intermediate cost, Finished cost, SCAR Cost and Sales Order Cost Etc... These fields are out put filed types. No input for these screens.. I have few doubts regarding this
How to populate the calculated values in Custom screen?
Where we wrote the code to populate the calculated values in custom screen?
You have any idea please guide me
Thanks & Regards,
SamantulaAs your screen fields should be global variables in SAPLXQQM, you may initialize them by implementing function module EXIT_SAPMIWO0_008 which also belongs to SAPLXQQM (Customer Exit: Transfer Notification Data to User Screen)
-
How to Transfer Rows from one table to another in a different Page
Hi Friends,
My problem is; I need to call a custom page as a popup using Java-Script. ( This is because our business users want the multi-select LOV to look and function differently ).
I have a table in the popped-up page from where; upon a button action I need to close the pop-up and transfer the selected rows , back to the base-page's table.
( Both the Base Page and the Pop-Up are Custom Pages.)
Please find below the AM code that I call before closing the window using Java Script.
But the Base-Page table remains un-disturbed. Can you please show me how to do the transfer of records if possible ?
OAViewObjectImpl main_vo = getBasePageTableVO1();
OAViewObjectImpl sel_vo = getPopupPageTableVO1();
int fetchedRowCount = sel_vo.getFetchedRowCount();
RowSetIterator iterator = sel_vo.createRowSetIterator("SelectedRows_Iterator");
if (fetchedRowCount > 0)
iterator.setRangeStart(0);
iterator.setRangeSize(fetchedRowCount);
for (int i = 0; i < fetchedRowCount; i++)
PopupPageTableVORowImpl row = (PopupPageTable)iterator.getRowAtRangeIndex(i);
BasePageTableVORowImpl main_row = (BasePageTableVORowImpl)main_vo.createRow();
if (main_vo.getFetchedRowCount() == 0)
main_vo.setMaxFetchSize(0);
main_vo.setWhereClause(" 1 = 0 ");
main_vo.executeQuery();
main_vo.setCurrentRow(main_vo.last());
main_vo.next();
main_vo.insertRow(main_row);
main_row.setNewRowState(main_row.STATUS_INITIALIZED);
main_vo.setCurrentRow(main_row);
try
main_row.setField1(row.getField1());
main_row.setField2(row.getField2());
main_row.setField3(row.getField3());
catch(JboException _ex)
iterator.closeRowSetIterator();Thanks Ramkumar. I am able to catch the action after I used formSubmit .
The below lines in processRequest declares the function cszRefreshBase and later; on attaching the function name in the open window java script call, I get my desired functionality.
StringBuffer stringbuffer = new StringBuffer();
stringbuffer.append("function cszRrefreshBase(lovwin, event) ");
stringbuffer.append("{ ");
stringbuffer.append(" if (!lovwin.PopupSL) ");
stringbuffer.append(" return false; ");
stringbuffer.append(" submitForm('DefaultFormName', 0, {'cmePopupEvent':'popupUpdate'}); ");
stringbuffer.append("}");
oapagecontext.putJavaScriptFunction("cszRefreshBaseJS", stringbuffer.toString());
Maybe you are looking for
-
Page Format different than doc
I have converted a pdf file to a word doc so I can insert into my document but the margins are different and the form is being cut off when I insert. I cannot change the margins on my document do to the large content. How can I get it to fit?
-
Hi all, Been running OpenBox with pypanel for a while and everything has been running smooth, but then I updated and had to comment the rgb in xorg.conf. Now pypanel doesn't display any text or the clock, just the icons. What can I do in order to get
-
Images in the shared library not loaded in the application EAR
The images in the shared library are not getting loaded in the application EAR deployed in the weblogic server. I have a portal web project, which is deployed in the server, as a shared library. I'm using this shared library in my application EAR. Al
-
Webdynpro application with multiple DCs
Hi, I have an application where it is splitted in to multiple DCs for the team development. Now at runtime there are navigation happenening across DCs, means on click of a button in view1 of DC1, it needs to call view2 of DC2. What is the best way to
-
Hi all, We have a product hierarchy created in ECC in Tcode V/76. These hierarchies have 3 levels and assigned to different materail in ECC materail master. We have done a initial load of Materail and all the products in CRM now have the R3PRODSTYP.