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

Date + Timestamp

Former Member
0 Likes
2,838

For a custom BAPI, I need to pass a date field as a selection criteria. And the date field should take value of the form:

mm/dd/yyyy hh:MM:ss:SSS

This custom BAPI is used to extract sales order details from VBAK and VBAP tables starting from the above said date-timestamp.

Is it possible? Does VBAK & VBAP has fields suppporting the above format of date/time?

Plz help.....

10 REPLIES 10
Read only

Former Member
0 Likes
1,869

Hi,

VBAK & VBAP don't have fields like the required format of date/time.

u hav to create the value by concatenation....

Amitava

Read only

0 Likes
1,869

Hi AD

How can that be done? Plz let me know

Thx

BD

Read only

0 Likes
1,869

Hi Bobby,

In VBAK table u have two fields called ERDAT(Creation Date) and ERZET(Entry Time).

I thnk u need to concatenate these two fields for forming a date-time stamp.

Use concatenate statement .

Like, CONCATENATE field 1 field2 into field3.

Regards,

Lakshman.

Read only

0 Likes
1,869

Hi Bobby

Extract date and time from vbak and vbap table, convert them in proper format and concatenate....

Amitava

Read only

0 Likes
1,869

Hi Bobby,

Just Concatenate both the fields.

lIke

CONCATENATE sy-datum sy-uzeit INTO gv_cur_timestamp.

Regards

Sachin

Read only

Former Member
0 Likes
1,869

Hi,

In VBAK table we have ERDAT (Date) and ERZET(Time) fields. You can pass the date field in format 'mm/dd/yyyy hh:MM:ss' as a string. Since the time field ERZET is of format HH:MM:SS, we cannot compare the time in format 'hh:MM:ss:SSS'.

After reading this date time value to custom BAPI, you can separate the date & time and then compare it with ERDAT & ERZET.

Below is the code you can use for splitting.

DATA: datetime TYPE string.

DATA: v_date TYPE string,

v_time TYPE string,

date1 TYPE sy-datum,

time1 TYPE sy-uzeit.

MOVE '10/25/2009 01:02:03' TO datetime.

*Split the date time.

MOVE datetime(10) TO v_date.

MOVE datetime+11(8) TO v_time.

CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'

EXPORTING

datum = v_date

dtype = 'DATS'

IMPORTING

idate = date1.

WRITE:/ date1.

CALL FUNCTION 'CONVERT_TIME_INPUT'

EXPORTING

input = v_time

IMPORTING

output = time1.

WRITE:/ time1.

I hope this would help you resolve the issue.

- Pratiksha.

Read only

Former Member
0 Likes
1,869

Hi Bobby,

In VBAK table u have two fields called ERDAT(Creation Date) and ERZET(Entry Time).

I thnk u need to concatenate these two fields for forming a date-time stamp.

Use concatenate statement .

Like, CONCATENATE field 1 field2 into field3.

Regards,

Lakshman.

Fetch the value of two fields (ERDAT(Creation Date) and ERZET(Entry Time) from Table VBAK) in a Work Area or variable.

For Example,

Types : Begin of t_vbak,

ERDAT type Erdat,

ERZET type ERZET,

end of t_vbak.

data : gt_vbak type table of t_vbak,

gs_vbak type t_vbak,

l_var1(25) type C. " Variable which will store mm/dd/yyyy hh:MM:ss:SSS

Select ERZET

ERDAT

into table gt_vbak.

Loop at gt_vbak into gs_vbak.

CONCATENATE gs_vbak-ERDAT+4(2)

'/ '

gs_vbak-ERDAT+6(2)

'/ '

gs_vbak-ERDAT(4)

' '

gs_vbak-ERZET(2)

':'

gs_vbak-ERZET+2(2)

':'

gs_vbak-ERZET+4(2)

into l_var1.

endloop

Thanks & regards

ShreeMohan

Read only

Former Member
0 Likes
1,869

reqmnt dropped

Read only

0 Likes
1,869

>

> reqmnt dropped

Because of recession time..

Read only

0 Likes
1,869

No Vijay... coz of too much of project works..