Set dynamic variant for time
Hi,
I have selection options for field as defined as TIME . I need to set dynamic variant for this field as
TIME should be "from"='current time-30 minutes' and "to"='24:59:59'.
This report going to run in 00 hours and 30 hours (48 times ie 24 X 2)
PS : Pl. remember this is for a SAP standard report
Any Info?
a®
Naimesh Patel wrote:
> I digged more deeper and found one FM RS_VARI_V_INIT_TIME which fill the options like Current Time, Current Time +/- ???, From Start of Day to Now etc. and Surprisinly all 3 options are hardcoded in it..!!
As you suggested due to hardcoded values here , we could not able to do much on this.
So i came in round away solution. Whenever program A called ( program with TIME selection input) i have called another custom program C . (This custom program will using the following function module RS_VARIANT_CONTENTS, and RS_VARIANT_CHANGE , So get the DEFAULT variant content of program A and change the variant content with LOW as current time - 30 and HIGH with 24:59:59) as preceding job.
In PI 7.01 system program A always called in JOB mode
Thanks for info.
a®
Similar Messages
-
How Can i SEt Dynamic Variant For WEEK on SELECTION Screen.pls help me..
<b>Hi ALL..
Pls Help Me for this Problem..i am very confused how can i do that...plese tell me proper process..
i want set Dynamice Varient for WEEK on Selection screen..
I have ALrady SET Dynamice Varient for DATE on Selection Screen.ther isd option is D...but in case of WEEK there is a no option...
Plese help me..
thaks in advance..
pls help me..</b>Hello,
Define your select-option in TVARV (assume Z_THISWEEK). And use a program like:
DATA:
zlv_week TYPE KWEEK.
call function 'DATE_GET_WEEK'
exporting date = syst-datum
importing week = zlv_week.
SELECT SINGLE *
FROM tvarvc
WHERE name = 'Z_THISWEEK'
AND type = 'S'
AND numb = '0000'.
tvarvc-low = zlv_week.
IF syst-subrc <> 0.
tvarvc-name = 'Z_THISWEEK'.
tvarvc-type = 'S'.
tvarvc-opti = 'EQ'.
tvarvc-sign = 'I'.
tvarvc-numb = '0000'.
insert tvarvc.
ELSE.
update tvarc.
ENDIF.
Regards,
John. -
How to set Dynamic variant for a program
Hello experts,
I want to set variants dynamically on a selection screen. Please help me.
Thanks,
Ashwani.Hi Ashwani,
The variant can be set using:
SUBMIT program name [USING SELECTION-SET <var>]
USING SELECTION-SET <var>
This option tells the system to start the called program with the variant <var>.
For further details you can refer the link below:
http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba51a35c111d1829f0000e829fbfe/frameset.htm
Also refer,
http://sapbrainsonline.com/sap-training/SAP-tutorial-pdf-material_425.html
Regards,
Soundarya.
Edited by: K.Soundarya Singh on Mar 16, 2010 7:16 AM -
How to set up Dynamic Variants for job which is based on Pay Period
Hi,
We need to set up dynamic variant for payroll interface. This interface is based on Pay periods and that is why we need to use different variant for each month. Letus know how to set up dynamic variant which will take care of Pay PeriodsHi, Thnx for reply.
We are not changing the control records, current period will be some old period in system.
payroll is not processed in SAP, -
Hi,
How to put current date in report output through variants.
I should not use events, when user selects variants then i should place the current date in my selection-screen.
help full information will be appreciated.Hi Rams,
U have to create a dynamic variant for this.
Fallow these steps.
1. Fill all the selection screen values including date(Current date).
2. Save it as variant(ctrl+S), give variant name and description.
3. In the same screen u can see some check boxes corrosponding to each selection screen parameter.
Now for the date field select the check box under
L Selection variable and then press the push button selection variables in the tool bar.
4. Now u will get the date range in the next screen.
5. Here press the yellow light under D, it will become green colour.
5. Next press drop down(Small arrow pointing down at the end of date)
6. Now u will get a list of options for calculations.
7. Here select current date.
8. Now save the variant.
This completes setting up of dynamic variant.
Now when ever u select this variant it will populate the selection screen with current date and remaining fields with the data u save while creating the variant.
Hope this will solve ur problem.
Thanks,
Vinod. -
Dynamic Variant for Date filed
Hi All,
I need to create a dynamic variant for date fields for standard report.
in date Low field...value will be harcoded as '01.01.2011' and S_Date-high date field should be current date - 1.
I dnt want to go for code in report to handle this.
I tried with many option but could not able to see up the dates like as above.
Kindly help.
PiyushHi,
try this code
data prevday like sy-datum.
SELECT-OPTIONS s_date for sy-datum DEFAULT '20110101' .", sy-datum-1.
INITIALIZATION.
AT SELECTION-SCREEN OUTPUT.
* S_DATE-HIGH = PREVDAY.
prevday = sy-datum.
s_date-high = prevday.
modify s_date index 1.
Hope the help
Edited by: j.ortiz on Jan 27, 2011 3:01 PM -
How to set "Configuration Variant" for a sales order item using function
Hello All,
I use function module 'SD_SALES_DOCU_MAINTAIN' to create Customer Indep. Requirements but how to set "Configuration Variant" for a sales order item.
Is their any idea or sample code?Hi Zhijun zhang,
<u>http://help.sap.com/saphelp_nw2004s/helpdata/en/c0/98038ce58611d194cc00a0c94260a5/content.htm</u>
<u>http://help.sap.com/saphelp_nw04/helpdata/en/c0/980374e58611d194cc00a0c94260a5/content.htm</u>
A variant is simply an SAP report where the parameters for running the report have been set by the user and then saved with unique name. This allows future retrieval and execution of the report faster without reentering the parameters. As a convention the variant name should start with with the digits 50 so searchs for LHU variants is easier and quicker.
The first link will guide you by screen shot wise.
Award points if it adds information.
Thanks
Mohan -
Dynamic VARIANT FOR Fiscal Period and dates
Hi
We have a custom transaction with date and fiscal period as vairable parameters and need to know if we can generate a DYNAMIC VARIANT for these based on FISCAL PERIOD.
Replies will rewardedHi,
Use transaction OB29, this is in the IMG.
Or
Path..
SPRO -> SAP REFERENCE IMG -> FINANCIAL ACCOUNTING -> FINANCIAL ACCOUNTING GLOBAL SETTINGS -> FISCAL YEAR -> MAINTAIN FISCAL YEAR...
<b>Reward points</b>
Regards
Message was edited by:
skk -
Dear All,
Please let me know how to create Dynamic Variant for
the report RSEXARCA.
Kindly let me know the procedure.
Regards,
KCR.Hi,
Use this function Module : RS_VARIANT_ADD
U can even get list of Variant Related function module
like RS_VARIANT_CHANGE.
Just go se37 enter RS_VARIANT* and press F4.
One Ex.
U can use RS_VARIANT_CONTENTS for find out the values for the varient fields.
U can use RS_VARIANT_ATTR_SAVE to save changes to the variants
Mark the Helpfull answers & close the thread.
Regards
Manoj
Message was edited by: Manoj Gupta -
How to set a dynamic variant for date in select-options in the upper field
Hi Variant experts Good Evening!
I have the following problem while setting up a dynamic varinat .
Ex: select-options: dat for sy-datum.
I am able to save the lower limit as a dynamic value but not able to save the upper values as dynamic in the select-options. Could any of you please help me in this.
Regards
Ravi.i hope dynamic variant concept is not there,
but u can use the fn module DYPRO_GET_VALUES and
DYNPRO_SET_VALUES
DYNPRO_GET_VALUES gets the values in the screen,
DYNPRO_SET VALUES sets the values.
first get the values, compare and set the values as u want -
How to set default variant for selection screen
Hi,
I want to make one variant as default for selection screen for one user.
For eg., take COOIS. For the selection screen, i have 3 variants. But i want one variant to be default. Thsi is not for all users. Thsi is for particular user.
I am not seeing any way to do this. please help me..
Thanks
SriniHi,
If you are using Z program then you can ask your developer to get Variant name Runtime from Parameter ID.
This means you decide a Parameter ID name : ZVAR in your Z program and ask your developer to load variant each time your Z program loads.
Now, second step will be using SU01 transaction you can set value of ZVAR in Parameters tab for the user. This value will be the variant which you created for this user.
This will solve your problem and you can make n number of variants and assign it to different users.
Regards,
Arpit -
Dynamic variants for a background job
Hi,
I need to set up a background job for a dynamic variant. To elaborate my selection screen has date ranges which need to change dynamically , if the job is secheduled on weekly basis the selection date range should change automatically in the variant. I got to know that the same is possible through the table TVARV. Can I know about the method of setting up the same?
Thanks,
ShailajaYou can set a dynamic date to today date or some other date without using the table TVARV.
To set the dynamic date:
Save variant on the selection screen.
In the vairant screen, press F4 against your field in the column "Selection Variable"
Select D here.
In the column Name of the variable, press F4 to have the list of the possible rules.
Here you can select "Current date - xxx,current date + yyy" if you want to have certain period.
When you select this system will pop up to put the values for XXX and YYY.
Say for last 7 days, you can set the values XXX as 7 and YYY as0.
But the best way is to change the program, if possible, and fill the select option in the intialization event.
Regards,
Naimesh Patel -
Dynamic variant for select option High value
Hi ,
Please help me in creating dynamic variable for a select option date field high value.
II tried the following method:
1. Enter the values in the selection screen
2. Save the variant using the SAVE button
3. In the next screen for the date variable select the 'Selection variable' checkbox (L) and click on the button 'Selection variable' in the toolbar.
4. Now you will see this variable in the next screen with 3 types of buttons. Click on the middle button (i.e. D - Dynamic date calculation).
5. Click on the down arrow button and select the option 'Current Date'.
5. Save the variant.
But it is saving the date value in Field LOW of select option( From value).
I need it in TO field( High value).
Please help.
regards,
SheebaHi Sheeba
we can do it other way .. Select the same steps as you have done but after the assigning the value current date to low ..click on the selection option push button at the application bar and choose the 'less than or equal to' option to your select option value and try the same ....
I guess this would throw you same results as that of the value in the high value button
Cheers,
Jacks. -
Dynamic Variant for Date Range
Making the Variant for Date or Date Range Dynamic in the Selection Screen of any Program.
There are actually many ways you can make the Variant for Dateu2019s Dynamic.
1. Providing he Values in the Variant Variables.
2. By creating the variables in the table TVARVC
3. By Initializing the values in the program itself.
I saw many posts with respect to these and found that everyone has their own way of dealing. Even I wrote code in the program initialization to get this done.
Here in this post I am showing you the easiest option which is available in the Variant creation.
EX : If you want to execute the batch job based on a date range.
SY-DATE u2013 60 days , that means always your program should execute the batch job based on System Date. And the variant should change accordingly.
Following are the step by stop to do that.
1. Select your program and select the Variant Radio button and then Click on Display.
2. It will pop up a screen with variant option below the program name.
3. Enter the Variant name and click on Create
4. You will see a screen, with the Attributes button.
5. Once you click on the Attributes button, it will take you a screen with selection option.
6. In my scenario my input is based on Calender Day, so select the Selection Variable for Calender Day: You will find 2 options T & D.
7. Select D: Dynamic date Calculation, then select the Name of Variable (input using f4). You can find many options.
8. Scroll down the Variant Attributes and select current date u2013 xxx, current date + yyy
9.Though it seems to be inactive, just double click on the row to provide the date range.
10. Just enter the value for xxx and yyy to get you dynamic range based on number of days
11. In my scenario I have to consider System Date u2013 60 days. 0 means current day.
12. Click on OK to check the range has been reflected or not. Then save the Variant and check the value by executing the program with saved Variant.
You can check the same in blog with all the screen shots attached but this thing is so easy you don't require screen shots.
Regards
Shankar ChintadaHi Shankar,
It would be great if you can put this information in Wiki .
Pravender -
Create Dynamic variant for date field
Hello all,
I need to have the current month year displayed in my selection screen in format MM.YYYY and the field is of type SPMON (Period to analyze - month).
and while saving the variant it is showing only 'T' (entries from TVARVC table) in "selection variable" field and not showing 'D' (Dynamic selection) for the above field.
So,please help me in resolving this issue.
Thanks in advance.hi
good
go through this code,i hope this ll help you to create the dynamic variant.
Please find the sample using RS_CREATE_VARIANT (FM).
It make use of other FM also , just have a look .
Hope this may help you.
REPORT ZEXAMPLE.
DATA: JVARI_DESC LIKE VARID,
RC LIKE SY-SUBRC,
VARIANT_TEXT LIKE VARIT-VTEXT,
JVT LIKE VARIT OCCURS 0 WITH HEADER LINE,
SELPA LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
PARMS LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
OBJS LIKE VANZ OCCURS 0 WITH HEADER LINE.
PARAMETERS: P_VAR LIKE RSVAR-VARIANT. "NAME OF VARIANT
JVARI_DESC-REPORT = SY-REPID.
JVARI_DESC-VARIANT = P_VAR.
JVARI_DESC-ENAME = 'EXAMPLES'.
JVT-REPORT = SY-REPID.
JVT-VARIANT = P_VAR.
JVT-LANGU = SY-LANGU.
JVT-VTEXT = 'FUNCTION EXAMPLES'.
APPEND JVT.
CLEAR SELPA.
SELPA-SIGN = 'I'.
SELPA-OPTION = 'EQ'.
SELPA-KIND = 'P'.
SELPA-SELNAME = 'P_VAR'.
SELPA-LOW = P_VAR.
APPEND SELPA.
CHECK IF VARIANT EXISTS
CALL FUNCTION 'RS_VARIANT_EXISTS'
EXPORTING
REPORT = JVARI_DESC-REPORT
VARIANT = P_VAR
IMPORTING
R_C = RC
EXCEPTIONS
NOT_AUTHORIZED = 1
NO_REPORT = 2
REPORT_NOT_EXISTENT = 3
REPORT_NOT_SUPPLIED = 4
OTHERS = 5.
IF RC = 0 AND SY-SUBRC EQ 0.
DELETE OLD VARIANT
CALL FUNCTION 'RS_VARIANT_DELETE'
EXPORTING
REPORT = JVARI_DESC-REPORT
VARIANT = P_VAR
FLAG_CONFIRMSCREEN = 'X'
EXCEPTIONS
NOT_AUTHORIZED = 1
NOT_EXECUTED = 2
NO_REPORT = 3
REPORT_NOT_EXISTENT = 4
REPORT_NOT_SUPPLIED = 5
VARIANT_LOCKED = 6
VARIANT_NOT_EXISTENT = 7
NO_CORR_INSERT = 8
VARIANT_PROTECTED = 9
OTHERS = 10.
IF SY-SUBRC NE 0.
WRITE: 'UNABLE TO DELETE VARIANT:', P_VAR ,'STATUS=', SY-SUBRC.
EXIT.
ELSE.
WRITE:/ P_VAR, 'DELETED'.
ENDIF.
ELSE.
WRITE:/ P_VAR, 'DOES NOT EXIST'.
ENDIF. " ALREADY EXISTS
CALL FUNCTION 'RS_CREATE_VARIANT'
EXPORTING
CURR_REPORT = JVARI_DESC-REPORT
CURR_VARIANT = P_VAR
VARI_DESC = JVARI_DESC
TABLES
VARI_CONTENTS = SELPA
VARI_TEXT = JVT
EXCEPTIONS
ILLEGAL_REPORT_OR_VARIANT = 1
ILLEGAL_VARIANTNAME = 2
NOT_AUTHORIZED = 3
NOT_EXECUTED = 4
REPORT_NOT_EXISTENT = 5
REPORT_NOT_SUPPLIED = 6
VARIANT_EXISTS = 7
VARIANT_LOCKED = 8
OTHERS = 9.
IF SY-SUBRC EQ 0.
WRITE:/ 'VARIANT', P_VAR, 'CREATED FOR PROGRAM', JVARI_DESC-REPORT.
ELSE.
WRITE:/ 'VARIANT', P_VAR, 'NOT CREATED FOR PROGRAM', JVARI_DESC-REPORT.
EXIT.
ENDIF.
CALL FUNCTION 'RS_VARIANT_CONTENTS'
EXPORTING
REPORT = JVARI_DESC-REPORT
VARIANT = P_VAR
TABLES
VALUTAB = PARMS
OBJECTS = OBJS
EXCEPTIONS
VARIANT_NON_EXISTENT = 1
VARIANT_OBSOLETE = 2
OTHERS = 3.
IF SY-SUBRC NE 0.
WRITE : / 'ERROR READING VARIANT CONTENTS.'.
ELSE.
CALL FUNCTION 'RS_VARIANT_TEXT'
EXPORTING
LANGU = SY-LANGU
CURR_REPORT = JVARI_DESC-REPORT
VARIANT = P_VAR
IMPORTING
V_TEXT = VARIANT_TEXT.
WRITE:/ 'VARIANT DESCRIPTION:', VARIANT_TEXT.
LOOP AT PARMS.
CHECK PARMS-LOW NE SPACE OR PARMS-HIGH NE SPACE.
READ TABLE OBJS WITH KEY NAME = PARMS-SELNAME.
WRITE : /2 PARMS-SELNAME, OBJS-TEXT,
45 PARMS-KIND,
PARMS-SIGN,
PARMS-OPTION,
PARMS-LOW,
PARMS-HIGH.
NEW-LINE.
ENDLOOP.
SKIP.
ENDIF.
some other approach....
This function module selects the Selection Screen contents
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = sy-repid
TABLES
selection_table = loc_int_tab
EXCEPTIONS
not_found = 1
no_report = 2
OTHERS = 3.
IF sy-subrc NE 0.
MESSAGE i000 WITH 'Error in RS_REFRESH_FROM_SELECTOPTIONS'(029).
LEAVE LIST-PROCESSING.
ENDIF.
Craete the variant VAR1
CALL FUNCTION 'RS_CREATE_VARIANT'
EXPORTING
curr_report = sy-repid
curr_variant = wf_variant
vari_desc = loc_varid
TABLES
vari_contents = loc_int_tab
vari_text = loc_varit
EXCEPTIONS
illegal_report_or_variant = 1
illegal_variantname = 2
not_authorized = 3
not_executed = 4
report_not_existent = 5
report_not_supplied = 6
variant_exists = 7
variant_locked = 8
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE i000 WITH 'Error while creating dynamic variant'(028).
LEAVE LIST-PROCESSING.
ENDIF.
reward point if helpful.
thanks
mrutyun^
Maybe you are looking for
-
Using WAIT step in Sync/Async Bridge
I am using a sync/async bridge and placed a 1 minute wait step in between my async send and async reply. When I test my process, the async reply comes in but then my 1 minute wait eventually times out and gives me an error. Can someone guide me in
-
Flash CS5 problem - missing text
We've got several Flash files created by a partner organization that we're trying to edit. The files are for an e-learning course and contain four or five "tabs," each with a multiple choice or true/false question, each option labeled A, B, C, etc..
-
Windows 7, Oracle DB, Instant Client and VBScript
I'm trying to to connect to a Oracle database via vbs on a Windows 7 machine using the instant client. I get an error [Oracle][ODBC][Ora]Ora-12560: TNS:protocol adapter error Code 80004005. Script still works fine in XP using the Microsoft ODBC for
-
Hi Friends How system generate Reconciliation while doing diffrent types of transactions ex Payment lot Account maintenance etc Regards Srinivas
-
Hi all, I have some questions, please help me soon. Table source: - How can I use URL template to display data of many columns, not only the text column? It means that do I have to concat these columns into one? - If I have a database with a hundreds