11-14-2013 11:14 AM
Dear forumers,
I have the following scenario for a report program:-
The selection screen contains a data input parameter for timestamp data, P_START.
When a user maintains selection screen variants for the report program, the exact data values for P_START are saved as well.
However, there are times that the user would also prefer to maintain the data values for P_START dynamically, i.e. the first day of the current month.
This cannot be achieved currently. What can I do for enabling this feature?
In the selection screen variant under the Attributes setting, I am guessing that this can be done by selecting 'T (table variable from TVARVC)' as the Selection Variable. (Currently, this is blank.) Next, when checking on the Name of Variable, these appear in the search help:-
SAP_SCMA_DETAIL_LIST
SAP_SCMA_FISC_YEAR
SAP_SCMA_PERIOD
SAP_SCMA_POST_DATE
SAP_SCMA_POST_PERIOD
SAP_SCMA_SELV_PROJECT
SAP_SCMA_TEST_RUN
SAP_SCMA_VALUE_DATE
Would you please advise, on how shall I proceed with this?
Appreciate any input at all.
Many thanks.
P/S: P_START -- has the data format of UTC Time Stamp in Short Form (YYYYMMDDhhmmss)
11-14-2013 12:43 PM
Hello Deb,
Istead of choosing "T", just choose "D" and you would get option as First day of current month the the column 'Name of Variable..."
11-14-2013 11:40 AM
Hi Tan,
I think you have to use dynamic variants. This link will guide you how to use dynamic variant creation:please check
Regards,
Ajit
11-15-2013 8:30 AM
Hi Ajit,
I am unable to use dynamic variants for the reasons below:-
- The data type for P_START is timestamp, not date.
- In Variant Attributes, for P_START - when selecting the search help for the Selection Variable, only one option is made available --> T (table variable from TVARVC). The 'D (dynamic variant)' option that you mentioned is not available for this data type, timestamp.
Any other suggestions, please?
11-14-2013 12:43 PM
Hello Deb,
Istead of choosing "T", just choose "D" and you would get option as First day of current month the the column 'Name of Variable..."
11-15-2013 8:34 AM
Hi Anirban,
I am unable to use dynamic variants for the reasons below:-
- The data type for P_START is timestamp, not just date alone.
- Example: '14.11.2013 05:50:30'
- In Variant Attributes, for P_START - when selecting the search help for the Selection Variable, only one option is made available --> T (table variable from TVARVC). The 'D (dynamic variant)' option that you mentioned is not available for this data type, timestamp.
Any other suggestions, please?
11-15-2013 2:13 PM
Hello Deb,
I don't think you can maintain Timestamp like that. What you need to do is;
1) goto to SM30 and put TVARV.
2) Maintain a Parameter named "ZTIMESTAMP". Keep the value blank.
3) In your custom program, in the Initialization section, write this;
TABLES: tvarvc.
DATA: lx_tstamp TYPE timestamp,
ITAB_TVARVC LIKE tvarvc OCCURS 0 WITH HEADER LINE.
PARAMETERS: P_START TYPE timestamp.
INITIALIZATION.
GET TIME STAMP FIELD lx_tstamp.
ITAB_TVARVC-name = 'ZTIMESTAMP'.
ITAB_TVARVC-type = 'P'.
ITAB_TVARVC-numb = '0000'.
ITAB_TVARVC-low = lx_tstamp.
CONDENSE ITAB_TVARVC-low.
APPEND ITAB_TVARVC.
CLEAR ITAB_TVARVC.
MODIFY tvarvc FROM TABLE ITAB_TVARVC.
4) Then you can create a dynamica variant. Use the "T" in the selection variable and choose "ZTIMESTAMP".
The idea is whenever the variant is called, ZTIMESTAMP would be updated with current date and time.
11-21-2013 6:53 AM
Hi Anirban,
This was what I was looking for; much thanks~! Appreciate this.
Deborah