cancel
Showing results for 
Search instead for 
Did you mean: 

regarding module pool.

Former Member
0 Kudos

hi ,

I have a query regarding module pool

i created table using table control passing values from internal table and the structure is

Header 1Header 2Header 3Header 4Header 5Header 6Header 7Header 8

  comm_3/8

  comm_1/16

  comm_15/32

----
abc123555

Now the problem is the user will enter the data abc,123...  it should store in database table like .

comm       3/8    abc    region -1srt record in data base table .

comm    1/16     123    region- 2nd record in data base table.

for that i have to loop on each column and with respective rows to store in database table.

how to loop the table ...and how to find that cursor current row and current line ???

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Venkat,

Please try this code  in your module pool prog.

In your PAI of screen keep the fields of internal table in chain
for example.

LOOP AT ITAB

CHAIN.

FIELD:

hd1,

hd2,

hd3,

hd4,

hd5.

MODULE modify_itab ON CHAIN-REQUEST.

*** Here you can check the record (if required ) is fresh or already in
database and you can be able to do any arithmetic function here (if required)

ENDCHAIN.

ENDLOOP.

check the value of (table control current line) tc-current_line
and OK_CODE

in user commond write the code

CHECK ok_code = 'SAVE'.
PERFORM save.

now loop your internal table with work area . If the record are
already available in table then write update statement or else insert the
record into the data base