Making a field visible for a particular row in table control.
Hi Experts,
I have a scenario where in there are 7 columns in table control wherein last column I have made invisible. Now I got to make that column visible only for the selected row and this column for the rest of the rows should be invisible.
How can I achieve this. Tried a lot playing with table control current line and cols structure but no fruit.
Please help. <removed by moderator>
Thanks,
Edited by: Thomas Zloch on Oct 19, 2010 2:38 PM
Hi All,
Sorry for late response. I was out of station for a while.
I tried a lot after going through the link provided by Robert and also tried what Anmol has suggested but its not working,
The column becomes invisible but it is not becoming visible again for the selected row.
The code I have written is as follows.
process before output.
module status_9000.
module tc_details_change_tc_attr.
loop at it_test
into wa_test
with control tc_details
cursor tc_details-current_line.
module tc_details_get_lines.
module customize. " Module to update table control dynamically
endloop.
module CUSTOMIZE output.
LOOP AT TC_DETAILS-cols INTO cols.
if cols-screen-name = 'WA_TEST-REMARKS'. " and wa_test-sel = 'X' ).
IF WA_TEST-SEL = 'X'.
COLS-SCREEN-ACTIVE = '1'.
COLS-INVISIBLE = '0'.
MODIFY TC_DETAILS-COLS FROM COLS INDEX SY-TABIX.
ELSE.
COLS-SCREEN-ACTIVE = '0'.
COLS-INVISIBLE = '1'.
MODIFY TC_DETAILS-COLS FROM COLS INDEX SY-TABIX.
ENDIF..
ENDIF.
ENDLOOP.
endmodule.
Please help.
Similar Messages
-
Making Screen field visible for BDC upload
Hi All
I have an existing BDC program to add Vendor data to LFB1 table using transaction FK01
Now I want to add Personnel No. PERNR value in LFB1-PERNR
On the Account Information (SAPMFK02 Screen 0210) screen field Personnel number is not visible so I am not able to run the BDC program it says LFB1-PERNR field not available on screen.
Please let me know how can i make that field visible on the screenHi Akshay,
U can make it visible thru SPRO transaction.
Financial accounting --> accounts receivable and acounts payable --> Vendor master --> Master data --> Define screen layout per company code.
Choose the specific company code and make the necessary changes,.
thank you.
reward points if u find the discussion useful -
To give colours for a certain row in table control in module pool
Hi,
In module pool,,,,,When I am displaying the Table Control......Suppose in some rows personnel no. is there and for the person who has exited from the company should be highlighted with red colour.
Please some code..
thanks..Hi Jayasree,
I think I had a similar requirement to have a one column on a particular row
available for input where all other rows for that column were not. It took
me a while to figure this out but it was quite simple. I expect it will
work for colour changes too.
In Process Before Output
LOOP AT INTERNAL TABLE INTO WA WITH CONTROL TC
Call Module
END LOOP
In the module program the condition on which the colour change / input
status etc has to be changed using
IF condition = true
LOOP AT SCREEN
IF SCREEN-NAME = column name
Make your colour / input status change
MODIFY SCREEN
ENDIF
ENDLOOP
ENDIF
I hope this helps you.
Please search the forum before adding a new thread. -
Deactivate the double click/ hot spot for a particular row in alv grid.
Hello,
As per a certain condition how to deactivate the double click/ hot spot for a particular row in alv grid.
Regards,
Sarojwhere u define layout there is a field hotspot.like
data: var.
if con is true
var = 'X'. (show hotspot)
else.
var = ' '. (deactive hotspot)
elseif ws_fieldcat-fieldname = 'DMBTR'
AND ws_fieldcat-tabname = 'T_MTAB'.
ws_fieldcat-do_sum = C_X.
<b>ws_fieldcat-hotsopts = var.</b>
MODIFY Wt_fieldcat FROM ws_fieldcat
TRANSPORTING DO_SUM.
It is helpful for u. if any problen send me ur coding i will change it.
Regards
Manish Kumar -
Visibility for a particular customized record.
We are facing an issue of visibility for a particular customized record.
As customized record costing is created automatically using web services, so by default it is picking the name of the Administrator.How can we remove admin by default and assign its real owner by default?
Thanks in Advance,
Manish.You should be able to assign this by using post default on the Opportunity Owner ID field to be the creator of the record. If you have hard coded a WS username to complete this perhaps look at using SSO
-
How to set different font for a particular row in jtables?
How to set different font size and font type for a particular row in jtable?
More than enough sample code here:
[http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]
db -
How to delete the row in table control with respect to one field in module pool programming?
Hi,
Can I know the way to delete the row in table control with respect to one field in module pool programming
Regards
Darshan MSHI,
I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
I have written this code,
module USER_COMMAND_9000 input.
DATA OK_CODE TYPE SY-UCOMM.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'DELETE'.
LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
APPEND LS_SOURCE TO LT_RESTORE.
DELETE TABLE LT_SOURCE FROM LS_SOURCE.
SOURCE-LINES = SOURCE-LINES - 1.
ENDLOOP.
But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
So I thought of doing with respect to the field. -
How to select perticular row in table control for BDC
Hi all
I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
Please Suggest me. it urgent.
Thanks& Regards,
RPHi all
I want to select perticular row in table control for deletion through BDC. My transaction is CA02, My input is material no and plant , then it display table control with work center. Now i want to select W999 cost center and delete through BDC.
Please Suggest me. it urgent.
Thanks& Regards,
RP -
Bdc for ip01, data upload in table control
I was working on a bdc for ip01 . there is a table control - whose 5 rows are visible and I need to fill data upto 6 row . 6th row get filled by scrolling . will scrolling get captured in recording . whether this is possible or not sir . If yes then how?
Sir please help me.
With regards,Hi
Scrolling does not get recorded while recording. You can achieve it by having ok_code to p+ or p++.
Refer the following link for detailed description.
http://wiki.sdn.sap.com/wiki/display/ABAP/BatchInputFAQ#BatchInputFAQ-Howtoscrollatablecontrol%3F
Hope this helps you.
Regards
Vinodh -
BDC : to select different rows in table control
Hi,
I have to fill many rows in table control and want to select different row one by one in increasing order which rows are filled in BDC.
Can anybody suggest me with coding...
thanks
nareshHi ,
I am attaching sample code for BDC transaction code is : FV11 , This code is also contains poage down concepts . By using this page down concept you can add number of item fields
Program Name : ZFV11_NEW
Program Description : To Upload Condition Records-FV11
Author : Jagadish
Start Date : 11/06/2007
REPORT zfv11
NO STANDARD PAGE HEADING LINE-SIZE 255.
DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
If it is nessesary to change the data section use the rules:
1.) Each definition of a field exists of two lines
2.) The first line shows exactly the comment
'* data element: ' followed with the data element
which describes the field.
If you don't have a data element use the
comment without a data element name
3.) The second line shows the fieldname of the
structure, the fieldname must consist of
a fieldname and optional the character '_' and
three numbers and the field length in brackets
4.) Each field must be type C.
Generated data section with specific formatting - DO NOT CHANGE ***
TABLES : t100.
DATA: BEGIN OF record OCCURS 0,
data element: KSCHA
kschl(004), "Condition Type
data element: SELKZ_LIST
selkz(001),
data element: WERKS_D
werks(004), "Plant
data element: ELIFN
lifnr(010), "Vendor
data element: MATNR
matnr(018), "Material No.
data element: KBETR_KOND
kbetr(016), "Amount
data element: KODATAB
datab(010), "Condition Validity Date from
data element: KODATBI
datbi(010), "Condition Validity To
data element: MWSKZ
mwsk1(002),
END OF record.
DATA : BEGIN OF it_new OCCURS 0, " Internal Table for Header Data
kschl(004),
werks(004),
lifnr(010),
END OF it_new.
DATA : BEGIN OF it_item OCCURS 0, " Internal table for Item Data
werks(004),
lifnr(010),
matnr(018),
kbetr(016),
datab(010),
datbi(010),
mwsk1(002),
END OF it_item.
DATA : cnt(2) TYPE n,
fld(25) TYPE c.
TYPE-POOLS: truxs.
DATA: it_raw TYPE truxs_t_text_data.
DATA : n TYPE n.
DATA:
BEGIN OF t_data OCCURS 0,
data TYPE string,
END OF t_data.
DATA:BEGIN OF it_mess OCCURS 0,
msgtyp(5),
lms(200),
msgv1(50),
END OF it_mess.
DATA : p_mode TYPE c.
DATA:it_msgtab TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE,
it_msgtab1 TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE.
DATA : l_mstring(150).
DATA : BEGIN OF bdcdata OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdcdata.
PARAMETERS : p_file1 LIKE rlgrap-filename.
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
PERFORM file_selection.
PERFORM data_upload.
PERFORM table_control.
LOOP AT it_new.
REFRESH bdcdata.
PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV13A-KSCHL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RV13A-KSCHL'
it_new-kschl.
PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV130-SELKZ(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=WEIT'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KONP-KBETR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'KOMG-WERKS'
it_new-werks.
PERFORM bdc_field USING 'KOMG-LIFNR'
it_new-lifnr.
DATA: "X(5) TYPE N,
N(5) TYPE N.
N = 0.
LOOP AT it_item.
N = N + 1.
ENDLOOP.
"X = 1.
CNT = 1.
DO N TIMES.
IF CNT > 19.
perform bdc_field using 'BDC_OKCODE' 'KOMG-MATNR(01)'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
CNT = 1.
ENDIF.
cnt = 1.
LOOP AT it_item WHERE werks EQ it_new-werks AND lifnr EQ it_new-lifnr . "FROM x TO x.
CONCATENATE 'KOMG-MATNR(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-matnr.
CONCATENATE 'KONP-KBETR(' cnt')' INTO fld.
PERFORM bdc_field USING fld it_item-kbetr.
CONCATENATE 'RV13A-DATAB(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-datab.
CONCATENATE 'RV13A-DATBI(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-datbi.
CONCATENATE 'KONP-MWSK1(' cnt ')' INTO fld.
PERFORM bdc_field USING fld it_item-mwsk1.
cnt = cnt + 1.
if cnt = 20.
perform bdc_field using 'BDC_OKCODE' 'KOMG-MATNR(19)'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
CNT = 1.
endif.
CLEAR it_item.
ENDLOOP.
ENDDO.
PERFORM bdc_dynpro USING 'SAPMV13A' '1363'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KONP-MWSK1(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
CALL TRANSACTION 'FV11' USING bdcdata MODE 'A'
UPDATE 'S'
MESSAGES INTO it_msgtab.
CLEAR bdcdata[].
PERFORM error.
ENDLOOP.
Start new screen -Subroutine for screen s *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field -Subroutine for field s *
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "BDC_FIELD
*& Form file_selection
FORM file_selection .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'P_FILE1'
IMPORTING
file_name = p_file1.
ENDFORM. " file_selection
*& Form data_upload
FORM data_upload .
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = p_file1
TABLES
i_tab_converted_data = record
EXCEPTIONS
conversion_failed = 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.
ENDFORM. " data_upload
*& Form error
FORM error .
LOOP AT it_msgtab.
IF it_msgtab-msgtyp = 'E'.
SELECT SINGLE * FROM t100 WHERE sprsl = it_msgtab-msgspra
AND arbgb = it_msgtab-msgid
AND msgnr = it_msgtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH it_msgtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH it_msgtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH it_msgtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH it_msgtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH it_msgtab-msgv1 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv2 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv3 INTO l_mstring.
REPLACE '&' WITH it_msgtab-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
it_mess-msgtyp = it_msgtab-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = it_msgtab-msgv1.
APPEND it_mess.
WRITE: / it_msgtab-msgtyp, l_mstring(150).
ELSE.
WRITE: / it_msgtab.
it_mess-msgtyp = it_msgtab-msgtyp.
it_mess-lms = l_mstring.
it_mess-msgv1 = it_msgtab-msgv1.
APPEND it_mess.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " error
*& Form table_Control
FORM table_control .
SORT record BY lifnr matnr.
LOOP AT record.
ON CHANGE OF record-lifnr.
MOVE-CORRESPONDING record TO it_new.
APPEND it_new.
ENDON.
MOVE-CORRESPONDING record TO it_item.
APPEND it_item.
ENDLOOP.
ENDFORM. " table_Control
Reward if useful
Thanks
Jagadeesh.G -
Enable/Disable Rows In table Control
I m getting material number for particular material doc. if i get N rows in output i want to disable all other rows of table control.
Moderator message: please search for previous solutions to similar problems before asking.
Edited by: Thomas Zloch on Nov 20, 2010 7:24 PMHi,
In PBO, Loop at your table control lines, create a module inside it and use
LOOP AT SCREEN.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDLOOP.
Regards,
Senthil -
Selecting rows in table control
Hi experts,
I have question regarding selecting rows in table control. How can I select a row when a button is pressed. I cannot use the selection column in this case. Is there any option to achieve my requirement without using the selection column. Thanks.
regards,
sriram.By,
Using the Get cursor syntax you can achive the Selected row in Table control.
DATA : selrow TYPE i,
selindex TYPE i .
* getting the cursor line in Table Control for selected row
GET CURSOR FIELD selfield LINE selrow.
selindex = <tablecontrol>-top_line + selrow - 1.
Prabhu -
How to select all the rows of table control in BDC
Hi All,
While I am doing BDC for Transaction Code MC88, After the first screen I will get another screen with tabble control, Here I need to select all the rows of table control, I am assignng the 'X' to the first field of Table Control which is the indicator for selection.
Here I am getting message called Indicator field is not in program and screen.
While doing Recording I am not able to record the indicator, Please any one let me know how to record the Entire table control selection.
Thanks in advance..Sorry about that lakshmi. Here is my code.
PERFORM dynpro USING : 'X' 'SAPMMCP6' '0105',
' ' 'RMCP2-MATNR' t_matnr,
' ' 'RMCP2-WERKS' t_werks,
' ' 'BDC_OKCODE' '=AKTV'.
PERFORM dynpro USING : 'X' 'SAPLMCPA' '0707',
' ' 'BDC_OKCODE' '=MRKE'.
PERFORM dynpro USING : 'X' 'SAPLMCPA' '0707',
' ' 'BDC_OKCODE' '=GRAO -
How to get all the index of "selected rows" in table control?
Hi Gurus,
I have a table control, wherein I need to get selected row so that I can get its respective TABIX.
I know that the event for capturing selected row is in PAI.
I also ensure that the w/ selColumn name in my screenpainter is exactly the same as my declaration in ABAP.
TOP INCLUDE
YPES: BEGIN OF Y_ZQID_CHECK,
IDNUM TYPE ZQID_CHECK-IDNUM,
WERKS TYPE ZQID_CHECK-WERKS,
MATNR TYPE ZQID_CHECK-MATNR,
LICHA TYPE ZQID_CHECK-LICHA,
LIFNR TYPE ZQID_CHECK-LIFNR,
ECOA_S TYPE ZQID_CHECK-ECOA_S,
ID_STAT TYPE ZQID_CHECK-ID_STAT,
ID_DATE TYPE ZQID_CHECK-ID_DATE,
FLAG_MAILCOA(1) TYPE C,
MARK(1) TYPE C, "Name of w/ SelColumn in ScreenPainter: T_ZQIDCHECK_DISCH-MARK
END OF Y_ZQID_CHECK.
DATA: T_ZQIDCHECK_DISCH TYPE STANDARD TABLE OF Y_ZQID_CHECK WITH HEADER LINE.
PAI
PROCESS AFTER INPUT.
* MODULE USER_COMMAND_9004.
LOOP AT T_ZQIDCHECK_DISCH.
MODULE READ_TC_DISCH .
ENDLOOP.
module READ_TC_DISCH input.
DATA: W_LINE_SEL TYPE SY-STEPL,
W_TABIX LIKE SY-TABIX.
GET CURSOR LINE W_LINE_SEL.
W_TABIX = TC_ID_ONLY-TOP_LINE + w_LINE_SEL - 1.
MODIFY T_ZQIDCHECK_DISCH INDEX TC_ID_ONLY-current_line.
If I am selecting single row, I can properly get the selected index via debug.
BUG:
When I'm selecting multiple rows in table control, only the last row is always being read inside the loop of my table control.
Please see the screenshot.
[url]http://img268.imageshack.us/img268/5739/tcselectedrows.jpg[url]
Notice in the debug screenshot, even if it's just in the 1st loop of table control, it automatically gets the 4th table control index, instead of the 2nd one.
Helpful inputs will be appreciated.
Thanks.
Jaime
Edited by: Jaime Cabanban on Dec 9, 2009 3:16 PMHi,
Are you sure that you have selected multiple line for tablecontrol in the property window of the tablecontrol.
Flowlogic.
LOOP WITH CONTROL TC_01.
Module Get_Marked.
ENDLOOP.
Module Pool
Module Get_Marked.
read the data from the internal table where mark = 'X'.
this should give you only selected records.
Endmodule.
Kindly check the tablecontrol property.
Regards,
Ranjith Nambiar -
Unable to delete a row in table control
Hi,
I'm unable to delete a row in table control.
I have defined a selection column for my table control but it is not getting value 'X' when i'm selecting a row for deletion.
Also, when I press enter, some of the columns in table control are getting initialized. I'm passing these values to the internal table along with other columns.
Please help.
Regards,
Manasee
Message was edited by: Manasee Chandorkarhi,
kindly chk this.
PROCESS BEFORE OUTPUT.
MODULE status_9010.
LOOP WITH CONTROL tab_control.
MODULE move_data_to_table.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL tab_control.
MODULE move_data_from_table.
ENDLOOP.
*& Module move_data_to_table OUTPUT
This is to move the data from the internal table to the table control
MODULE move_data_to_table OUTPUT.
This is to move the data from the internal table to the table control
zmpets_mode-modecode,zmpets_range-rangeid,zmpets_servfacto-factor are column name of table control
READ TABLE int_factor INDEX tab_control-current_line.
IF sy-subrc = 0.
zmpets_mode-modecode = int_factor-modecode.
zmpets_range-rangeid = int_factor-rangeid.
zmpets_servfacto-factor = int_factor-factor.
ENDIF.
ENDMODULE. " move_data_to_table OUTPUT
*& Module move_data_from_table INPUT
Date is moved from the table control to the Internal Table
MODULE move_data_from_table INPUT.
To move the data from the table control to internal table 'INT_FACTOR'.
int_factor-modecode = zmpets_mode-modecode.
int_factor-rangeid = zmpets_range-rangeid.
int_factor-factor = zmpets_servfacto-factor.
int_factor-chk = line.
*here if the data is there, it will modify
MODIFY int_factor INDEX tab_control-current_line.
IF sy-subrc NE 0. "data not exixting in table control . ie new data, then append it
APPEND int_factor.
CLEAR int_factor.
ENDIF.
ENDMODULE. " move_data_from_table INPUT
*delete a line from table control
MODULE user_command_9010 INPUT.
CASE sy-ucomm.
When an entry is deleted, and the entry is removed from the table
control.
WHEN 'DELETE'.
PERFORM f_del_frm_tab_cntrl.
ENDCASE.
ENDMODULE.
FORM f_del_frm_tab_cntrl .
LOOP AT int_factor WHERE chk = 'X'.
DELETE int_factor WHERE chk = 'X' .
CONTINUE.
ENDLOOP.
CLEAR int_factor.
ENDFORM.
for any clarifiaction pls mail me.
pls reward points, if this helped u.
regards,
anversha.
[email protected]
Message was edited by: Anversha s
Maybe you are looking for
-
I Pod isn't being detected by my comp
I have tried different cords and ports and my Ipod doesn't appear at all. It says there is no device connected. ios 616
-
How can you get a pdf document file to an editable format?
I have a lease document that I need to update. It was sent to me as a pdf. I have since scanned it into my MacBook thinking I could save it in some edible format but I cannot accomplish this. Any ideas? Thanks, working better
-
Change the name of report painter report
HI, I have created an operating exp report by cost center and named it as "Op exp by CC". Now I want to change the name of the report to "Op exp by CC dtl". How can I do this? Please help me out with this. Regards, Nitish
-
WIll cancel sql server database backup cause anything to be hurt?
I run full backup of one big database. After 20 seconds, I click "stop action now" to cancel this backup. Will it cause anything to hurt? Want to make sure that database is still safe. Thanks
-
Disable "Delete Record" button in the NavigatorBar
Hi, I am working on a JSP application. For the security reason, I'd like to disable or get rid of the "Delete Record" button in the NavigatorBar. After several tries, I still couldn't figure out how to disable or get rid of the NAVIGATE_DELETE, NAVIG