on 06-26-2013 2:44 PM
hi ,
I have a query regarding module pool
i created table using table control passing values from internal table and the structure is
Header 1 | Header 2 | Header 3 | Header 4 | Header 5 | Header 6 | Header 7 | Header 8 |
---|---|---|---|---|---|---|---|
comm_3/8 | comm_1/16 | comm_15/32 | - | - | - | - | |
abc | 123 | 555 |
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.