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 table TVARV

Former Member
0 Likes
2,253

Hi,

I am writing a small program to update tavle TVARV. I don't want to use UPDATE TVARV statement,

is there any FM or Transaction I can use?

Thanks.

7 REPLIES 7
Read only

Former Member
0 Likes
1,423

Hello,

Use Modify statement to store the variant the TVARV table.

Thanks,

Jayant

Read only

Former Member
0 Likes
1,423

Hello,

Instead of using the TVARV table, you can use the table TVARVC.

If no record found then use INSERT statement to create a entry in table i.e. first time you execute your report, from the next time use MODIFY statement to update the values in the table.

Hope it helps.

Thanks,

Jayant

Read only

Former Member
0 Likes
1,423

Have a look at FM RS_VARIANT_CHANGE

And please search before asking.

Rob

Read only

Former Member
0 Likes
1,423

Hi everyone,

Thanks for your reply.

Sorry I didn't make the question clear.

I have an variable 'AUCIO' in table TVARV already, it's used to update the post period parameter

of program RKO7KO8G. I wrote a small program to update the table TVARV.

TABLES: T009B.

DATA: gv_low(3) type c,

GV_PERIV LIKE T009B-PERIV VALUE 'Z1',

GV_PERIOD LIKE T009B-POPER.

CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'

EXPORTING

I_DATE = SY-DATUM

I_PERIV = GV_PERIV

IMPORTING

E_BUPER = GV_PERIOD.

select single low into gv_low from tvarv

where name = 'AUCIO' and type = 'P'.

if gv_low ne gv_period.

update tvarv set low = gv_period

where name = 'AUCIO' and type = 'P'.

commit work.

endif.

The thing is, use UPDATE or INSERT, MODIFY statements is considered dangerous, so I'm

look some other ways to update the table, either through FM or transaction. Can anybody

give me suggestion?

Thanks.

Read only

0 Likes
1,423

What's the problem with the FM I mentioned?

Rob

Read only

0 Likes
1,423

Rob,

That FM is fine, I'm trying to use it.

Thanks

Read only

0 Likes
1,423

It's not documented, but if you search the forum, you'll probably find some pointers on how to use it.

Rob