Hiding column in table in smartform
HI,
Can we hide a column in a table on a specific condition?
PLease let me know.
Reagards
Sandeep
Hi,
Here 2 options are there select based on requirement.
1. Column will hide but there empty space will display. This can be acheived by setting the condition in condition tab of the column related text in that node(table).
2.Completly hiding the cloumn and also empty space means create 2 tables table1 with 4 columns and table2 with3 columns. create alternative and put condition. if yes table1 display.if no means table2 will display.
Thanks,
Suma.
Similar Messages
-
HI,
It's rather a simple question for most of you but as I am new to Smartforms I am little confused ...
I had created a table in the main window with two columns and had also created two text elements and assigned to the table but my problem is the text elements are displaying the values in two different rows rather then in two columns...In templates we have the option of assigning the columna dn row in the output options of a text element but I do not find in tables..Am I missing something .Please help me out..
I had assigned the same default line type created with two columns to both the text elements.
Regards
PavanHi,
1. In the Table Main area you have the assign the Line Type which will give you the Rows of the Table.
[Table Layout|http://help.sap.com/saphelp_nw70/helpdata/EN/fa/0c1444d30111d3b568006094192fe3/content.htm]
2. For every row inside it there are Cells which are columns that you have defined in the table. (In your case the cells will be two if you have designed the table with 2 columns)
[How to draw columns in Tables|http://help.sap.com/saphelp_nw70/helpdata/EN/12/d4c6d62e9811d5b694006094192fe3/content.htm]
3. Now in each cell you need to define the text window and give the text element over there.
This is how we need to assign the text elements to the columns
Regards
Sarves -
Hiding columns in table control
Hi Experts,
I have requirement to hide certain columns in table control. I have tried my best to use SCREEN structure with ACTIVE, INVISIBLE, INPUT, OUTPUT options, but not working properly.
The table control has nearly 10 columns with DATE as the first one. Once the screen appears after executing program, the second and third columns should be hidden and when double clicked on any date value from the basic list, the hidden columns should be visible with its values in the next level.
I am not able to hide columns in table control. By the way, suggest me options for double clicking in table control too.
Thanks.Hi,
The value of sy-ucomm when user double clicks is /CS
To get the details of field name and value use:-
GET CURSOR FIELD g_cs_field VALUE g_cs_value.
Now you can code in PAI to display those two columns initially hidden by the user:-
CASE sy-ucomm.
WHEN '/CS'.
IF g_cs_field = '<field1_name>'.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-invisible = 0. "display control
screen-active = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDCASE.
Remember that in PBO of screen you have written a code to hide these same columns initially, so make sure that the code is not executed when user double clicks to display those columns.
Try this code for hidding the columns in table control initially.
MODULE status_8001.
LOOP AT SCREEN.
IF screen-group1 = 'ABC'.
screen-invisible = 1. "hide control
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDMODULE.
Hope this helps you.
Regards,
Tarun -
Hiding and restoring table columns from file?
how i handle hiding and unhiding columns in a jtable is that i have a checkbox for each column, depending on which is checked "on" the tablecolumn is found and added to a vector and removed from the table.
when the checkbox is checked "off" this vector is searched for the correct tablecolumn, and then added back to the table. this works fine.
when i close out of the program, i go thru the table and write the visible column names along with its size to file.
when i re-open the program, i create the table normally, then go thru the file and hide(remove) the tablecolumns found in it..this works fine.
but when i go back to this checkbox list and try to unhide the tablecolumn, i get an exception
java.lang.IllegalArgumentException: Cannot format given Object as a Number
at java.text.NumberFormat.format(NumberFormat.java:219)
at java.text.Format.format(Format.java:133)
at javax.swing.JTable$DoubleRenderer.setValue(JTable.java:3397)
at javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent(DefaultTableCellRenderer.java:160)
at javax.swing.JTable.prepareRenderer(JTable.java:3731)
at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149)
at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
at javax.swing.JComponent.paintComponent(JComponent.java:541)
at javax.swing.JComponent.paint(JComponent.java:808)
at javax.swing.JComponent.paintChildren(JComponent.java:647)
at javax.swing.JComponent.paint(JComponent.java:817)
at javax.swing.JViewport.paint(JViewport.java:722)
at javax.swing.JComponent.paintChildren(JComponent.java:647)
at javax.swing.JComponent.paint(JComponent.java:817)
at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4787)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4740)
at javax.swing.JComponent._paintImmediately(JComponent.java:4685)
at javax.swing.JComponent.paintImmediately(JComponent.java:4488)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)before i unhide the columns, the table is already populated with values. so it might have something to do with that...cuz there is no problems unhiding them if the table contains no data
any ideas?
thanksIf you're interested, this method hides a table column without any modifications of its content:
public static void setTableColumnVisible(JTable table, int col,
boolean visible, int width) {
try {
TableColumn column = table.getColumnModel().getColumn(col);
if (!visible) {
column.setMinWidth(0);
column.setWidth(0);
column.setMaxWidth(0);
column.setPreferredWidth(0);
else {
column.setWidth(width);
column.setPreferredWidth(width);
catch(Exception e) {
e.printStackTrace();
}Method use:
. setTableColumnVisible(table, col, false, 0) hides the column
. setTableColumnVisible(table, col, true, 100) restores the column to its size of 100
Hope this helped,
Regards. -
I am experiencing issue with my SharePoint site , when I am trying to add new Item in List . Error given below :--> 02/03/2015 08:23:36.13 w3wp.exe (0x2E04) 0x07E8 SharePoint Server Logging Correlation Data 9gc5 Verbose Thread change; resetting trace
level override to 0; resetting correlation to e2e9cddc-cf35-4bf8-b4f3-021dc91642da c66c2c17-faaf-4ff9-a414-303aa4b4726b e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015 08:23:36.13 w3wp.exe (0x2E04) 0x07E8 Document Management Server Document Management 52od
Medium MetadataNavigationContext Page_InitComplete: No XsltListViewWebPart was found on this page[/sites/00003/Lists/PM%20Project%20Status/NewForm.aspx?RootFolder=&IsDlg=1]. Hiding key filters and downgrading tree functionality to legacy ListViewWebPart(v3)
level for this list. e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015 08:23:36.17 w3wp.exe (0x1B94) 0x1A0C SharePoint Server Logging Correlation Data 77a3 Verbose Starting correlation. b4d14aec-5bd4-4fb1-b1e3-589ba337b111 02/03/2015 08:23:36.17 w3wp.exe (0x1B94)
0x1A0C SharePoint Server Logging Correlation Data 77a3 Verbose Ending correlation. b4d14aec-5bd4-4fb1-b1e3-589ba337b111 02/03/2015 08:23:36.31 w3wp.exe (0x2E04) 0x07E8 SharePoint Foundation Database 880i High System.Data.SqlClient.SqlException: Cannot insert
the value NULL into column 'tp_DocId', table 'Content_SP_00003.dbo.AllUserData'; column does not allow nulls. INSERT fails. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavi... e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015
08:23:36.31* w3wp.exe (0x2E04) 0x07E8 SharePoint Foundation Database 880i High ...or runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream,
Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,
RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand
command, CommandBehavior behavior,Are you trying to setup P2P? Could you explain the process you followed completely? By anychance you create the backup and then created the publication?
Regards, Ashwin Menon My Blog - http:\\sqllearnings.com -
Hi folks,
I'm developing a program, one part of which should show in a table the information it got from the DB. It works just fine. The problem is - the user doesn't need to see all the columns (some of them are even unknown and are for intern use only). How could I hide those columns? Or should I create another TableModel and show it instead?
Thanks in advanceAs a new member you should learn how to search the forum before asking a question.
A simple search would use "hiding column jtable" as the keywords as an example. -
Reg:How to delete the column in table control also from database table.
Hi Experts,
Once again thank u all for giving the responses.
one more doubt is how to delete the columns of table control and also the record shold delete from ztable.
With Regards,
Saroja.P.Hi,
If you want to delete the rows in the table control and simultaneously delete it from the database table, then you can implement a 'DELETE' functionality specific to your table control. Have a MARK field (you will find that in the screen attributes of the table control -> give a name for the MARK field, you will find an additional MARK column at the beginning of your table control). You can check whatever rows you want to delete from the table control, call the delete module.
"This portion of code inside the LOOP...ENDLOOP.
IF sy-ucomm eq 'F_DELETE'.
gt_itab2-check = mark. " Store the MARK field status into your internal table's correspoding field 'check'
MODIFY gt_itab INDEX tabcontrol-current_line.
ENDIF.
iF sy-ucomm eq 'DELETE1'.
DELETE gt_itab WHERE check eq 'X'. "Your internal table does not have rows that you want to delete
ENDIF.
Now you can modify your database table using the MODIFY statement.
MODIFY ZDB FROM TABLE gt_itab. -
Issue in display format of a internal table in SMARTFORM
I m printing an internal table in smartform.when a particular field exceeds the coloumn's length.the rest of the texts come down to the next line.It can be shown in the below example.i m printing "+ text to be printed" in that particular coloumn.
Because of the size of the coloumn in table ,"ed." comes down as shown.
+ text to be print
ed.
I dont want ed to come directly down '+'.I want it to start from where 't' of 'text'
starts in the above line.
Notice that the requirement is to print "ed" after '4' spaces.
Please suggest what i need to do to get the desired result...
Regards
RudraUnfortunately there is no such way.
-
Issue in display format of internal table in smartform
I m printing an internal table in smartform.when a particular field exceeds the coloumn's length.the rest of the texts come down to the next line.It can be shown in the below example.i m printing "+ text to be printed" in that particular coloumn.
Because of the size of the coloumn in table ,"ed." comes down as shown.
<b>+ text to be print
ed. </b>
its coming by default.
I want it like <b>+ text to be print
ed</b>
I dont want ed to come directly down '+'.I want it to start from where 't' of 'text'
starts in the above line.
Notice that the requirement is to print "ed" after '2' spaces.And we can not use the string length concept bcoz not of characters after which the line comes down is not fixed.May be some change of setting in smartform will do the trick.
Please suggest what i need to do to get the desired result...
Regards
RudraUnfortunately there is no such way.
-
Declaring an internal table in smartform
hi,
can anyone tell how to declare internal table in smartform.
the internal table contains fields from 2 or more data dictionary tables(eg.kna1
and adrc). after this from the print program(internal table containing data in print
program) internal table should be passed to the smartform.
thanks.hi laxya,
if u want to pass the data from internal table in print program to Smartform.. there is only way.. that is using form interface..
1. goto se11, create a structure same as the itab in the print program.ex. <b>z_itab</b>
2. create line type... se11>select radio button-DATA type><b>z_it_itab</b> >press create>then select>TABLE Type> then entrer some text--> in the line type Field in giveth Str name u have created in STEP 1. activate it.
3. got SMARTFORMS-> form inteface>tables tabe--> give some name ex <b>IT_tab type z_it_itab</b>.
then acivate it.. then in the driver progam pass this table data.
Exapmpel
CALL FUNCTION fp_v_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = fp_st_control_parameters
user_settings = space
output_options = fp_st_output_options
wa_vbdkr = fp_st_vbdkr
IMPORTING
job_output_info = l_it_ssfcrescl
job_output_options = l_it_ssfcresop
TABLES
<b> IT_tab = z_it_itab (or table in driver program)</b>
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Another way is cteate a type in Globaldifination-->types tab..
ex:
types: begin of ty_itab,
matnr type matnr,
meins type meins
vrkme type vrkme,
end of ty_itab,
ty_it_itab type standard table of ty_itab.
then GLOBAL DIFINATION>GLOBAL DATA TAB>IT)ITAB TYPE TY_IT_ITAB.
BUT In this u can't pass the data from the print Program.. if u want to populate data in to this table... u have to write the Select query in the GLOBAL DIFINATIONS-->INITILIZATIONS TAB.
Please Close this thread.. when u r problem is solved
Reward if Helpful
Regards
Naresh Reddy K
Message was edited by:
Naresh Reddy -
PASSING INTERNAL TABLE IN SMARTFORM
HI' I M NEW TO SMARTFORMS, MY PROBLEM IS =THAT
I'VE CREATED A NEW TYPE(SAY TY_BKPF) IN THE DRIVER PROGRAM.
THEN I'VE DECLARED AN INTERNAL TABLE OF THIS TYPE.
TO PASS THIS INTERNAL TABLE INTO MY SMARTFORM I'VE PASSED THE INTERNAL TABLE'S NAME INTO THE FUNCTION MODULE UNDER THE TABLES PARAMETER.
BUT I'M NOT ABLE TO UNDERSTAND AS TO WHAT TYPE SHOULD I GIVE IT IN THE FORM INTERFACE IN THE TABLES TAB.
PLZ HELP.Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
Also have a look at below sample code. It will give you idea abt the same.
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Have a look at below link for more help on smart forms.
http://sap.ionelburlacu.ro/sap0/sapsf001.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers -
How to Define Internal Table in Smartform
Hello,
I have some problem on define Internal Table in Smartform
I define a Temp_IT_Gen Type LBBIL_IT_GEN in Global Definiations
but i find that it is not available for me to append data into it,
the error message is Temp_IT_Gen is not a Internal Table - the Occurs n Specification is missing
so how can i solve it?
i want to use the internal table in the hold program.
Thanks a lot in advance.Hi,
First U define the Table type in 'TYPES' tab of Global Definitions and then assing that table type to Internal table in 'Global Data' tab.
Eg:
define the Table Type like below in TYPES tab.
TYPES:BEGIN OF ty_TEMP.
INCLUDE STRUCTURE XXXXXXX.
TYPES:END OF ty_TEMP.
TYPES: g_t_temp TYPE STANDARD TABLE OF ty_TEMP .
Now, define the Internal table in Global Data tab like below:
Variable Name Type assignment Associated Type
G_T_ITEM_1 TYPE G_T_TEMP
NOTE: whatever U define in Global Definitions can be used only in SMARTFORM, if u want to use it in Program U must define in Form Interface.
Hope it helps!!
Rgds,
Pavan -
While selecting Frame for Table in Smartform
hi
While i am selecting Frame for Table in Smartform , it displaying very Bold frame.
wat is the reason,
guide mehi,
do this steps,
->first in the shading of the table select white color
->provide the saturation as 100
->select the pattern and select any one of the pattern
->and then check the output
you will get the required do this in the same fashion i explained
Thanks,
Nethaji. -
how can we declare an internal table for a standard sap table in smartforms in the 'Global Setting' part of smartforms?
Hai,
You can define the standard table in smartforms like this.
In Global settings:
variable name type assignment reference type
it_ekpo type table structure
In Global definitions:
variable name type assignment reference type
it_ekpo type table structure
regards,
kamala. -
How to Enable and Disable column in Table Control.
Hi all,
I want to make certain column of Table control as Enable or Disable on Button action.
Enable means ready for input and Disable means not ready for input.
Please send me sample code.
Thanks in advance.Hi Vipin,
You have to loop through the table columns to set the properties in the PBO of your screen.
Here is the sample solution.
delcare a workarea for the columns in the table control in your top include.
Table Control .
CONTROLS: TAB1 TYPE TABLEVIEW USING SCREEN '0100'.
DATA: WA_COLS LIKE LINE OF TAB1-COLS.
in your screen
PROCESS BEFORE OUTPUT.
MODULE INTIALISE_100.
*& Module 0100_INTIALISE OUTPUT
MODULE INTIALISE_100 OUTPUT.
LOOP AT TAB1-COLS INTO WA_COLS.
WA_COLS-SCREEN-INPUT = 1.
MODIFY TAB1-COLS FROM WA_COLS TRANSPORTING SCREEN-INPUT.
ENDLOOP.
ENDMODULE. " 0100_INTIALISE OUTPUT
modify the screen-input property as required for the table control columns.
Please provide points if helpfull.....
Thanks,
Karthik
Message was edited by: Karthik
Karthikeyan K
Maybe you are looking for
-
Cash Management - does a current day bank statement feature available ?
My business uses the current day bank report downloaded from the bank (not the BAI format), for figuring out the projected cash outflows like cheques presented by suppliers in our bank. They are planning to implement Cash Management shortly. What fea
-
How to add standard field in the CRM Pricing field catalog?
Hello All I am working on CRM 7.0 , I have a problem with the CRM pricing field catalog that when I am trying to add new field in the catalog the system gives me an error message that the entries should be in the allowed namespace (Y Or Z) but the fi
-
Transfer music from iPod mini to iPod with video
I'm going to be spending a few nights at my friend's house and they plan on giving me their iPod with video. I currently have the iPod mini and I was just wondering if there's a way (in Windows XP) if I can get my music and playlists from my iPod min
-
Need with xml manipulation(help!!!)
am trying to use jdom to manipulate an xml file...can anybody help on how to achieve this structure below. I have an xml file in this form <test name ="x " value="y"> <id name="d" value="1"/> <id name="d" value="1"/> <id name="d" value="1"/> </test>
-
Add and edit BOM component in the Equi BOM using LSMW
Hi All, I created a Batch input recording in LSMW to add BOM component in the Equi BOM (IB02). It is working fine. But my requirement is while adding it should check the material already available in the BOM, if not insert a new line or if it is ther