How to clear data from Table-Control
Hi all,
I am working on table control. I have some data on the table control.
When I press the 'Cancel' button, I require that the table-control should be cleared.
I tried using REFRESH CONTROL TC01 USING SCREEN 1001. But, the data doesn't get cleared.
Please advise.
Regards,
Saurabh Buksh.
hi
good
try this example
REPORT demo_dynpro_tabcont_loop_at.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA: cols LIKE LINE OF flights-cols,
lines TYPE i.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: itab TYPE TABLE OF demo_conn.
TABLES demo_conn.
SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
LOOP AT flights-cols INTO cols WHERE index GT 2.
cols-screen-input = '0'.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
DESCRIBE TABLE itab LINES lines.
flights-lines = lines.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE read_table_control INPUT.
MODIFY itab FROM demo_conn INDEX flights-current_line.
ENDMODULE.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'TOGGLE'.
LOOP AT flights-cols INTO cols WHERE index GT 2.
IF cols-screen-input = '0'.
cols-screen-input = '1'.
ELSEIF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
WHEN 'SORT_UP'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'SORT_DOWN'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'DELETE'.
READ TABLE flights-cols INTO cols
WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
DELETE itab.
ENDLOOP.
ENDIF.
ENDCASE.
ENDMODULE.
thanks
mrutyun^
Similar Messages
-
How to clear data in Table Control.
hi! all
How to clear the data in table control.
i have a Table control which displays column A data from the previous screen and allows to enter column B and column C and i have a button CLEAR, when i click CLEAR button the Data displaying in table control has to be cleared. how to do it.
Regards,
NagulanHi,
Loop over the internal table of table control & clear data from table control.
loop at tctab.
clear tctab.
modify tctab.
endloop.
Best regards,
Prashant -
How to retrieve data from Table Control
Hi,
I am a Beginner to ABAP. I want to know how to fetch the selected rows from Screen table control.
Here is my scenario:
I am having one table control with selection field. Once i select some rows means the selected rows are going to be stored in one Internal Table.
If any body knows the thing means please reply me the logic as well as giving me some code sample.
Thankyou.Hi Mithun,
Try to implement this code in your requirement.
There will be some button on your screen and after selecting some or all the records from the table control you must be pressing some button for collecting the selected rows from the table control too your internal table.
Put Fcode of that button in WHEN condition in this CASE.
CONSTANTS: kc_sel_flag TYPE char01 VALUE 'X'.
CASE sy-ucomm.
WHEN kc_sel.
PERFORM f_sel_desel USING kc_sel_flag.
ENDCASE.
FORM f_sel_desel
USING p_sel_desel TYPE c.
Set the value
wa_cond_type-z_sel = p_sel_desel.
Update the Itab.
MODIFY it_cond_type
FROM wa_cond_type
TRANSPORTING z_sel
WHERE mandt EQ sy-mandt. "Where cond is only to specify all
ENDFORM. " f_sel_desel
After that all the selected records will be having 'X' in the internal table.
Regards,
Mueksh Kumar -
How to insert data into table control
hi experts,,
i have inserted data into data base table through table control .
now i want to insert data into table control through database table.
how to delete data from table control for selected rowHi
go through this link.
http://www.****************/Tutorials/ABAP/TableControl/Demo.htm -
How to populate data in table control .
hi all,
i put matnr no. in screen no. 103
validation is done at that screen only.
now when i want to modify dat record
when i put matnr no. at screen 103
so how i will get all data of dat number to table control screen.Hi Darshan,
Here is a detailed description of how to update data in table controll.
Updating data in table control
The ABAP language provides two mechanisms for loading the table control with data from the internal table and then storing the altered rows of the table control back to the internal table.
Method 1: Read the internal table into the Table Control in the screenu2019s flow logic. Used when the names of the Table Control fields are based on fields of the internal table.
Method 2: Read the internal table into the Table Control in the module pool code. Used when the names of the Table Control fields are based on fields of the database table.
Method 1 (table control fields = itab fields)
In the flow logic we can read an internal table using the LOOP statement. Define the reference to the relevant able control by specifying WITH CONTROL <ctrl>
Determine which table entry is to be read by specifying CURSOR <ctrl>-CURRENT_LINE.
After the read operation the field contents are placed in the header line of the internal table. If the fields in the table control have the same name as the internal they will be filled automatically. Otherwise we need to write a module to transfer the internal table fields to the screen fields.
We must reflect any changes the user makes to the fields of the table control in the internal table otherwise they will not appear when the screen is redisplayed after PBO processing, (eg, after the user presses Enter or scrolls) However, this processing should be performed only if changes have actually been made to the screen fields of the table control (hence the use of the ON REQUEST)
PROCESS BEFORE OUTPUT.
LOOP AT ITAB_REG WITH CONTROL TCREG
CURSOR TCREG-CURRENT_LINE.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT ITAB_REG.
MODULE MODIFY_ITAB_REG.
ENDLOOP.
MODULE MODIFY_ITAB_REG INPUT.
MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
ENDMODULE.
Method 2 (table control fields = dict. fields)
If using a LOOP statement without an internal table in the flow logic, we must read the data in a PBO module which is called each time the loop is processed.
Since, in this case, the system cannot determine the number of internal table entries itself, we must use the EXIT FROM STEP-LOOP statement to ensure that no blank lines are displayed in the table control if there are no more corresponding entries in the internal table.
PROCESS BEFORE OUTPUT.
LOOP WITH CONTROL TCREG.
MODULE READ_ITAB_REG.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL TCREG.
CHAIN.
FIELD: ITAB_REG-REG,
ITAB_REG-DESC.
MODULE MODIFY_ITAB_REG
ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE READ_ITAB_REG OUTPUT.
READ TABLE ITAB_REG INDEX TCREG-CURRENT_LINE.
IF SY-SUBRC EQ 0.
MOVE-CORRESPONDING ITAB_REREG TO TCREG.
ELSE.
EXIT FROM STEP-LOOP.
ENDIF.
ENDMODULE.
MODULE MODIFY_ITAB_REG INPUT.
MOVE-CORRESPONDING TCREG TO ITAB_REG.
MODIFY ITAB_REG INDEX
TCREG-CURRENT_LINE.
ENDMODULE.
Updating the internal table
Method 1
PROCESS AFTER INPUT.
LOOP AT ITAB_REG.
CHAIN.
FIELD: ITAB_REG-REG,
ITAB_REG-DESC.
MODULE MODIFY_ITAB_REG ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE MODIFY_ITAB_REG INPUT.
ITAB_REG-MARK = u2018Xu2019.
MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
ENDMODULE.
Method 2
PROCESS AFTER INPUT.
LOOP WITH CONTROL TCREG.
CHAIN.
FIELD: TCREG-REG,
TCREG-DESC.
MODULE MODIFY_ITAB_REG ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE MODIFY_ITAB_REG INPUT.
MOVE-CORRESPONDING TCREG TO ITAB_REG.
ITAB_REG-MARK = u2018Xu2019.
MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
ENDMODULE.
Updating the database
MODULE USER_COMMAND_100.
CASE OK_CODE.
WHEN u2018SAVEu2019.
LOOP AT ITAB-REG.
CHECK ITAB_REG-MARK = u2018Xu2019.
MOVE-CORRESPONDING ITAB_REG TO TCREG.
UPDATE TCREG.
ENDLOOP.
WHEN u2026
u2026
ENDCASE.
ENDMODULE.
Hope this will solve your problem.
Regards,
Pavan.
Edited by: PAVAN CHANDRASEKHAR GANTI on Aug 3, 2009 12:48 PM -
How to delete data in table control
Hi,
I am doing module pool programming. After the user enters the data in table control after saving the data. if the user wants to remove the line item the line item shd be removed from the screen and data base.
Please Give me vaulable Suggestions
RegardsHi,
Screen 8002 (with table control) --> select records --> press delete button --> delete selected records
Now you wan to delete those records selected by the user at runtime when DELETE button is clicked.
Take another internal table and work area same as the initial internal table and work area used in screen 8002 which is to be used to delete the selected data.
Take the names of the input/output fields as work_area-field_name and select column in table control as work_area-flag.
Also take a flag field of size 1 datatype character as the last field in the internal table and work area while declaration.
You must have passed a code in PBO of the screen for reading internal table into the table control.
So it reads the internal table into the table control whenever you perform any action on use command.
All you need to do is to write a code to modify the internal table form the table control while performing any user action.
Remember to change the LINE SEL option in attributes of table control as MULTIPLE.
At screen logic,
PROCESS BEFORE OUTPUT.
MODULE status_8002. "for pf-status
LOOP WITH CONTROL po_tab. "po_tab is table control
MODULE pass_data. "to pass data into table control from internal table
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_command_8002. "for user command(back and exit)
LOOP WITH CONTROL po_tab.
MODULE modify_data. "to modify data from table control into table control
ENDLOOP.
MODULE delete. "to delete the selected records
In PBO,
*& Module STATUS_8002 OUTPUT
MODULE status_8002 OUTPUT.
SET pf-status 'ZAB_PFSTA'. " pf-status
DATA : line_count TYPE i.
DESCIRBE TABLE it_ekpo
LINES line_count.
po_tab-lines = line_count + 10.
" to make table control scrollable
ENDMODULE. " STATUS_8002 OUTPUT
*& Module PASS_DATA OUTPUT
MODULE pass_data OUTPUT.
READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
ENDMODULE. " PASS_DATA OUTPUT
"it_ekpo is internal table and wa_ekpo is the work area
In PAI,
*& Module MODIFY_DATA INPUT
MODULE MODIFY_DATA INPUT.
MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
"modify records from table control into the internal table
ENDMODULE. " MODIFY_DATA INPUT
*& Module DELETE INPUT
MODULE DELETE INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'DELETE'. "when delete button is clicked
SORT IT_EKPO BY FLAG DESCENDING. "sort by flag(selection column value)
CLEAR WA_EKPO1.
CLEAR WA_EKPO.
REFRESH IT_EKPO1.
LOOP AT IT_EKPO INTO WA_EKPO WHERE FLAG = 'X'.
DATA : J TYPE I.
CLEAR J.
J = SY-TABIX. "assign index value if a record is selected
MOVE-CORRESPONDING WA_EKPO TO WA_EKPO1. "append selected records to another
"work area and append to another internal table to delete
APPEND WA_EKPO1 TO IT_EKPO1.
DELETE IT_EKPO. "delete the selected records from initial internal table
" to reflect the changes on the table control
ENDLOOP.
IF J = 0.
MESSAGE I006. "if no record selected
ELSE. "if some records are selected
DELETE ZEKPO FROM TABLE IT_EKPO1. "delete from database table
COMMIT WORK.
IF SY-SUBRC = 0.
MESSAGE S007. "success message (records deleted)
ENDIF.
ENDIF.
ENDCASE.
ENDMODULE. " DELETE INPUT
Now at PAI, you have delete records and these changes are reflected back to the internal table.
Now when PBO is executed it will again read the initial internal table and will not show the deleted records.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
How to transfer data in table control in bdc
hi
how to transfer data in table control in bdc . I need the theory regarding this
byeHi,
just check in the forum , there is many threads available to ur questions.
Table control in BDC
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
You can even refer to these related threads
bdc table control
Re: table control in bdc
table control in BDC
Reward if helpful.
Thanks
Naveen khan -
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> -
How to retrieve data from table(BOM_ITEM)
Hi All,
I wrote webservices using axis1.4 to get BOM information from SAP.. funtional module is CAD_DISPLAY_BOM_WITH_SUB_ITEMS
webservices works fine..I'am able to retrieve data from Export Parameter..But not able to retrieve data from table
How to retrieve data from table(BOM_ITEM)..?
Cheers, all help would be greatly appreciated
VijayHi,
1. Create Page Process.
2. Select Data Manipulation
3. In category select "Automated Row Fetch"
4. Specify process name, sequence, select "On Load - Before Header" in point.
5. Specify owner, table, primary key, and the primary key column(Item name contains primary key).
6. Create a process.
7. In each item select "Database Column" in "Source Type".
Regards,
Kartik Patel
http://patelkartik.blogspot.com/
http://apex.oracle.com/pls/apex/f?p=9904351712:1 -
How to modify data in table control
hi
i have created table control where i have displayed data into table control
logic used
screen 200
PROCESS BEFORE OUTPUT.
MODULE SELECT_RECORD.
*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TBC_200'
MODULE TBC_200_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TBC_200_CHANGE_COL_ATTR.
LOOP AT IT_MARA
INTO WA_MARA
WITH CONTROL TBC_200
CURSOR TBC_200-CURRENT_LINE.
MODULE TBC_200_GET_LINES.
*&SPWIZARD: MODULE TBC_200_CHANGE_FIELD_ATTR
ENDLOOP.
MODULE STATUS_0200.
PROCESS AFTER INPUT.
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TBC_200'
LOOP AT IT_MARA.
CHAIN.
FIELD WA_MARA-MATNR.
FIELD WA_MARA-ERSDA.
FIELD WA_MARA-ERNAM.
MODULE TBC_200_MODIFY ON CHAIN-REQUEST.
ENDCHAIN.
FIELD WA_MARA-MARK
MODULE TBC_200_MARK ON REQUEST.
ENDLOOP.
MODULE TBC_200_USER_COMMAND.
*&SPWIZARD: MODULE TBC_200_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TBC_200_CHANGE_COL_ATTR.
module -
MODULE SELECT_RECORD.
MODULE SELECT_RECORD OUTPUT.
SELECT MATNR ERSDA ERNAM
FROM MARA
INTO CORRESPONDING FIELDS OF TABLE it_mara.
ENDMODULE. " SELECT_RECORD OUTPUT
and
another thing
i have made field MARA-ERSDA. and FIELD WA_MARA-ERNAM editable by
input possible using layout
so
now those 2 fields contents are editable
i want to know how to edit and save the data
some body guide.
and i want to put the lock so that i can update
can tell how to implement lock.
Thanks
Edited by: viju bangalore on Jan 27, 2011 10:40 AMHi Viju,
In PAI do something like this
LOOP AT itab.
MODULE mod_table_control.
ENDLOOP.
MODULE user_command_0100.
at module mod_table_control put this
MODULE mod_table_control INPUT.
MODIFY itab FROM demo_conn INDEX flights-current_line.
if sy-subrc ne 0.
insert itab.
endif.
ENDMODULE.
for saving you can create at custom gui status with a save button, and at MODULE user_command_0100 save the data. -
How to show data through table control
Hi Experts,
I have created an table control through wizard using table EKKO.
I have to populate one internal table( type ekko ), and then show it in output through table control.
Please advise, how to do that and in where i have to write the codes.
I will reward points for every suggestion
Thanks in advance.
regardshi saubrab,
This is kiran kumar.G.I am sending some sample code to populate data into table control check it once.
i will give input in 100 screen. and display table control in 200 screen.check it once once ..ok....
SE38 :(CODE)
*& Module pool YMODULEPOOL_TABLECONTROL1 *
*& DEVELOPER : KIRAN KUMAR.G *
*& PURPOSE : TABLE CONTROL DEMO *
*& CREATION DT : 17/12/2007 *
*& T.CODE : YMODTABLECONTROL1 *
*& REQUEST : ERPK900035 *
PROGRAM ymodulepool_tablecontrol1.
Tables
TABLES: yvbap, "Sales Document: Item Data
vbak. "Sales Document: Header Data
Controls
CONTROLS: my_table TYPE TABLEVIEW USING SCREEN 200.
Global Variables
DATA: gv_lines TYPE i,
gv_lines1 type i,
gv_temp type i,
gv_flag(20) TYPE c VALUE 'DISP',
gv_mode1 TYPE c,
gv_mode TYPE c VALUE 'C'. " C: Change, D :Display
Internal Table
DATA: BEGIN OF gt_item OCCURS 0,
vbeln LIKE vbap-vbeln, "Sales Document Number
posnr LIKE vbap-posnr, "Sales Document Item
matnr LIKE vbap-matnr, "Material Number
matkl LIKE vbap-matkl, "Material Group
arktx LIKE vbap-arktx, "Short Text for Sales Order Item
cflag, "Deletion Indicator
END OF gt_item.
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'ZTABLECONTROL' OF PROGRAM 'YMODULEPOOL_TABLECONTROL'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'DISP'.
SELECT single vbeln
erdat
angdt
bnddt
FROM vbak
INTO (vbak-vbeln,vbak-erdat,
vbak-angdt,vbak-bnddt)
WHERE vbeln = vbak-vbeln.
IF sy-subrc EQ 0.
*Fetch the table control data and place them in Internal Table
SELECT vbeln
posnr
matnr
matkl
arktx
FROM yvbap
INTO TABLE gt_item
WHERE vbeln = vbak-vbeln.
IF sy-subrc EQ 0.
*NO OF line in the Internal Table
DESCRIBE TABLE gt_item LINES gv_lines.
my_table-lines = gv_lines + 20.
ENDIF.
ENDIF.
*Call Screen 200.
SET SCREEN 200.
WHEN 'EXIT' OR 'BACK' OR 'CANCEL'.
*Exit from the Program
CALL TRANSACTION 'SESSION_MANAGER'.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
module STATUS_0200 output.
SET PF-STATUS 'ZTABLECONTROL1'.
endmodule. " STATUS_0200 OUTPU
*& Module copy_data OUTPUT
text
module copy_data output.
*Fetch the current line data from the Table control
read table gt_item index my_table-current_line.
if sy-subrc eq 0.
*Populating data into screen fields
gt_item-vbeln = gt_item-vbeln.
gt_item-posnr = gt_item-posnr.
gt_item-matnr = gt_item-matnr.
gt_item-matkl = gt_item-matkl.
gt_item-arktx = gt_item-arktx.
endif.
SE51:CODE (SCREEN 100)
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
SE51 :CODE (SCREEN 200)
PROCESS BEFORE OUTPUT.
MODULE STATUS_0200.
loop at gt_item with control my_table cursor my_table-current_line.
module copy_data.
endloop.
PROCESS AFTER INPUT.
loop at gt_item.
MODULE USER_COMMAND_0200.
endloop.
HAVE A NICE DAY..
Award points if helpful,kiran kumar.G -
How to populate data from table into datagrid in form
hi there. may i know how to populate data from a table into a datagrid? i have created a datagrid in a form using OLE's microsoft datagrid. i'm having problem to populate data from table into the grid. can i know how to do that? thanks
Not exactly. I want to enter input from form and the user can have all options to choose i.e. HIGH, MEDIUM or so on.
Suppose, you have option to select HIGH, MEDIUM or LOW and you can see all these options together. You select LOW and when you save, it is saves in the table as a value. So when you view the table again, it will show LOW as active and HIGH and MEDIUM are null. -
How to read data from table GLFUNCA quickly?
Hello everybody!
Recently,my colleague has programmed a report about reading data from table GLFUNCA,and its speed is very slowly and exceeded limited time sometimes .
Excuse me?
how to use INDEX and VIEW TO accelerate it?
pls supply my helpful solutions.
Thanks!
Best wishes!Hi,
Please check your SELECT statement to find out what are the columns being used in the WHERE clause. Then go to SE11 and find out if there are indexes on those columns.
If Indexes don't exist then you can create indexes on those columns, which might improve the performance.
However, there might be other areas also, where the performance can be improved. Do a run time analysis / trace and figure which part of the program is taking maximum time.
Regards,
Ravi
Note : Please mark the helpful answers -
How to Insert data from Table A to Table B
Hi,
I have to insert data from Table A into Table B.
Table A is having 100 records and table B is having 10000 records.
Condition is if data in Table A is not in table B then I have to insert into Table B or else I have to skip that.
Can anyone help me with sample code.
Thanks in advance and points are awarded for usefull answers.
Thanks,
Kumar.Hello Kumar
Assuming that tables A and B have the same structure you can use the same logic as change documents are prepared. Assuming both of your itabs are of structure struc_a. Then define the following type:
TYPES: BEGIN OF ty_s_itab_di.
INCLUDE TYPE struc_a.
TYPES: CHIND TYPE bu_chind.
TYPES: END OF ty_s_itab_di.
TYPES: ty_t_itab_di TYPE STANDARD TABLE OF ty_s_itab_di
WITH DEFAULT KEY.
DATA: gt_itab_old TYPE ty_t_itab_di,
gt_itab_new TYPE ty_t_itab_di.
Fill itabs gt_Itab_old with the corresponding data of itab1 and gt_itab_new with the corresponding data of itab2.
Very important: sort you itabs either by all key fields or by all fields.
Call function <b>CHANGEDOCUMENT_PREPARE_TABLES</b> with the following parameters:
- CHECK_INDICATOR = ' '
- TABLE_NEW = gt_Itab_new
- TABLE_OLD = gt_itab_old
The function module will remove identical lines from both itabs. New entries in gt_itab_New will have CHIND = 'I' and deleted entries in gt_itab_old will have CHIND = 'D'. Modified entries are indicated by CHIND = 'U'.
Read the documentation of the function module and play around with it. You will see that this a quite easy yet powerful approach for comparing itabs.
Regards
Uwe -
How to display data in Table control?
Hi Experts,
Can anyone please explain me how to display the data from two different tables(those two table is related with 1 field) into a single table control?
For Example: T1 has fields (F1,F2) and
T2 has fields (F3,F4) --> here F3 is foreign key for F1
I need to display the data F1,F2,F3,F4 into the table control.
Can anyone explain me?
Thanks in Advance,
Regards,
RaghuHi,
If F3 is foreign key for F1, then both fields will have same values. Then why do you need to display both F1 and F3? Either one of them is enough. Try the following code.
types: begin of t_table,
F1 type T1-F1,
F2 type T1-F2,
F4 type T2-F4,
end of t_table.
data: i_table type standard table of t_table with header line.
select F1 F2 F4 into table i_table from T1 inner join T2 on T1F1 = T2F3.
You should create three columns in the table control with names i_table-F1, i_table-F2, i_table-F3.
After populating the internal table, refresh the control with the following statement.
REFRESH CONTROL <NAME> FROM SCREEN <SCREEN_NO>.
All the above statements should be in your PBO Module.
Regards,
Hema
Message was edited by:
Sorry, Declarations can be in the common include. Select statement and refresh statement should be in PBO.
Hema Nagarajan
Maybe you are looking for
-
Change background color in notes.
Can I change background color in notes? to black with white font? If not, why doesn't Apple already make this an option?
-
My new Droid X only came with a 2g card. Can I buy a 16g to replace it? Can it handle one that large?
-
Does anyone know when iOS 5 will be available?
Hi everyone, I was wondering if anyone know when iOS 5 will be available. I watched the video about it and now i'm just soo impatient! On the website they say it will be available this spring (i am in Australia) but i wanna know more!
-
Organizing Music / Play Lists / Folders
I have tried looking for the answer to my question in the iTunes forum search engine without much luck what so ever. But I am trying to organize my music and music video library in classifications putting together each form of music or music video in
-
What is "Override Common Settings"?
Certain configuration settings exist at the Phone, Common Phone Profile, and the Enterprise Phone Configuration If you set a parameter at any of the following above mentioned levels - the setting that takes precedence is determined in the following o