05-29-2009 9:49 PM
Is there a function module to update TVARVC table that holds the variants. Or do most people recommend a UPDATE statement to do so?
05-29-2009 9:58 PM
See if FM FASU_RS_CHANGE_CREATED_VARIANT helps.
I take it back - It's probably not what you want.
Rob
Edited by: Rob Burbank on May 29, 2009 5:00 PM
05-29-2009 9:55 PM
Hi,
Create a table maintenance view and post entries by using transaction SM30
Regards
Krishna
05-29-2009 9:58 PM
See if FM FASU_RS_CHANGE_CREATED_VARIANT helps.
I take it back - It's probably not what you want.
Rob
Edited by: Rob Burbank on May 29, 2009 5:00 PM
05-29-2009 9:59 PM
05-29-2009 10:14 PM
Currently I am doing this
UPDATE tvarvc SET low = i_mseg-charg WHERE name = somethingBut I hate to manually update database tables
05-29-2009 10:22 PM
OK - see note 557314. It looks like transaction STVARV is what you need.
Rob
05-29-2009 10:39 PM
Thanks for the OSS note. But I am looking for a function module that I can use within my user exit to update TVARC table with the new variant value. I should be able to pass the variant name and value and update table TVARC.
06-01-2009 2:21 PM
If you do a where used list for this table, I think you'll find that SAP just does inserts to this table, so I don't see anything wrong with your current approach.
Rob
06-01-2009 9:27 PM
06-02-2009 5:07 PM
have a look on my programm to update tvarvc:
REPORT ZVS_TVARV.
.
tables: tvarvc.
data: dat(2) type c
,year(4) type c.
data itab like tvarvc occurs 0 with header line.
data wa_itab like itab.
select * from tvarvc
where name eq 'SAP_SCMA_PERIOD'.
move-corresponding tvarvc to itab.
append itab.
endselect.
move-corresponding tvarvc to wa_itab.
move sy-datlo+4(2) to dat.
case dat .
when '01'.
move '1' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
when '02'.
move '2' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
when '03'.
move '3' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
when '04'.
move '4' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
when '05'.
move '5' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
when '06'.
move '6' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
when '07'.
move '7' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
when '08'.
move '8' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
when '09'.
move '9' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
when '10'.
move '10' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
when '11'.
move '11' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
when '12'.
move '12' to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_PERIOD'.
endcase.
update tvarvc from table itab.
refresh itab.
select * from tvarvc
where name eq 'SAP_SCMA_FISC_YEAR'.
move-corresponding tvarvc to itab.
append itab.
endselect.
move-corresponding tvarvc to wa_itab.
move sy-datum(4) to year.
move year to wa_itab-low.
modify itab from wa_itab transporting low where name eq
'SAP_SCMA_FISC_YEAR'.
update tvarvc from table itab.maybe it helps.
regards tony