11-06-2007 9:21 PM
Hey gurus,
I have to write a program to read data from sets and modify the custom table..with the data read...I got a function module that reads data from the set...G_SET_GET_ALL_VALUES...
How shud i update the table with the read values...
Please guide me in this...
Thanks
Sam
11-06-2007 11:01 PM
you need to make a loop through the result table to get all the object related to that like:
For this example I am checkint the cost centers.
CALL FUNCTION 'G_SET_GET_ALL_VALUES'
EXPORTING
SETNR = SET_ID "RDI_SETS_4.0
TABLES
SET_VALUES = KO_VAL
EXCEPTIONS
SET_NOT_FOUND = 1
OTHERS = 2.
ranges: r_kostl for CSKS-KOSTL.
LOOP AT KO_VAL.
r_kostl-sign = 'I'.
r_kostl-options = 'BT'.
r_kostl-low = ko_val-from.
r_kostl-high = ko_val-to.
append r_kostl.
ENDLOOP.
select kostl from csks
into it_csks
where kostl in r_kostl.
loop at it_csks.
* insert data into your z table
endloop.
Regards,
Naimesh Patel
11-06-2007 11:01 PM
you need to make a loop through the result table to get all the object related to that like:
For this example I am checkint the cost centers.
CALL FUNCTION 'G_SET_GET_ALL_VALUES'
EXPORTING
SETNR = SET_ID "RDI_SETS_4.0
TABLES
SET_VALUES = KO_VAL
EXCEPTIONS
SET_NOT_FOUND = 1
OTHERS = 2.
ranges: r_kostl for CSKS-KOSTL.
LOOP AT KO_VAL.
r_kostl-sign = 'I'.
r_kostl-options = 'BT'.
r_kostl-low = ko_val-from.
r_kostl-high = ko_val-to.
append r_kostl.
ENDLOOP.
select kostl from csks
into it_csks
where kostl in r_kostl.
loop at it_csks.
* insert data into your z table
endloop.
Regards,
Naimesh Patel
11-07-2007 1:48 AM
Thanks for the reply Naimesh...
How shud i update the database table with the records in the internal table....
Please suggest..
Thanks
Sam
11-07-2007 3:12 AM
YOu can use the MODIFY option
Like:
MODIFY ZTAB from table ITAB.
Regards,
Naimesh Patel