Insert row in a table control
Hi,
I have a requirement to insert a new row and delete an existing row from a table control.
Please help me how to proceed with this.
Thanks in advance.
Suresh
Hi,
Sorry for wrongly framed question.
The question is
I have a requirement to insert a new <b>column</b> and delete an existing <b>column</b> from a table control.
Thanks,
Suresh
Similar Messages
-
Insert row and delete row in a table control
Hi Experts,
I am using a table control in module pool programming, How can I Insert row and delete row in a table control?
Thanks in Advance....Santhosh,
Iam using this code..
FORM fcode_delete_row
USING p_tc_name TYPE dynfnam
p_table_name
p_mark_name .
-BEGIN OF LOCAL DATA----
DATA l_table_name LIKE feld-name.
data: p_mark_name type c.
FIELD-SYMBOLS <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <wa>.
FIELD-SYMBOLS <mark_field>.
-END OF LOCAL DATA----
ASSIGN (p_tc_name) TO <tc>.
get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
delete marked lines *
DESCRIBE TABLE <table> LINES <tc>-lines.
LOOP AT <table> ASSIGNING <wa>.
access to the component 'FLAG' of the table header *
ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
if <MARK_FIELD> = 'X'.
PERFORM f_save_confirmation_9101.
IF gv_answer EQ '1'.
DELETE <table> INDEX syst-tabix.
IF sy-subrc = 0.
<tc>-lines = <tc>-lines - 1.
ENDIF.
ELSE.
ENDIF.
ENDIF.
ENDLOOP.
in this code ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
if <MARK_FIELD> = 'X'.
this code is not working... -
How to insert multiple entries in table control
Hi All,
I want to insert multiple entries in table control in BDC program.Can any body help in this regard.
Thanks,
Satish.Hi,
Go through the following 2 example programs:
THis is example to upload the Bank details of the Vendor which has the TC.
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.
ABAP Name : ZMM_PR_UPLOAD_MAT
Description : PR Upload BDC Program(With Material)
Created by : Anji Reddy V
Created on : 04/11/2004
Description : This Program is used to Upload the Purchase
Requisition data Using the Transaction ME51N.
Modification Log:
Date Programmer Correction Description
04/11/2004 Anji Reddy Initial
REPORT zmm_pr_upload_mat
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_pr OCCURS 0,
Header Screen
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
lpein(001), " Category of Del Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
Item Details
matnr(018), " Material No
menge(017), " Quantity
badat(010),
frgdt(010),
preis(014), " Valuation Price
waers(005), " Currency
peinh(005),
wepos(001),
repos(001),
sakto(010), " GL Account
kostl(010), " Cost Center
bnfpo(005),
END OF i_pr.
Internal Table for header Data
DATA: BEGIN OF it_header OCCURS 0,
sno(3), " SNo
bsart(004), " PR Type
epstp(001), " Item Category
knttp(001), " Account Assignment
eeind(010), " Delivery Date
werks(004), " Plant
lgort(004), " Storage Location
ekgrp(003), " Purchasing Group
matkl(009), " Material Group
bednr(010), " Tracking No
afnam(012), " Requisitioner
END OF it_header.
Internal Table for Item Data
DATA: BEGIN OF it_item OCCURS 0,
sno(3), " SNo
matnr(018), " Material No
menge(017), " Quantity
preis(014), " Valuation Price
sakto(010), " GL Account
kostl(010), " Cost Center
END OF it_item.
Data Variables & Constants
CONSTANTS : c_x VALUE 'X'. " Flag
DATA : v_l(2), " Counter
v_rowno(5), " Row No
v_2(2), " Counter
v_rows LIKE sy-srows, " Rows in TC
v_field(45). " String
Parameters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_pr
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT i_pr BY sno.
LOOP AT i_pr.
MOVE-CORRESPONDING i_pr TO it_item.
APPEND it_item.
CLEAR it_item.
AT END OF sno.
READ TABLE i_pr INDEX sy-tabix.
MOVE-CORRESPONDING i_pr TO it_header.
APPEND it_header.
CLEAR it_header.
ENDAT.
ENDLOOP.
SORT it_header BY sno.
SORT it_item BY sno.
v_rows = sy-srows - 6.
Upload the Data from Internal Table
LOOP AT it_header.
Header Data
PERFORM bdc_dynpro USING 'SAPMM06B' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-BEDNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-BSART'
it_header-bsart.
PERFORM bdc_field USING 'RM06B-EPSTP'
it_header-epstp.
PERFORM bdc_field USING 'EBAN-KNTTP'
it_header-knttp.
PERFORM bdc_field USING 'RM06B-EEIND'
it_header-eeind.
PERFORM bdc_field USING 'RM06B-LPEIN'
it_header-lpein.
PERFORM bdc_field USING 'EBAN-WERKS'
it_header-werks.
PERFORM bdc_field USING 'EBAN-LGORT'
it_header-lgort.
PERFORM bdc_field USING 'EBAN-EKGRP'
it_header-ekgrp.
PERFORM bdc_field USING 'EBAN-MATKL'
it_header-matkl.
PERFORM bdc_field USING 'EBAN-BEDNR'
it_header-bednr.
PERFORM bdc_field USING 'EBAN-AFNAM'
it_header-afnam.
Item Details
v_l = 0.
To add no. of rows
v_2 = 0 .
As the screen is showing 13 rows defaulted to 130
v_rowno = 130 .
LOOP AT it_item WHERE sno = it_header-sno.
v_l = v_l + 1.
IF v_l = 14 .
IF v_2 = 12 .
v_2 = 12 .
v_l = 2 .
From second time onwards it is displaying 12 rows only
v_rowno = v_rowno + 120 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ELSE.
V_2 initialized to 12 for second screen purpose
v_2 = 12 .
v_l = 2 .
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'RM06B-BNFPO'
v_rowno .
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ENDIF.
ENDIF.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CLEAR v_field.
CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-matnr.
CLEAR v_field.
CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.
PERFORM bdc_field USING v_field it_item-menge.
PERFORM bdc_dynpro USING 'SAPMM06B' '0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBAN-PREIS'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'EBAN-PREIS'
it_item-preis.
PERFORM bdc_dynpro USING 'SAPMM06B' '0505'.
PERFORM bdc_field USING 'BDC_CURSOR'
'EBKN-SAKTO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'EBKN-SAKTO'
it_item-sakto.
Cost Center
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_CURSOR'
'COBL-KOSTL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'COBL-KOSTL'
it_item-kostl.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RM06B-BNFPO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
Call The Transaction
PERFORM bdc_transaction USING 'ME51'.
ENDLOOP.
Close the BDC Session
PERFORM close_group.
reward for useful answers.
Regards,
Anji -
Error while inserting rows in a table
Hi,
We have recently migrated from 9i to 10g. We have a scheduled job out our DB which first deletes all the rows from a table and then inserts them back by selecting rows from 5 tables. This table has a composite primary key based on 6 columns in it. In 9i, when i try to insert rows into the table after deleting all the rows from it, I am able to insert the data successfully . However, in 10g, when i try doing the same operation, it fails with the ORA error:
ORA-00001: unique constraint violated
The same query which works perfectly in 9i fails in 10g
If anybody has some ideas on how to resolve the same, kindly let me know.
Thanks in advance.Hi,
I was finally able to resolve the reason behind that error message and found it even more weird. The error was because I was using the substr function for extracting the characters 1-4 from a column which is 5 characters long. When i specify the query as:
select substr(column1, 1, 4)) from table1;
only the characters 1-3 are retrieved. Now if i change the query to select substr(column1, 1, 5)) from table1, in that case also only 3 characters are retrieved although i have specified the substr to start from 1 and read till 5 characters. Also, when i run the query:
select length(substr(column1, 1, 4)) from table1 or select length(substr(column1, 1, 5)) from table1
I get the answer as 3.
However, the most amazing part is that the query is working perfectly in 9i and is retrieving the data correctly i.e. from substr 1-4.
Can anyone suggest what the problem could be?
Thanks
Edited by: CrazyAnie on May 13, 2009 1:34 AM -
Need to insert rows into 100 tables at a time
hi there,
below is our script for creation of 100 tables...
we need a plsql script, to insert rows into 100 tables at a single time...
please help us...vey urgent...
DECLARE
counter NUMBER;
sql_string VARCHAR2(2000);
BEGIN FOR counter IN 1..100 LOOP sql_string := 'CREATE TABLE emp_table'||counter||'
(id integer primary key, col_a VARCHAR2(42),col_b date,col_c number,col_d varchar2(20),col_e varchar2(20),
col_f varchar2(20),col_g varchar2(20),col_h date,col_i varchar2(20),col_j varchar2(20),col_k date)';
EXECUTE IMMEDIATE sql_string;
END LOOP;
END;
/hi,
below is our procedure and the error we are getting...
Name Null? Type
ID VARCHAR2(10)
COL_A VARCHAR2(10)
COL_B VARCHAR2(10)
COL_C VARCHAR2(10)
COL_D VARCHAR2(10)
COL_E VARCHAR2(10)
COL_F VARCHAR2(10)
COL_G VARCHAR2(10)
COL_H VARCHAR2(10)
COL_J DATE
DECLARE
counter NUMBER;
sql_string VARCHAR2(4000);
BEGIN FOR counter IN 1..100 LOOP sql_string := 'CREATE TABLE emp_a'||counter||'
(id varchar2(10), col_a varchar2(10), col_b varchar2(10), col_c varchar2(10), col_d varchar2(10), col_e varchar2(10),
col_f varchar2(10), col_g varchar2(10), col_h varchar2(10), col_j date)';
EXECUTE IMMEDIATE sql_string;
END LOOP;
END;
DECLARE
counter NUMBER;
sql_string VARCHAR2 (2000);
BEGIN
FOR OuterCounter IN 1 .. 100 LOOP --- table prefix in which it is to be inserted
FOR InnerCounter IN 1 .. 100 LOOP --- records to be inserted
sql_string := 'INSERT INTO emp_a' || Outercounter || ' (id, col_a, col_b, col_c, col_d, col_e, col_f, col_g, col_h, col_j)
VALUES ('
|| InnerCounter || ', to_char( ''col_a''' || innercounter || '),'
|| InnerCounter || ', to_char( ''col_d''' || innercounter || '),'
|| ', to_char( ''col_e''' || innercounter || '),'
|| ', to_char( ''col_f''' || innercounter || '),'
|| ', to_char( ''col_g''' || innercounter || '),'
|| ', to_char( ''col_h''' || innercounter || '),'
|| ', to_char( ''col_j''' || innercounter || '), SYSDATE)';
EXECUTE IMMEDIATE sql_string;
END LOOP;
END LOOP;
END;
DECLARE
ERROR at line 1:
ORA-00907: missing right parenthesis
ORA-06512: at line 17
please check the procedure and write the correct one... -
Get the count of rows in a table control
Hi Experts,
How do I get the count of the rows in a table control during run time.
I am developing a BDC in which I have to check all entries in a table control.
My requirement is to get the total number of rows in a table control dynamically.
Thanks
KumarHi,
Use a variable when u r passing the records from the internal table to the screen fields
and display the same.
I think this idea may help u.
And pls explain me ur requirement clearly.
Refer to the following link this may help u.
http://sapabapnotes.blogspot.com/2008/03/working-with-ecatt-extended-computer.html
Reward if helpful.
Jagadish -
Help in inserting rows into a table
I have a table called acct_fact,
I need to insert rows in the table using a script but the problem is there's a column called seq_nbr which has random seq nbr of 14character length like 'ZWX98MGD9MVAD6J','ZWX98MG67RVAD6J' etc.,
While inserting rows I need to generate such seq_nbr for those columns and insert rows into the table, can I use any such mechanism in my insert query to insert such random nbr's while inserting rows into a table.
If so please suggest meHi Peter,
Thankyou for the quick reply:)
can you suggest me how to implement it here in my script snippet:
while read var_acct_nbr
do
echo "update acct_attr set acct_attr_exp_dt ='$ExpDate' where Acct_Attr_Value_Text='15' and acct_attr_exp_dt is null and person_id='LDCarrBillAgrm' and acct_nbr='$var_acct_nbr' ;" >> ./$DirectoryName/SQLQuery_$TimeStamp.sql
echo "insert into acct_fact values ('$var_acct_nbr','$ExpDate','$ExpTime','*seq_nbr*','N','ProjTereza','Remoção de acordo d; data de expiração: $ExpDate',null,'1','LDE',null);" >> ./$DirectoryName/SQLQuery_$TimeStamp.sql
done < ./$DirectoryName/ExpireAccts_$TimeStamp.LOG
the script takes each acct_nbr nbr form a input file and fires an insert statement.
The one in bold is the column where such sequence need to be inserted.can you help me in implementing the way you suggested in my script i.e., insert statement
Thanks in Advance:)
Edited by: rkrish on Jun 27, 2012 3:04 AM -
Hi,
I want to select only the last inserted row in a table. Can anybody help me how can i get it.
Eg
select * from emp;
empno ename sal
12 abc 100
13 xyz 200
Now i have inserted a row as
Insert into emp values (14,'Rohit',500);
So i only want to select the last inserted row i.e.. empno 14 (in this case).
Thanks
Bye
Rohit TanejaThanks to all for replying.
But the result is not which i desire.
I have deleted the existing row in the same table as
SQL> Delete from emp where empno = 13;
1 row deleted.
Then i inserted a new row as
SQL> insert into emp values(10,'SRI',200);
1 row created.
Then i committed the work
SQL> commit;
Commit complete.
But still am getting the last row as
SQL> select * from emp
where rowid=(select max(rowid)
from emp);
EMPNO ENAME SAL
14 ROHIT 500
as the solution.
But here i am supposed to get the row with empno 10.
I have tried both the queries and still geting the same result.
Please look aat it again,
Thanks in advance
Bye
Rohit Taneja
Hi,
I want to select only the last inserted row in a
table. Can anybody help me how can i get it.
Eg
select * from emp;
empno ename sal
12 abc 100
13 xyz 200
Now i have inserted a row as
Insert into emp values (14,'Rohit',500);
So i only want to select the last inserted row i.e..
empno 14 (in this case).
Thanks
Bye
Rohit Taneja -
Changing number of rows oin a table control dynamically
Hi all
Is there a way to change the no of rows dynamically.
I have a requirement that at run time , depending on a condition, I have to change the no of rows in the table control to 1 row.
Is this possible to do?If else How?
Thanks.You can redefine table control attributes eachtime PBO is called, because those attributes are dynamic. So although you defined tc-lines as 1 in first PBO execution, you can redefine to 2 if some condition is achieved,
One idea could be to create a global var, called tc_lines which is initialized as 1. In your PBO you shoud use: <tc>-lines = tc_lines.
In PAI, when you obtain your condition, you shoud here add or subract one from this global variable.
Regards,
Valter Oliveira. -
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 display particular ROW of a table control in display/change mode
Hi,
Can we make particular ROW in a table control display mode or editable mode depending upon the conditions?.
Any inputs..
Rgds,
LakshmirajHi,
Yes it is possible. check the follwoing code for help.
*& Include Z101954_ASSIGNMENT1I01
*& Module VALIDATE_SALES_ORG INPUT
text
MODULE validate_sales_org INPUT.
SELECT SINGLE zvkorg FROM vbak INTO zvbak-zvkorg
*WHERE zvbeln = zbookhdr-zvbeln.
IF sy-subrc <> 0.
MESSAGE 'INVALID AIRLINE ID INPUT' TYPE 'I'.
CALL SCREEN 1000.
ENDIF.
ENDMODULE. " VALIDATE_SALES_ORG INPUT
*& Module USER_COMMAND_1001 INPUT
text
MODULE user_command_1001 INPUT.
var3 = 1.
IF sy-ucomm <> 'SAVE'.
PERFORM material_check.
IF sy-subrc <> 0.
MESSAGE 'ENTER THE CORRECT MATERIAL NUMBER' TYPE 'I'.
ELSE.
SELECT SINGLE zmaktx zmeins zwaerk zstprs FROM zmara
INTO CORRESPONDING FIELDS OF it_salesitems
WHERE zmatnr = it_salesitems-zmatnr.
SELECT SINGLE zwerks zlgort FROM zorg
INTO CORRESPONDING FIELDS OF it_salesitems
WHERE zvkorg = wa_salesorder-zvkorg
AND zvtweg = wa_salesorder-zvtweg
AND zspart = wa_salesorder-zspart.
it_salesitems-znetwr = it_salesitems-zstprs * it_salesitems-zbrgew.
MODIFY it_salesitems FROM it_salesitems INDEX sy-tabix.
MOVE-CORRESPONDING it_salesitems TO temp_salesitems.
APPEND temp_salesitems.
REFRESH it_salesitems.
ENDIF.
ENDIF.
LOOP AT temp_salesitems.
if it_salesitems-pick = 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'DETAIL'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endif.
endloop.
CASE sy-ucomm.
WHEN 'SAVE'.
PERFORM check_ship_to_party.
IF sy-subrc <> 0.
MESSAGE 'ENTER THE CORRECT SHIP TO PARTY ' TYPE 'I'.
ELSE.
PERFORM check_payer.
IF sy-subrc <> 0.
MESSAGE 'ENTER THE CORRECT PAYER' TYPE 'I'.
ELSE.
PERFORM check_bill_to_party.
IF sy-subrc <> 0.
MESSAGE 'ENTER THE CORRECT BILL TO PARTY' TYPE 'I'.
ELSE.
wa_salesorder-zernam = sy-uname.
MOVE-CORRESPONDING wa_salesorder TO zvbak.
MODIFY zvbak.
LOOP AT it_salesitems.
it_salesitems-zvbeln = wa_salesorder-zvbeln.
MOVE-CORRESPONDING it_salesitems TO zvbap.
MODIFY zvbap.
ENDLOOP.
IF sy-subrc = 0.
MESSAGE 'THE DATA IS SAVED SUCCESSFULLY' TYPE 'I'.
CLEAR wa_salesorder.
REFRESH it_salesitems.
REFRESH temp_salesitems.
IF sy-tcode = 'ZVA01'.
CALL SCREEN '1000'.
ELSE.
CALL SCREEN '1003'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
WHEN 'DETAIL'.
CALL SCREEN '1002'.
WHEN 'BACK'.
IF sy-tcode = 'ZVA03'.
CLEAR wa_salesorder.
CALL SCREEN '1003'.
ELSE.
PERFORM pop_up.
ENDIF.
WHEN 'EXIT'.
IF sy-tcode = 'ZVA03'.
LEAVE PROGRAM.
ELSE.
PERFORM pop_up.
ENDIF.
WHEN 'CANCEL'.
IF sy-tcode = 'ZVA03'.
CLEAR wa_salesorder.
CALL SCREEN '1003'.
ELSE.
PERFORM pop_up.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_1001 INPUT
*& Module input_help_sold_to_party INPUT
text
MODULE input_help_sold_to_party INPUT.
SELECT zkunag FROM zvbak INTO CORRESPONDING FIELDS OF TABLE
itab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'ZKUNAG'
PVALKEY = ' '
dynpprog = sy-cprog
dynpnr = '1000'
dynprofield = 'ZKUNAG'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = itab
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " input_help_sold_to_party INPUT
*& Form pop_up
text
--> p1 text
<-- p2 text
FORM pop_up .
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = ' '
DIAGNOSE_OBJECT = ' '
text_question = 'DO YOU WANT TO SAVE THE ORDER?'
text_button_1 = 'YES'(001)
icon_button_1 = ' '
text_button_2 = 'No'(002)
icon_button_2 = ' '
default_button = '1'
display_cancel_button = 'X'
userdefined_f1_help = ' '
START_COLUMN = 25
START_ROW = 6
POPUP_TYPE =
IV_QUICKINFO_BUTTON_1 = ' '
IV_QUICKINFO_BUTTON_2 = ' '
IMPORTING
answer = ans
TABLES
PARAMETER =
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CASE ans.
WHEN '001'.
PERFORM check_ship_to_party.
IF sy-subrc <> 0.
MESSAGE 'ENTER THE CORRECT SHIP TO PARTY ' TYPE 'I'.
ELSE.
PERFORM check_payer.
IF sy-subrc <> 0.
MESSAGE 'ENTER THE CORRECT PAYER' TYPE 'I'.
ELSE.
PERFORM check_bill_to_party.
IF sy-subrc <> 0.
MESSAGE 'ENTER THE CORRECT BILL TO PARTY' TYPE 'I'.
ELSE.
wa_salesorder-zernam = sy-uname.
MOVE-CORRESPONDING wa_salesorder TO zvbak.
MODIFY zvbak_101954.
temp_salesitems-zvbeln = wa_salesorder-zvbeln.
MOVE-CORRESPONDING temp_salesitems TO zvbap.
MODIFY zvbap.
IF sy-subrc = 0.
MESSAGE 'THE DATA IS SAVED SUCCESSFULLY' TYPE 'I'.
CLEAR wa_salesorder.
REFRESH it_salesitems.
REFRESH temp_salesitems.
IF sy-ucomm = 'EXIT'.
LEAVE PROGRAM.
ENDIF.
IF sy-tcode = 'ZVA01'.
CALL SCREEN '1000'.
ELSE.
CALL SCREEN '1003'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
WHEN '002'.
IF sy-tcode = 'ZVA01'.
CLEAR wa_salesorder.
REFRESH it_salesitems.
REFRESH temp_salesitems.
CALL SCREEN '1000'.
ELSE.
CLEAR wa_salesorder.
REFRESH it_salesitems.
REFRESH temp_salesitems.
CALL SCREEN '1003'.
CLEAR ans.
ENDIF.
ENDCASE.
ENDFORM. " pop_up
*& Module USER_COMMAND_1002 INPUT
text
MODULE user_command_1002 INPUT.
IF sy-datar = 'X'.
PERFORM material_check.
IF sy-subrc <> 0.
MESSAGE 'ENTER THE CORRECT MATERIAL' TYPE 'I'.
ELSE.
SELECT SINGLE zmaktx zmeins zwaerk zstprs FROM zmara_101954
INTO CORRESPONDING FIELDS OF wa_salesitems
WHERE zmatnr = wa_salesitems-zmatnr.
wa_salesitems-znetwr = wa_salesitems-zstprs * wa_salesitems-zbrgew.
ENDIF.
var = 1.
ENDIF.
IF sy-ucomm = 'BACK'.
LOOP AT temp_salesitems.
MODIFY temp_salesitems FROM wa_salesitems .
ENDLOOP.
it_salesitems-pick = ' '.
CALL SCREEN '1001'.
ENDIF.
ENDMODULE. " USER_COMMAND_1002 INPUT
*& Module USER_COMMAND_1000 INPUT
text
MODULE user_command_1000 INPUT.
CASE sy-ucomm.
WHEN 'NEXT'.
SELECT * FROM zt001k_101954 INTO CORRESPONDING FIELDS OF
temp_salesorder WHERE
zvkorg = wa_salesorder-zvkorg AND
zvtweg = wa_salesorder-zvtweg AND
zspart = wa_salesorder-zspart.
ENDSELECT.
IF sy-subrc = 0.
CALL SCREEN '1001'.
ELSE.
MESSAGE 'Invalid Data Entered' TYPE 'I'.
CALL SCREEN '1000'.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUT
*& Module USER_COMMAND_1003 INPUT
text
MODULE user_command_1003 INPUT.
IF sy-ucomm = 'NEXT'.
IF sy-datar = ' '.
MESSAGE 'ENTER PURCHASE ORDER NUMBER' TYPE 'I'.
CALL SCREEN 1000.
IF NOT wa_salesorder-zvbeln CO '0123456789'.
MESSAGE 'PURCHASE ORDER NUMBER IS NOT IN THE EXPECTED FORMAT' TYPE 'I'.
CALL SCREEN '1003'.
ENDIF.
var3 = 0.
CALL SCREEN '1001'.
ENDIF.
ENDMODULE. " USER_COMMAND_1003 INPUT
*& Module input_help_sales_order INPUT
text
MODULE input_help_sales_order INPUT.
SELECT zvbeln FROM zvbak_101954 INTO CORRESPONDING FIELDS OF TABLE
itab1.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'ZVBELN'
PVALKEY = ' '
dynpprog = sy-cprog
dynpnr = '1003'
dynprofield = 'ZVBELN'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = itab1
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " input_help_sales_order INPUT
*& Module back_command INPUT
text
module back_command input.
*if sy-ucomm = 'SAVE' OR 'BACK' OR 'DETAIL' OR 'EXIT' OR 'CANCEL'.
*endif.
endmodule. " back_command INPUT
Regards
Rajesh Kumar -
Locking a particular row in a table control
Hi All,
I have module pool program in which table control is used. I would like to know whether it is possible to lock a particular row in the table so that another person will not be able to edit it until the first user completes his work. It should be only for that particular record which is being currently edited in the table.Hi,
Yes you can lock particular row in a table control..
In the flow logic..
PROCESS BEFORE OUTPUT.
LOOP AT itab INTO wa WITH CONTROL tc.
MODULE disable_row.
ENDLOOP.
MODULE disable_row.
* call the Enqueue function module..If the
IF sy-subrc NE 0.
LOOP AT screen.
SCREEN-INPUT = 0. " Disable for input
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE.
Thanks
Naren -
Changing height of a row in a table control
Hi all,
I have developed a webdynpro application in which i am using a table control in the view. Can anyone tell me how can i change the height of a row in the table control?
thanx in advance
anuradhahi anuradha,
you can set the number of the rows to be displayed, in the table controller properties, so that those many rows will be disaplayed at a time.
to do this.
Go to table controller properties,
mention the integer( number of rows to be displayed ) value in the <b>visiblerowcount</b> property.
if your requirement is not this then let me know.
bye.
Brahmanandam. -
What is the maximum number of row for a table control in LabWindows/CVI ?
I use LabWindows CVI 8.5.1 (MMI first developped in version 6.0).
In one of our many MMI, a table control contains a list of aircraft parameters.
We can add as many parameters (row) as we want but over 40 000 we observe a crash of the LabWindows CVI runtime.
Our client want to inscrease the number of parameters (row) up to 200 000 !!!
So my questions are:
What is the real maximum number of row for the table control ?
Is this maximum number of row different on LabWindows 2010 version ?
Or is there an other solution ?
ThanksGreetings,
Can you clarify what you mean by "crash"? Is there an error message thrown? Is it possible that you've consumed all of the available memory?
Please let me know.
Thanks, James Duvall
Product Support Engineer
National Instruments -
Highlighting one row in a table control
Hi All,
Can i highlight one row in a table control. I found some stroke color in the properties for a field in table control. But i am not sure, will it be applied to the entire column or to a particular field.
Anybody aware of this.?
Regards,
Manjunatha.T.SHi,
This is not currently available in VC.
Lior
Maybe you are looking for
-
Hi there, I recently purchased my father a mac mini to sit as a media centre under his LCD TV. All hooked up great and it all works very well... apart from audio CD's, they spin at a ridiculous speed meaning that when the sound is low all you can hea
-
How can I use a word file without pages changing the file
I want to edit this word file I created, but pages either can't open it because i sent it via email from google docs, or it will change it completley. I don't want to get Office for mac, so What Do I Do?
-
Hi all can some body tell me how can I clear invoices from lock box. After running FLB2 execution I am not sure about next steps. I think we run FLB1 for reprocessing . But how do we clear the customer invoices after FLb2 & what are the steps/tcode p
-
Having problem with trigger.(help needed)
HI all, i m totally new to the PL/SQL.... hope someone can help me with this..... i am now using trigger to block inserting into "attendance99" table when the record reach the maximum limit and insert the record to the "waiting_list" table. The probl
-
Previous Lightroom Serial Number?
HI, downloaded the standalone version of lightroom, when asked for me to enter my serial number, I did so. It then asks me for my previous version serial number. I never had Lightroom previously so I don't have that number. Just want to edit some pho