Application Development 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: 

Update TVARVC

Former Member
0 Kudos

Is there a function module to update TVARVC table that holds the variants. Or do most people recommend a UPDATE statement to do so?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

9 REPLIES 9

Former Member
0 Kudos

Hi,

Create a table maintenance view and post entries by using transaction SM30

Regards

Krishna

Former Member
0 Kudos

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

0 Kudos

FASU_RS_CHANGE_CREATED_VARIANT does not help

0 Kudos

Currently I am doing this

UPDATE tvarvc SET low = i_mseg-charg WHERE name = something

But I hate to manually update database tables

0 Kudos

OK - see note 557314. It looks like transaction STVARV is what you need.

Rob

0 Kudos

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.

0 Kudos

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

0 Kudos

Thank you.

0 Kudos

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