Application Development and Automation 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: 
Read only

Date Format in EXCEL upload in ABAP Program

arpita_churi3
Active Participant
0 Likes
3,671

Dear All,

I have an requirement ,to upload the excel sheet data into a report program for updating material master. In excel sheet , I have one column with date values. I want to validate the value entered by user in excel sheet is in DDMMYYYY.

I am trying to do it as below:

SET PROPERTY OF lv_selection 'NumberFormat' = '[$-14409]dd.mm.yyyy;@'.

but it is not working. acn anyone has worked on similar kind of req?

and also i have one more question , if i enter the value in excel cell starting with 0 , zero is going off.

Thanks,

Arpita

2 REPLIES 2
Read only

arpita_churi3
Active Participant
0 Likes
1,503

Req is to download excel template using OLE2_OBJECT, there we are using

SET PROPERTY OF lv_selection 'NumberFormat' = '[$-14409]dd.mm.yyyy;@'.even thought it is not showing format.

Sample Code:

CALL METHOD OF lv_activesheet 'Columns' = lv_column EXPORTING #1 = 8.

* Format of the column

CALL METHOD OF lv_column 'Select'.

CALL METHOD OF lv_application 'selection' = lv_selection.

SET PROPERTY OF lv_selection 'NumberFormat' = '[$-14409]dd.mm.yyyy;@'.

Read only

Former Member
1,503

Hi,

1. When uploading from Excel, i usually use data type STRING.

After calling BAPI/FM to convert excel file to internal table, the validation of STRING is much more easier and flexible.

2. You'd better to format the column in excel to Text or put character ' before entering number

Best Regards,

Nam