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 Table Dynamically

Former Member
0 Likes
19,641

Hi,

I am having 2 parameters in TVARVC Table.

1. Fiscal year - "SAP_SCMA_FISC_YEAR"

2. Period - "SAP_SCMA_PERIOD"

Do we have any program to update these 2 parameters with system defaults.

Today's date is 26/10/2009

Ex : Fiscal Year should be 2009

Period 09

It should be update on starting of every month?

Thanks

Bhuvana

10 REPLIES 10
Read only

Former Member
0 Likes
8,637

Try creating a program which does BDC for SM30 of the table and you can update the values in the table.

Thanks,

Aravind

Read only

0 Likes
8,637

Hi,

Use FM 'RS_VARIANT_CHANGE',

The varaints related function modules can be found in Function group: SVAR.

Regards,

Praveen

Read only

Former Member
0 Likes
8,637

Hi ,

You can use function module 'RS_CHANGE_CREATED_VARIANT' .

Regards

Satish

Read only

Former Member
0 Likes
8,637

Hi,

Try using the Fm "RS_CREATE_VARIANT".

please close the thread, if solved

Regards,

Aditya

Read only

0 Likes
8,637

Hello,

You can wrote a progam like this exemple

SELECT * FROM TVARVC WHERE NAME = 'SAP_SCMA_FISC_YEAR'.

TVARV-LOW = new_value .

UPDATE TVARV.

ENDSELECT.

And you create a job wich start at the beginin of the month

Thierry

Read only

Former Member
0 Likes
8,637

Hi,

Updating of table TVARVC Dynamically can be done by writing a program and scheduling the same as batch job to run at fixed interval as starting of the month.

Thanks,

Vengal Rao.

Read only

Former Member
0 Likes
8,637

Resolved

Read only

0 Likes
8,637

Hi Bhuvaneswari ,

Could you please post how you resolved the issue to update TVARVC table with system defaults.

As I have a similar reqt. where I wud be passing values from selection screen to update the TVARVC values.

Regards,

Gaurav

Read only

0 Likes
8,637

Hi,

Please check the below code.

INITIALIZATION.

p_date = sy-datum.

START-OF-SELECTION.

PERFORM fiscal_period_determine.

PERFORM update_tvarvc_table.

FORM fiscal_period_determine .

CALL FUNCTION 'FI_PERIOD_DETERMINE'

EXPORTING

i_budat = p_date

i_bukrs = gc_bukrs

IMPORTING

e_gjahr = gv_year

e_poper = gv_period.

ENDFORM.

UPDATE tvarvc SET sign = gc_i opti = gc_eq low = gv_year WHERE name = 'SAP_SCMA_FISC_YEAR'.

IF sy-subrc = 0.

gv_flag1 = gc_x.

ENDIF.

UPDATE tvarvc SET sign = gc_i opti = gc_eq low = gv_period WHERE name = 'SAP_SCMA_PERIOD'.

IF sy-subrc = 0.

gv_flag2 = gc_x.

ENDIF.

IF gv_flag1 = gc_x AND gv_flag2 = gc_x.

MESSAGE 'TVARVC Table is Successfully Updated'(002) TYPE 'S'.

ELSE.

MESSAGE 'Error in Updating TVARVC Table'(003) TYPE 'E'.

ENDIF.

Thanks

Bhuvana

Read only

0 Likes
8,637

Hi Bhuvana

Where did you put above code?