Table Control Dropdown List Problem
Hi,
I have this problem with my table control.
I now have an input field (with input help) called: Reference Table, as well as a table control.
What i need is to select the table names (select from the Reference table input help) and the field names will be populated inside the table control (according to the field names inside the respective tables) as a dropdown list.
Refer to this diagram if unclear: http://img166.imageshack.us/img166/1066/tablecontrolwt4.png
Please give me sample codes as i really need help.
Will reward marks if useful.
thanks a lot.
Below is my codes:
*& Report ZHERA_TABLE3
REPORT ZHERA_TABLE3_EVONNE.
DATA: P_HERA TYPE DNTAB-TABNAME VALUE 'Z07P4_REF',
ITAB_HERA TYPE TABLE OF Z07P4_REF,
FIELD_COUNT TYPE I,
WA_HERA LIKE LINE OF ITAB_HERA.
SELECT * INTO TABLE ITAB_HERA FROM Z07P4_REF.
START-OF-SELECTION.
CALL SCREEN 3000.
MODULE STATUS_3000 OUTPUT.
SET PF-STATUS 'UI'.
SET TITLEBAR 'TITLE'.
ENDMODULE. "STATUS_8000 OUTPUT
MODULE USER_COMMAND_8000 INPUT
MODULE USER_COMMAND_3000 INPUT.
CASE SY-UCOMM.
WHEN 'BACK' OR 'EXIT'.
LEAVE PROGRAM.
WHEN 'SAVE'.
PERFORM UPDATE_TABLE.
ENDCASE.
ENDMODULE. "USER_COMMAND_8000 INPUT
*&SPWIZARD: DECLARATION OF TABLECONTROL 'ZTABLE' ITSELF
CONTROLS: ZTABLE TYPE TABLEVIEW USING SCREEN 3000.
*&SPWIZARD: LINES OF TABLECONTROL 'ZTABLE'
DATA: G_ZTABLE_LINES LIKE SY-LOOPC.
DATA: OK_CODE LIKE SY-UCOMM.
*&SPWIZARD: OUTPUT MODULE FOR TC 'ZTABLE'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: UPDATE LINES FOR EQUIVALENT SCROLLBAR
MODULE ZTABLE_CHANGE_TC_ATTR OUTPUT.
DESCRIBE TABLE ITAB_HERA LINES ZTABLE-lines.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'ZTABLE'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: GET LINES OF TABLECONTROL
MODULE ZTABLE_GET_LINES OUTPUT.
G_ZTABLE_LINES = SY-LOOPC.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'ZTABLE'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE ZTABLE_MODIFY INPUT.
MODIFY ITAB_HERA
FROM WA_HERA
INDEX ZTABLE-CURRENT_LINE.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'ZTABLE'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: PROCESS USER COMMAND
MODULE ZTABLE_USER_COMMAND INPUT.
OK_CODE = SY-UCOMM.
PERFORM USER_OK_TC USING 'ZTABLE'
'ITAB_HERA'
CHANGING OK_CODE.
SY-UCOMM = OK_CODE.
ENDMODULE.
INCLUDE TABLECONTROL_FORMS *
*& Form USER_OK_TC *
FORM USER_OK_TC USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME
P_MARK_NAME
CHANGING P_OK LIKE SY-UCOMM.
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA: L_OK TYPE SY-UCOMM,
L_OFFSET TYPE I.
&SPWIZARD: END OF LOCAL DATA----
*&SPWIZARD: Table control specific operations *
*&SPWIZARD: evaluate TC name and operations *
SEARCH P_OK FOR P_TC_NAME.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
L_OFFSET = STRLEN( P_TC_NAME ) + 1.
L_OK = P_OK+L_OFFSET.
*&SPWIZARD: execute general and TC specific operations *
CASE L_OK.
WHEN 'INSR'. "insert row
PERFORM FCODE_INSERT_ROW USING P_TC_NAME
P_TABLE_NAME.
CLEAR P_OK.
WHEN 'DELE'. "delete row
PERFORM FCODE_DELETE_ROW USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME.
CLEAR P_OK.
WHEN 'P--' OR "top of list
'P-' OR "previous page
'P+' OR "next page
'P++'. "bottom of list
PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
L_OK.
CLEAR P_OK.
WHEN 'L--'. "total left
PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
WHEN 'L-'. "column left
PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
WHEN 'R+'. "column right
PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
WHEN 'R++'. "total right
PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
WHEN 'MARK'. "mark all filled lines
PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
CLEAR P_OK.
WHEN 'DMRK'. "demark all filled lines
PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
CLEAR P_OK.
WHEN 'SASCEND' OR
'SDESCEND'. "sort column
PERFORM FCODE_SORT_TC USING P_TC_NAME
l_ok.
ENDCASE.
ENDFORM. " USER_OK_TC
*& Form FCODE_INSERT_ROW *
FORM fcode_insert_row
USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_LINES_NAME LIKE FELD-NAME.
DATA L_SELLINE LIKE SY-STEPL.
DATA L_LASTLINE TYPE I.
DATA L_LINE TYPE I.
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE CXTAB_CONTROL.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <LINES> TYPE I.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: 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
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
ASSIGN (L_LINES_NAME) TO <LINES>.
*&SPWIZARD: get current line *
GET CURSOR LINE L_SELLINE.
IF SY-SUBRC <> 0. " append line to table
L_SELLINE = <TC>-LINES + 1.
*&SPWIZARD: set top line *
IF L_SELLINE > <LINES>.
<TC>-TOP_LINE = L_SELLINE - <LINES> + 1 .
ELSE.
<TC>-TOP_LINE = 1.
ENDIF.
ELSE. " insert line into table
L_SELLINE = <TC>-TOP_LINE + L_SELLINE - 1.
L_LASTLINE = <TC>-TOP_LINE + <LINES> - 1.
ENDIF.
*&SPWIZARD: set new cursor line *
L_LINE = L_SELLINE - <TC>-TOP_LINE + 1.
*&SPWIZARD: insert initial line *
INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
<TC>-LINES = <TC>-LINES + 1.
*&SPWIZARD: set cursor *
SET CURSOR LINE L_LINE.
ENDFORM. " FCODE_INSERT_ROW
*& Form FCODE_DELETE_ROW *
FORM fcode_delete_row
USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME
P_MARK_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: 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
*&SPWIZARD: delete marked lines *
DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
IF <MARK_FIELD> = 'X'.
DELETE <TABLE> INDEX SYST-TABIX.
IF SY-SUBRC = 0.
<TC>-LINES = <TC>-LINES - 1.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " FCODE_DELETE_ROW
*& Form COMPUTE_SCROLLING_IN_TC
text
-->P_TC_NAME name of tablecontrol
-->P_OK ok code
FORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
P_OK.
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TC_NEW_TOP_LINE TYPE I.
DATA L_TC_NAME LIKE FELD-NAME.
DATA L_TC_LINES_NAME LIKE FELD-NAME.
DATA L_TC_FIELD_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <LINES> TYPE I.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get looplines of TableControl *
CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
ASSIGN (L_TC_LINES_NAME) TO <LINES>.
*&SPWIZARD: is no line filled? *
IF <TC>-LINES = 0.
*&SPWIZARD: yes, ... *
L_TC_NEW_TOP_LINE = 1.
ELSE.
*&SPWIZARD: no, ... *
CALL FUNCTION 'SCROLLING_IN_TABLE'
EXPORTING
ENTRY_ACT = <TC>-TOP_LINE
ENTRY_FROM = 1
ENTRY_TO = <TC>-LINES
LAST_PAGE_FULL = 'X'
LOOPS = <LINES>
OK_CODE = P_OK
OVERLAPPING = 'X'
IMPORTING
ENTRY_NEW = L_TC_NEW_TOP_LINE
EXCEPTIONS
NO_ENTRY_OR_PAGE_ACT = 01
NO_ENTRY_TO = 02
NO_OK_CODE_OR_PAGE_GO = 03
OTHERS = 0.
ENDIF.
*&SPWIZARD: get actual tc and column *
GET CURSOR FIELD L_TC_FIELD_NAME
AREA L_TC_NAME.
IF SYST-SUBRC = 0.
IF L_TC_NAME = P_TC_NAME.
*&SPWIZARD: et actual column *
SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
ENDIF.
ENDIF.
*&SPWIZARD: set the new top line *
<TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
ENDFORM. " COMPUTE_SCROLLING_IN_TC
*& Form FCODE_TC_MARK_LINES
marks all TableControl lines
-->P_TC_NAME name of tablecontrol
FORM FCODE_TC_MARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME.
&SPWIZARD: EGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: 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
*&SPWIZARD: mark all filled lines *
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
<MARK_FIELD> = 'X'.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
*& Form FCODE_TC_DEMARK_LINES
demarks all TableControl lines
-->P_TC_NAME name of tablecontrol
FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
DATA L_TABLE_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE cxtab_control.
FIELD-SYMBOLS <TABLE> TYPE STANDARD TABLE.
FIELD-SYMBOLS <WA>.
FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: 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
*&SPWIZARD: demark all filled lines *
LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header *
ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
<MARK_FIELD> = SPACE.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
FORM UPDATE_TABLE.
"Update physical database table
UPDATE Z07P4_REF FROM TABLE ITAB_HERA.
ENDFORM. "UPDATE_TABLE
Edited by: Evonne Gow on Jan 4, 2008 2:52 AM
hey gary help me lei...
Edited by: Evonne Gow on Jan 4, 2008 2:55 AM
Similar Messages
-
How to attach value range table to dropdown list box
Hi there,
could u please explain me how to attach a value range table to dropdown list box (i.e I/O box with dropdown attribute as list with key).
if possible please explain me with a sample code.
Thanks in advance.
-Tulasi.hi ...if the associated domain of the field that u are using as i.o field has value range the same will come as drop down list...u u select the list box option and click from dictionary check box on the attributes...
To check if the domain has it or not...go to the domain..click on value range..u can see thr,...if values are not thr u can giv the same...
Or if u are not refering to dictionary type then use fm VRM_SET_VALUes
reward if the abv is helpful.. -
Table Control Text fields problem , help plz
Hello Anand , Rich , John & All
I hav problem with Text 3 fields( type c)(either L or R aligned ) , it is not geting updated , otherwise everything else is perfectly fine(scrolling,sorting etc ....) .
Fields giving problem are
1. Status(20) type c
2. Fdat type date
3. Remark(100) type c
All numerical fields are working fine .
<u><b> My yahoo messenger-id is [email protected]</b></u>
<b>Any light on this will be awarded plz .</b>
FLOW LOGIC
PROCESS BEFORE OUTPUT.
MODULE SET_STATUS.
LOOP AT ITAB
WITH CONTROL TCL1
CURSOR TCL1-CURRENT_LINE .
MODULE SET_LINE_COUNT .
ENDLOOP.
PROCESS AFTER INPUT.
MODULE UPD_OK_COD.
MODULE EXIT_COMAND AT EXIT-COMMAND.
MODULE SCROLL_SORT.
LOOP AT ITAB.
MODULE UPDATE_ITAB.
ENDLOOP.
MODULE UPDATE_TABLE.
REPORT ZSD_REP_ORDER_BANK_CHANGE NO STANDARD PAGE HEADING LINE-SIZE 255.
TABLES: VBAK,VBAP,VBRK,ZSD_TABL_ORDBANK,MARA,KONV.
CONTROLS: TCL1 TYPE TABLEVIEW USING SCREEN 0200.
DATA: ITAB LIKE ZSD_TABL_ORDBANK OCCURS 0 WITH HEADER LINE,
WA_ITAB LIKE ZSD_TABL_ORDBANK,
OK_CODE LIKE SY-UCOMM,
SAVE_OK_CODE LIKE SY-UCOMM,
UPD_OK_CODE LIKE SY-UCOMM,
ANSWER TYPE C,
I LIKE SY-LOOPC ,
J LIKE SY-LOOPC,
V_LINES LIKE SY-LOOPC,
LINE_COUNT LIKE SY-LOOPC,
STS TYPE N,
EMGRP LIKE MARA-EXTWG,
QTY LIKE ZSD_TABL_ORDBANK-QTY,
UPRICE LIKE ZSD_TABL_ORDBANK-UPRICE,
TOT LIKE ZSD_TABL_ORDBANK-TOT,
INO LIKE VBAP-POSNR,
COL TYPE CXTAB_COLUMN,
COPIED_ONCE ,
FLDNAME(100),HELP(100).
FIELD-SYMBOLS:
<FS_ITAB> LIKE LINE OF ITAB,
<FS_TCL1> LIKE LINE OF TCL1-COLS.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECT-OPTIONS: S_CCODE FOR ZSD_TABL_ORDBANK-CCODE
NO INTERVALS NO-EXTENSION OBLIGATORY,
S_SORG FOR ZSD_TABL_ORDBANK-SORG
NO INTERVALS NO-EXTENSION OBLIGATORY,
S_DCHAN FOR ZSD_TABL_ORDBANK-DISTCHAN,
S_DIV FOR ZSD_TABL_ORDBANK-DIV,
S_MATNO FOR ZSD_TABL_ORDBANK-MATNO,
S_CUSTNO FOR ZSD_TABL_ORDBANK-CUSTNO ,
S_QTNO FOR ZSD_TABL_ORDBANK-QTNO,
S_QTDAT FOR ZSD_TABL_ORDBANK-QTDAT,
S_QTVDAT FOR ZSD_TABL_ORDBANK-QTVALDAT,
S_SONO FOR ZSD_TABL_ORDBANK-SONO.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
SELECT * FROM ZSD_TABL_ORDBANK
INTO TABLE ITAB
WHERE CCODE IN S_CCODE
AND SORG IN S_SORG
AND DISTCHAN IN S_DCHAN
AND DIV IN S_DIV
AND MATNO IN S_MATNO
AND CUSTNO IN S_CUSTNO
AND QTNO IN S_QTNO
AND QTDAT IN S_QTDAT
AND QTVALDAT IN S_QTVDAT
AND SONO IN S_SONO .
IF SY-SUBRC EQ 0.
REFRESH ITAB.
CLEAR COPIED_ONCE.
CALL SCREEN 0200.
ELSE.
MESSAGE E012(ZQOTBANK) .
ENDIF.
*& Module SET_STATUS OUTPUT
* text
MODULE SET_STATUS OUTPUT.
SET PF-STATUS '0200'.
SET TITLEBAR '0200'.
IF COPIED_ONCE IS INITIAL.
SELECT * FROM ZSD_TABL_ORDBANK
INTO TABLE ITAB
WHERE CCODE IN S_CCODE
AND SORG IN S_SORG
AND DISTCHAN IN S_DCHAN
AND DIV IN S_DIV
AND MATNO IN S_MATNO
AND CUSTNO IN S_CUSTNO
AND QTNO IN S_QTNO
AND QTDAT IN S_QTDAT
AND QTVALDAT IN S_QTVDAT
AND SONO IN S_SONO .
IF SY-SUBRC EQ 0.
DESCRIBE TABLE ITAB LINES V_LINES.
TCL1-LINES = V_LINES.
ENDIF.
COPIED_ONCE = 'X'.
REFRESH CONTROL 'TCL1' FROM SCREEN '0200'.
ENDIF.
LOOP AT ITAB.
QTY = ITAB-QTY.
UPRICE = ITAB-UPRICE.
TOT = QTY * UPRICE .
ITAB-TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-CGL_QTY.
UPRICE = ITAB-CGL_UPRICE.
TOT = QTY * UPRICE .
ITAB-CGL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-BHEL_QTY.
UPRICE = ITAB-BHEL_UPRICE.
TOT = QTY * UPRICE .
ITAB-BHEL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-ALSTOM_QTY.
UPRICE = ITAB-ALSTOM_UPRICE.
TOT = QTY * UPRICE .
ITAB-ALSTOM_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-SIEMENS_QTY.
UPRICE = ITAB-SIEMENS_UPRICE.
TOT = QTY * UPRICE .
ITAB-SIEMENS_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-TELK_QTY.
UPRICE = ITAB-TELK_UPRICE.
TOT = QTY * UPRICE .
ITAB-TELK_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ITAB-OTH_QTY.
UPRICE = ITAB-OTH_UPRICE.
TOT = QTY * UPRICE .
ITAB-OTH_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
MODIFY ITAB.
ENDLOOP.
ENDMODULE. " SET_STATUS OUTPUT
*& Module SET_LINE_COUNT INPUT
* text
MODULE SET_LINE_COUNT OUTPUT.
LINE_COUNT = SY-LOOPC.
ENDMODULE. " SET_LINE_COUNT INPUT
*& Module UPD_OK_CODE INPUT
* text
MODULE UPD_OK_COD INPUT.
IF OK_CODE = 'SAVE'.
UPD_OK_CODE = OK_CODE.
* CLEAR OK_CODE.
ENDIF.
ENDMODULE. " UPD_OK_CODE INPUT
*& Module EXIT_COMAND INPUT
* text
MODULE EXIT_COMAND INPUT.
SAVE_OK_CODE = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK_CODE.
WHEN 'BACK'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Order Bank Entry'
TEXT_QUESTION = 'Do you want to Go BacK ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE TO SCREEN 0.
ELSE.
ENDIF.
WHEN '%EX'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Order Bank Entry'
TEXT_QUESTION = 'Do you want to Exit ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE TO SCREEN 0.
ELSE.
ENDIF.
ENDCASE.
ENDMODULE. " EXIT_COMAND INPUT
*& Module UPDATE_MOD INPUT
* text
MODULE UPDATE_ITAB INPUT.
MODIFY TABLE ITAB FROM ITAB.
ENDMODULE. " UPDATE_MOD INPUT
*& Module SCROLL INPUT
* text
MODULE SCROLL_SORT INPUT.
SAVE_OK_CODE = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK_CODE.
WHEN 'P--'.
TCL1-TOP_LINE = 1.
WHEN 'P-'.
TCL1-TOP_LINE = TCL1-TOP_LINE - LINE_COUNT.
IF TCL1-TOP_LINE LE 0.
TCL1-TOP_LINE = 1.
ENDIF.
WHEN 'P+'.
I = TCL1-TOP_LINE + LINE_COUNT.
J = TCL1-LINES - LINE_COUNT + 1.
IF J LE 0.
J = 1.
ENDIF.
IF I LE J.
TCL1-TOP_LINE = I.
ELSE.
TCL1-TOP_LINE = J.
ENDIF.
WHEN 'P++'.
TCL1-TOP_LINE = TCL1-LINES - LINE_COUNT + 1.
IF TCL1-TOP_LINE LE 0.
TCL1-TOP_LINE = 1.
ENDIF.
WHEN 'SORTUP'.
READ TABLE TCL1-COLS ASSIGNING <FS_TCL1> WITH KEY SELECTED = 'X'.
IF SY-SUBRC = 0.
SPLIT <FS_TCL1>-SCREEN-NAME AT '-' INTO HELP FLDNAME.
SORT ITAB ASCENDING BY (FLDNAME).
ENDIF.
WHEN 'SORTDN'.
READ TABLE TCL1-COLS ASSIGNING <FS_TCL1> WITH KEY SELECTED = 'X'.
IF SY-SUBRC = 0.
SPLIT <FS_TCL1>-SCREEN-NAME AT '-' INTO HELP FLDNAME.
SORT ITAB DESCENDING BY (FLDNAME).
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND INPUT
*& Module TABL_UPD INPUT
* text
MODULE UPDATE_TABLE INPUT.
CASE UPD_OK_CODE.
WHEN 'SAVE'.
UPDATE ZSD_TABL_ORDBANK FROM TABLE ITAB .
IF SY-SUBRC EQ 0.
MESSAGE I002(ZQOTBANK) .
CLEAR UPD_OK_CODE.
ELSE.
MESSAGE E003(ZQOTBANK) .
ENDIF.
ENDCASE.
ENDMODULE. " TABL_UPD INPUT
Thnx
moni<b></b><b></b>
Message was edited by: md monirujjaman
Message was edited by: md monirujjamanHi Moni,
The problem as I had replied in your earlier post is with the MODIFY statement.
MODIFY TABLE ITAB FROM ITAB. This statement will do the modifications based on the table key. When you have character fields as editable, then some problems are to be anticipated. In such a scenario, you must update the internal table based on the <i>index</i>, rather than based on <i>key</i>.
So consider using
MODIFY ITAB FROM ITAB INDEX TCL-CURRENT_LINE.
Where TCL is the name of the Table Control. Also observe the difference in syntax here, don't use the TABLE keyword for the MODIFY statement.
Please try it out and let me know.
Regards,
Anand Mandalika. -
New insight into my dropdown list problems: loss of session info
I tried again, this time with NetBeans 5.5.1 (with Tomcat 5.5.17) and stepped through my code; code executed as a result of selecting an item in the second, misbehaving dropdown box.
I have this function:
public void prerender() {
SessionBean1 sb = this.getSessionBean1();
sb.setPortfolio_id(0);
this.getDropDown2().setSelected(ddsi);
}This uses a private data member:
Object ddsi = null;
And here is my value changed event handler for this combobox:
public void dropDown2_processValueChange(ValueChangeEvent event) {
SessionBean1 sb = this.getSessionBean1();
String sp_id = (String) this.getDropDown2().getValue();
ddsi = event.getNewValue();
String desc = (String) ddsi;
Long Ldesc = new Long(desc);
long p_id = Ldesc.longValue();
sb.setPortfolio_id(p_id);
this.getFacesContext().getCurrentInstance().renderResponse();
}As you can see, I am trying to ensure that the value selected is preserved and used the next time the item is rendered.
sb.setPortfolio_id(p_id); is a trivial setter function (taking a long argument) for the property portfolio_id.
When I step through this code, at every step along the way, I see the correct value for p_id! The correct value is passed to the session bean! And I even see the correct value in ddsi when the function "prerender" is executed. However, it seems that this information is lost when the page is actually rendered.
And, when the servlet that produces the image that is to be displayed on the page checks the session bean, the session bean has the default value (0) for the portfolio_id property rather than the the value (30) that had been passed to the session bean.
It is as if the session information has been lost, or a new session bean is provided each time the page is rendered.
The only additional clue is this (found in Tomcat's output);
com.sun.rave.web.ui.component.DropDown::The current value of component form1:dropDown2 does not match any of the selections.
Did you forget to reset the value after changing the options?
Why is this happening? I know full well that at the time the value in dropdown2 is changed, the value in dropdown1 has not, and therefore the value passed to dropDown2 IS in the list of selections. But, when the value in dropDown1 is changed, the list of options in dropDown2 is changed. I wonder if the valueChanged event handler for dropdown1 is being executed every time the page is rendered, forcing dropDown2 to "forget" what was selected, and somehow losing the session info at the same time?????????
Any ideas?
Thanks
TedUpgrading to itunes 7.0 just cost me 2 days of messing around and in the end I had to revert back to v6.0 and resore my lib.
Apple CS was good but did not belly up the fact that 7.0 is defective in some cases and in the end told me I had a hardware problem!
The main issue is that I could not get itunes 7.0 to see my ipod (very infrequently after a hard boot I would see it but would not be able to upload anything). Worked(s) 100% with v 6.0.
This is very defintey 1/2 baked following in the steps of the other well known producers of sw that is not always functional/buggy the first time around.
My computer is a x40 IBM laptop with xp sp2. Will have to wait a few more weeks to see how this pans out.
IBM X40 Windows XP -
DropDown List Problem for Dynamic Store Proc Parameter in SAP B1 8.8
I am working with the crystal report 2008 in SAP B1 8.8 and the report is used the Store Proc for retrieving data. As i need to show a list of Documnet No (DOCNUM) from Sales Order (ORDR) and Purchase Order (OPOR) for the users to select, i use the Dynamic Parameter as for the Store Proc parameter (@Contno), However, the drop down list can be shown fine in Crystal Report, but cant be shown in "Report Selection Criteria" while opening the Crystal Report through SAP B1.
Therefore, can anyone tell me how to add the dynamic drop down list (cause the documnet no list will be changed very frequently) in the SAP B1 8.8 "Report Selection Criteria" screen.
Thanks!!Classic Crystal Reports and Classic SAP connectivity questions
Classic Crystal Reports and Classic SAP connectivity questions -
Dropdown list in table control
Hi,
how do i create dropdown list in table control with reference to the database table field names? (dropdown list will be populated with the particular table field names upon selecting the input help value from an input box).
please provide sample codes.
thanks.
will reward marks if useful.ok i have checked that for the past few days but its not what i want.
i am using wizard to do this and i need to populate the database table records (individual field names) and display in the table control dropdown list.
what the demo shows is only how to display a dropdown list with reference to the table names. -
Dropdown List in table - multicolumn foreign key
Hello,
Steve Muench has a nice screencast how to create a dropdown list in an editable adf table.
Is there a way how to update this example to work with multicolumn foreign key between edited table and lookup table?
Let's say lookup table has Code, Line attributes as primary key and edited table has foreign key attributes MasterCode and MasterLine. How populate the FK attributes by dropdown list?
For editable table it's probably not possible directly from dropdown list. I tried to find a solution but I had problem to identify which lookup row was selected.
Radook i have checked that for the past few days but its not what i want.
i am using wizard to do this and i need to populate the database table records (individual field names) and display in the table control dropdown list.
what the demo shows is only how to display a dropdown list with reference to the table names. -
Problem when creating list box in table control
Hi every body ,
I am placing a list box in table control , the list box is coming perfectly but
when I am scrolling or pressing enter the data in that field is clearing.
if I remove the list box , and i enter the data directly and scrolling or press enter
the data is not clearing.
But only for list box only it is be having like that
what is the problem?
the code is as follows
*{ INSERT DEVK935807 1
*& Module glaccuontlist INPUT
text
module glaccuontlist input.
type-pools vrm.
tables: zglaccount.
data:
name type vrm_id,
list type vrm_values,
value like line of list.
clear:value.
refresh: list.
name = 'ACGL_ITEM-HKONT'.
select * from zglaccount.
value-key = sy-dbcnt.
value-text = zglaccount-hkont.
append value to list.
clear value.
endselect.
call function 'VRM_SET_VALUES'
exporting
id = name
values = list
EXCEPTIONS
ID_ILLEGAL_NAME = 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.
endmodule. " glaccuontlist INPUT
*} INSERT
thanks in advance.\
srinivas.Hi srinivasa,
try it.
select * from zglaccount.
<b>value-key = zglaccount-hkont.</b>
value-text = zglaccount-hkont.
append value to list.
clear value.
endselect.
Regards
Allan Cristian -
Values from check table to Dropdown
Hi Experts,
I have a requirement like, i want to show the values from a check table in dropdown list. i have two transparent table of which i made a foreign key relation with the second one with some value restrictions. That all working fine.
I tried creating an input box with reference to the field in the first table.then the search help is comming correctly with the valus from check table. But when i tried to attach the same to dropdown its not displaying the value.
please suggest a solution to display the values in drop down.
Regards
Sarath
Message was edited by:
sarath satheesanhi sarath.........
consider you want to have some 10 purchase order numbers in your drop down.
you will be assigning a node to your drop down.
in its supply function, write the codings to fill your node by using a select query.
just like filling a table.
in this case, your drop down gets filled automatically.
--regards,
alex b justin -
Is it possible to enter our own value in dropdown list box in Module Pool. How?
Dear Experts,
Being new to ABAP, I am trying my hands on Dropdownlist box on Module Pool.
I want to pull data from Ztable(Custom Table) into Dropdown list box on Screen in Module pool and be able to edit it, delete it and enter new data through it, thus thereby able to manage the Ztable. Is it possible in dropdown.
Looking forward for experts advice.
Regards
DeepikaDear Kannan,
Thanks. But why sud I write an event in Table maintenance generator. My code is in Module Pool and it has no connection with Table Msintenance.
The I/O field Drop down list box is on the Screen in my Module Pool. I am able to pull data in it from Ztable but now I want to edit this pulled data and also want to enter new data in this dropdown list box.
Regards
Deepika -
Error when displaying - on table control
hy guys,
im working with a table control..
the problem is when the table control loads a -200 or any number with - .
ERROR
DYNPRO_FIELD_CONVERSION
I already tried to change the format of the table field to currency, dec, char and numc
currency the error is displayed.
dec the error is displayed
char the column is displayed empty
numc the table is displayed but the - is not displayed in the field.
any ideas?
Edited by: javier santana on Sep 7, 2008 7:26 PMHi,
The problem mayb with the -ve value display, keep the format to currency and double click on the field in table control, u wil find a option to display -ve values select that
If -ve value is ur prob then this should work -
Sample pgm for moving data from table control to internal table
Hi Experts,
I am newbi to ABAP. I don't have good material for Table control . Appreciate if you direct me to some good source of knowledge on Table control.
The problem at hand : I am trying to move info/data from table control (in screen painter/ input and output mode ) to ITAB but couldn't . Sample pgm if possible.
<b>Modify ITAB index TC-Current_Line .</b>
The above statement is not inserting new lines to ITAB . Help me!
Thanks for your timehi,
do like this...
<b>PROCESS AFTER INPUT.</b>
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TAB1'
LOOP AT itab_det.
CHAIN.
FIELD itab_det-comp_code.
FIELD itab_det-bill_no.
FIELD itab_det-bill_date.
FIELD itab_det-vend_cust_code.
FIELD itab_det-bill_amt.
MODULE <b>tab1_modify</b> ON CHAIN-REQUEST.
ENDCHAIN.
FIELD itab_det-mark
MODULE tab1_mark ON REQUEST.
ENDLOOP.
<b>MODULE tab1_modify INPUT.</b>
APPEND itab_det.
<b>ENDMODULE. "TAB1_MODIFY INPUT</b> -
Dynamic tabstrips and table control in custom infotype
Dear Experts,
I have a requirement to create a custom infotype using tabstrips and table control. The tabstripes should also be dynamically populated. For example we have infty 8(Basic pay) used table control and 24(Qualifications) for tabstripes.
Could you please tell me how to do this. Please do the needful ASAP.
Thanks,
Chaitanya.
Moderator message - Please don't just post your requirements and ask the forum to do your work for you...especially ASAP - Thread locked
Edited by: Rob Burbank on Oct 7, 2009 4:16 PMHi Partha,
Pls check the threads:
Best way to store a table control into an infotype
Re: Custom Infotype with table control - Overview/List Screen
Dilek -
Hello All,
I have subscreen in which i created a table control.
The problem is when i have a tbale control on subscreen the program dumps but where as when i have one field in sub screen the program doesn't dump.
Could any please help me to solve the problem.
Regards,
LisaHi
You have a field on the sub screen and keep it hidden or invisible.
This will let you work with table control.
Regards,
Venkat -
How to handle scroll bar in table control in bdc
hi friends,
how to handle scroll bar coding in table control in bdc
Thanks & Regards,
Srinadh Dhi,
check the sites :
table control scrolling:
Scrolling in table control
Re: scrolling in table control
Table control - Vertical scrolling problem
table control scrolling problem
Maybe you are looking for
-
Ipod Formatted to Windows but I want to use Mac!
I know you should be able to use an ipod formatted to windows on a Mac, but I can't. I have itunes 7 and it won't let me put music on my ipod says software is too old. I've been trying to update the software but everything says you can't unless you h
-
Dealing with special characters in PHP part deux
Something else is confusing me about special characters. I am doing some troubleshooting/maintenaince on my files. On one files I have my navigation bar on a separte file and use the include function to use it. For the other file, I took the includ
-
Ran Bootcamp / installed WinXP SP2 / Have some questions
I bought an iMAC for the stability and security of it. I, however use Embroidery and Quilting software that will run on WINDOWS only. So, I had to run bootcamp or lose the use of over $5,000 in software! Anyway... there are times I will need to updat
-
Acrobat-related error message in Word when moving around the ribbon
Win 7 x64 Acrobat X, all latest updates installed Word 2010 Acrobat/Word add-in is installed Recently, started getting the error Custom UI Runtime Error in Acrobat PDFMaker Office COM Addin/an error occurred while calling the callback "GetImage" Erro
-
ADF Drag and drop event inside the single af:treetable
Hi Experts, I have a af:treeTable in my ADF web project and i would like to implement the drag and drop event to the same tree table for supporting my sample test project use case. Currently i am facing some issue to get the source tree node and the