Authorization in BDC session (date format)

Hi All,
  I have a very peculiar problem, When I am executing a Background job (XK15) sometimes the job is successful and sometimes it is failing. When I am checking the error (SM35)it is showing as Date format (MM/DD/YYYY). My data format is same as MM/DD/YYYY but observed that under authorization it is taking different users.Sometimes it is taking my user id and the jobs are successful.
I feel that when it is taking different user ids for the sessions executed by me it is taking the date format of those user ids and I am getting the date format error.
Formatting error in the field RV13A-DATAB;
see next message     XK15     1     SAPMV13A     1806     2     E     0
Enter date in the format ____/__/__
Please let me know why it is taking different userid's and how to resolve this issue ?
Early response is highly appreciated.
Thanks
Supriya

Hi,
Goto tableUSR01.
Take field value 'DATFM' for every user.
Depends on this use FM, 'CONVERSION_EXIT_PDATE_OUTPUT' to convert date.
or do manual processing using concatenate statement to get user specific date format.
If you struck up anywhere revert back,
Thanks,
Krishna.

Similar Messages

  • In bdc if date format of records is different  do we need to hard code

    in bdc if date format of records is different  do we need to hard code or bdc will support automatically,please provide the answer.

    Make sure to format the date before passing to BDC.
    data: datum(10) type c.
    call function 'CONVERT_DATE_TO_EXTERNAL'
      EXPORTING
        DATE_INTERNAL                  = SY-DATUM
      IMPORTING
        DATE_EXTERNAL                  = datum.
    Regards,
    Rich Heilman

  • Date format in MVIEW

    Hi All,
    I have creted the snapshot as
    CREATE SNAPSHOT EMPLOYEE_CRIS_MVIEW
    PCTFREE 10
    PCTUSED 40
    MAXTRANS 255
    TABLESPACE users
    STORAGE (
    INITIAL 40960
    NEXT 73728
    PCTINCREASE 1
    MINEXTENTS 1
    MAXEXTENTS 505
    BUILD IMMEDIATE
    REFRESH ON DEMAND
    With rowid
    AS
    select
    emp_id,
    join_dt,
    emp_stat,
    from employee_CRIS
    The date format for the column join_dt is dd-mon-yyyy.
    But I want to modify the date format for this column as 'MM/DD/YYYY'.
    For that I tried
    ALTER snapshot EMPLOYEE_CRIS_MVIEW modify(TO_CHAR(join_dt,'MM/DD/YYYY'));
    But I got the error
    ERROR at line 1:
    ORA-00902: invalid datatype
    Could you please help me to change the change the date format of the column of the snapshot
    with out dropping the snapshot.
    Please help me.
    Thanks in advance.

    What people are saying is that date columns (of DATE datatype) are stored internally using a fixed internal notation, which is essentially a series of bytes that describe the date.
    e.g.
    SQL> select empno, ename, hiredate, dump(hiredate) as dump_hiredate from emp;
         EMPNO ENAME      HIREDATE            DUMP_HIREDATE
          7369 SMITH      17/12/1980 00:00:00 Typ=12 Len=7: 119,180,12,17,1,1,1
          7499 ALLEN      20/02/1981 00:00:00 Typ=12 Len=7: 119,181,2,20,1,1,1
          7521 WARD       22/02/1981 00:00:00 Typ=12 Len=7: 119,181,2,22,1,1,1
          7566 JONES      02/04/1981 00:00:00 Typ=12 Len=7: 119,181,4,2,1,1,1
          7654 MARTIN     28/09/1981 00:00:00 Typ=12 Len=7: 119,181,9,28,1,1,1
          7698 BLAKE      01/05/1981 00:00:00 Typ=12 Len=7: 119,181,5,1,1,1,1
          7782 CLARK      09/06/1981 00:00:00 Typ=12 Len=7: 119,181,6,9,1,1,1
          7788 SCOTT      19/04/1987 00:00:00 Typ=12 Len=7: 119,187,4,19,1,1,1
          7839 KING       17/11/1981 00:00:00 Typ=12 Len=7: 119,181,11,17,1,1,1
          7844 TURNER     08/09/1981 00:00:00 Typ=12 Len=7: 119,181,9,8,1,1,1
          7876 ADAMS      23/05/1987 00:00:00 Typ=12 Len=7: 119,187,5,23,1,1,1
          7900 JAMES      03/12/1981 00:00:00 Typ=12 Len=7: 119,181,12,3,1,1,1
          7902 FORD       03/12/1981 00:00:00 Typ=12 Len=7: 119,181,12,3,1,1,1
          7934 MILLER     23/01/1982 00:00:00 Typ=12 Len=7: 119,182,1,23,1,1,1
    14 rows selected.Here, you can see from the dumped dates that they are all stored as 7 bytes of data, which sort of resemble the date you see on the screen in some way, but not quite. It's an internal format that Oracle understands and uses, and it's important it's stored in this way so that date arithmetic and date range comparisons can be performed easily (and quickly) in queries.
    If we were to alter our sessions date format (the display format for our session only) and query the data again in the same way...
    SQL> alter session set nls_date_format='YYYY-MM-DD';
    Session altered.
    SQL> select empno, ename, hiredate, dump(hiredate) as dump_hiredate from emp;
         EMPNO ENAME      HIREDATE   DUMP_HIREDATE
          7369 SMITH      1980-12-17 Typ=12 Len=7: 119,180,12,17,1,1,1
          7499 ALLEN      1981-02-20 Typ=12 Len=7: 119,181,2,20,1,1,1
          7521 WARD       1981-02-22 Typ=12 Len=7: 119,181,2,22,1,1,1
          7566 JONES      1981-04-02 Typ=12 Len=7: 119,181,4,2,1,1,1
          7654 MARTIN     1981-09-28 Typ=12 Len=7: 119,181,9,28,1,1,1
          7698 BLAKE      1981-05-01 Typ=12 Len=7: 119,181,5,1,1,1,1
          7782 CLARK      1981-06-09 Typ=12 Len=7: 119,181,6,9,1,1,1
          7788 SCOTT      1987-04-19 Typ=12 Len=7: 119,187,4,19,1,1,1
          7839 KING       1981-11-17 Typ=12 Len=7: 119,181,11,17,1,1,1
          7844 TURNER     1981-09-08 Typ=12 Len=7: 119,181,9,8,1,1,1
          7876 ADAMS      1987-05-23 Typ=12 Len=7: 119,187,5,23,1,1,1
          7900 JAMES      1981-12-03 Typ=12 Len=7: 119,181,12,3,1,1,1
          7902 FORD       1981-12-03 Typ=12 Len=7: 119,181,12,3,1,1,1
          7934 MILLER     1982-01-23 Typ=12 Len=7: 119,182,1,23,1,1,1
    14 rows selected.... whilst the hiredate is now showing on the screen in the format we've chosen, the actual internal storage of those dates remains completely unchanged. i.e. we don't have to change the format of the internal storage of dates to make them display differently.
    Likewise you can format dates manually as part of your query using to_char function...
    SQL> select empno, ename, to_char(hiredate,'DD Month YYYY') as hiredate, dump(hiredate) as dump_hiredate from emp;
         EMPNO ENAME      HIREDATE          DUMP_HIREDATE
          7369 SMITH      17 December  1980 Typ=12 Len=7: 119,180,12,17,1,1,1
          7499 ALLEN      20 February  1981 Typ=12 Len=7: 119,181,2,20,1,1,1
          7521 WARD       22 February  1981 Typ=12 Len=7: 119,181,2,22,1,1,1
          7566 JONES      02 April     1981 Typ=12 Len=7: 119,181,4,2,1,1,1
          7654 MARTIN     28 September 1981 Typ=12 Len=7: 119,181,9,28,1,1,1
          7698 BLAKE      01 May       1981 Typ=12 Len=7: 119,181,5,1,1,1,1
          7782 CLARK      09 June      1981 Typ=12 Len=7: 119,181,6,9,1,1,1
          7788 SCOTT      19 April     1987 Typ=12 Len=7: 119,187,4,19,1,1,1
          7839 KING       17 November  1981 Typ=12 Len=7: 119,181,11,17,1,1,1
          7844 TURNER     08 September 1981 Typ=12 Len=7: 119,181,9,8,1,1,1
          7876 ADAMS      23 May       1987 Typ=12 Len=7: 119,187,5,23,1,1,1
          7900 JAMES      03 December  1981 Typ=12 Len=7: 119,181,12,3,1,1,1
          7902 FORD       03 December  1981 Typ=12 Len=7: 119,181,12,3,1,1,1
          7934 MILLER     23 January   1982 Typ=12 Len=7: 119,182,1,23,1,1,1
    14 rows selected.
    SQL>Again, the internal date format remains the same.
    It is important that, when you store date information you store it as DATE datatype and let oracle use it's internal format, so that it can accurately do the date arithmetic, date range searches and date ordering etc., that everyone likes to do in queries. If you try and store it as VARCHAR2 then not only can information be lost (i.e. is '01/02/2010' representing 1st February 2010 or is it 2nd January 2010?) but you prevent date arithmetic, range searches and ordering in your queries from working correctly (i.e. '03/01/2009' would work out to be a greater date than '01/02/2010'). To prove it...
    SQL> select 'Wrong' from dual where '03/01/2009' > '01/02/2010';
    'WRON
    Wrong
    SQL> ed
    Wrote file afiedt.buf
      1* select 'Wrong' from dual where to_date('03/01/2009','DD/MM/YYYY') > to_date('01/02/2010','DD/MM/YYYY')
    SQL> /
    no rows selected

  • BDC - Session Method - No batch input data for screen  SAPMZ_TPSCREEN02 100

    Hi ABAP Experts,
    I have written a Dialog Program For a Screen Which contains 5 fields namely,
    carrid,
    connid,
    fldate,
    price,
    planetype.
    I have written the PAI logic to insert whatever entries entered in the fields, into Database Table SFLIGHT.
    I created a Transaction and Tested whether the entries are succesfully entetered into the Database Table and it works just fine.
    Now i planned to write a BDC program for the above Transaction so that i can upload data to the Database table from a flat file.
    I went to SHDB transaction and created a new recording and transferred the program to generate a source code.
    include bdcrecx1.
    start-of-selection.
    loop at itab.
    perform open_group.
    perform bdc_dynpro      using 'SAPMZ_TPSCREEN02' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=CREA'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'SFLIGHT-PLANETYPE'.
    perform bdc_field       using 'SFLIGHT-CARRID'
                                  'AA'.
    perform bdc_field       using 'SFLIGHT-CONNID'
                                  '0017'.
    perform bdc_field       using 'SFLIGHT-FLDATE'
                                  '11/01/2007'.
    perform bdc_field       using 'SFLIGHT-PRICE'
                                  '767'.
    perform bdc_field       using 'SFLIGHT-PLANETYPE'
                                  'A310-200F'.
    perform bdc_transaction using 'Z_TPSCREEN02'.
    perform close_group.
    Then i defined an internal table which contains the same fields as those in my Screen and Transaction.
    I populated the internal table from a flat file using GUI_UPLOAD function module.
    I want to clarify - I got this flat file by using the GUI_DOWNLOAD module and later i uploaded the same file using GUI_UPLOAD.
    I tested whether the internal table is populated or not using LOOP  AT ITAB. WRITE Statements.
    Its working just fine.
    Finally my code look like this.
    report ZVMREC
           no standard page heading line-size 255.
    TABLES: sflight.
    DATA: BEGIN OF itab OCCURS 0,
    carrid LIKE sflight-carrid,
    connid LIKE sflight-connid,
    fldate LIKE sflight-fldate,
    price TYPE sflight-price,
    planetype TYPE sflight-planetype,
          END OF itab.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = 'C:\users\vamc\documents\flightinfo.txt'
        FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
      tables
        data_tab                      = itab.
    include bdcrecx1.
    start-of-selection.
    loop at itab.
    perform open_group.
    perform bdc_dynpro      using 'SAPMZ_TPSCREEN02' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=CREA'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'SFLIGHT-PLANETYPE'.
    perform bdc_field       using 'SFLIGHT-CARRID'
                                  'AA'.
    perform bdc_field       using 'SFLIGHT-CONNID'
                                  '0017'.
    perform bdc_field       using 'SFLIGHT-FLDATE'
                                  '11/01/2007'.
    perform bdc_field       using 'SFLIGHT-PRICE'
                                  '767'.
    perform bdc_field       using 'SFLIGHT-PLANETYPE'
                                  'A310-200F'.
    perform bdc_transaction using 'Z_TPSCREEN02'.
    perform close_group.
    endloop.
    I checked for errors, activated and executed.
    I gave session name and executed, it generated same number of sessions as number of records.
    I went to SM35 and Processed one of the sessions in foreground.
    It brought my screen up with all fields fill up by the fields of first record in the internal table and with
    OK Code popping up.
    I check the OK Code.
    Now the problem has come up, its says
    *No batch input data for screen SAPMZ_TPSCREEN02 1000 *
    My session was now incorrectly processed,
    Please help me to fix this problem.
    I searched so many forums and google it a lot.
    But i didn't find any clue.
    Kindly take your time and have a look at this problem and let me know how can i fix it.
    Thank you very much all.
    Shiv
    Edited by: Sivaram  Naga on Apr 15, 2008 5:57 AM

    I used this code to convert the date format. I'm still getting the short dump.
       DATA: v_yyyy(4) TYPE c,
           v_mm(2) TYPE c,
           v_dd(2) TYPE c,
           v_date(8) TYPE c.
    v_yyyy = itab-fldate(4).
    v_mm = itab-fldate+4(2).
    v_dd = itab-fldate+6(2).
    concatenate v_yyyy v_mm v_dd  into v_date. 
    I'm once again, putting my code.
    report ZVMREC
           no standard page heading line-size 255.
    TABLES: sflight.
    DATA: BEGIN OF itab OCCURS 0,
    carrid LIKE sflight-carrid,
    connid LIKE sflight-connid,
    fldate LIKE sflight-fldate,
    price TYPE sflight-price,
    planetype TYPE sflight-planetype,
          END OF itab.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = 'C:\users\vamc\documents\flightinfo.txt'
        FILETYPE                      = 'ASC'
        HAS_FIELD_SEPARATOR           = 'X'
      tables
        data_tab                      = itab.
    include bdcrecx1.
    start-of-selection.
    loop at itab.
    DATA: v_yyyy(4) TYPE c,
           v_mm(2) TYPE c,
           v_dd(2) TYPE c,
           v_date(8) TYPE c.
    v_yyyy = itab-fldate(4).
    v_mm = itab-fldate+4(2).
    v_dd = itab-fldate+6(2).
    concatenate v_yyyy v_mm v_dd  into v_date.
    perform open_group.
    perform bdc_dynpro      using 'SAPMZ_TPSCREEN02' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=CREA'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'SFLIGHT-PLANETYPE'.
    perform bdc_field       using 'SFLIGHT-CARRID'
                                   ITAB-CARRID.
    perform bdc_field       using 'SFLIGHT-CONNID'
                                   ITAB-CONNID.
    perform bdc_field       using 'SFLIGHT-FLDATE'
                                  V_DATE.
    perform bdc_field       using 'SFLIGHT-PRICE'
                                   ITAB-PRICE.
    perform bdc_field       using 'SFLIGHT-PLANETYPE'
                                  ITAB-PLANETYPE.
    perform bdc_transaction using 'Z_TPSCREEN02'.
    perform close_group.
    endloop.
    Kindly take a look at it and please help me out. I tried very hard. But i dont understand why?
    Thanks
    Shiv
    Edited by: Sivaram  Naga on Apr 15, 2008 5:46 PM

  • Date format in flat file of bdc

    Hi Folks,
    In BDC I have a flat file which has to be uploaded from a flat file and 4 users are using each of one has their date format.
    so inorder to get their required date format what i need to do .

    Hi,
           use the below logic in your code.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-031.
    PARAMETERS: date1 RADIOBUTTON GROUP rad1 DEFAULT 'X',                                     "SAP date format YYYYDDMM
                date2 RADIOBUTTON GROUP rad1,                                                 "Date format like aprial31, 2006
                date3 RADIOBUTTON GROUP rad1,                                                 "Date format like 31 apr,2006
                date4 RADIOBUTTON GROUP rad1,                                                 "Date format like DD/MM/YYYY
                date5 RADIOBUTTON GROUP rad1.                                                 "Date format like DD.MM.YYYY
    SELECTION-SCREEN END OF BLOCK b2
    FORM getmonth .
      SELECT mnr
             ktx
             ltx
       INTO TABLE T_month
       FROM t247
       WHERE spras = 'EN'.
      IF sy-subrc NE '0'.
          MESSAGE I                                                          "Message - Not able to get month values from the table T247
      ENDIF.
    ENDFORM.                                                                               
    DATA : temp_date(16)  TYPE c,
             temp1_date(60) TYPE c,
             year(4)        TYPE c,
             daymonth(11)   TYPE c,
             daymonth1(11)  TYPE c,
             month(9)       TYPE c,
             day(2)         TYPE c,
             mon            LIKE t247-ktx,
             len            TYPE i   .
      MOVE date TO temp1_date .
      CONDENSE temp1_date NO-GAPS.
      MOVE temp1_date TO temp_date .
      IF date2 EQ 'X'.                                                                     "The date format is like Aprial 31, 2007
        CONDENSE temp_date NO-GAPS.
        SPLIT date AT ',' INTO daymonth year.
        IF STRLEN( year ) NE '4'.
          error = 'X'.
          WRITE :  'Invalid date format.'.
        ELSE.
          daymonth1 = daymonth.
          CONDENSE daymonth1 NO-GAPS.
          _len      = STRLEN( _daymonth1 ).
          l_len      = 13 - len.
          SHIFT daymonth1 RIGHT BY len PLACES.
          CONDENSE daymonth1 NO-GAPS.
          month    = daymonth1.
          CONDENSE month NO-GAPS.
          SORT t_month BY monthltx.
          READ TABLE t_month WITH KEY monthltx =  month.
          IF sy-subrc <> 0.
            error = 'X'.
            WRITE : 'Invalid date format.' .
          ELSE.
            len = STRLEN( month ).
            CONDENSE daymonth NO-GAPS.
            SHIFT daymonth LEFT BY len PLACES.
            day =  daymonth.
            CONDENSE day NO-GAPS.
            CONCATENATE year t_month-monthnumber day INTO o_date.
          ENDIF.
        ENDIF.
      ELSEIF p_date3 EQ 'X'.                                                                "The date format is like 31 apr, 2007
        CONDENSE temp_date NO-GAPS.
        SPLIT i_date AT ',' INTO daymonth year.
        IF STRLEN( year ) NE '4'.
          error = 'X'.
          WRITE :  'Invalid date format.'.
        ELSE.
          daymonth1 = daymonth.
          CONDENSE daymonth1 NO-GAPS.
          SHIFT daymonth1 LEFT BY 2 PLACES.
          CONDENSE daymonth1 NO-GAPS.
          month  = daymonth1.
          CONDENSE month NO-GAPS.
          TRANSLATE month TO UPPER CASE.
          SORT t_month BY monthstx.
          MOVE month to mon.
          READ TABLE t_month WITH KEY monthstx = mon.                                 
          IF sy-subrc <> 0.
            error = 'X'.
            WRITE : 'Invalid date format.' .
          ELSE.
            CONDENSE daymonth NO-GAPS.
            day =  daymonth+0(2).
            CONDENSE day NO-GAPS.
            CONCATENATE year t_month-monthnumber day INTO o_date.
         ENDIF.
       ENDIF.
      ELSEIF p_date4 EQ 'X' OR p_date5 EQ 'X'.                                             "Date format is like DD.MM.YYYY or DD/MM/YYYY
        CONDENSE temp_date NO-GAPS.
        IF STRLEN( temp_date ) EQ 10.
          o_date0(4) = temp_date6(4).
          o_date4(2) = temp_date3(2).
          o_date6(2) = temp_date0(2).
        ELSE.
          error = 'X'.
          WRITE : 'Invalid date format.' .
        ENDIF.
    ENDIF.
    IF STRLEN( o_date ) NE '8'.
         error = 'X'.
         WRITE : 'Invalid date format.'.
    ENDIf.
    ENDFORM.                                                                               
    regards

  • Dates Format in Promts using Session Variables

    Hi Experts,
    I have an issue in controlling date format in prompts using session variable which I am using to set default value.
    By default date format is timestamp E.g '2010-12-19 12:00:00 AM'.
    As per requriement(s) I customized the date format in Reports as 19-Dec-2010 and I saved it as "System Wide Default for <Date Column Name> "
    So, I got desired format in Reports and Date Prompts.
    Now, I need to set a default value in Date Prompt. So, in RPD I created a Session Variable which returned me date in
    DD-MON-YYYY format. Using follwing SQL :
    SELECT REPLACE(CONVERT(VARCHAR(11), Getdate (), 106), ' ', '-') AS [DD-Mon-YYYY]
    But in reports takes this value as string and not Datetime. So i got an error message.
    A datetime value was expected (received "19-Dec-2010").
    If i do not use above SQL to CONVERT date then default date in prompt get displayed as timestamp format and give me desired results but Formatting looks very odd in prompt
    Is this a way so I can persist the [DD-Mon-YYYY] Formatting for default value which comes using variable and still run the report.
    Above problem also exist vice versa that is if i SET that session variable and pass the datetime value to server. But there i guess I can use ToDate or some Casting in RPD column expression to handle that. Tell me if i am right ?
    Thanks
    Saurabh

    That almost works. I had to adjust the syntax to the following...and then there are other issues doing this.
    select cust_no, name,'@{session.currentUser}' from customersMy write-back SQL is this:
    UPDATE customers SET NAME='@{c1}',LAST_EDITED_BY='@{c2}' WHERE CUST_NO=@{c0}But I don't want to display the cust_no column to the user. So I hide it in the UI. But if I do that I get the below error during write-back. Apparently sometimes when you hide a column on a direct query (numeric maybe?) the value doesn't transfer over to the write-back. If that's the case, this won't work for me. Hmm...
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43093] An error occurred while processing the EXECUTE PHYSICAL statement. [nQSError: 17001] Oracle Error code: 936, message: ORA-00936: missing expression at OCI call OCIStmtExecute: UPDATE customers SET NAME='Wyatt Donnely',LAST_EDITED_BY='Administrator' WHERE CUST_NO= . [nQSError: 17011] SQL statement execution failed. (HY000)
    SQL Issued: EXECUTE PHYSICAL CONNECTION POOL dev1 UPDATE customers SET NAME='Wyatt Donnely',LAST_EDITED_BY='Administrator' WHERE CUST_NO=

  • Date Format Issue in Session

    DECLARE
    err_mesg_out          NUMBER(1):=0;
    x     DATE;
    y     VARCHAR2(50) := Null;
    z     DATE;
    BEGIN
    select scheduled_date into x
    from CONTRACT_SCHEDULED_FULFILLMENT where CONTRACT_ID=94875672 and fulfillment_type_id=9;
    dbms_output.put_line('x ='||x);
    select TO_CHAR(scheduled_date,'MM/DD/YYYY HH24:MI:SS') into y
    from CONTRACT_SCHEDULED_FULFILLMENT where CONTRACT_ID=94875672 and fulfillment_type_id=9;
    dbms_output.put_line('y ='||y);
    z := TO_DATE(y,'MM/DD/YYYY HH24:MI:SS');
    dbms_output.put_line('z ='||z);
    --my_proc(10001,20002,z,err_mesg_out);
    END;
    OutPut
    x =14-feb-2011
    y =02/14/2011 11:46:24
    z =14-feb-2011
    err_mesg_out =0I want to get the 'z' variable value in 'MM/DD/YYYY HH24:MI:SS' format in my session. Why I think so is because the same format/value need to be passed to
    a procedure "my_proc" - which is currently commented out. Even if I hardcode the 'z' param value while calling the "my_proc" it still throwing exception
    my_proc(10001,20002,'02/14/2011 11:46:24',err_mesg_out);
    ORA-01843: not a valid monthWhen this procedure is getting executed from the application code with the same value/format it's working fine and I think something need to be done in my SQLPLUS session. Can anyone suggest how I can set the date format to resolve this ?

    Hi,
    As Blushadow said, format (such as the difference between '16-Feb-11' and '02/16/2011 05:08:13') is something that applies only to strings, not DATEs. All DATEs have the same (purely internal) format, which has nothing to do with how they appear when you display them.
    By the way, assuming you want the variables x and y, the following code does exactly the same as what you posted:
    DECLARE
         err_mesg_out     NUMBER (1)     := 0;
         x          DATE;
         y          VARCHAR2 (50)      := Null;
         z          DATE;
    BEGIN
         select      scheduled_date
         into      x
         from      CONTRACT_SCHEDULED_FULFILLMENT
         where      CONTRACT_ID          = 94875672
         and      fulfillment_type_id     = 9;
         dbms_output.put_line ('x =' || x);
         y := TO_CHAR (x, 'MM/DD/YYYY HH24:MI:SS');
         dbms_output.put_line ('y =' || y);
         z := x;
         dbms_output.put_line ('z =' || z);
    --     my_proc (10001, 20002, z, err_mesg_out);
    END;
    / There's no need to query the table more than once, and it's just plain silly to convert a DATE (such as scheduled_date) into a string (such as y), just so you can convert it back to a DATE (such as z) again.
    If all you want to do is call my_proc, then the following is all you need:
    DECLARE
         err_mesg_out     NUMBER (1)     := 0;
         z          DATE;
    BEGIN
         select      scheduled_date
         into      z
         from      CONTRACT_SCHEDULED_FULFILLMENT
         where      CONTRACT_ID          = 94875672
         and      fulfillment_type_id     = 9;
         dbms_output.put_line ('z =' || z);
    --     my_proc (10001, 20002, z, err_mesg_out);
    END;
    /

  • BDC Session Saves Data Only in Foreground

    I have created a bdc program to create an SM35 session of CA02.  The wierd thing is that the session will run in background with no errors, but the data is not updated.  If I run the session in foreground the data is updated.  Have I overlooked something simple?

    To see what is going on, I commented out the save at the end to force it to error out.  If I run the session in foreground the data is changed.  If I run it in display errors only mode, the data is not changed.  So it seems not to have anything to do with the save at the end.  Perhaps it is now appropriate to post some of the code.
    After the data file is uploaded into the itab and the bdc group has been created, for each routing group I do the following:
      PERFORM dynpro USING:
    * ***   Initial Screen   ***
          'X'   'SAPLCPDI'       '1010',
          ' '   'RC271-PLNNR'    gk_rec-groupnum,
          ' '   'BDC_OKCODE'     '/00',
    * *** Header Overview  ***
          'X'   'SAPLCPDI'       '1200',
          ' '   'BDC_OKCODE'     'MTUE'.     "open material allocation screen
    Then for each material allocation the data file says to delete:
      PERFORM dynpro USING:
    * *** Material Allocation ***
          'X'   'SAPLCZDI'         '1010',
          ' '   'RC27X-ENTRY_ACT'  gv_entry,   "gv_entry holds row number to delete
          ' '   'BDC_OKCODE'       'ENT1',       "position button
          'X'   'SAPLCZDI'         '1010',
          ' '   'BDC_CURSOR'       'MAPL-MATNR(01)',  "place cursor on the line to delete
          ' '   'BDC_OKCODE'       'LOE',                      "delete line
          'X'   'SAPLSPO1'         '0100',
          ' '   'BDC_OKCODE'       'YES'.                      "confirm dialog
    then at the end of the session:
      PERFORM dynpro USING:
            'X'   'SAPLCZDI'       '1010',
            ' '   'BDC_OKCODE'     'BACK', "leave material allocation screen
            'X'   'SAPLCPDI'       '1200',
            ' '   'BDC_OKCODE'     'BU'.  "save
    Then, I insert into the bdc session using tcode ca02.  All this given the following subroutine:
    FORM dynpro USING p_dynbegin TYPE any p_name TYPE any p_value TYPE any.
      CLEAR gk_bdc_tab.
      IF p_dynbegin = 'X'.
        MOVE:  p_name  TO gk_bdc_tab-program,
               p_value TO gk_bdc_tab-dynpro,
               'X'   TO gk_bdc_tab-dynbegin.
      ELSE.
        MOVE:  p_name  TO gk_bdc_tab-fnam,
               p_value TO gk_bdc_tab-fval.
      ENDIF.
      APPEND gk_bdc_tab TO gt_bdc_tab.
    ENDFORM.
    It seems that the cursor isn't specifying the line to delete when run in background.

  • How to write date format in bdc

    how to write date format in bdc report

    Hi,
         First you have a data decleration i.e data l_format(10) type c.
    now if a variable say l_date which is of sy-datum type, you will have to  <b>write l_date to l_format</b>, this will transfer the date in which you(user) have set the date format in user settings. Never hard code the format such as dd.mm.yyyy. or mm/dd/yyyy because the may have different formats, and the BDC will fails. After you have used write to to new l_format, pass this new value to BDC recording.
    Reward if useful.
    Kiran

  • How to do Regional Setting Configuration in RDP session ( Eg Date Format, Currency, Decimal Seperator etc)

    Hi All,
    I am new to Windows Server 2008 R2 administration.
    I would like to know is there a way to  do Regional Setting Configuration in RDP session. i.e Date Format, Currency, Decimal Separator etc are based on users local machine.
    Eg If a user from UK logs in he should see date format as DD/MM/YY and if user from US logs in he should date format as MM/DD/YY.
    We are currently using citrix and we are managing this using logon script that runs based on citrix published application name.
    Is there any way we can achieve the same in RDP ?
    Thanks in Advance.
    Thanks & Regards,
    Nithin Kumar

    Hi Nithin,
    Do you need any other assistance?
    Thanks.
    Dharmesh Solanki
    TechNet Community Support

  • Set nls-date-format for each session

    I'm using oracle 8i on win2k professional. Using sql*plus I want my date formats as: 'DD-MON-YYYY'
    how is it possible for each session.
    Regards

    You posted this same question in the SQL forum. Did you see my reply?
    Re: How to populate a filter field in one page with the value from other pa
    Armand

  • Date Format IN BDC

    Hi,
    In One Interview I was asked that How can You Handle Data Format when Writing BDC ?

    Satya,
    The date format depends on User settings. Its different for different login ID's.
    It can be YYYY.MM.DD or MM.DD.YYYY or anything.
    To handle the date format, you need to query on table USR01 and fetch DATFM field that stores date format.
    Refer below piece of code
    */...Fetch the date format settings for the user
          SELECT SINGLE datfm
                   INTO gv_date_format
                   FROM usr01
                  WHERE bname = sy-uname.
      CASE gv_date_format.
        WHEN 1.     "DD.MM.YYYY
          CONCATENATE fv_impdate+6(2) '.'
                      fv_impdate+4(2) '.'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 2.     "MM/DD/YYYY
          CONCATENATE fv_impdate+4(2) '/'
                      fv_impdate+6(2) '/'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 3.     "MM-DD-YYYY
          CONCATENATE fv_impdate+4(2) '-'
                      fv_impdate+6(2) '-'
                      fv_impdate+0(4) INTO fv_expdate.
        WHEN 4.     "YYYY.MM.DD
          CONCATENATE fv_impdate+0(4) '.'
                      fv_impdate+4(2) '.'
                      fv_impdate+6(2) INTO fv_expdate.
        WHEN 5.     "YYYY/MM/DD
          CONCATENATE fv_impdate+0(4) '/'
                      fv_impdate+4(2) '/'
                      fv_impdate+6(2) INTO fv_expdate.
        WHEN 6.     "YYYY-MM-DD
          CONCATENATE fv_impdate+0(4) '-'
                      fv_impdate+4(2) '-'
                      fv_impdate+6(2) INTO fv_expdate.
      ENDCASE.
    This would convert the date into the format set for user.
    Hope this is helpful.
    Amogh

  • Date format with alter session -- very urgent !!!!

    The default format of date is DD-MON-YY.
    I like to change as DD/MM/YYYY. So I tried to do so by going
    through my login in SQLPlus and wrote
    ALTER SESSION
    SET NLS_DATE_FORMAT = 'DD/MM/YYYY'.
    The format got changed and there after every query displayed
    date in dd/mm/yyyy format. But once I exit sqlplus and reenter
    in sqlplus, the format goes away and the default date format i.e
    dd-mon-yy comes in existence.
    I want to know, how can i make my date format permanent and too
    for all users.
    null

    hello Khan,
    You can set this format in 2 ways, one is
    local setting and the other one is on server setting.
    Edit your c:\windows\oracle.ini (local setting)
    or your init.ora (oracle server setting)
    and add this script
    SET NLS_DATE_FORMAT = 'DD/MM/YYYY'
    note: if there's no nls_date_format in oracle.ini, the server
    nls_date_format in init.ora will be the current setting
    on your PC
    Hope this will help
    NEC PHIl.
    Shamsad Khan (guest) wrote:
    : The default format of date is DD-MON-YY.
    : I like to change as DD/MM/YYYY. So I tried to do so by going
    : through my login in SQLPlus and wrote
    : ALTER SESSION
    : SET NLS_DATE_FORMAT = 'DD/MM/YYYY'.
    : The format got changed and there after every query displayed
    : date in dd/mm/yyyy format. But once I exit sqlplus and reenter
    : in sqlplus, the format goes away and the default date format
    i.e
    : dd-mon-yy comes in existence.
    : I want to know, how can i make my date format permanent and
    too
    : for all users.
    null

  • I am posting data for va01 and va02 using BDC session,what happens if

    Hi,
    I am posting some data for va01 and va02 using BDC session,but what happens  if i try to post same data using call transaction.

    Hi,
    That is just another method. You can post the data using Call Transaction as well.
    Just give it a try and in case you face some problem revert back with your issue.
    We will help you to solve the same.
    Hope this helps!!!
    Regards,
    Lalit

  • BDC of below data format

    my EXCEL FORMAT IS LIKE BELOW :
    header                                       Item
    F1        I     F2     I    F3     I        F4   I        F5      I 
    2                3             TR             R5              U6
                                    ER             TY              FG
                                    FG             RG             RF
    1               5             TT               TR              TR
                                   RTE            TT                RTR
    i want to do bdc for the above data format.Can anybody suggest
    me how to do with simple coding ?
    thanks

    Hello,
    Use a FM to upload the file into an internal table....
    FM GUI_UPLOAD WILL BE ENOUGH.
    the create the Bdc seassion.... you ´ll find a lot of samples on the forum
    Bye
    gabriel p

