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

How to make time field empty/NULL?

former_member699182
Participant
0 Likes
4,094

I am trying to create a report program similar to sm37. But my program will not have the time field as parameter.

So i am trying to keep it blank. But when i pass the  table (which has the time field) to a FM, it automatically assumes value 000000.

I want this value to be kept null when the table is passed to my FM. I tried by specifying ls_btcselect-from_time = '  '. But it still takes 00000 as value.

How to make it NULL??

Any ideas?

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,024

Hi,

Internal representation of an empty time field is '000000' and it cannot be changed.

If you want it to be completely blank then change its type to C.

Data types such as I, D, T all have 0s filled when empty or initial so if a completely blank field is requied it should be of type C or N.

Regards,

Ashish

I am trying to create a report program similar to sm37. But my program will not have the time field as parameter.

So i am trying to keep it blank. But when i pass the  table (which has the time field) to a FM, it automatically assumes value 000000.

I want this value to be kept null when the table is passed to my FM. I tried by specifying ls_btcselect-from_time = '  '. But it still takes 00000 as value.

How to make it NULL??

Any ideas?

Thanks.

5 REPLIES 5
Read only

Former Member
0 Likes
2,025

Hi,

Internal representation of an empty time field is '000000' and it cannot be changed.

If you want it to be completely blank then change its type to C.

Data types such as I, D, T all have 0s filled when empty or initial so if a completely blank field is requied it should be of type C or N.

Regards,

Ashish

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,024

Ashish Rawat wrote:

so if a completely blank field is requied it should be of type C or N.

Incorrect

A numeric variable (type N) has an initial value with "0" for each position. E.g, a variable of type N length 2 will have an initial value of 00 & not '  '.

Read only

0 Likes
2,024

Thanks a lot Ashish and Suhas. But the field that I have right now is of type BTCSELECT.

DATA ls_btcselect TYPE BTCSELECT.
In this i am assigning values to ls-btcselect-from_time = '  '.

How can I make this empty? Any ideas?

Thanks.

Read only

0 Likes
2,024

As an addition, when I debug and saw sm37, the time field when left blank,gets passed as blank/null to the FM BP_JOB_SELECT_SM37B. Why doesnt it happen in my program? Am i missing something?

Thanks.

Read only

0 Likes
2,024

Resolved. Like below.

    IF ls_btcselect-from_time IS INITIAL.

       ls_btcselect-from_time = '      '.

    ENDIF.

    IF ls_btcselect-to_time IS INITIAL.

       ls_btcselect-to_time = '      '.

    ENDIF.

Thanks.