Table contorl
Hi Guys,
Please help me to solve -
I have created a dialog in which , companycd, date is parmeters. Based the input
data, tbl control is getting filled from the tables.
1. Table control input field problem - the moment user enter data and press enter key the data is vanishing the and cursor is going back to companycd parameter field.
2. The moment the users saves , all the fields are being refresh. When the user
try to exit the companycd is again validing the input (as blank) and asking for proper input.
Your help is highly appreciated.
Regards,
Pra
In my table control input fields, the moment Enter key pressed the data is vanishing even though MODIFY tbldata INDEX etbl-current_line is giving.
I have given my sample code, please help me to fix the problem.
PROCESS BEFORE OUTPUT.
MODULE status_0100.
LOOP AT tbldata WITH CONTROL etbl.
MODULE read_data.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE exit AT EXIT-COMMAND.
CHAIN.
FIELD icompanycd MODULE validate_cd AT CURSOR-SELECTION.
ENDCHAIN.
LOOP AT tbldata.
MODULE update_tblctl.
CHAIN.
FIELD zmam_metro_data-metro_agency.
MODULE tab_modify. " Heres the code, but not working
ENDCHAIN.
ENDLOOP.
MODULE user_command_0100.
Similar Messages
-
How to add a new columns in table contorl in standard screen.
Hi All,
I am working on a enhancement for transaction VA01. I have to add few column for tab Additional Data B. In this tab column are displayed in table control. Now i have to add two more column in table control. Could you please help me to find out the exit and the way to populate the new columns.
Thanks
Piyush MathurHi Piyush,
That table control might have been created using an internal table i.e declared in the exit. Add two more fields which you want to that internal table. And come to the layout and create table control once again using that internal table.
Reward if helpful.
Regards,
Ramana -
The input or display only attribute of table contorl fileds
HI,experts
in the program there is one parameter p_recount.
in my table control ,there are 5 columns, f1 f2 f3 f4 f5
f1 f2 f3 is display only, and if p_recount = 00.,f4 f5 may input but if p_recount != 00.
f4 f5 also display only.
and when i push the "new" button,all the 5 fileds are input fields.
when i use LAY OUT to set attributes for the fields,the input/output attributes may not change
i think.
if there is some way to do this in the program use code?
how to do this?
thank you very much!
Edited by: hongtan zhang on Sep 15, 2008 9:11 AMHi you group the fields F1,F2,F3 in a single group1 named 'GP1'. and f4,f5 in group 'GP2'..
you also create a another group 'GP3' having all fields.
now in PBO.
loop at <i_tab> with control <tc-con>.
module modify.
if ok_code = 'NEW'.
loop at screen .
if screen-group2 = 'GP3'.
screen-input = '1'.
modify screen.
endif.
endloop.
endif.
loop at screen .
if screen-group1 = 'GP1'.
screen-input = '1'.
modify screen.
endif.
endloop.
loop at screen .
if screen-group1 = 'GP2'.
screen-input = '1'.
modify screen.
endif.
endloop. -
Updating record using table contorl
hi ABAPers,
i have a problem while updating the record to a database table from table control,
please,check the code writtern,
Code in Top include:
Tables: MARA,
MAKT.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
END OF ITAB.
*data:ok_code(20).
CONTROLS TC1 TYPE TABLEVIEW USING SCREEN 2000.
*DATA: cols LIKE LINE OF TC1-cols,
lines TYPE i.
Screen_1000:Code in PAI:
module USER_COMMAND_1000 input.
CASE SY-UCOMM.
WHEN 'DISPLAY'.
SELECT SPRAS MAKTX FROM MAKT INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE MATNR = MARA-MATNR.
IF SY-DBCNT IS INITIAL.
MESSAGE I127(ZKC_MSGCLS).
ELSE.
SET SCREEN 2000.
ENDIF.
WHEN 'EXIT'.
LEAVE PROGRAM.
SET SCREEN 0.
ENDCASE.
endmodule. " USER_COMMAND_1000 INPUT
Screen_2000:Code in PBO:
module ctrl_pai output.
MOVE-CORRESPONDING ITAB TO MAKT.
endmodule. " ctrl_pai OUTPUT
Screen_2000:Code in PAI:
module USER_COMMAND_2000 input.
CASE SY-UCOMM.
WHEN 'UPDATE'.
LOOP AT TC1-cols INTO cols WHERE index GT 2.
IF cols-screen-input = '0'.
cols-screen-input = '1'.
ELSEIF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY TC1-cols FROM cols INDEX sy-tabix.
ENDLOOP.
WHEN 'EXIT'.
LEAVE PROGRAM.
SET SCREEN 0.
WHEN 'BACK'.
SET SCREEN 1000.
ENDCASE.
endmodule. " USER_COMMAND_2000 INPUT
Screen_2000:Code outside PBO
LOOP AT itab WITH CONTROL TC1 CURSOR TC1-TOP_LINE.
MODULE ctrl_pai.
ENDLOOP.
Screen_2000:Code outside PAI
LOOP AT itab.
ENDLOOP.
regards,
vinodHi,
Go thro' the coding in this link.It will help you.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/table%20control%20in%20abap.pdf
Message was edited by:
Jayanthi Jayaraman -
How make Invisible a particular Cell in the TAble Control.
Dear Freinds,
I have requirement where in on a particular conditon i have to close one of the fields in the TAble contorl . That is i have to make it as invisible ....iam able only to make only display (greyed out) only iam not able to make invisible.
Please could any one let me know how can we make invisible a particular field.
regards
divya.Hi,
Try this it works,
LOOP AT tc_release_ord-cols INTO wa_cols. "tc_release_ord-----> table control
CASE wa_cols-screen-name.
WHEN 'ZRELEASE_ORDER-SPOTS1'.
IF spots1 = ' '. > use your condition here
wa_cols-invisible = 'X'. > set property to invisible
MODIFY tc_release_ord-cols FROM wa_cols. >modify table control
ENDIF.
WHEN 'ZRELEASE_ORDER-SPOTS2'.
IF spots2 = ' '.
wa_cols-invisible = 'X'.
MODIFY tc_release_ord-cols FROM wa_cols.
ENDIF.
WHEN 'ZRELEASE_ORDER-SPOTS3'.
IF spots3 = ' '.
wa_cols-invisible = 'X'.
MODIFY tc_release_ord-cols FROM wa_cols.
ENDIF.
endcase.
Endloop.
Hope it helps you,
Regards,
Abhijit G. Borkar -
hi friends,
Could u please tell me what BDC TABLE CONTROLER
in which cases we can use the bdc Table Contorler
Regards
srinu yHi srinu,
<b>Check this link</b>
http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm
How to deal with table control / step loop in BDC
<b>Steploop</b> and <b>table contol</b> is inevitable in certain transactions. When we run BDC for such transactions, we will face the situation: how many visible lines of steploop/tablecontrol are on the screen? Although we can always find certain method to deal with it, such as function code 'NP', 'POPO', considering some extreme situation: there is only one line visible one the screen, our BDC program should display an error message. (See transaction 'ME21', we you resize your screen to let only one row visible, you can not enter mutiple lines on this screen even you use 'NP')
Now with the help of Poonam on sapfans.com developement forum, I find a method with which we can determine the number of visible lines on Transaction Screen from our Calling BDC program. Maybe it is useless to you, but I think it will give your some idea.
Demo <b>ABAP code</b> has two purposes:
<b>1.</b> how to determine number of visible lines and how to calculte page number;
(the 'calpage' routine has been modify to meet general purpose usage)
<b>2.</b> using field symbol in BDC program, please pay special attention to the difference in Static ASSIGN and Dynamic ASSIGN.
Now I begin to describe the step to implement my method:
(I use transaction 'ME21', screen 121 for sample,
the method using is Call Transation Using..)
<b>Step1:</b> go to screen painter to display the screen 121, then we can count the fixed line on this screen, there is 7 lines above the steploop and 2 lines below the steploop, so there are total 9 fixed lines on this screen. This means except these 9 lines, all the other line is for step loop. Then have a look at steploop itselp, one entry of it will occupy two lines.
(Be careful, for table control, the head and the bottom scroll bar will possess another two fixed lines, and there is a maximum number for table line)
Now we have : FixedLine = 9
LoopLine = 2(for table control, LoopLine is always equal to 1)
<b>Step2:</b> go to transaction itself(ME21) to see how it roll page, in ME21, the first line of new page is always occupied by the last line of last page, so it begin with index '02', but in some other case, fisrt line is empty and ready for input.
Now we have: FirstLine = 0
or FirstLine = 1 ( in our case, FirstLine is 1 because the first line of new page is fulfilled)
<b>Step3:</b> write a subroutine calcalculating number of pages
(here, the name of actual parameter is the same as formal parameter)
<b>global data:</b> FixedLine type i, " number of fixed line on a certain screen
LoopLine type i, " the number of lines occupied by one steploop item
FirstLine type i, " possbile value 0 or 1, 0 stand for the first line of new " scrolling screen is empty, otherwise is 1
Dataline type i, " number of items you will use in BDC, using DESCRIBE to get
pageno type i, " you need to scroll screen how many times.
line type i, " number of lines appears on the screen.
index(2) type N, " the screen index for certain item
begin type i, " from parameter of loop
end type i. " to parameter of loop
*in code sample, the DataTable-linindex stands for the table index number of this line
form calpage using FixedLine type i (see step 1)
LoopLine type i (see step 1)
FirstLine type i (see step 2)
DataLine type i ( this is the item number you will enter in transaction)
changing pageno type i (return the number of page, depends on run-time visible line in table control/ Step Loop)
changing line type i.(visible lines one the screen)
data: midd type i,
vline type i, "visible lines
if DataLine eq 0.
Message eXXX.
endif.
vline = ( sy-srows - FixedLine ) div LoopLine.
*for table control, you should compare vline with maximum line of
*table control, then take the small one that is min(vline, maximum)
*here only illustrate step loop
if FirstLine eq 0.
pageno = DataLine div vline.
if pageno eq 0.
pageno = pageno + 1.
endif.
elseif FirstLine eq 1.
pageno = ( DataLine - 1 ) div ( vline - 1 ) + 1.
midd = ( DataLine - 1 ) mod ( vline - 1).
if midd = 0 and DataLine gt 1.
pageno = pageno - 1.
endif.
endif.
line = vline.
endform.
<b>Step4</b> write a subroutine to calculate the line index for each item.
form calindex using Line type i (visible lines on the screen)
FirstLine type i(see step 2)
LineIndex type i(item index)
changing Index type n. (index on the screen)
if FirstLine = 0.
index = LineIndex mod Line.
if index = '00'.
index = Line.
endif.
elseif FirstLine = 1.
index = LineIndex mod ( Line - 1 ).
if ( index between 1 and 0 ) and LineIndex gt 1.
index = index + Line - 1.
endif.
if Line = 2.
index = index + Line - 1.
endif.
endif.
endform.
<b>Step5</b> write a subroutine to calculate the loop range.
form calrange using Line type i ( visible lines on the screen)
DataLine type i
FirstLine type i
loopindex like sy-index
changing begin type i
end type i.
If FirstLine = 0.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loopindex gt 1.
begin = Line * ( loopindex - 1 ) + 1.
end = Line * loopindex.
if end gt DataLine.
end = DataLine.
endif.
endif.
elseif FirstLine = 1.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loop index gt 1.
begin = ( Line - 1 ) * ( loopindex - 1 ) + 2.
end = ( Line - 1 ) * ( loopindex - 1 ) + Line.
if end gt DataLine.
end = DataLine.
endif.
endif.
endif.
endform.
<b>Step6</b> using field sysbol in your BDC, for example: in ME21, but you should calculate each item will correponding to which index in steploop/Table Control
form creat_bdc.
field-symbols: <material>, <quan>, <indicator>.
data: name1(14) value 'EKPO-EMATN(XX)',
name2(14) value 'EKPO-MENGE(XX)',
name3(15) value 'RM06E-SELKZ(XX)'.
assign: name1 to <material>,
name2 to <quan>,
name3 to <indicator>.
do pageno times.
if sy-index gt 1
*insert scroll page ok_code"
endif.
perform calrange using Line DataLine FirstLine sy-index
changing begin end.
loop at DataTable from begin to end.
perform calindex using Line FirstLine DataTable-LineIndex changing Index.
name1+11(2) = Index.
name2+11(2) = Index.
name3+12(2) = Index.
perform bdcfield using <material> DataTable-matnr.
perform bdcfield using <quan> DataTable-menge.
perform bdcfield using <indicator> DataTable-indicator.
endloop.
enddo.
Reward with points if it is helpful
Cheers
Alfred -
Its been a loing day and I am sure this was working earlier, but I've since had to delete and recreate my table contorl and now it is not retatining any entered values. I used the wizard to create the table control which references my internal table in the program for some reasn the modify fails in the PAI. And then the table info is lost. Any ideas?
MODIFY IT_NEW_BATCHES
FROM S_NEW_BATCHES
INDEX TABLE_CONTROL-CURRENT_LINE.Hi ,
IN PAI .
loop at it_new_batches .
module user_command_1000.
endloop. "end of PAI
MODULE user_command_1000 INPUT. " This is to be done in Driving program .
READ TABLE IT_NEW_BATCHES
INDEX tab_ctrl-current_line TRANSPORTING NO FIELDS .
IF sy-subrc = 0 .
MODIFY IT_NEW_BATCHES
FROM IT_NEW_BATCHES
INDEX tab_ctrl-current_line .
CLEAR IT_NEW_BATCHES .
ELSE .
APPEND IT_NEW_BATCHES .
CLEAR IT_NEW_BATCHES .
ENDIF.
ENDMODULE.
Regards
Deepak.
Edited by: Deepak Dhamat on Nov 25, 2011 4:43 AM -
Table Control Alternativ​es?
I am trying to find another more sophisticated alternative to the LabVIEW Table Control. Any suggestions? I would like to associate some lookup table code with it to output an interpolated value based on inputs. I actually want to create a lookup table control which highlights the section of the table being accessed and things like that. Does this exist? I have already created the equivalent with a VI and a LabVIEW text based table, but the implementation is not as easy as I would like (creating refrences and all that mess). Dropping it into code takes more effort than I'd like. I'd like to have a self contained control to drop in. Any sugesstions would be appreciated.
R6.hi,
We have the specify the reference field for the field in table control. Otherwise, we get a short dump showing an error conv_to_number.
To avoid this, we need to set the reference field in the properties of the field in table control.
Double click on the field of table control, we get the properties window opened, in it specify the reference field there.
There is an other simple way to avoid this dump. Select the field of the table contorl and in the TEXT inputbox which exists on the top right of the window, set last letter as _______V But in this case, we get the values justified to the right.
Regards,
Sailaja. -
Can we add page numbers to ALV Grid Control.
Hi All,
1.My requirement is to display page numbers when we down load the list in to EXCEL.
Can we do this in ALV Grid Control.
2.Can we display the page numbers in the SAP Query,when we down load the out put list in to the EXCEL.
Thanks & Regards,
Seshadri GHi Seshadri,
No, it is not possible to print the page number when you download the list to EXCEL. Because in ALV grid the report output is display as table contorl and this data can not be divided into page when you download to EXCEL.
Regards,
Satya. -
Bapi/FM to delete the status record from Business location(O402)
Hi,
Is there any BAPI/FM to delete the status from Business location?
My requirement is as follows:-
1. I have to delete the last status from business location.
2. I can find out the number of status maintained for a business location,
a. so if the status which i have to delete is visible in table contorl,
i can decide the cursor position very easily in bdc.
b. But if i have to scroll down to get the status record,
in that the cursor position is not known.
Please help.Hi,
Any idea?
Even if i write a bdc, i didn't know how to find the last record. The page down and page up will also not work as there may be chances that mutiple status can be removed. -
Hr...bdc for pa40-salary increment
HI FRIENDS..
M NOT ABLE TO FETCH VALUES FOR TABLE CONTORL IN PA40 T.CODE FOR SALARY INCREMENT..
ACT D PROBLEM IS..
THE OLD SALARY SRTUCTURE IS DIFFERENG FROM CURRENT SALARY STRUCTURE IN EXCEL SHEET..
DOES ANY1 HAVE THE BDC FOR SALARY INCREMENT ..?
PLS HELP..
PTS REWRDED FOR SURE..Hi,
We never write BDC for PA40.
Write it for PA30.
Goto SHDB tcode and record for the required infotype.
Or you can also use any of the following FM instead of BDc.
HR_INFOTYPE_OPERATION
HR_MAINTAIN_MASTERDATA.
Refer
https://forums.sdn.sap.com/click.jspa?searchID=4208189&messageID=3188548
https://forums.sdn.sap.com/click.jspa?searchID=4208189&messageID=1552901
Regards -
Re: Module Pool Type Conversion Error.
Hi,
I have used the screen fields
quantity parameter of type imseg-erfmg
pmeins parameter of type imseg-erfme.
while conversion.. i am passing the value
lbbes-erfmg to quantity
and lbbes-erfme to pmeins
when the conversion is done the lbbes-erfmg has negative value and when fed into the screen
it creates dump.
can anyone help me.
Thanks & Regards
Guhapriyan Subrahmanyamhi,
We have the specify the reference field for the field in table control. Otherwise, we get a short dump showing an error conv_to_number.
To avoid this, we need to set the reference field in the properties of the field in table control.
Double click on the field of table control, we get the properties window opened, in it specify the reference field there.
There is an other simple way to avoid this dump. Select the field of the table contorl and in the TEXT inputbox which exists on the top right of the window, set last letter as _______V But in this case, we get the values justified to the right.
Regards,
Sailaja. -
TABLE_GET_KEY_TO_SET_CUR_ROW
Hi,
in table contorl,I want to use POSITION push button to get the right line to the top line
i want to use TABLE_GET_KEY_TO_SET_CUR_ROW to get current line,
CALL FUNCTION 'TABLE_GET_KEY_TO_SET_CUR_ROW'
EXPORTING
table = gt_tc
F4_FORMNAME = ' '
F4_PROGRAMNAME = ' '
F1_FORMNAME = ' '
F1_PROGRAMNAME = ' '
IMPORTING
TABLE_KEY =
TABLES
SELLIST =
EXCLUDE_FIELDS =
CHANGING
TABLE_KEY_NEW = ' '
EXCEPTIONS
CANCELLED_BY_USER = 1
TABLE_NOT_FOUND = 2
OTHERS = 3
I don't no how to use this fm,because i want to input 3 fields of the table line to choose the right line of table contorl, which parameter should i importing and changing and exporting,Hi
Just take a look at the include program L0Q13F10 which uses the function module 'TABLE_GET_KEY_TO_SET_CUR_ROW'.
Shakir -
Production Order Print . table data in print output of order
Hi SAP Buddies
Can any one tell me what are the steps required for setting the SFC print output.
IMG setting for print output.. of SFC papers
Actually my main purpose is to get TABLE : MARD and Field LGPBE to printed on Goods Issue Slip.
Warm Regards
Brijesh Vermahi
IN iMG settings OPK8 you need to set the Script forms,program name, list contorls,and printer specifications. against the lists
to get your required data you need to edit the program assigend to the Goosde issue slip.
pl check
-ashok
Edited by: Ashok Keerthipati on Dec 24, 2008 10:00 AM -
How to skip a table row in Smartforms
HI experts!
I want to skip a row of the internal table while printing the document. Other words, I want to block all of the subnodes of the Table node for rows.
The where condition of the table node is not the solution, because this filtering depends on a variable value.
thanksyou can create a flag variable and use that in the condition tab of all the nodes which you donnot want to display...
the flag can be contorlled based on some condition in a program line.
Maybe you are looking for
-
Saving Form created in Adobe Acrobat 9 Standard (V 9.4.5)
Hi, I was wondering if someone could help me. I have a form that is created in Adobe 9 that is sent out and the form is filled out and then submitted back but the problem is that many of the users who click the "Submit Form" button it does not appear
-
HT4707 Using Lion I cannot "edit" in iPhoto. Why not?
I recently installed Lion and now when using iPhoto (8.1.2 424) I cannot access "Edit" to enlarge a photo or crop it. Any reason why? Something else I need to do now that my operating system is Lion?
-
Changing background color in JTable, only changes one row at a time...
I'm trying to change the color of rows when the 5th column meets certain criteria. I think I'm very close, but I've hit a wall. What's happening is the row will change color as intended when the text in the 5th column is "KEY WORD", but when I type "
-
Trigger-Body isnt remaped during IMPDP and REMAP_SCHEMA in Oracle 10g
Hello, we are facing the following problem: During an IMPDP we are remaping the schema. The schema includes triggers. The trigger bodys are of normal syntax without a relation to the schema/user. If we start the import with datapump using the remap_s
-
How to attached a file to email?
I want to send an email with an attachment but do not see icon for attachment.