Application Development 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: 

convert dd.mm.yyyy from excel while bapi uploading

0 Kudos
305

Im uploading excel file it doc_Date pstng date, baseline date . when I am passing the date format 26.02.2021 in excel. it's shows up error : " enter the data in yyyy.mm.dd format. " how to upload the date format dd.mm.yyyy.

here the bapi structre conatains data type DAT 8 but my excel has CHAR 10 i.e 26.02.2021. how to pass this date formate to bapi field(pstnf date) plz help

here is my code


CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = LS_FINAL-PSTNG_DATE
* ACCEPT_INITIAL_DATE =
IMPORTING
DATE_INTERNAL = LS_FINAL-PSTNG_DATE
EXCEPTIONS
DATE_EXTERNAL_IS_INVALID = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.

LS_HEADER-PSTNG_DATE = LS_FINAL-PSTNG_DATE.

1 REPLY 1

Sandra_Rossi
Active Contributor
0 Kudos
202

You forgot to explain how you pass "the date format 26.02.2021 in excel".