on 10-29-2015 8:05 PM
Hi,
I created Infoobjects(ZVALIDFROM,ZVALIDTO) as char with the length 10 and I'm able to load data into PSA but when I try to load into the DSO/Cube the date format is DATS with length 8(standard). Basically I am mapping custom date field to system date format like mm/dd/yyyy(valid from ,valid to fields)
I am trying to write the routine in the transformations like below but i am getting wrong format as shown in the picture.
Concatenate SOURCE_FIELDS-/BIC/ZVALIDTO+3(2) '/'
SOURCE_FIELDS-/BIC/ZVALIDTO+0(2) '/'
SOURCE_FIELDS-/BIC/ZVALIDTO+6(4) into RESULT.
Thank you
Raghu Muvva
Hi,
Can you show the screen of your data in PSA and the FIELDS tab in your datasource? I think you have CONVERSION routine in your datasource..From there we can tell you how to solve this scenarion in datasource or transformation level..
Regards,
Loed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ragavendra,
Please find the below code for dispaly of data format DD/MM/YYYY.
DATA: date(10) TYPE c.
CONCATENATE sy-datum+6(2) '/' sy-datum+4(2) '/' sy-datum+0(4) INTO date. WRITE:/ date.
OR
Data:date_form type CHAR10.
call function 'HRGPBS_HESA_DATE_FORMAT'
exporting
P_DATE = sy-datum
importing
DATESTRING = date_form
exceptions
others = 1.
write : date_form.
OR
v_date = w_file-mod_date.
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
date_internal = v_date
IMPORTING
date_external = w_file-mod_date
EXCEPTIONS
date_internal_is_invalid = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
Hi Raghu,
W.r.t. date fields, you have to distinguish between internal and external format. The preferred approach is using Characteristics with reference to 0DATE (i.e. data type DATS). Internal format is always: yyyymmdd (yyyy for year, mm for month and dd for day). The external format is dependent on your user settings (t/code SU3).
I don't know which DataSource you are dealing with. Here you can also switch between internal and external format. This way you might be able to link the DataSource fields to a Date Characteristic w/o any routine.
If you cannot avoid using a routine, please be aware of the internal format yyyymmdd which you have to map to in routines.
Best regards,
Sander
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghavendra
May I know what are you trying to achieve by doing this?
My guess is when you run the report, you need to show the date in mm/dd/yyyy format. To get this done, you need to change the user settings in SU01.
When this is done, whatever the format is in your cube, your report will allow you to enter the date in the configured format.
You don't have to write any routines. Just leave it as direct mapping
If your requirement is something else, please let us know. We will help you to get the right code
Please update if it helps.
Regards
Karthik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.