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

Problem in Updating the Variant values through program

jay_kumar8
Active Participant
0 Likes
2,430

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

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
1,761

Looks like you're populating your field with the display format rather than the input format which is YYYYMMDDhhmmss

5 REPLIES 5
Read only

matt
Active Contributor
0 Likes
1,762

Looks like you're populating your field with the display format rather than the input format which is YYYYMMDDhhmmss

Read only

jay_kumar8
Active Participant
0 Likes
1,761

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

Read only

matt
Active Contributor
0 Likes
1,761

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.

Read only

jay_kumar8
Active Participant
0 Likes
1,761

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

Read only

JackGraus
Active Contributor
0 Likes
1,761

Hello

Will this ABAP statement do ?

CONVERT DATE syst-datum TIME syst-uzeit INTO TIME STAMP created_at TIME ZONE gv_timezone.

Regards Jack