Convert internation date to mm/dd/yyyy

I'm very new to Power Query so here goes.
In a query to a SQL server, the date field is set as an International Date format of yyyymmdd and I want to convert it to an American format of mm,dd,yyyy. Any help is greatly appreciated.
Thanks,
Lee

hi..,
You try to use below code:
let
    Source = Table.FromList( { [Date=20140105],[Date=20140328],[Date=20140125],[Date=20140405] }, Record.FieldValues , {"Date"}),
    ChangeText = Table.TransformColumns(Source, {"Date", each Text.Insert(Text.Insert( Number.ToText(_) ,4,"/"), 7,"/") } ),
    ChangedType = Table.TransformColumnTypes(ChangeText,{{"Date", type date}})
in
    ChangedType

Similar Messages

  • How to convert system Date into DD-MMM-YYYY Format

    hi friends,
    please help me How to convert system Date into DD-MMM-YYYY Format.
    Regards
    Yogesh

    HI..
    data: w_dt(11) type c,
             w_month(2),
             w_mon(3).
    w_month = p_date+4(2). **p_date = given date**
    case w_month.
    when '01'.
    w_mon = 'Jan'.
    when '02'.
    w_mon = 'Feb'.
    when '03'.
    w_mon = 'Mar'.
    when '04'.
    w_mon = 'Apr'.
    when '05'.
    w_mon = 'May'.
    when '06'.
    w_mon = 'Jun'.
    when '07'.
    w_mon = 'Jul'.
    when '08'.
    w_mon = 'Aug'.
    when '09'.
    w_mon = 'Sep'.
    when '10'.
    w_mon = 'Oct'.
    when '11'.
    w_mon = 'Nov'.
    when '12'.
    w_mon = 'Dec'.
    endcase.
    Now...
      concatenate p_date6(2)  '-'  w_mon  '-'   p_date0(4)  into w_dt.
    write w_dt.

  • How to convert the date format 'm/d/yyyy hh:mi:ss AM' to 'MM/DD/YYYY HH:M'

    How can i convert a the date format 'm/d/yyyy hh:mi:ss AM' to 'MM/DD/YYYY HH:MI:SS AM' in Oracle
    I have a query
    select UPPER(t.val_10) "TYPE", count(val_3) "Number of Transfers"
    from table1 t
    where t.is_active = 1
    and t.val_4 = 'INBOUND'
    and to_date(to_date(val_5,'MM/DD/YYYY HH:MI:SS AM'), 'DD/MM/YY') between to_date(to_date('01/08/2008 00:00:00','DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YY') and add_months(to_date(to_date('01/08/2008 00:00:00','DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YY'),1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)
    I get the error [ORA-01861: literal does not match format string which i think is because
    val_5 has the values in the following format:
    8/29/2008 6:31:10 PM
    Does anyone have an answer?
    Thanks in advance
    Edited by: user2360027 on 26-Mar-2009 03:50                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    first off, you've got to_date(to_date(...)) - NEVER do this - you're forcing an implicit to_char which can cause all sorts of problems!
    What is the data type of your column val_5? If it's DATE then your query is simply:
    select UPPER(t.val_10) "TYPE",
           count(val_3) "Number of Transfers"
    from   table1 t
    where  t.is_active = 1
    and    t.val_4 = 'INBOUND'
    and    val_5 between to_date('01/08/2008','DD/MM/YYYY') and add_months(to_date('01/08/2008','DD/MM/YYYY') ,1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)If it's a varchar2 (why, oh why, oh why, ...?!), then your query should be:
    select UPPER(t.val_10) "TYPE",
           count(val_3) "Number of Transfers"
    from   table1 t
    where  t.is_active = 1
    and    t.val_4 = 'INBOUND'
    and    to_date(val_5, 'mm/dd/yyyy hh:mi:ss AM') between to_date('01/08/2008','DD/MM/YYYY') and add_months(to_date('01/08/2008','DD/MM/YYYY') ,1)
    group by UPPER(t.val_10)
    order by UPPER(t.val_10)Remember that dates in DATE format are stored in an internal Oracle format - in order for you to tell Oracle that your string is a date, you need to use to_date. When you want to retrieve a date, you need to use to_char to put it into the format you want to see it in.
    Remember also that your nls_date_format defines the default format that you'll see a date, which is what is used in the implicit conversion that oracle does when you select a date:
    SQL> alter session set nls_date_format='dd/mm/yyyy hh24:mi:ss';
    Session altered.
    SQL> select sysdate from dual;
    SYSDATE
    26/03/2009 11:01:53
    1 row selected.
    SQL> alter session set nls_date_format='mm/dd/yy hh12:mi:ss AM';
    Session altered.
    SQL> select sysdate from dual;
    SYSDATE
    03/26/09 11:02:24 AM
    1 row selected.It doesn't make sense to convert something that's already in a DATE format into a DATE format - in order to do that, oracle has to first change the date into a string, and it does that by using the nls_date_format parameter setting - if you're working with dates-in-strings that are in a different format, then all sorts of problems arise, as you have found out!

  • How to convert internal date to the format of user default setting

    In the BDC program, I need to convert the date, such as the sy-datum 20070427, to the format of user default that is defined in T-code SU01, such as YYYY-MM-DD or YYYY.MM.DD, and so on.
    The user format has 6 six kinds, and it is not good idea to write the code to process. So I look for the functions or CLASS method to process. I can use the function 'ITS_GET_USER_DEFAULTS' to get the user default setting of the Date format and Decimal notation.The problem is that I can not find the function or CLASS method to convert the internal date to user's date format.
    The function: CONVERT_DATE_TO_INTERNAL can not do it.
    The CLASS method: cl_abap_datfm=>conv_date_int_to_ext may be do it. But I do know how exchange the parameters, and fail to make it work finely.
    Is there the functions or CLASS method to process it?
    Thanks a lot!

    Hi John,
    create a veriable :
    data: v_date type char10.
    then after getting the date in YYYYMMDD format, write the following statement.
    WRITE SY-DATUM TO V_DATE.
    this might solve your problem.
    Regards,
    Hemant.

  • How to convert a date from "yyMMddHHmmss" into "yyyy-MM-dd HH:mm:ss format

    hi
    please help i got the date "yyMMddHHmmss this format, how do i convert this into "yyyy-MM-dd HH:mm:ss" format using java code
    please help me anybody having idea

    YoungWinston wrote:
    jverd wrote:
    ...you don't need to know anything about dates or calendars to do that transformation, other than the rules for converting a 2-digit year to a 4-digit one.
    @OP: And for that, you have [SimpleDateFormat.set2DigitYearStart()|http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/text/SimpleDateFormat.html#set2DigitYearStart%28java.util.Date%29].
    WinstonRight. But I was talking about the case where we just use string manipulation directly, and skip DateFormat altogether. In this case we just need and if check against the int value of the first two digits.

  • How to convert the date in mm/dd/yyyy.

    hi,
    I am working with tcurr tables when i go in se16 and see the table i see the field gdatu in '79929474'.
    if i double click on the that particular row the format of gdatu changes to '25.05.2007'.
    I am working on an extract and the date is coming in  '79929474'. I need to convert it to mm/dd/yyyy format.
    I need ur help and guidence.
    Kamlesh

    Hi Kamlesh
    Try to execute the program and see the result.The same logic can be used for solving your date issue.
    TABLES :tcurr.
    TYPES:BEGIN OF g_ty_tcurr.
            INCLUDE STRUCTURE tcurr.
    TYPES: date TYPE sy-datum.
    TYPES: END OF g_ty_tcurr.
    DATA : it_tcurr TYPE TABLE OF g_ty_tcurr,
           wa_tcurr LIKE LINE OF  it_tcurr.
    SELECT *  FROM tcurr INTO CORRESPONDING FIELDS OF TABLE it_tcurr.
    LOOP AT  it_tcurr INTO  wa_tcurr.
      DATA:wrk_date(10) TYPE c.
      CALL FUNCTION 'CONVERSION_EXIT_INVDT_OUTPUT'
        EXPORTING
          input  = wa_tcurr-gdatu
        IMPORTING
          output = wrk_date.
      CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
        EXPORTING
          date_external            = wrk_date
        IMPORTING
          date_internal            = wrk_date
        EXCEPTIONS
          date_external_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.
      DATA: wrk_date1 TYPE sy-datum.
      CONCATENATE wrk_date4(2) wrk_date6(2) wrk_date+0(4) INTO wrk_date1.  " to get teh date in mmddyyyy format.
      wa_tcurr-date = wrk_date1.
      MODIFY it_tcurr FROM wa_tcurr TRANSPORTING date.
    ENDLOOP.

  • Convert system date into mm-dd-yyyy format

    Hi everyone, I am developing an web application in jsp.In my application when a client enters his information like name,email etc, they are copied into the database.What i need now is at the same time the system date also has to enter into the database in the format mm-dd-yyyy.My application doesn't ask the user to enter the particular date.So immediately after the client clicks the save button along with the information he saved the system date also has to enter into his particular database. Can anyone help me how to program this or give an idea regarding the approach to be followed. Any sample code is highly appreciated.Thanks in advance,

    well, your application collects user entered info at some place (either in a jsp or a servlet or a handler). At this point you have to generate the sysdate in the specified format.
    For example, if its a servlet that collects the user info,
    public void doGet(.........){
       //collect all request parameters
       //code from previous post to generate date in specific format
       //call method to insert all data
    }You will have to import the library classes as shown below in your program.
    import java.util.Calendar;
    import java.util.Date;
    import java.text.SimpleDateFormat;cheers,
    ram.
    PS: Also when your sql statement should use some kind of functions to convert the String to a date value for insertion.
    For example, in Oracle, you would do this,
    insert into test values(to_date('08-24-2005','mm-dd-yyyy'));Here test is a table with one date column.
    The to_date() function converts the string, which is the first argument, to a date and conversion pattern is the second argument.
    Unfortunately I cant help you with this because Iam not so familiar with mysql.
    cheers,
    ram.

  • Convert system date to MM/dd/yyyy

    Hi,
    I have to insert system date(current date) to MS Access database which contains colums in MM/dd/yyyy. Can you tell me how can i do it?
    --Ramesh.N                                                                                                                                                                                                                                                                                                                           

    String getDate() {
              Date theDate = new Date();
              SimpleDateFormat newForm = new SimpleDateFormat("MM/dd/yyyy");
              String date =  newForm.format(theDate);
              return date;
         }Try that

  • Converting Oracle 7-Byte Internal Date FOrmat to MM/DD/YYYY format.

    I can get the date stored in the database in 7-Byte Internal representation.
    I want to convert this number to mm/dd/yyyy format,using PRO*C-SQLDA(Method 4),overriding any NLS DATE Format.
    null

    Only Oracle Spatial questions
    here please.
    null

  • How to convert "any" date format to internal format

    Hi,
    I want to convert any date format  to internal format. Is there any function module ?
    The date formats could be:
    DD.MM.YYYY
    MM/DD/YYYY
    MM-DD-YYYY
    YYYY.MM.DD
    YYYY/MM/DD
    YYYY-MM-DD
    Thank you,
    Surya

    Hi,
    Check this sample program..It will convert sap supported external format to the internal format..
    PARAMETERS: v_char(10).
    DATA: v_date TYPE sydatum.
    DATA: v_period TYPE usr01-datfm.
    Get the format.
    DD.MM.YYYY
    IF v_char+2(1) = '.'.
    CONCATENATE v_char6(4) v_char3(2) v_char(2) INTO v_date.
    ENDIF.
    MM/DD/YYYY
    IF v_char+2(1) = '/'.
    CONCATENATE v_char6(4) v_char(2) v_char3(2) INTO v_date.
    ENDIF.
    MM-DD-YYYY
    IF v_char+2(1) = '-'.
    CONCATENATE v_char6(4) v_char(2) v_char3(2) INTO v_date.
    ENDIF.
    YYYY.MM.DD
    IF v_char+4(1) = '.'.
    CONCATENATE v_char(4) v_char5(2) v_char8(2)  INTO v_date.
    ENDIF.
    YYYY/MM/DD
    IF v_char+4(1) = '/'.
    CONCATENATE v_char(4) v_char5(2) v_char8(2)  INTO v_date.
    ENDIF.
    YYYY-MM-DD
    IF v_char+4(1) = '-'.
    CONCATENATE v_char(4) v_char5(2) v_char8(2)  INTO v_date.
    ENDIF.
    WRITE: / v_date.
    Thanks,
    Naren

  • How to Convert internal table data into text output and send mail in ABAP

    Hi All,
    Good Morning.
    Taking a glance at a code that converts internal table data to an Excel file in ABAP. also checked how to send this excel to mailing list as attachment.
    But thought of doing it without excel.
    I mean, I have an internal table which contains fields of all types (character,integer,date,time). Since it is only around 4 to 5 rows in it (output),why to convert it to excel. not required!!.  Instead I  want to send this output to User's mails as Normal mail body with No attachments.
    Could anybody please suggest me a way as to how to send internal table data as a mail ( not as an excel or PDF etc).
    as of now my findings are, it is quite complex to convert internal table data to email (Text) format. but i believe if there is some way of doing it.
    Best Regards
    Dileep VT

    here's something I have used in the past where we send out information about failed precalculation settings (which are stored in internal table gt_fail)
    notice we use gt_text as "mail body"
    TRY.
    *     -------- create persistent send request ------------------------
           gv_send_request = cl_bcs=>create_persistent( ).
    *     -------- create and set document -------------------------------
    *     create text to be sent
           wa_line = text-001.
           APPEND wa_line TO gt_text.
           CLEAR wa_line.
           APPEND wa_line TO gt_text.
           LOOP AT gt_fail ASSIGNING <fs_fail>.
             MOVE <fs_fail>-retry_count TO gv_count.
             CONCATENATE text-002
                         <fs_fail>-setting_id
                         text-003
                         gv_count
                         INTO wa_line SEPARATED BY space.
             APPEND wa_line TO gt_text.
             CLEAR wa_line.
           ENDLOOP.
           APPEND wa_line TO gt_text.
           wa_line = text-007.
           APPEND wa_line TO gt_text.
    *     create actual document
           gv_document = cl_document_bcs=>create_document(
                           i_type    = 'RAW'
                           i_text    = gt_text
                           i_length  = '12'
                           i_subject = 'Failed Precalculation Settings!' ).
    *     add document to send request
           CALL METHOD gv_send_request->set_document( gv_document ).
    *     --------- set sender -------------------------------------------
           gv_sender = cl_sapuser_bcs=>create( sy-uname ).
           CALL METHOD gv_send_request->set_sender
             EXPORTING
               i_sender = gv_sender.
    *     --------- add recipient (e-mail address) -----------------------
           LOOP AT s_email INTO wa_email.
             MOVE wa_email-low TO gv_email.
             gv_recipient = cl_cam_address_bcs=>create_internet_address(
                                               gv_email ).
             CALL METHOD gv_send_request->add_recipient
               EXPORTING
                 i_recipient = gv_recipient
                 i_express   = 'X'.
           ENDLOOP.
    *     ---------- set to send immediately -----------------------------
           CALL METHOD gv_send_request->set_send_immediately( 'X' ).
    *     ---------- send document ---------------------------------------
           CALL METHOD gv_send_request->send(
             EXPORTING
               i_with_error_screen = 'X'
             RECEIVING
               result              = gv_sent_to_all ).
           IF gv_sent_to_all = 'X'.
             WRITE text-004.
           ENDIF.
           COMMIT WORK.
    *   exception handling
         CATCH cx_bcs INTO gv_bcs_exception.
           WRITE: text-005.
           WRITE: text-006, gv_bcs_exception->error_type.
           EXIT.
       ENDTRY.
    with the following declarations
    * TABLES                                                               *
    TABLES:
       adr6,
       rsr_prec_sett.
    * INTERNAL TABLES & WORK AREAS                                         *
    DATA:
       gt_fail          TYPE SORTED TABLE OF rsr_prec_sett
                             WITH UNIQUE KEY setting_id run_date,
       gt_text          TYPE bcsy_text,
       wa_fail          LIKE LINE OF gt_fail,
       wa_line(90)      TYPE c.
    FIELD-SYMBOLS:
       <fs_fail>        LIKE LINE OF gt_fail.
    * VARIABLES                                                            *
    DATA:
       gv_count(4)      TYPE n,
       gv_send_request  TYPE REF TO cl_bcs,
       gv_document      TYPE REF TO cl_document_bcs,
       gv_sender        TYPE REF TO cl_sapuser_bcs,
       gv_recipient     TYPE REF TO if_recipient_bcs,
       gv_email         TYPE adr6-smtp_addr,
       gv_bcs_exception TYPE REF TO cx_bcs,
       gv_sent_to_all   TYPE os_boolean.
    * SELECTION-SCREEN                                                     *
    SELECT-OPTIONS:
       s_email          FOR adr6-smtp_addr NO INTERVALS MODIF ID sel.
    DATA:
       wa_email         LIKE LINE OF s_email.

  • How to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format

    Hi All,
    I have a requirement in my project like to convert the date time from one format to another.my situation is like to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format. I am using the soa suite 11.1.1.6.
    Can any one suggest me how to convert in the BPEL transformation.
    Thanks,
    Sanju.

    Hi Sanju,
    Store the date to be converted into a variable viz. dateVar. Now, process an expression in assign as: xp20:format-dateTime($dateVar,'[Y0001]-[M01]-[D01] [h]:[m01]:[s01]').
    Regards

  • Convert internal table data to pdf format and send mail to Users

    Hi all ,
    I want to convert the data available in internal table to pdf format and then send it to mail .
    Please tell me wht are the fn modules available to convert the data from internal table to pdf and then send it mail .
    regards
    santosh .

    Hi Santosh
    Sending mail with attachment report in Background
    Content Author: Fernando Faian
    I have read the hint about "Sending mail with attachment report".
    It's great, but how can I make this function work in background??
    I had that needed last year too. See attachment a function group with two functions. The second one has that functionality to send email or fax (SAP office) with attachment objects in background job using SO_ATTACHMENT_INSERT function. 
    Pay attention because it’s working with output list from spool converted to pdf. 
    =================================================================================
    z_send_email_fax_global
    FUNCTION-POOL z_gfaian_mail_fax.            "MESSAGE-ID ..
    WORK TABLE AREAS
    TABLES: tsp01.
    INTERNAL TABLES
    DATA: lt_rec_tab LIKE STANDARD TABLE OF soos1 WITH HEADER LINE,
          lt_note_text   LIKE STANDARD TABLE OF soli  WITH HEADER LINE,
          lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE.
    DATA: lt_objcont LIKE STANDARD TABLE OF soli WITH HEADER LINE,
          lt_objhead LIKE STANDARD TABLE OF soli WITH HEADER LINE.
    DATA: pdf_format LIKE STANDARD TABLE OF tline WITH HEADER LINE.
    TYPES: BEGIN OF y_files,
           file(60) TYPE c,
           END OF y_files.
    DATA: lt_files TYPE STANDARD TABLE OF y_files WITH HEADER LINE.
    DATA: l_objcont     LIKE soli OCCURS 0 WITH HEADER LINE.
    DATA: l_objhead     LIKE soli OCCURS 0 WITH HEADER LINE.
    STRUCTURES
    DATA: folder_id      LIKE soodk,
          object_id      LIKE soodk,
          link_folder_id LIKE soodk,
          g_document     LIKE sood4,
         g_header_data  LIKE sood2,
          g_folmem_data  LIKE sofm2,
          g_header_data  LIKE sood2,
          g_receive_data LIKE soos6,
          g_ref_document LIKE sood4,
          g_new_parent   LIKE soodk,
          l_folder_id    LIKE sofdk,
          v_email(50).
    DATA: hd_dat  like sood1.
    VARIABLES
    DATA: client  LIKE tst01-dclient,
          name    LIKE tst01-dname,
          objtype LIKE rststype-type,
          type    LIKE rststype-type.
    DATA: numbytes TYPE i,
          arc_idx LIKE toa_dara,
          pdfspoolid LIKE tsp01-rqident,
          jobname LIKE tbtcjob-jobname,
          jobcount LIKE tbtcjob-jobcount,
          is_otf.
    DATA: outbox_flag LIKE sonv-flag VALUE 'X',
          store_flag  LIKE sonv-flag,
          delete_flag LIKE sonv-flag,
          owner       LIKE soud-usrnam,
          on          LIKE sonv-flag VALUE 'X',
          sent_to_all LIKE sonv-flag,
          g_authority LIKE sofa-usracc,
          w_objdes    LIKE sood4-objdes.
    DATA: c_file LIKE rlgrap-filename,
          n_spool(6) TYPE n.
    DATA: cancel.
    DATA: desired_type  LIKE sood-objtp,
          real_type LIKE sood-objtp,
          attach_type LIKE sood-objtp,
          otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
          ali LIKE sood-objtp VALUE 'ALI'. " ABAP lists
    CONSTANTS
    CONSTANTS: ou_fol LIKE sofh-folrg              VALUE 'O',
               c_objtp    LIKE g_document-objtp    VALUE 'RAW',
               c_file_ext LIKE g_document-file_ext VALUE 'TXT'.
    =================================================================================
    z_send_email_fax2
    FUNCTION z_faian_mail_fax2.
    ""Interface local:
    *"  IMPORTING
    *"     REFERENCE(SRC_SPOOLID) LIKE  TSP01-RQIDENT
    *"     REFERENCE(FAX_MAIL_NUMBER) TYPE  SO_NAME
    *"     REFERENCE(HEADER_MAIL) TYPE  SO_OBJ_DES
    *"     REFERENCE(OBJECT_TYPE) TYPE  SO_ESCAPE
    *"  TABLES
    *"      LT_BODY_EMAIL STRUCTURE  SOLI
    *"  EXCEPTIONS
    *"      ERR_NO_ABAP_SPOOLJOB
    Fist part: Verify if the spool really exists
      SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
      IF sy-subrc NE 0.
        RAISE err_no_abap_spooljob. "doesn't exist
      ELSE.
        client = tsp01-rqclient.
        name   = tsp01-rqo1name.
        CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
             EXPORTING
                  authority     = 'SP01'
                  client        = client
                  name          = name
                  part          = 1
             IMPORTING
                  type          = type
                  objtype       = objtype
             EXCEPTIONS
                  fb_error      = 1
                  fb_rsts_other = 2
                  no_object     = 3
                  no_permission = 4
                  OTHERS        = 5.
        IF objtype(3) = 'OTF'.
          desired_type = otf.
        ELSE.
          desired_type = ali.
        ENDIF.
        CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
             EXPORTING
                  rqident              = src_spoolid
                  desired_type         = desired_type
             IMPORTING
                  real_type            = real_type
             TABLES
                  buffer               = l_objcont
             EXCEPTIONS
                  no_such_job          = 14
                  type_no_match        = 94
                  job_contains_no_data = 54
                  no_permission        = 21
                  can_not_access       = 21
                  read_error           = 54.
        IF sy-subrc EQ 0.
          attach_type = real_type.
        ENDIF.
        CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
             EXPORTING
                  owner     = sy-uname
                  region    = ou_fol
             IMPORTING
                  folder_id = l_folder_id
             EXCEPTIONS
                  OTHERS    = 5.
    fill out informations about the header of the email
        CLEAR: g_document.
        g_document-foltp     = l_folder_id-foltp.
        g_document-folyr     = l_folder_id-folyr.
        g_document-folno     = l_folder_id-folno.
        g_document-objtp     = c_objtp.
        g_document-objdes    = header_mail.
        g_document-file_ext  = c_file_ext.
        g_header_data-objdes    = header_mail.
        CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
             EXPORTING
                  method      = 'SAVE'
                  office_user = sy-uname
             IMPORTING
                  authority   = g_authority
             TABLES
                  objcont     = lt_body_email
                  attachments = lt_attachments
             CHANGING
                  document    = g_document
                  header_data = g_header_data
             EXCEPTIONS
                  OTHERS      = 1.
        folder_id-objtp = l_folder_id-foltp.
        folder_id-objyr = l_folder_id-folyr.
        folder_id-objno = l_folder_id-folno.
        object_id-objtp = c_objtp.
        object_id-objyr = g_document-objyr.
        object_id-objno = g_document-objno.
        link_folder_id-objtp = l_folder_id-foltp.
        link_folder_id-objyr = l_folder_id-folyr.
        link_folder_id-objno = l_folder_id-folno.
        REFRESH lt_rec_tab.
       CLEAR lt_rec_tab.
       lt_rec_tab-sel        = 'X'.
       lt_rec_tab-recesc     = object_type.   "This field for FAX/MAIL
       lt_rec_tab-recnam     = 'U-'.
       lt_rec_tab-deliver    = 'X'.
       lt_rec_tab-not_deli   = 'X'.
       lt_rec_tab-read       = 'X'.
       lt_rec_tab-mailstatus = 'E'.
       lt_rec_tab-adr_name   = fax_mail_number.
       lt_rec_tab-sortfield  = fax_mail_number.
       lt_rec_tab-recextnam  = fax_mail_number.
       lt_rec_tab-sortclass  = '5'.
       APPEND lt_rec_tab.
          lt_rec_tab-recextnam = fax_mail_number.
          lt_rec_tab-recesc = object_type.
          lt_rec_tab-sndart = 'INT'.
          lt_rec_tab-sndpri = 1.
          APPEND lt_rec_tab.
        lt_files-file = c_file.
        APPEND lt_files.
    begin of insertion by faianf01
        hd_dat-objdes = header_mail.
        CALL FUNCTION 'SO_ATTACHMENT_INSERT'
             EXPORTING
                  object_id                  = object_id
                  attach_type                = attach_type
                  object_hd_change           = hd_dat
                  owner                      = sy-uname
             TABLES
                  objcont                    = l_objcont
                  objhead                    = l_objhead
             EXCEPTIONS
                  active_user_not_exist      = 35
                  communication_failure      = 71
                  object_type_not_exist      = 17
                  operation_no_authorization = 21
                  owner_not_exist            = 22
                  parameter_error            = 23
                  substitute_not_active      = 31
                  substitute_not_defined     = 32
                  system_failure             = 72
                  x_error                    = 1000.
        IF sy-subrc > 0.
        ENDIF.
    end of insertion by faianf01
    send email from SAPOFFICE
        CALL FUNCTION 'SO_OBJECT_SEND'
             EXPORTING
                  folder_id                  = folder_id
                  object_id                  = object_id
                  outbox_flag                = outbox_flag
                  link_folder_id             = link_folder_id
                  owner                      = sy-uname
                 check_send_authority       = 'X'
             TABLES
                  receivers                  = lt_rec_tab
                 note_text                  = lt_note_text
             EXCEPTIONS
                  active_user_not_exist      = 35
                  communication_failure      = 71
                  component_not_available    = 1
                  folder_no_authorization    = 5
                  folder_not_exist           = 6
                  forwarder_not_exist        = 8
                  object_no_authorization    = 13
                  object_not_exist           = 14
                  object_not_sent            = 15
                  operation_no_authorization = 21
                  owner_not_exist            = 22
                  parameter_error            = 23
                  substitute_not_active      = 31
                  substitute_not_defined     = 32
                  system_failure             = 72
                  too_much_receivers         = 73
                  user_not_exist             = 35.
      ENDIF.
    ENDFUNCTION.
    =================================================================================
    z_send_email_fax
    FUNCTION ZCBFS_SEND_MAIL.
    ""Interface local:
    *"  IMPORTING
    *"     REFERENCE(SRC_SPOOLID) LIKE  TSP01-RQIDENT
    *"     REFERENCE(HEADER_MAIL) TYPE  SO_OBJ_DES
    *"  TABLES
    *"      LIST_FAX_MAIL_NUMBER STRUCTURE  SOLI
    *"  EXCEPTIONS
    *"      ERR_NO_ABAP_SPOOLJOB
      DATA: vg_achou(1) TYPE n.
    Fist part: Verify if the spool really exists
      vg_achou = 1.
      DO 60 TIMES.
        SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
        IF sy-subrc IS INITIAL.
          CLEAR vg_achou.
          EXIT.
        ELSE.
          WAIT UP TO 1 SECONDS.
        ENDIF.
      ENDDO.
      IF vg_achou = 1.
        RAISE err_no_abap_spooljob. "doesn't exist
      ENDIF.
      client = tsp01-rqclient.
      name   = tsp01-rqo1name.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
           EXPORTING
                authority     = 'SP01'
                client        = client
                name          = name
                part          = 1
           IMPORTING
                type          = type
                objtype       = objtype
           EXCEPTIONS
                fb_error      = 1
                fb_rsts_other = 2
                no_object     = 3
                no_permission = 4
                OTHERS        = 5.
      IF objtype(3) = 'OTF'.
        desired_type = otf.
      ELSE.
        desired_type = ali.
      ENDIF.
      CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
           EXPORTING
                rqident              = src_spoolid
                desired_type         = desired_type
           IMPORTING
                real_type            = real_type
           TABLES
                buffer               = l_objcont
           EXCEPTIONS
                no_such_job          = 14
                type_no_match        = 94
                job_contains_no_data = 54
                no_permission        = 21
                can_not_access       = 21
                read_error           = 54.
      IF sy-subrc EQ 0.
        attach_type = real_type.
      ENDIF.
      CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
           EXPORTING
                owner     = sy-uname
                region    = ou_fol
           IMPORTING
                folder_id = l_folder_id
           EXCEPTIONS
                OTHERS    = 5.
    fill out informations about the header of the email
      CLEAR: g_document.
      g_document-foltp     = l_folder_id-foltp.
      g_document-folyr     = l_folder_id-folyr.
      g_document-folno     = l_folder_id-folno.
      g_document-objtp     = c_objtp.
      g_document-objdes    = header_mail.
      g_document-file_ext  = c_file_ext.
      g_header_data-objdes    = header_mail.
      CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
           EXPORTING
                method      = 'SAVE'
                office_user = sy-uname
           IMPORTING
                authority   = g_authority
           TABLES
                attachments = lt_attachments
           CHANGING
                document    = g_document
                header_data = g_header_data
           EXCEPTIONS
                OTHERS      = 1.
      folder_id-objtp = l_folder_id-foltp.
      folder_id-objyr = l_folder_id-folyr.
      folder_id-objno = l_folder_id-folno.
      object_id-objtp = c_objtp.
      object_id-objyr = g_document-objyr.
      object_id-objno = g_document-objno.
      link_folder_id-objtp = l_folder_id-foltp.
      link_folder_id-objyr = l_folder_id-folyr.
      link_folder_id-objno = l_folder_id-folno.
      REFRESH lt_rec_tab.
      LOOP AT LIST_FAX_MAIL_NUMBER.
        lt_rec_tab-recextnam = LIST_FAX_MAIL_NUMBER-LINE.
        lt_rec_tab-recesc = 'U'.
        lt_rec_tab-sndart = 'INT'.
        lt_rec_tab-sndpri = 1.
        APPEND lt_rec_tab.
      ENDLOOP.
      lt_files-file = c_file.
      APPEND lt_files.
      hd_dat-objdes = header_mail.
      CALL FUNCTION 'SO_ATTACHMENT_INSERT'
           EXPORTING
                object_id                  = object_id
                attach_type                = attach_type
                object_hd_change           = hd_dat
                owner                      = sy-uname
           TABLES
                objcont                    = l_objcont
                objhead                    = l_objhead
           EXCEPTIONS
                active_user_not_exist      = 35
                communication_failure      = 71
                object_type_not_exist      = 17
                operation_no_authorization = 21
                owner_not_exist            = 22
                parameter_error            = 23
                substitute_not_active      = 31
                substitute_not_defined     = 32
                system_failure             = 72
                x_error                    = 1000.
      IF sy-subrc > 0.
      ENDIF.
    send email from SAPOFFICE
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                folder_id                  = folder_id
                object_id                  = object_id
                outbox_flag                = outbox_flag
                link_folder_id             = link_folder_id
                owner                      = sy-uname
           TABLES
                receivers                  = lt_rec_tab
                note_text                  = lt_note_text
           EXCEPTIONS
                active_user_not_exist      = 35
                communication_failure      = 71
                component_not_available    = 1
                folder_no_authorization    = 5
                folder_not_exist           = 6
                forwarder_not_exist        = 8
                object_no_authorization    = 13
                object_not_exist           = 14
                object_not_sent            = 15
                operation_no_authorization = 21
                owner_not_exist            = 22
                parameter_error            = 23
                substitute_not_active      = 31
                substitute_not_defined     = 32
                system_failure             = 72
                too_much_receivers         = 73
                user_not_exist             = 35.
    ENDFUNCTION.
    Regards,
    Sree

  • To convert dec date 732,677 in to dd.mm.yyyy format

    Hi,
    i have to convert dec date 732,677 in to dd.mm.yyyy format .
    plz help me out
    its urgent
    regards,
    Nishu Gupta

    use this Fm
    CONVERSION_EXIT_INVDT_INPUT
    <b>CONVERSION_EXIT_INVDT_output.</b>
    i hope u r referring to Tcurr-gdatu.
    refer this code for the working ..
    data : date like sy-datum,
           date1(10) type c,
           val like sy-datum,
           datum(8) type n .
    date = sy-datum.
    write:/ date.
    concatenate date4(2) date6(2) date+0(4) into val.
    CALL FUNCTION 'CONVERSION_EXIT_INVDT_INPUT'
      EXPORTING
      input          = val
    IMPORTING
       OUTPUT        = datum.
    write:/'tcurrformat' datum.
    *clear val.
    CALL FUNCTION 'CONVERSION_EXIT_INVDT_OUTPUT'
      EXPORTING
        input         = datum   "----
    >pass this
    IMPORTING
        OUTPUT        = date1.
    write:/'normal format',  date1.
    Please close your previous threads.
    regards,
    vijay

  • Convert date to mm/dd/yyyy HH:MM:SS AM

    Hi, how in oracle would I convert this date [27-NOV-12 06.50.16 AM] to this format mm/dd/yyyy HH:MM:SS AM.?
    Thanks

    989873 wrote:
    Hi, how in oracle would I convert this date [27-NOV-12 06.50.16 AM] to this format mm/dd/yyyy HH:MM:SS AM.?
    ThanksDate in Oracle is always stored in format that it recognizes and not in the format that you ask it for. Hence, if you are not able to see some information or in a different format, then it is because of your Display settings.
    Date format as displayed on your client follows the format as specified by NLS_DATE_FORMAT.
    See, how the date format is rendered.
    select sysdate from dual;
    SYSDATE                  
    26-FEB-13
    alter session set nls_date_format = 'DD-Mon-YYYY HH24:MI:SS';
    select sysdate from dual;
    SYSDATE                  
    26-Feb-2013 07:13:07You can change the NLS_DATE_FORMAT into the format that you want to.
    alter session set nls_date_format = 'Mon/DD/YYYY HH24:MI:SS';
    select sysdate from dual;
    SYSDATE                  
    Feb/26/2013 07:14:46 For more information on Dates, Read Datetime Datatypes.

Maybe you are looking for

  • How to know a Word File is open.

    I am opening a word file from oracle forms using webutil in the following way. APP := CLIENT_OLE2.CREATE_OBJ('WORD.APPLICATION');      DOCS := CLIENT_OLE2.INVOKE_OBJ(APP,'DOCUMENTS'); ARGS := CLIENT_OLE2.CREATE_ARGLIST; CLIENT_OLE2.ADD_ARG(ARGS,V_FIL

  • Merging Backups from a cloned machine

    I had been using Time Machine to back up my MacBook Pro to an external hard drive. When I bought my iMac, which I intend to use as my main machine, I used the Time Machine backups to clone it from the MacBook, changing the name of the new machine. I

  • XSLT position() not returning sequential values

    I'm having trouble with the XSLT position() function. I have the following snippet of XML: <categories>   <category id="6">     <title>Alumni</title>   </category>   <category id="10">     <title>Built Environment</title>   </category>   <category id

  • Include zip file as resource for project

    Is it possible to include a zip file as a project resource? Currently when building I get a warning that archive zip is not supported and has been ignored. I tried adding a copy files build phase but that reports the same error. At the moment I am ma

  • N97 problems :(

    hello guys my mobile phone (N97) gives those errors ; Security Module Error and Memory Full, i sent it to nokia care point 2 times, i still have the same problem. Nokia Care point says no hardware problem, anyone have the same experience?I  am fed up