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

HH:MM Parameter in Selection Screen

Former Member
0 Likes
2,337

My requirement is to have a parameter taking input as "HH:MM" not "HH:MM:SS". It should also have a F4 help. Is there any standard solution (any API?) for this or do I have to write a custom F4 help?

My requirement is to have a parameter taking input as "HH:MM" not "HH:MM:SS". It should also have a F4 help. Is there any standard solution (any API?) for this or do I have to write a custom F4 help?

6 REPLIES 6
Read only

GauthamV
Active Contributor
0 Likes
1,774

Try this FM.

F4_CLOCK

Read only

naimesh_patel
Active Contributor
0 Likes
1,774

No need to have any complex logic. Addition VISIBLE LEN would work for you..!


PARAMETERS: p_time type sy-uzeit VISIBLE LENGTH 5.

Regards,

Naimesh Patel

Read only

0 Likes
1,774

@gautham,

F4_clock is by default functionality of a time variable.

@naimesh,

visible length only shortens the visibility but the format remains same as HH:MM:SS.. and with same F4..as of F4_clock...

@Saurav,

you can replicate the F4 help with your own modal screen with listboxes. that will help i guess. little tedious process but will work.. mean while lets carry on checking more ways...

Read only

0 Likes
1,774

@naimesh,

visible length only shortens the visibility but the format remains same as HH:MM:SS.. and with same F4..as of F4_clock...

You can simply ignore last two characters...

Regards,

Naimesh Patel

Read only

0 Likes
1,774

what about F4... lets try this..

type-POOLs : vrm.
DATA : v TYPE vrm_values.
DATA : vw LIKE LINE OF v.

INITIALIZATION.
  vw-key = '1'.
  vw-text = '01'.
  APPEND vw TO v.

  vw-key = '2'.
  vw-text = '02'.
  APPEND vw TO v.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = 'P1'
      values          = v.

  refresh v.
  vw-key = '10'.
  vw-text = '10'.
  APPEND vw TO v.

  vw-key = '20'.
  vw-text = '20'.
  APPEND vw TO v.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = 'P2'
      values          = v.
PARAMETERS: p_time type sy-uzeit VISIBLE LENGTH 5 MODIF ID AA.
SELECTION-SCREEN BEGIN OF SCREEN 100.
  SELECTION-SCREEN BEGIN OF line.
    PARAMETERS: p1(2) as LISTBOX VISIBLE LENGTH 4.
    PARAMETERS: p2(2) as LISTBOX VISIBLE LENGTH 4.
  SELECTION-SCREEN end OF line.
SELECTION-SCREEN end OF SCREEN 100.

at SELECTION-SCREEN on VALUE-REQUEST FOR P_TIME.
  call SELECTION-SCREEN 100 STARTING AT 10 10.
  p_time(2) = P1.
  P_time+2(2) = p2.
  P_time+4(2) = 00.

Read only

0 Likes
1,774

Using data element ATIM ( or any data elemnt with domain HHMM) will create parameter with right output length

parameters : p_time type ATIM .