‎2018 Jun 13 8:31 AM
Hi All,
I had requirement to change the selection screen created_at field dynamically based on the report execution date.
created_at field is of data type DEC 15.
Domain for this field is of type COM_TSTMP
The values for this field will be stored in the format as shown below
07.01.2010 12:10:13 TO 20.01.2010 15:10:13
Due to this format i cannot populate the date dynamically.
so decided to use the FM RS_CHANGE_CREATED_VARIANT to change the variant based on execution of report and trying to populate the select options.
I am populate the field created_at manually as per my requirement
and passing the values to the tables parameter vari_contents of the function module RS_CHANGE_CREATED_VARIANT.
it is resulted in runtime error saying that Unable to interpret "20180613 00:00:01" as a number.
Is there any way to overwrite the variant values for the field which is of data type DEC.
I tried many ways but the result is same.
Regards
Jai
‎2018 Jun 13 9:43 AM
Looks like you're populating your field with the display format rather than the input format which is YYYYMMDDhhmmss
‎2018 Jun 13 9:43 AM
Looks like you're populating your field with the display format rather than the input format which is YYYYMMDDhhmmss
‎2018 Jun 13 10:14 AM
Thank you very much Mathew, Its working.
But the problem here is it is populating differently in the selection screen even though i am concatenating SY-DATUM and time as shown below.
CONCATENATE sy-datum '000001' INTO lv_dtfrm ....from value of created_at field
CONCATENATE sy-datum '235959' INTO lv_dtto ......TO value of created_at field
the variant in selection screen is updating as

Anything doing wrong here..
Regards
‎2018 Jun 13 12:40 PM
You should run it in debug and see how the data is being converted. Also consider that it might be better to use GET TIMESTAMP than to use SY-DATUM and concatenate.
‎2018 Jun 14 3:55 PM
Thank you Matthew.
But After debugging also still not able to trace.
I tried differently , By maintaining variable in TVRAVC.
And update it through program and retrieve the same by selecting the variant as selection varaible "T" and name of TVARVC variable for the field in the variant.
Regards
Raj
‎2018 Jun 13 9:51 AM
Hello
Will this ABAP statement do ?
CONVERT DATE syst-datum TIME syst-uzeit INTO TIME STAMP created_at TIME ZONE gv_timezone.
Regards Jack