Maybe you are looking for

  • Error while creating SC: Message E COM_PRODUCT_SETTINGS 001

    Hi Experts, When try to create a SC the error message is through: Message E COM_PRODUCT_SETTINGS 001 cannot be processed in plug mode HTTP. I am configuring the SRM7.0 for the first time and system throws the error message. Kindly help to resolve thi

  • UCM contributor green gear

    The green gear icon is not showing up while in contributor mode when an item is in a work flow. What are the configurations that we should check to ensure this icon is enabled? It is my understanding that a contributor can click on this icon and acce

  • Please help!!! rotating a video clip!!!!

    Hi all, I went to see Robbie Williams in concert and took a video of one of the songs... problem is, like a dork, a took the video in portrait format on my camera, so now it imports in landscape with robbie singing on his side... Does anyone know how

  • Can you get reoccurring alerts for text and email received?

    Can you get reoccurring alerts for text, email an voicemail received? I am too dumb for my smartphone.......I have looked on the forums and cannot find an answer. I just got my Droid Razr Maxx HD 2 weeks ago and so far I can only find that the "littl

  • NetWeaver EE 5 jsp include action issue

    Under NetWeaver EE 5 trial version I encounter the following problem: page buffer is always flushed before jsp:include. By default flush must default to "false", but either I specify flush="false" or miss the attribute - the buffer is always flushed.