How to put drop down in table control ?
Hi All,
I m writing one module pool program to edit table.
I want dropdown to one field so that user can select the appropriate value. And also I want to save that record.
So how to get the dropdown list and after editing that record how to save that in the database?
Thanx in advance.
-Umesh
Hi Umesh,
Please check this demo program RSDEMO_TABLE_CONTROL on how to add drop down list in table control. Also check this program DEMO_DYNPRO_TABCONT_LOOP_AT as well.
To save to database you can code something like this in PAI.
MODULE USER_COMMAND_0100 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'SAVE'.
MODIFY <database table> FROM TABLE <table control>.
IF SY-SUBRC = 0.
ELSE.
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Hope this will help.
Regards,
Ferry Lianto
Similar Messages
-
Hi All,
I have added Z_field in Va01 Transaction. I want to put drop down list for that .
Can you please suggest me how to do that.
Regards
RadhaHi Radha Konjeti,
To have a dropdownlist/listbox in your report, use this demo code for creating a listbox with a set of values in it and select a single value for processing:-
REPORT Y_MOVIE MESSAGE-ID ZMSG.
TABLES : Y_MOVIES.
TYPE-POOLS: VRM.
TYPES : BEGIN OF MOVIE,
YR LIKE Y_MOVIES-YR,
CATEGORY LIKE Y_MOVIES-CATEGORY,
WINNER LIKE Y_MOVIES-WINNER,
NOTES LIKE Y_MOVIES-NOTES,
END OF MOVIE.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST,
MOVIETAB TYPE STANDARD TABLE OF MOVIE INITIAL SIZE 10 WITH HEADER LINE.
PARAMETERS: CATEGORY(10) AS LISTBOX VISIBLE LENGTH 10.
AT SELECTION-SCREEN.
IF CATEGORY EQ ''.
MESSAGE E006.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
NAME = 'CATEGORY'.
VALUE-KEY = 'PIC'.
VALUE-TEXT = 'PIC'.
APPEND VALUE TO LIST.
VALUE-KEY = 'MAL'.
VALUE-TEXT = 'MAL'.
APPEND VALUE TO LIST.
VALUE-KEY = 'FEM'.
VALUE-TEXT = 'FEM'.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST.
START-OF-SELECTION.
WRITE : / 'Category Selected :', CATEGORY.
ULINE.
SELECT
YR
CATEGORY
WINNER
NOTES
FROM Y_MOVIES INTO TABLE MOVIETAB
WHERE CATEGORY = CATEGORY.
END-OF-SELECTION.
WRITE : /1 'Year', 6 'Category', 16 'Winner', 50 'Notes'.
ULINE.
LOOP AT MOVIETAB.
WRITE : /1 MOVIETAB-YR, 8 MOVIETAB-CATEGORY, 16 MOVIETAB-WINNER, 50 MOVIETAB-NOTES.
ULINE.
ENDLOOP.
IF SY-SUBRC <> 0.
MESSAGE I005.
ENDIF.
Hope this solves your problem.
Thanks & Regards.
Tarun Gambhir. -
How to put drop down box in selection screen
Hi all,
I have to create a selection screen.
in that i have to use a drop down box for the text box.
how to do that.
thanking u.
with regards,
giri.HI
Check thi ssample code -
REPORT ZTESTPRG.
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.
AT SELECTION-SCREEN OUTPUT.
NAME = 'PS_PARM'.
VALUE-KEY = '1'.
VALUE-TEXT = 'LINE 1'.
APPEND VALUE TO LIST. VALUE-KEY = '2'.
VALUE-TEXT = 'LINE 2'.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
START-OF-SELECTION.
WRITE: / 'PARAMETER:', PS_PARM.
Hope this helps.
OR
You can use the F4 function module or use a List box
see the sample codes
See the following ex:
TYPES: BEGIN OF TY_MBLNR,
MBLNR LIKE MKPF-MBLNR,
END OF TY_MBLNR.
DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.
data: it_ret like ddshretval occurs 0 with header line.
At selection-screen on value-request for s_mat-low.
Select MBLNR from mkpf into table it_mblnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MBLNR'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_MBLNR
FIELD_TAB =
RETURN_TAB = IT_RET
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.
IF SY-SUBRC = 0.
read table it_ret index 1.
move it_ret-fieldval to S_mat-low.
ENDIF.
Go through the test program.
REPORT Ztest_HELP .
TABLES : MARA.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_MATNR(10) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.
DATA : BEGIN OF ITAB OCCURS 0,
MATNR TYPE MATNR,
END OF ITAB.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.
SELECT MATNR
FROM MARA
INTO TABLE ITAB
UP TO 10 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'MATERIAL NUMBER'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_MATNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = ITAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
LIST BOX
Input : p_char = 'J'.
Press: enter
List Box of Month = January, June , July.
REPORT ZLIST_VALUES.
TYPE-POOLS vrm.
tables:
spfli.
parameters: p_char type c.
parameters:
p_month(12) as listbox visible length 20,
p_year as listbox visible length 20 .
DATA:
t_table TYPE STANDARD TABLE OF vrm_value,
t_table1 TYPE STANDARD TABLE OF vrm_value,
vrm_values1 LIKE LINE OF t_table.
DATA:
t_year TYPE STANDARD TABLE OF vrm_value.
data: w_year(4) type n value '2000'.
at selection-screen output.
vrm_values1-key = 'a'.
vrm_values1-text = 'January'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'p'.
vrm_values1-text = 'February'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'q'.
vrm_values1-text = 'March'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'r'.
vrm_values1-text = 'April'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 's'.
vrm_values1-text = 'May'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 't'.
vrm_values1-text = 'June'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'u'.
vrm_values1-text = 'July'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'v'.
vrm_values1-text = 'August'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'w'.
vrm_values1-text = 'September'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'x'.
vrm_values1-text = 'October'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'y'.
vrm_values1-text = 'November'.
APPEND vrm_values1 TO t_table.
vrm_values1-key = 'z'.
vrm_values1-text = 'December'.
APPEND vrm_values1 TO t_table.
t_table1[] = t_table.
delete t_table1 where text+0(1) <> p_char.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'p_month'
values = t_table1
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2.
do 10 times.
add 1 to w_year.
vrm_values1-key = sy-index.
vrm_values1-text = w_year.
APPEND vrm_values1 TO t_year.
enddo.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'p_year'
values = t_year
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2.
start-of-selection.
write: p_month. -
Hi All,
I am facing Problems here ;-
I have developed a table control in WDA4 application i have 3 dropdowns which are dependent on each other i.e. when i select the entry in the first one then corresponding to that entry the data should be shown in next drop down and same goes for the third one .I am using dropdown by index here .
Thnks ,
SahilHello Sahiil,
You need to bind the table to a context node and the three drop downs separately to three context nodes. when you click one one of the drop downs, populate the the other nodes.
I hope this works for you.
Please feel free to ask if you have any further doubts.
Regards,
Ritwik. -
Drop Downs in Table Control in Web dynproABAP
Hi All,
I am facing Problems here ;-
I have developed a table control in WDA4 application i have 3 dropdowns which are dependent on each other i.e. when i select the entry in the first one then corresponding to that entry the data should be shown in next drop down and same goes for the third one .I am using dropdown by index here .
Thnks ,
Sahilhi!
you can bind the texts property of your Dropdownbyindex
to the required attribute.this will populate your data.
thanks
vishal -
How to put drop down menu over iframe?
I created drop down menu in A-Master with height 100 pixels.
On a page which uses A-Master template I've put youtube video, example:
<iframe width="1000" height="500" src="//www.youtube.com/embed/8eDuupJ9Uus" frameborder="0" allowfullscreen></iframe>
and when I export HTML, Iframe video is over dropdown menu so I can't see this menu, iframe is on top of it, how can I place dropdown menu on top of this iframe?
Tried to search whole internet with no good results, I have only found other people has same problem.
...and I have tried this "wmode="transparent" too:
<iframe width="560" height="349"src="http://www.youtube.com/embed/rLVCjnEGrqQ?wmode=transparent"frameborder="0" allowfullscreen wmode="transparent"></iframe>
was no goodYour menu layer should be on top of everything!
Regards,
Frank -
How to get different values in drop down in table rows
Hi
I have an application, which has a drop down in the table. Each row is to have different values in its drop down based on the "characteristic" parameter. For eg. first row has characteristic as color, and the corresponding drop down will contain the color names. Second row has charateristic as weight, and the drop down will carry corresponding weight values.
I am getting the data from the backend as a flat table i.e. charaterisitc - value pair.
I think i will have to use the Drop Down by Index control, but i dont know how exactly to go about it.
Can any one please help in this regard.
Thanks & regards,
AnupreetHi Maksim
I am sorry, but i am not able to get you.
This is the piece of code that i wrote for populating the drop down:
IPrivateMaintainDocAttribView.IDropElement dropEle = null;
for(int i = 0;i<size;i++)
dropEle = wdContext.nodeDrop().createDropElement();
dropEle.setDropval(wdContext.nodeCtxNode_DocAttribs().getCtxNode_DocAttribsElementAt(i).getCmpCtx_Value());
wdContext.nodeDrop().addElement(dropEle);
Here, Dropis the sub node to which i am putting the data and thisis linked to the table.
CtxNode_DocAttribs is the model node from where i am picking the data and setting in the subnode.
Thanks & regards,
Anupreet -
How to put scrol bar in table viw control in module pool programming
how to put scrool bar in table-view control in module pool programming
Hi Rani,
You need not insert Scrollbar in the table control, it appears automcatically once the amount of data vertical or horizontal limit of table control.
Regards,
Sathish
Note : Reward useful Answers -
How to create Drop down menu in the selection screen
Hi all,
How to create Drop down menu in the selection screen.
Fast answer will be highly rewarded
Regards
Bikashi ,
TYPE-POOLS : vrm.
TABLES:vbak,vbap.
DATA : v(80) TYPE c.
DATA: wa_vbak TYPE vbak,
it_vbak TYPE vbak OCCURS 0 WITH HEADER LINE,
wa_vbap TYPE vbap,
it_vbap TYPE vbap OCCURS 0 WITH HEADER LINE.
DATA: l_name TYPE vrm_id,
li_list TYPE vrm_values ,
v_count TYPE i,
l_value LIKE LINE OF li_list.
PARAMETERS: p_test(20) AS LISTBOX VISIBLE LENGTH 60 MODIF ID DAT.
INITIALIZATION.
AT SELECTION-SCREEN OUTPUT.
PERFORM get_data.
LOOP AT it_vbak.
l_value-key = it_vbak-vbeln .
l_value-text = it_vbak-vbeln .
APPEND l_value TO li_list.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_TEST'
values = li_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
AT SELECTION-SCREEN ON P_TEST.
clear : li_list , li_list[].
SELECT vbeln
matnr
meins
FROM vbap
INTO CORRESPONDING FIELDS OF TABLE it_vbap
WHERE vbeln = p_test.
START-OF-SELECTION.
SELECT vbeln
matnr
meins
FROM vbap
INTO CORRESPONDING FIELDS OF TABLE it_vbap
WHERE vbeln = p_test.
LOOP AT it_vbap.
WRITE :/ it_vbap-vbeln, it_vbap-matnr,it_vbap-meins.
ENDLOOP.
*& Form get_Data
text
--> p1 text
<-- p2 text
FORM get_data .
SELECT vbeln
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE it_vbak.
ENDFORM. " get_Data
regards,
venkat. -
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. -
How to add a column in table control
Hi ,
Can any one tell me how to add a column in table control? My requirement is to add two columns ( custom fields ) into table control ( It is a standard program). I have added the column in the table and also in the table control. But when I am running the standard program, The newly added column is not there. But I have added in the perticular screen. Change is not reflected.
Can anyone help me on this please.
Thanks in advance.
Regards,
Lakshmi.Hi,
Ensure the following :
1. After adjusting the database, you`ll have to use the database utility and activate the table.
2. If you have changed the standard screen, in tcode se80 -- right click on the program and click activate all. This activates all objects related to that program.
Now execute the program.
Reward if helpful.
Regards -
How to create vertical Scrollbar in table control?
Dear All,
How to create vertical scrollbar in table controll.?
regards,
DharmeshHi
It should be created automatically, if you can't see it, try to set the field lines of table control
PROCESS PBO
MODULE SET_ATTR_TC.
LOOP AT ITAB WITH .....
ENDLOOP.
MODULE SET_ATTR_TC.
DESCRIBE TABLE ITAB LINES SY-TABIX.
<TABLE CONTROL>-LINES = SY-TABIX.
ENDMODULE.
Max -
How can I work lsmw with table control using mm01 appl?
Hi
How can I work lsmw with table control using mm01 appl?
Is it difefrent the way we handle table control in BDC?
Thank YouHi
How can I work lsmw with table control using mm01 appl?
Is it difefrent the way we handle table control in BDC?
Thank You -
How to get value on the table control in infotyp e0008
Dear Freinds
I have written a user exit ZXPADU02 for my requirement
as per the requirement in i have calculated wa-poo8-bet01 = wa_p0008-ansal/12 and i have passed on to the INNNN structure .
Nowe when do a Create or Copy for a rcord in infotype 0008 iam not
getting value on Q0008-betrg field on the SCREEN , since it is table control how to get data on the table Control Cell .
Please let me knlow
regardsHi Syamala,
The try to find the name of the table control and pass the values to it.
Of course you have to loop and endloop, the table control and mofidy it from the work area.
Message was edited by:
Sera -
How to have push button in Table control
Hi Experts,
I have an internal table which I populate in table control. How can I have pushbutton in table control(in every row). If done how to have funtion code which will trigger PAI.
Thanks and regards.
VenkatHi,
I dont think that pushbuttons will be of much use as when you click a button same code will be executed all time.
So, you can take either selection column in table control (use the SELCOL in the table attributes)
or you can also take a checkbox in table control and then can perform action on lines which were selected by the user.
Hope this helps you out.
Regards,
Tarun
Maybe you are looking for
-
Hi, The version of my NetWeaver Developer Studio is 2.0.9 This Version does not support com.sap.ide.webdynpro.uielementdefinitions.Resource type for Context Attribute.(in which resource is missing) My task is to upload and parse a XML file. How to re
-
Treatement of Fault Messages in Synchronous Scenarios?!
Hi all, I got a question concerning the use of fault messages in synchronous scenarios... 1. When I define a fault message for my synchronous receiver interface, a fault message, coming back would not be handled by my sync. Interface- and
-
How to call Copy.GetItem Method in Excel vba function
Hi, I want to use sharepoint copy services to download/upload or retreive field information of a sharepoint file. For that i want to sharepoint web services. One class among them is copy. I want to call the GetItem method present in that class. Think
-
Just restored my iPad at apple store but iCloud won't restore during setup
Went to Genius Bar last evening with issues on my iPad 2 .. Based on Genius Bar findings I had bad core apps causing restart ... Before restore we verified iCloud restore was all set .. But during the activate process it won't let me restore from bac
-
All users can't access library
I have a Windows XP Home computer with two user accounts: administrator and limited. When I log in to the pc as admin and open iTunes I can see all the songs in the library, yet when I log in to the limited account and open iTunes I see nothing. It's