Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Date format DD.MM.YYYY to system date format mm/dd/yyyy

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

Former Member
Former Member replied

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.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
  •         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question