‎2008 Apr 09 11:10 AM
I create a table control named ZENTER. it used the table i_enter
i_enter contined field enter(key field)
materiel(key field)
price
amount
i used wazid and just display materiel price in the screen layout.
i also create a I/O button P_ENTER,
i want insert date from the screen,for example
p_enter = 0001
materiel =001 price = 20
materiel =002 price =30
materiel =003 price =10
how should i do to apend these data into i_enter
0001 001 20
0001 002 30
0001 003 10
and in the after input modules
MODULE ZENTER_MODIFY INPUT.
MODIFY I_ENTER
FROM WA_ENTER
INDEX ZENTER-CURRENT_LINE.
ENDMODULE.
what should i do??
thank u
‎2008 Apr 09 11:17 AM
hi,
u need to write this in that module..
MODULE tab1_modify INPUT.
MODIFY i_mat
FROM i_mat
INDEX tab1-current_line.
APPEND i_mat.
ENDMODULE. "TAB1_MODIFY INPUT
reward if usefull....
‎2008 Apr 09 11:13 AM
Hi
Go through the following Procedure
1) Screen tables
A table can be created in transaction. These tables, when designed on the screen are called as SCREEN TABLES.
These are of two types.
Table Controls and Step loops
These tables are treated as Loops.
2)Features of Table Controls
Data is displayed in the form of table.
Table control gives user the feeling of an actual table.
You can scroll through the table vertically as well as horizontally.
You can select rows and columns.
You can resize the with of columns.
You can have separator lines between rows and columns.
Automatic resizing of the table when the user resizes the window.
You can update information in the table control and it can be updated in the database table by writing code for it.
3)Steps for creating table control
Declaration of table control in module pool program.
Designing of table controls on the screen.
Passing data to table control in flow logic.
4)Declaration of TC in MPP
syntax:
controls <name of table control> type tableview using screen <escreen no.f>.
5)Designing Table control on screen
Click on Table in Control bar and place it on the screen. You can adjust the length and width of the Table Control.
Name the table control.(same name as given in data declaration).
From dictionary object OR from program fields select the fields and place them in the table control
6)Passing data to table control
Usually transfer of data from program to screen is automatic.
In case of TC, you need to explicitly transfer the data to table control.
ABAP/4 provides Loop statement, which is associated with flow logic to transfer the data.
7)Passing of data contd.
PBO.
Loop at <name of internal table> with control <name of table control> cursor <scroll variable>.
modulecc.
Endloop.
PAI.
Loop at < name of internal table>.Endloop.
8)Scroll variables
Top_line : the row of table where the screen display starts.
Current_line : the row currently being processed inside a loop.
9)Transfer of data from prg to TC.
With eLoop at cf statement, the first row is placed in the header of internal table.
If any module is specified between Loop and End loop, it will be executed. In this module, generally we will be assigning this internal table fields to table control screen fields.
The row in internal table is transferred to the TC as stated in the eLoop atc..f statement.
The system encounters the eEndloopf statement and control is passed back to the next line of internal table.
In the same way all the records of the internal table are passed to the TC.
Regards
Sreeni
‎2008 Apr 10 4:54 AM
now ,i changed my itab and screen,
they have same fields, in the screen of TC,it have 3 fields,
and in itab it also have 3 fields.
what i really want is tansfer data from TC of the screen to itab.
when i execute my program ,
in the screen i input the first line of the 3 fields,
but in the module
MODULE ZDELIVERY_MODIFY INPUT.
MODIFY I_DELIV
FROM WA_DELIV
INDEX ZDELIVERY-CURRENT_LINE.
ENDMODULE.
(WA_DELIV : 000001 12 100)
(ZDELIVERY-CURRENT_LINE = 1).
but after i execute this module ,
the I_DELIV contines 0 items ,
why?
and what should i do?
thank u.
‎2008 May 09 10:43 AM
You answered my question before ,it is about table control ,now i want to see the details of table control ,in something like sap library,but i can't find it in sap library,please gave me a link.
thank you very much
‎2008 Apr 09 11:17 AM
hi,
u need to write this in that module..
MODULE tab1_modify INPUT.
MODIFY i_mat
FROM i_mat
INDEX tab1-current_line.
APPEND i_mat.
ENDMODULE. "TAB1_MODIFY INPUT
reward if usefull....
‎2008 Apr 10 4:55 AM
now ,i changed my itab and screen,
they have same fields, in the screen of TC,it have 3 fields,
and in itab it also have 3 fields.
what i really want is tansfer data from TC of the screen to itab.
when i execute my program ,
in the screen i input the first line of the 3 fields,
but in the module
MODULE ZDELIVERY_MODIFY INPUT.
MODIFY I_DELIV
FROM WA_DELIV
INDEX ZDELIVERY-CURRENT_LINE.
ENDMODULE.
(WA_DELIV : 000001 12 100)
(ZDELIVERY-CURRENT_LINE = 1).
but after i execute this module ,
the I_DELIV contines 0 items ,
why?
and what should i do?
thank u.
‎2008 Apr 10 4:59 AM
hi Hongtan,
Is your module is inside the loop...endloop, structure if not place the module inside it.
Hope it helps.
Thanks,
Arun