2009 Sep 25 11:35 AM
Hi Experts,
I have query regarding data type of date field while running bdc.
Like for e.g
data : budat type bseg-budat.
instead of that we have to write budat1(6) type c.
If you try with type budat than the upload of data is not proper while uploading.
I want to know that what is the reason.
Thanks & Regards,
Vipul
Hi Experts,
I have query regarding data type of date field while running bdc.
Like for e.g
data : budat type bseg-budat.
instead of that we have to write budat1(6) type c.
If you try with type budat than the upload of data is not proper while uploading.
I want to know that what is the reason.
Thanks & Regards,
Vipul
2009 Sep 25 11:40 AM
Hi,
It depends on the date format from the source your are uploading and using in the BDC. If the date format is anything other than YYYYMMDD, you will have to upload using budat1(6) type c and do the necessary conversions before using it in the BDC field. That must be the reason why you are using budat1(6) type c
If the date format is YYYYDDMM directly in the upload file, you can use
data : budat type bseg-budat.
Regards,
Vikranth
2009 Sep 25 11:54 AM
type d has internal representation which is not accepted by reports. They expect a human readable date format.
convert those with the
write ... to ... DD/MM/YYYY.stetement.
2009 Sep 25 12:00 PM
Hi,
For a BDC the date is expected in a format as per the user settings.
While getting the date from the flat file get it into a variable of type c length 8 or type sydatum.
But assuming that the date coming from the file is in format YYYYMMDD.
Then while transferring to the field of the screen use WRITE TO statement so that the date comes on the screen as per the user settings.
Regards,
Ankur Parab
2009 Sep 25 12:21 PM
Hi ankur,
Thanks for reply. plz clear how to write syntax for 'Write to' according to you.
regards,
vipul
2009 Sep 25 12:56 PM
Hi,
while passing Date and currency fields to the BDC screen you need to pass character field..
data : w_date(10) type c.
write sy-datum to w_date. "this will convert the date according to user date format..i.e dd/mm/yyyy or dd.mm.yyyyy
"now pass w_date to BDC screen.
or
call function 'CONVERT_DATE_TO_EXTERNAL'
exporting
date_internal = sy-datum
importing
date_external = w_date "this is character lenght 10
exceptions
date_internal_is_invalid = 1
others = 2.
if sy-subrc <> 0.
endif.
"now pass w_date to BDC screen
Prabhudas
2009 Sep 25 12:10 PM
Hi vipul gupta ,
The data you trying to populate using BDC right. BDC is nothing but automating SAP funcitonality for multiple transactions. Basically when u run a transaction the display of data is dependant on the user format set in user own data. That means the date,currancy...etc will have their masks. So while populating BDC also we should populate the data as per the user format set in user own data which is possible only with TYPE CHAR. So you have to take all the fields in TYPE CHAR and sort out the data into user format before you populate the BDC table.
Here your requirement is date. The underlying date format in database is YYYYMMDD. And the user format, let us assume MM/DD/YYYY. Here you need to populate the date as per user format. Example today is Sept'25 2009 format for this date is 09/25/2009.
To achive this format you have to take the field of length 10 of type CHAR use the below syntax for easly formatting the date.
Arrange the input date (came from flat file) to YYYYMMDD in a type DATS field use the below syntax to get user format.
WRITE W_DATE TO W_DATE_CHAR.
W_DATE IS OF TYPE DATS and W_DATE_CHAR is of type CHAR 10.
Venkat
2009 Sep 25 12:44 PM
Hi Vipul,
you can use concatenate the days month and year in field declared by you before passing to the BDC.
declare three variable as follows:
DATA : BUDAT1(8) TYPE C.
DATA : dd(2) type c,
mm(2) type c,
yyyy(4) type c.
Pass specified value to these variables from the fied whichever value you need.
like dd = budat(2).
mm = budat+2(2).
yy = budat+4(4).
just before the code PERFORM BDC_FIELD, you can use concatenate statement for these fields into BUDAT1 field.
CONCATENATE DD MM YY INTO BUDAT1.
OR
CONCATENATE YY MM DD INTO BUDAT1.
Hope you understand the logic and can do as per your requirement.
Regds,
Anil
2009 Oct 27 5:03 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |