Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

table control

Former Member
0 Likes
1,006

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
927

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....

6 REPLIES 6
Read only

Former Member
0 Likes
927

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>.

modulecc.

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 cf 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 atc..f statement.

The system encounters the eEndloopf 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

Read only

0 Likes
927

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.

Read only

0 Likes
927

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

Read only

Former Member
0 Likes
928

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....

Read only

Former Member
0 Likes
927

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.

Read only

0 Likes
927

hi Hongtan,

Is your module is inside the loop...endloop, structure if not place the module inside it.

Hope it helps.

Thanks,

Arun