Table control...? its urgent
Hi friends,
Can anyone gve me example table control program..
My requirement is I have to display blank table control.....but when user enetrs value.. and submits it should be added to the inetrnal table in my program please help......
Also if he wants to see the records in table control..which he enetered earlier the table should be displayed as populated..
Please help its urgent....points will be rewarded....
Seet he following ex:
Created table control using wizard.
*& Module pool ZTEST_TBLCTRL
PROGRAM ZTEST_TBLCTRL.
***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'TC1'
*&SPWIZARD: DEFINITION OF DDIC-TABLE
TABLES: ZFG_SRNO, ZFIH0004.
*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TC1'
*TYPES: BEGIN OF T_TC1,
ZSRNO LIKE ZFG_SRNO-ZSRNO,
SCRNAME LIKE ZFIH0004-SCRNAME,
END OF T_TC1.
*TYPES: BEGIN OF T_TC1.
STRUCTURE ZFG_SRNO.
END OF T_TC1.
*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TC1'
*DATA: G_TC1_ITAB TYPE T_TC1 OCCURS 0 WITH HEADER LINE,
G_TC1_WA TYPE T_TC1. "work area
DATA: G_TC1_ITAB LIKE ZFG_SRNO OCCURS 0 WITH HEADER LINE,
G_TC1_WA LIKE G_TC1_ITAB. "work area
DATA: G_TC1_COPIED. "copy flag
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TC1' ITSELF
CONTROLS: TC1 TYPE TABLEVIEW USING SCREEN 0100.
*&SPWIZARD: LINES OF TABLECONTROL 'TC1'
DATA: G_TC1_LINES LIKE SY-LOOPC.
DATA: OK_CODE LIKE SY-UCOMM,
S_CODE LIKE SY-UCOMM,
MARK.
DATA: T1(10).
*&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: COPY DDIC-TABLE TO ITAB
MODULE TC1_INIT OUTPUT.
IF G_TC1_COPIED IS INITIAL.
*&SPWIZARD: COPY DDIC-TABLE 'ZFG_SRNO'
*&SPWIZARD: INTO INTERNAL TABLE 'g_TC1_itab'
SELECT * FROM ZFG_SRNO
INTO CORRESPONDING FIELDS
OF TABLE G_TC1_ITAB.
G_TC1_COPIED = 'X'.
REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
IF T1 <> SPACE.
G_TC1_ITAB-ZSRNO = T1.
CLEAR T1.
APPEND G_TC1_ITAB.
REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
ENDIF.
*TC1-TOP_LINE = 1.
ENDIF.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MOVE ITAB TO DYNPRO
MODULE TC1_MOVE OUTPUT.
MOVE-CORRESPONDING G_TC1_WA TO ZFG_SRNO.
if sy-subrc ne 0.
*append G_TC1_WA to G_TC1_ITAB.
*endif.
READ TABLE G_TC1_ITAB INDEX TC1-CURRENT_LINE.
IF SY-SUBRC = 0.
G_TC1_WA-ZSRNO = G_TC1_ITAB-ZSRNO.
ENDIF.
MOVE-CORRESPONDING G_TC1_ITAB TO ZFG_SRNO.
REFRESH CONTROL 'TC1' FROM SCREEN '8001'.
tc1-lines = G_TC1_LINES + 100.
ENDMODULE.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: GET LINES OF TABLECONTROL
MODULE TC1_GET_LINES OUTPUT.
G_TC1_LINES = SY-LOOPC.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE TC1_MODIFY INPUT.
*break-point.
MOVE-CORRESPONDING ZFG_SRNO TO G_TC1_ITAB.
MODIFY G_TC1_ITAB INDEX TC1-CURRENT_LINE.
G_TC1_COPIED = 'X'.
REFRESH CONTROL 'TC1' FROM SCREEN '8001'.
MOVE-CORRESPONDING ZFG_SRNO TO G_TC1_WA.
MODIFY G_TC1_ITAB
FROM G_TC1_WA
INDEX TC1-CURRENT_LINE.
G_TC1_COPIED = 'X'.
if sy-subrc ne 0.
append G_TC1_WA to G_TC1_ITAB.
endif.
*modify G_TC1_ITAB INDEX TC1-CURRENT_LINE.
ENDMODULE.
*&SPWIZARD: INPUT MODULE FOR TC 'TC1'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: PROCESS USER COMMAND
MODULE TC1_USER_COMMAND INPUT.
OK_CODE = SY-UCOMM.
PERFORM USER_OK_TC USING 'TC1'
'G_TC1_ITAB'
'FLAG'
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
*& Module D20XX_INIT OUTPUT
text
MODULE D20XX_INIT OUTPUT.
*if screen-name = 'ZSRNO'.
SCREEN-INPUT = 0.
SCREEN-COLOR = 0.
MODIFY SCREEN.
endif.
ENDMODULE. " D20XX_INIT OUTPUT
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
*CLEAR R1_REF.
DO 30 TIMES.
APPEND G_TC1_ITAB.
ENDDO.
DESCRIBE TABLE G_TC1_ITAB LINES TC1-LINES.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module TAB1_INIT OUTPUT
text
MODULE TAB1_INIT OUTPUT.
ENDMODULE. " TAB1_INIT OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module MESSAGE INPUT
text
MODULE MESSAGE INPUT.
OK_CODE = SY-UCOMM.
S_CODE = OK_CODE.
CLEAR OK_CODE.
if S_CODE = 'DELE'.
loop at G_TC1_ITAB.
if G_TC1_ITAB-scrname = 'X'.
delete g_tc1_itab.
endif.
endloop.
ELSEIF S_CODE = 'SAVE'.
G_TC1_WA-ZSRNO = T1.
MOVE-CORRESPONDING G_TC1_WA TO ZFG_SRNO.
REFRESH CONTROL 'TC1' FROM SCREEN '0100'.
ENDIF.
ENDMODULE. " MESSAGE INPUT
*& Module DELETE_RECORD INPUT
text
MODULE DELETE_RECORD INPUT.
IF MARK = 'X' AND S_CODE = 'DELE'.
DELETE TABLE G_TC1_ITAB FROM ZFG_SRNO.
DESCRIBE TABLE G_TC1_ITAB LINES TC1-LINES.
ENDIF.
ENDMODULE. " DELETE_RECORD INPUT
*********************Screen modules*********************
PROCESS BEFORE OUTPUT.
*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TC1'
MODULE TC1_INIT.
*&SPWIZARD: MODULE TC1_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TC1_CHANGE_COL_ATTR.
LOOP AT G_TC1_ITAB
INTO G_TC1_WA
WITH CONTROL TC1
CURSOR TC1-CURRENT_LINE.
*&SPWIZARD: MODULE TC1_CHANGE_FIELD_ATTR
MODULE TC1_MOVE.
MODULE TAB1_INIT.
MODULE TC1_GET_LINES.
ENDLOOP.
MODULE D20XX_INIT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TC1'
*BREAK POINT.
LOOP AT G_TC1_ITAB.
CHAIN.
FIELD ZFG_SRNO-ZSRNO.
MODULE TC1_MODIFY ON CHAIN-REQUEST.
MODULE TC1_MODIFY.
ENDCHAIN.
MODULE MESSAGE .
MODULE DELETE_RECORD.
ENDLOOP.
MODULE TC1_USER_COMMAND.
*&SPWIZARD: MODULE TC1_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TC1_CHANGE_COL_ATTR.
MODULE USER_COMMAND_0100.
Similar Messages
-
F4 help in table control. - Urgent Please
Hi all,
Iam using F4 help in table control. when the user selects the data in F4 values 4 more fields that are displayed in the F4 has to be updated in the table control
What function modules should I use to capture the f4 values and keep in the current table control record. Please help by sending some code.
Helpful answers will be rewarded.
Thankhs
AdityaHi ,
Check out the follwing Eg.
To read the remaining fields in the corresponding row use <b>dynpfld_mapping</b> parameters in Table option of F4 help Function Module.And then use <b>DYNP_VALUES_UPDATE </b> FM to populate into the screen fields.
MODULE shlpcntno INPUT.
DATA : BEGIN OF i_cntno OCCURS 0,
contnum LIKE zmps_veh_entry-contnum,
contsl LIKE zmps_veh_entry-contsl,
END OF i_cntno.
CLEAR: i_cntno,i_cntno[],i_return,i_return[],i_map,i_map[].
SELECT contnum contsl FROM zmps_veh_entry INTO TABLE i_cntno.
i_map-fldname = 'F0001'.
i_map-dyfldname = 'I_CNTNO-CONTNUM'.
APPEND i_map.
CLEAR i_map.
i_map-fldname = 'F0002'.
i_map-dyfldname = 'I_CNTNO-CONSTL'.
APPEND i_map.
CLEAR i_map.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CONTNUM'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'W_CONTNUM'
value_org = 'S'
TABLES
value_tab = i_cntno
dynpfld_mapping = i_map
return_tab = i_return.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT i_return.
IF i_return-fieldname = 'F0001'.
w_contnum = i_return-fieldval.
ELSEIF i_return-fieldname = 'F0002' AND flag = 3.
w_slno = i_return-fieldval.
CLEAR: i_dynread, i_dynread[].
i_dynread-fieldname = 'W_SLNO'.
i_dynread-fieldvalue = w_slno.
APPEND i_dynread.
CLEAR i_dynread.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = i_dynread
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDLOOP.
ENDMODULE. -
Problem in displaying o/p in Table Control
Hi ,
while displaying in table control.
its is displaying line twice.
I have some contains in iti itab.
which i am displaying itf itab through table control..
i have coded like this...
PROCESS BEFORE OUTPUT.
MODULE STATUS_0112.
LOOP at itf WITH CONTROL TC CURSOR tc-current_line.
MODULE FILL_TABLE_CONTROL.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
LOOP at itf.
module read_table_INPUT.
ENDLOOP.
MODULE USER_COMMAND_0112.
*& Module STATUS_0112 OUTPUT
text
MODULE STATUS_0112 OUTPUT.
SET PF-STATUS 'ZTC'.
SET TITLEBAR 'xxx'.
DESCRIBE TABLE iti LINES tc-lines.
ENDMODULE. " STATUS_0112 OUTPUT
MODULE fill_table_control OUTPUT
MODULE fill_table_control OUTPUT.
loop at iti .
READ TABLE itf with key ingr_code = iti-ingr_code
ingr_desc = iti-ingr_desc.
MOVE iti-INGR_CODE TO ITF-INGR_CODE.
MOVE iti-INGR_DESC TO ITF-INGR_DESC.
MOVE iti-CONC TO ITF-CONC.
MOVE iti-QUANTITY TO ITF-QUANTITY.
MOVE iti-UOM TO ITF-UOM.
append ITF ."index tc-current_line.
endloop.
ENDMODULE. "fill_table_control OUTPUT
can any one help meloop at iti .
READ TABLE itf with key ingr_code = iti-ingr_code
ingr_desc = iti-ingr_desc.
MOVE iti-INGR_CODE TO ITF-INGR_CODE.
MOVE iti-INGR_DESC TO ITF-INGR_DESC.
MOVE iti-CONC TO ITF-CONC.
MOVE iti-QUANTITY TO ITF-QUANTITY.
MOVE iti-UOM TO ITF-UOM.
append ITF ."index tc-current_line.
endloop
You dont need to append the data , you have to Modify the data.
Problem is with the above code.
Correct to this...
MODULE fill_table_control OUTPUT.
READ TABLE itf index tc-current_line.
MOVE iti-INGR_CODE TO ITF-INGR_CODE.
MOVE iti-INGR_DESC TO ITF-INGR_DESC.
MOVE iti-CONC TO ITF-CONC.
MOVE iti-QUANTITY TO ITF-QUANTITY.
MOVE iti-UOM TO ITF-UOM.
endloop.
ENDMODULE. "fill_table_control OUTPUT
Regards
Vijay Babu Dudla -
How to display icon status in table control
hi, i trying to display icon in table control its not displaying
i given below statment.
DATA: BEGIN OF WA_MARA,
ICON1(4) TYPE C,
END OF WA_MARA.
INCLUDE <list>.
MOVE ICON_GREEN_LIGHT TO IT_MARA-ICON1.
APPEND IT_MARA..
when i debugging it display green icon but after run the program its display ' @08@ ' in table control.
how to display green icon in table control help me.Hi,
check the link:
Table control in custom infotypes -
Table control layout column positions are different with dislay positions
Hello All,
I added one column to standard table control at the 13th position,but at the display of that table control its showing at
96th position.please suggest me how to set that to 13th position at dislay.
Thanks in advanceHi,
You can do this using a single table control.
There is a option in the screen parameters to hide the column of the table control.
So based on the list value, you loop at screen containing the table control, and set the option to make the column invisible.. Try this.
Hope it helps..
Regards,
Sekar -
How to determine actual table control line
Hi experts,
How can I determine the table control line in case of scrollable table control.
I tried this one, but did not worked correctly:
GET CURSOR LINE l_line_fc2.
l_line = l_line_fc2 + ctrl_mod-top_line - 1.
Everytime I try to catch the top_line of the table control its value is always 1. Is it possible?Hi,
Current table control line will be found in SY-STEPL.
Regards
Mohammad Shaik. -
Hi All, How we can handle a table control in bdc - in detail its urgent pls
Hi All, How we can handle a table control in bdc - in detail its urgent. Please send me the explanation in detail.
Thanks®ards.
Bharathi,
Create Table Control
Step 1 (Create new structure for table control)
Type is name of structure (ZTC_EKKO) and press create
Step 2 (Create Program)
Goto transaction SE80(Object Navigator) -> Repository Browser -> Program.
Enter your program name, please ensure that is begins with SAPMZ as this is a module pool (dialog program).
Press enter to create, and press yes!
Ensure that you create a top include, and press Enter.
Accept the name created for the top include.
Press Enter.
Press Save
Step 3 (Create TOP include)
Double click on the top include and enter following ABAP code:
Tables: ZTC_EKKO.
controls: tc100 type tableview using screen 100.
data: ok_code type sy-ucomm.
data: it_ekko type standard
table of ZTC_EKKO initial size 0,
wa_ekko type ZTC_EKKO.
data: ok_code type sy-ucomm.
Press Save and Activate
Step 4 (Create screen)
Right click the program to create a screen 100 for the dialog. Enter Short description, set screen type to Normal and enter 0 or blank into Next screen. Then move to Element List tab and enter the OK code as OK_CODE (i.e. the same as what you declared in the top include with data: ok_code type sy-ucomm).
Step 5 (Create table control)
Press the Layout button to bring up the screen painter editor.
Press table control button and drag it on to the screen, enter the name of table control created in TOP include (TC100). Now press the yellow button for attributes and set the table control as below options
Step 6 (Populate table control )
Press the orange button (Fields). On the next screen enter ZTC_EKKO and press the Get from Dict button. Select the fields you want (all) and press enter. Now drag them onto your Table Control.
Below is the result, there will been syntax errors if we check now! So Save and go back into the flow logic tab.
Step 7 (Create flow control )
Within the flow logic of screen 100 and create two modules, one to select the data from the database and the other to move the selected fields into the table control. Also insert the two loop statements to populate and retrieve the lines of the table control.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
module data_retrieval.
loop at it_ekko into wa_ekko with control TC100.
module populate_screen.
endloop.
PROCESS AFTER INPUT.
loop at it_ekko.
endloop.
MODULE USER_COMMAND_0100.
Double click the module data_retrieval to create and click yes to get past the popup. Ensure that a new include is created to hold all the PBO modules (default). Press enter.
Select 10 rows of data from the EKKO table and load into the internal table it_ekko. Go back to the flow logic to load this data into the Table Control.
check this one
REPORT ZCALL_TRANS_TAB1 .
TABLES: LFA1,LFBK,lfb1.
data: BEGIN OF it_vendor occurs 0,
LIFNR LIKE LFA1-LIFNR,
bukrs like lfb1-bukrs,
END OF it_vendor.
DATA: BEGIN OF IT_BANK occurs 0,
LIFNR LIKE LFA1-LIFNR,
BANKS LIKE LFBK-BANKS,
BANKL LIKE LFBK-BANKL,
BANKN LIKE LFBK-BANKN,
koinh like lfbk-koinh,
END OF IT_BANK.
data: it_bdcdata like bdcdata occurs 0 with header line.
data: it_messages like bdcmsgcoll occurs 0 with header line.
*selection screen.
selection-screen: begin of block b1 with frame.
parameters: p_file like rlgrap-filename default 'c:/vendor.txt'
obligatory.
parameters: p_file1 like rlgrap-filename default 'c:/xyz.txt'
obligatory.
selection-screen: end of block b1.
*at selection screen.
at selection-screen on value-request for p_file.
perform f4_help using p_file.
at selection-screen on value-request for p_file1.
perform f4_help1 using p_file1.
*start of selection
start-of-selection.
*******uploading file
perform upload_file using p_file P_FILE1.
******open session.
perform populate_data.
*& Form f4_help
form f4_help using p_p_file.
data: l_file type ibipparms-path.
call function 'F4_FILENAME'
importing
file_name = l_file.
p_file = l_file.
endform. " f4_help
*& Form POPULATE_DATA
form populate_data .
DATA: L_STRING TYPE STRing.
DATA: L_COUNTER(2) TYPE n.
loop at it_vendor.
perform bdc_dynpro using 'SAPMF02K' '0106'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-D0130'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
it_vendor-lifnr.
perform bdc_field using 'RF02K-BUKRS'
it_vendor-bukrs.
perform bdc_field using 'RF02K-D0130'
'X'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-bankn(03)'.
perform bdc_field using 'BDC_OKCODE'
'=UPDA'.
*********bank details
CLEAR l_COUNTER.
LOOP AT IT_BANK WHERE LIFNR = IT_VENDOR-LIFNR.
l_COUNTER = l_COUNTER + 1.
clear l_string.
CONCATENATE 'lfbk-banks(' l_counter ')' into l_string.
perform bdc_field using l_string
it_bank-banks.
clear l_string.
CONCATENATE 'lfbk-bankl(' l_counter ')' into l_string.
perform bdc_field using l_string
it_bank-bankl.
clear l_string.
CONCATENATE 'lfbk-bankn(' l_counter ')' into l_string.
perform bdc_field using l_string
it_bank-bankn.
endloop.
******CALL TRANSACTION.
call transaction 'FK02' using it_bdcdata mode 'A'
messages into it_messages.
write:/ sy-subrc.
perform format_messages.
clear it_bdcdata.
refresh it_bdcdata.
endloop.
endform. " POPULATE_DATA
*& Form FORMAT_MESSAGES
form format_messages .
data: l_msg(100).
loop at it_messages.
call function 'FORMAT_MESSAGE'
exporting
id = it_messages-msgid
lang = sy-langu
no = it_messages-msgnr
v1 = it_messages-msgv1
v2 = it_messages-msgv2
v3 = it_messages-msgv3
v4 = it_messages-msgv4
importing
msg = l_msg
exceptions
not_found = 1
others = 2
write:/ l_msg.
endloop.
endform. " FORMAT_MESSAGES
*& Form bdc_dynpro
form bdc_dynpro using value(p_program)
value(p_screen).
it_bdcdata-program = p_program.
it_bdcdata-dynpro = p_screen.
it_bdcdata-dynbegin = 'X'.
append it_bdcdata.
clear it_bdcdata.
endform. " bdc_dynpro
*& Form bdc_field
form bdc_field using value(p_fnam)
value(p_fval).
it_bdcdata-fnam = p_fnam.
it_bdcdata-fval = p_fval.
append it_bdcdata.
clear it_bdcdata.
endform. " bdc_field
*& Form upload_file
form upload_file using p_p_file
p_p_file1.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = P_P_FILE
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = IT_VENDOR
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
STOP.
ENDIF.
*******UPLOADING BANK DETAILS
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = P_P_FILE1
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = IT_BANK
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
STOP.
ENDIF.
endform. " upload_file
*& Form f4_help1
-->P_P_FILE1 text
form f4_help1 using p_p_file1.
data:l_file1 type ibipparms-path.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = l_file1.
p_file1 = l_file1.
endform. " f4_help1
http://sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Regards,
Sankar -
Issue with number of lines in Table control for an web transaction in ITS
Hi,
We have acustom web transaction ZC03 where we have used table controls. Recently a kernal patch has been installed and after that the number of lines appearing in table control has got changed. Earlier table control was coming with 5 lines and presently its coming with 3 lines. Can you please help me to fix the issue.
The code used in HTML template for table controi is given below:
`SAP_DynproLayerBegin(005,013,067,006)`
`SAP_TableControl("TC_TIME1")`
`SAP_DynproLayerEnd()`
I have tried other alternatives like `SAP_DynproTableControl("TC_TIME1")`, `D_TableControl("TC_TIME1') but did n't get any fruitful result also.
Thanks and Regards,
RanadevWhat where the precise Kernel updates? What where you on and what did you upgrade too?
Did you apply any BASIS Support Pack corrections during the Kernel upgrade?
If you applied a new BASIS support pack - check the following WIKI:
[How to check the publishing Date of an Internet Service|http://wiki.sdn.sap.com/wiki/x/OYG8BQ ]
if you need to republish - use the following WIKI:
[How to activate, publish and test ITS services in the integrated ITS?|http://wiki.sdn.sap.com/wiki/x/kmE ]
Regards,
Oisin -
Table Control in ITS is getting wrongly displayed
Hi All,
I Have developed a program(say abc) and created a screen for that program(abc).
My issue is that,i have kept the table control in the box .
When i execute the screen in se80 under the program(abc) ,its displaying properly ( i mean table control is inside the box).
I have created an internet service program in se80 where i am passing the transaction code of that program(abc) in the parameters tab.
**problem is***
but when i execute the internet service program(xyz) after publishing then the
table control is coming out of the box in ESS ,
i mean the width of the table control is not getting reduced.
It(table control) has to get fit inside the box.
even though its working properly through screen.
please help me out of this issue.
thanks,
bhavani.
Edited by: BHAVANI MADIREDDY on Jul 26, 2008 9:53 AMHi ,
I have set vertical scroll bar to 'X' but still when I scroll the scroll bar the counter is getting incremented and the last entered value is appended many times in the table control.
What can be done to overcome this issue? -
How to remove the "table control" icon in ITS based ESS screen
Hi All,
I have upgraded my external ITS 620 to patch level 28. Earlier we were on patch 04.
Since then I am seeing the table control in my ESS screens (ITS Based),
In some thread i got to know that the table control is totally redefined / modified from patch 22 of ITS.
Is it possible that we can remove / hide the table control from the screens.
I dont want to let the users access the "Table Settings" screen at all....can u plz tell me how to do it
regards,
PKwe could not remove the table control...it seems like we can not remove it as the table control also appears in the r3 screens also..
-
How to control CPU Utilazation on linux, Its URGENT
Hi Friends,
Our Os is Linux. And weblogic server is running on production mode.
time to time CPU usage is reaching till 90%. I checked from console
that there are standby process. Please help me to controll CPU usage.
At what point should I concentrate.
Please help me. its urgent.In our application that is CMS(Content Management System), has used Unsynchonized HashMap.
Is this causing High CPU Utilization, and what may be other root cause for the same.
Plaese help me. -
Delete duplicate entriess from the internal table its urgent pls help.
Hi friends,
Hope everybody is doing good,Here is m query on delete duplicate data from the intenal table.
I have an internal table which contain data in the following format.
Doc No Comp Cod Vendor Assignment
1500000009 JM11 00000000
1500000008 JM11 20070212(Repeating)
1500000007 JM11 20070212
1500000006 JM11 00000000
1500000005 JM11 00000000
1500000004 JM11 00000000(Repeating)
1500000003 JM11 00000000 (Repeating)
1500000002 JM11 00000000
1500000001 JM11 20050302
1500000000 JM11 00000000
1500000003 JM11 10000088
1500000001 JM11 10000088
1500000030 JM11 10006260
1500000010 JM11 10006269
1500000008 JM11 10006269
1500000006 JM11 10006269
1500000004 JM11 10006269
if you see the document numbers,there are some document number which are repeating here,there are some document numer which contain vendor number but not the assignments,some of the document numbers contain the assignments but not the vendors.
If my internal table contain this kind of data with repeted document numbers than i want the document number which contains only the vendor number.
Pls help me with the appropriate logic,its urgent.
Thanks a lot
mrutyun^Hi,
<u><b>Deleting Adjacent Duplicate Entries</b></u>
To delete adjacent duplicate entries use the following statement:
DELETE ADJACENT DUPLICATE ENTRIES FROM <itab>
[COMPARING <f1> <f2> ...
|ALL FIELDS].
The system deletes all adjacent duplicate entries from the internal table <itab>. Entries are
duplicate if they fulfill one of the following compare criteria:
Without the COMPARING addition, the contents of the key fields of the table must be
identical in both lines.
If you use the addition COMPARING <f1> <f2> ... the contents of the specified fields <f1>
<f2> ... must be identical in both lines. You can also specify a field <fi> dynamically as
the contents of a field <ni> in the form (<ni>). If <ni> is empty when the statement is
executed, it is ignored. You can restrict the search to partial fields by
specifying offset and length.
If you use the addition COMPARING ALL FIELDS the contents of all fields of both lines
must be identical.
You can use this statement to delete all duplicate entries from an internal table if the table is
sorted by the specified compare criterion.
If at least one line is deleted, the system sets SY-SUBRC to 0, otherwise to 4.
Examples
DATA: BEGIN OF LINE,
COL1 TYPE I,
COL2 TYPE I,
END OF LINE.
DATA ITAB LIKE HASHED TABLE OF LINE WITH UNIQUE KEY COL1.
DO 4 TIMES.
LINE-COL1 = SY-INDEX.
LINE-COL2 = SY-INDEX ** 2.
INSERT LINE INTO TABLE ITAB.
ENDDO.
LINE-COL1 = 1.
DELETE TABLE ITAB: FROM LINE,
WITH TABLE KEY COL1 = 3.
LOOP AT ITAB INTO LINE.
WRITE: / LINE-COL1, LINE-COL2.
ENDLOOP.
The output is:
2 4
4 16
The program fills a hashed table with a list of square numbers. The DELETE
statement delete the lines from the table where the key field COL1 has the contents 1 or 3.
Regards,
Bhaskar -
Table control on ITS need to design
Hi,
Can anybody let me know how to create Table Control on ITS Template ?
I need to create one Table control in ITS template in internet service .
With this i also need to transfer OK code in SAPGUI .
I have created Table contol in SAP gui and want to display on ITS Template .
I have internal table which i want to show on ITS .
any help will be appreciated .
Thanks,
SSHi,
here a short example how to display a table control on a ITS template:
`repeat with j from MY_TC.firstvisible to MY_TC.lastvisible`
<tr>
<td> <input type=text
name="`myField[j].name`"
value="`myField1[j].value`">
</td>
</tr>
`end`
MY_TC is the name of the table control.
Best regards
Dennis -
Last_page button is not working in table control-urgent
hi all,
iam displaying the data in table control.in my pf-status i have first_page,next_page,prev_page and last_page.out of 4 buttons 3 buttons are working finr except last_page. any body can send me the code for this program.iam sending my program below.
REPORT ZMAHI_TABLE_CONTROL .
TABLES : VBAK,VBAP.
DATA : BEGIN OF ITAB OCCURS 0,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
ERNAM TYPE VBAK-ERNAM,
ERZET TYPE VBAK-ERZET,
REASON(40) TYPE C,
END OF ITAB.
DATA : FILL TYPE I VALUE 1.
DATA : N TYPE I .
DATA : BEGIN OF XVALUES OCCURS 50,
BUTXT LIKE T001-BUTXT,
END OF XVALUES.
DATA : BEGIN OF XFIELDS OCCURS 50.
INCLUDE STRUCTURE HELP_VALUE.
DATA : END OF XFIELDS.
DATA : BEGIN OF SEL_VAL OCCURS 50.
INCLUDE STRUCTURE HELP_VTAB.
DATA : END OF SEL_VAL.
TABLE CONTROL DECLARATIONS------
CONTROLS : CONTROL_DATA TYPE TABLEVIEW USING SCREEN '100'.
DATA : OK_CODE TYPE SY-UCOMM,
LIN TYPE I,
LIN1 TYPE I,
LIN2 TYPE I,
LIN3 TYPE I.
DATA: LINES TYPE I,
LIMIT TYPE I VALUE 1.
DATA : LINE_COUNT TYPE I,
LINEI TYPE I,
LINEJ TYPE I,
LINE1 TYPE I,
LINE2 TYPE I,
LN1 TYPE I.
SELECTION-SCREEN : BEGIN OF BLOCK B1.
SELECT-OPTIONS : P_VBELN FOR VBAK-VBELN.
SELECTION-SCREEN : END OF BLOCK B1.
START-OF-SELECTION.
SELECT VBELN
ERDAT
ERNAM
ERZET
FROM VBAK
INTO TABLE ITAB
WHERE VBELN IN P_VBELN.
CALL SCREEN 100.
*& Module F4_HELP INPUT
MODULE F4_HELP INPUT.
FREE : XFIELDS,SEL_VAL,XVALUES.
MOVE : 'ZMAHI' TO XFIELDS-TABNAME,
'REASON' TO XFIELDS-FIELDNAME,
'X' TO XFIELDS-SELECTFLAG.
APPEND XFIELDS.
XVALUES = 'Non Trade F&F'.
APPEND XVALUES .
XVALUES = 'Non Trade Retention'.
APPEND XVALUES .
XVALUES = 'Oldbills Accnt cntmnt'.
APPEND XVALUES .
XVALUES = 'Non Trade Not claimed'.
APPEND XVALUES .
XVALUES = 'Non Trade Dispute'.
APPEND XVALUES .
XVALUES = 'Non Trade Payment Block'.
APPEND XVALUES .
XVALUES = 'N/T Subsntly Cleared'.
APPEND XVALUES .
XVALUES = 'N/T Unstld Advances'.
APPEND XVALUES .
XVALUES = 'N/T OThers'.
APPEND XVALUES .
XVALUES = 'Trade Non Receipt OF BOE'.
APPEND XVALUES .
XVALUES = 'Trade OEM Adjustments'.
APPEND XVALUES .
XVALUES = 'Trade Reject Of Material'.
APPEND XVALUES .
XVALUES = 'Trade NOt Claimed'.
APPEND XVALUES .
XVALUES = 'Trade Dispute'.
APPEND XVALUES .
XVALUES = 'Trade Payment BLock'.
APPEND XVALUES .
XVALUES = 'Trade Subsntly Cleared'.
APPEND XVALUES .
XVALUES = 'Trade Non Submission of bills'.
APPEND XVALUES .
XVALUES = 'Trade others'.
APPEND XVALUES .
CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE_EXT'
EXPORTING
CUCOL = 0
CUROW = 0
DISPLAY = ' '
FIELDNAME = 'REASON'
TABNAME = 'ZIFIOD011'
IMPORTING
SELECT_VALUE = ITAB-REASON
TABLES
FIELDS = XFIELDS
SELECT_VALUES = SEL_VAL
VALUETAB = XVALUES.
ENDMODULE. " F4_HELP INPUT
*& Module STATUS_0100 OUTPUT
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '0100'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'CANCEL' OR 'EXIT' OR 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'NEXT_LINE'.
CONTROL_DATA-top_line = CONTROL_DATA-top_line + 1.
limit = fill - lines + 1.
IF CONTROL_DATA-top_line > limit.
CONTROL_DATA-top_line = limit.
ENDIF.
WHEN 'PREV_LINE'.
CONTROL_DATA-top_line = CONTROL_DATA-top_line - 1.
IF CONTROL_DATA-top_line < 0.
CONTROL_DATA-top_line = 0.
ENDIF.
WHEN 'NEXT_PAGE'.
CONTROL_DATA-TOP_LINE = CONTROL_DATA-TOP_LINE + LINES.
LIMIT = LIMIT + 1.
CONTROL_DATA-TOP_LINE = LIMIT.
WHEN 'PREV_PAGE'.
CONTROL_DATA-TOP_LINE = CONTROL_DATA-TOP_LINE - LINES.
LIMIT = LIMIT - 1.
CONTROL_DATA-TOP_LINE = LIMIT.
WHEN 'LAST_PAGE'.
CONTROL_DATA-TOP_LINE = FILL - LINES + 1.
WHEN 'FIRST_PAGE'.
CONTROL_DATA-TOP_LINE = 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module SCROLL_BAR INPUT
MODULE SCROLL_BAR INPUT.
DESCRIBE TABLE ITAB LINES CONTROL_DATA-LINES.
ENDMODULE. " SCROLL_BAR INPUT
thanks,
maheedhar.THi Ravi,
The code which u sent to me is not working for next page and previous page.
can u plz resend me the code.
iam sending my code below.
REPORT ZMAHI_TABLE_CONTROL .
TABLES : VBAK,VBAP.
DATA : BEGIN OF ITAB OCCURS 0,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
ERNAM TYPE VBAK-ERNAM,
ERZET TYPE VBAK-ERZET,
REASON(40) TYPE C,
END OF ITAB.
DATA : FILL TYPE I VALUE 1.
DATA : N TYPE I .
DATA : BEGIN OF XVALUES OCCURS 50,
BUTXT LIKE T001-BUTXT,
END OF XVALUES.
DATA : BEGIN OF XFIELDS OCCURS 50.
INCLUDE STRUCTURE HELP_VALUE.
DATA : END OF XFIELDS.
DATA : BEGIN OF SEL_VAL OCCURS 50.
INCLUDE STRUCTURE HELP_VTAB.
DATA : END OF SEL_VAL.
TABLE CONTROL DECLARATIONS------
CONTROLS : CONTROL_DATA TYPE TABLEVIEW USING SCREEN '100'.
DATA : OK_CODE TYPE SY-UCOMM,
LIN TYPE I,
LIN1 TYPE I,
LIN2 TYPE I,
LIN3 TYPE I.
DATA: LINES TYPE I,
LIMIT TYPE I VALUE 1.
DATA : LINE_COUNT TYPE I,
LINEI TYPE I,
LINEJ TYPE I,
LINE1 TYPE I,
LINE2 TYPE I,
LN1 TYPE I.
SELECTION-SCREEN : BEGIN OF BLOCK B1.
SELECT-OPTIONS : P_VBELN FOR VBAK-VBELN.
SELECTION-SCREEN : END OF BLOCK B1.
START-OF-SELECTION.
SELECT VBELN
ERDAT
ERNAM
ERZET
FROM VBAK
INTO TABLE ITAB
WHERE VBELN IN P_VBELN.
CALL SCREEN 100.
*& Module F4_HELP INPUT
MODULE F4_HELP INPUT.
FREE : XFIELDS,SEL_VAL,XVALUES.
MOVE : 'ZMAHI' TO XFIELDS-TABNAME,
'REASON' TO XFIELDS-FIELDNAME,
'X' TO XFIELDS-SELECTFLAG.
APPEND XFIELDS.
XVALUES = 'Non Trade F&F'.
APPEND XVALUES .
XVALUES = 'Non Trade Retention'.
APPEND XVALUES .
XVALUES = 'Oldbills Accnt cntmnt'.
APPEND XVALUES .
XVALUES = 'Non Trade Not claimed'.
APPEND XVALUES .
XVALUES = 'Non Trade Dispute'.
APPEND XVALUES .
XVALUES = 'Non Trade Payment Block'.
APPEND XVALUES .
XVALUES = 'N/T Subsntly Cleared'.
APPEND XVALUES .
XVALUES = 'N/T Unstld Advances'.
APPEND XVALUES .
XVALUES = 'N/T OThers'.
APPEND XVALUES .
XVALUES = 'Trade Non Receipt OF BOE'.
APPEND XVALUES .
XVALUES = 'Trade OEM Adjustments'.
APPEND XVALUES .
XVALUES = 'Trade Reject Of Material'.
APPEND XVALUES .
XVALUES = 'Trade NOt Claimed'.
APPEND XVALUES .
XVALUES = 'Trade Dispute'.
APPEND XVALUES .
XVALUES = 'Trade Payment BLock'.
APPEND XVALUES .
XVALUES = 'Trade Subsntly Cleared'.
APPEND XVALUES .
XVALUES = 'Trade Non Submission of bills'.
APPEND XVALUES .
XVALUES = 'Trade others'.
APPEND XVALUES .
CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE_EXT'
EXPORTING
CUCOL = 0
CUROW = 0
DISPLAY = ' '
FIELDNAME = 'REASON'
TABNAME = 'ZIFIOD011'
IMPORTING
SELECT_VALUE = ITAB-REASON
TABLES
FIELDS = XFIELDS
SELECT_VALUES = SEL_VAL
VALUETAB = XVALUES.
ENDMODULE. " F4_HELP INPUT
*& Module STATUS_0100 OUTPUT
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '0100'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'CANCEL' OR 'EXIT' OR 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'NEXT_LINE'.
CONTROL_DATA-top_line = CONTROL_DATA-top_line + 1.
limit = fill - lines + 1.
IF CONTROL_DATA-top_line > limit.
CONTROL_DATA-top_line = limit.
ENDIF.
WHEN 'PREV_LINE'.
CONTROL_DATA-top_line = CONTROL_DATA-top_line - 1.
IF CONTROL_DATA-top_line < 0.
CONTROL_DATA-top_line = 0.
ENDIF.
WHEN 'NEXT_PAGE'.
CONTROL_DATA-TOP_LINE = CONTROL_DATA-TOP_LINE + LINES.
LIMIT = LIMIT + 1.
CONTROL_DATA-TOP_LINE = LIMIT.
WHEN 'PREV_PAGE'.
CONTROL_DATA-TOP_LINE = CONTROL_DATA-TOP_LINE - LINES.
LIMIT = LIMIT - 1.
CONTROL_DATA-TOP_LINE = LIMIT.
WHEN 'LAST_PAGE'.
DESCRIBE TABLE ITAB LINES LIMIT.
CONTROL_DATA-TOP_LINE = LIMIT.
WHEN 'FIRST_PAGE'.
CONTROL_DATA-TOP_LINE = 0.
WHEN 'P--'.
CLEAR ok_code.
PERFORM paging USING 'P--'.
WHEN 'P-'.
CLEAR ok_code.
PERFORM paging USING 'P-'.
WHEN 'P+'.
CLEAR ok_code.
PERFORM paging USING 'P+'.
WHEN 'P++'.
CLEAR ok_code.
PERFORM paging USING 'P++'.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module SCROLL_BAR INPUT
MODULE SCROLL_BAR INPUT.
DESCRIBE TABLE ITAB LINES CONTROL_DATA-LINES.
ENDMODULE. " SCROLL_BAR INPUT
*& Form paging
text
-->P_0356 text
*FORM paging USING VALUE(P_0356).
FORM paging USING code.
DATA: i TYPE i,
j TYPE i.
CASE code.
WHEN 'P--'.
CONTROL_DATA-top_line = 1.
WHEN 'P-'.
CONTROL_DATA-top_line = CONTROL_DATA-top_line - line_count.
IF CONTROL_DATA-top_line LE 0.
CONTROL_DATA-top_line = 1.
ENDIF.
WHEN 'P+'.
i = CONTROL_DATA-top_line + line_count.
j = CONTROL_DATA-lines - line_count + 1.
IF j LE 0. j = 1. ENDIF.
IF i LE j.
CONTROL_DATA-top_line = i.
ELSE.
CONTROL_DATA-top_line = j.
ENDIF.
WHEN 'P++'.
CONTROL_DATA-top_line = CONTROL_DATA-lines - line_count + 1.
IF CONTROL_DATA-top_line LE 0.
CONTROL_DATA-top_line = 1.
ENDIF.
ENDCASE.
ENDFORM. " PAGING
*ENDFORM. " paging
thanks,
maheedhar.t -
Urgent: Table control validation of defaulted values
Hi All,
I have 5 fields in my table control. I have provided a button on the screen, if the user clicks that button, one of the fields( checkbox) is set as 'X'.
Now , I want to validate the value in this field.
The issue I have is that it is not going into the CHAIN ENCHAIN module logic to do the validation, if the value is updated through the button, but it performs validation if I update the field manually.
Please advice.
Thanks.
K KTry this in the PAI process of screen:
LOOP AT itab.
CHAIN.
FIELD: ...
MODULE CHECK_MODIFIED ON CHAIN-INPUT.
ENDCHAIN.
ENDLOOP.
Oherwise,you can add the check logic into the flow logic of the button,if the value is not valid,block it.
Edited by: Liang Zhang on May 28, 2008 4:34 AM
Maybe you are looking for
-
Where the task payload is stored in the dehydration store
Hi All, I wanted to get the taskPayload from the BPEL dehydration store. I have gone thru the WFTASK table but I didn't see any column which conains the taskpaylod. I need this payload to do the following.. - Get the taskPayload - Modify it so that I
-
I brought hoyle slots it did not down correctly i want to reload without being billed again
how can i reload an app that did not load correctly without being charge again
-
I can not download iTunes as it should he warned me of a problem of "assembly" HRESULT
-
Can't create a leave request via ptarq
hi all, i can't create neither approve any request via ptarq ? anyhelp would be appreciated .
-
Very basic questions about hard drives
I'm upgrading from vintage Beige G3, so much of the jargon about internal drives is new to me. My MacPro will come with an OEM 160 GB drive. I will use this for my primary boot drive -- OS and Apps. All my data, photo files etc. will be kept on my se