excelui-automationabapdynpro

Date format into Excel


I am trying to use BATCH Input for my record adding page.

But I can't receive the date format from Excel; it is always shown as '00000000'.

I tried those examples : 31.07.2012 20123007 20120730 and so on..

But those are not solve my problem. How can I fix this issue?


Solution

  • The date format can be indicated when you create a Batch Input session from SHDB, or from BDC_OPEN_GROUP function module DATFM parameter. If the DATFM parameter value is "%" (default), SAP will use the user's date format.

    1.You can use the code to convert a date variable from internal to external format

    DATA table_date_field TYPE d. "internal format YYYYMMDD, 8 digits
    DATA screen_date_field TYPE bapi_date. "external format 10 characters
    table_date_field = '20101231'.
    WRITE table_date_field TO screen_date_field.
    
    1. You can get the appropriate date format by calling the function module 'DATUMSAUFBEREITUNG'.