Application Development and Automation 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: 
Read only

Update TVARVC

Former Member
0 Likes
10,339

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
Read only

Former Member
0 Likes
6,241

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

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

9 REPLIES 9
Read only

Former Member
0 Likes
6,241

Hi,

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

Regards

Krishna

Read only

Former Member
0 Likes
6,242

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

Read only

0 Likes
6,241

FASU_RS_CHANGE_CREATED_VARIANT does not help

Read only

0 Likes
6,241

Currently I am doing this

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

But I hate to manually update database tables

Read only

0 Likes
6,241

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

Rob

Read only

0 Likes
6,241

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.

Read only

0 Likes
6,241

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

Read only

0 Likes
6,241

Thank you.

Read only

0 Likes
6,241

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