‎2009 Jul 14 12:28 PM
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.....
‎2009 Jul 14 12:46 PM
Hi,
VBAK & VBAP don't have fields like the required format of date/time.
u hav to create the value by concatenation....
Amitava
‎2009 Jul 14 12:48 PM
‎2009 Jul 14 12:52 PM
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.
‎2009 Jul 14 12:53 PM
Hi Bobby
Extract date and time from vbak and vbap table, convert them in proper format and concatenate....
Amitava
‎2009 Jul 14 12:54 PM
Hi Bobby,
Just Concatenate both the fields.
lIke
CONCATENATE sy-datum sy-uzeit INTO gv_cur_timestamp.
Regards
Sachin
‎2009 Jul 15 5:41 AM
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.
‎2009 Jul 15 5:57 AM
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
‎2009 Jul 24 10:35 AM
‎2009 Jul 24 10:38 AM
‎2009 Jul 24 10:47 AM