How to get pivot table by using dates

Hi,
How to get pivot table by using dates in column.
Below is the sample table and its value is given.
create table sample1
Order_DATE       DATE,
order_CODE       NUMBER,
Order_COUNT   NUMBER
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),1,232);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),2,935);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),3,43);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),4,5713);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('30-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),5,11346);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),1,368);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),2,1380);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),3,133);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),4,7109);
Insert into sample1 (Order_DATE,order_CODE,Order_COUNT) values (to_timestamp('29-SEP-12','DD-MON-RR HH.MI.SSXFF AM'),5,14336);
select * from sample1;So how to get the data like below.
          order_date
order_code 30-sep-12 29-sep-12
1 232 368
2 935 1380
3 43 133
4 5713 7109
5 11345 14336

Using the extra data I inserted in my previous reply:select ORDER_CODE,
SUM(DECODE(extract (month from ORDER_DATE),1,ORDER_COUNT,0)) JAN,
SUM(DECODE(extract (month from ORDER_DATE),2,ORDER_COUNT,0)) FEB,
SUM(DECODE(extract (month from ORDER_DATE),3,ORDER_COUNT,0)) MAR,
SUM(DECODE(extract (month from ORDER_DATE),4,ORDER_COUNT,0)) APR,
SUM(DECODE(extract (month from ORDER_DATE),5,ORDER_COUNT,0)) MAY,
SUM(DECODE(extract (month from ORDER_DATE),6,ORDER_COUNT,0)) JUN,
SUM(DECODE(extract (month from ORDER_DATE),7,ORDER_COUNT,0)) JUL,
SUM(DECODE(extract (month from ORDER_DATE),8,ORDER_COUNT,0)) AUG,
SUM(DECODE(extract (month from ORDER_DATE),9,ORDER_COUNT,0)) SEP,
SUM(DECODE(extract (month from ORDER_DATE),10,ORDER_COUNT,0)) OCT,
SUM(DECODE(extract (month from ORDER_DATE),11,ORDER_COUNT,0)) NOV,
SUM(DECODE(extract (month from ORDER_DATE),12,ORDER_COUNT,0)) DEC
from SAMPLE1
where trunc(order_date, 'YY') = trunc(sysdate, 'YY')
group by order_code
order by order_code;
ORDER_CODE JAN FEB MAR APR MAY JUN JUL AUG   SEP   OCT NOV DEC
         1   0   0   0   0   0   0   0   0   600   600   0   0
         2   0   0   0   0   0   0   0   0  2315  2315   0   0
         3   0   0   0   0   0   0   0   0   176   176   0   0
         4   0   0   0   0   0   0   0   0 12822 12822   0   0
         5   0   0   0   0   0   0   0   0 25682 25682   0   0Now a bit of explanation.
1) Whenever you pivot rows to columns, no matter what version of Oracle and no matter what method you use, you have to decide in advance how many columns you are going to have and what the names of the columns are. This is a requirement of the SQL standard.
2) I use the WHERE clause to get just the data for this year
3) With EXTRACT, I get just the month without the year.
4) Using DECODE, I put every month's data into the correct column
5) Once I do all that, I can just GROUP BY order_code while SUMming all the data for each month.

Similar Messages

  • How to get internal table from SAP Data Provider C#

    Hello.
    ABAP:
       DATA: lt_t001 TYPE TABLE OF t001.
       DATA: url(1000) TYPE c.
      SELECT * INTO TABLE lt_t001 FROM t001.
      CALL FUNCTION 'DP_CREATE_URL'
        EXPORTING
          type                 = 'APPLICATION'
          subtype           = 'X-R3TABLE'
        TABLES
          data                 = lt_t001
        CHANGING
          url                    = url
        EXCEPTIONS
          OTHERS           = 4.
    C#:
    using SAPDataProvider;
    using SAPTableFactoryCtrl;
    public void SetDataFromUrl(string url)
                SAPDataProviderClass p = new SAPDataProviderClass();
                p.SetDataFromURL("APPLICATION", "X-R3TABLE", url);
                ISapDPR3Table tbl = p.GetDataAsR3Table("APPLICATION", "X-R3TABLE");
                SAPTableFactoryClass tf = new SAPTableFactoryClass();
                Table tb = (Table)tf.NewTable();
                tb.ISAPrfcITab = tbl.DataTable; // Exception !!!!!!
    How to get internal table from SAP Data Provider ?

    Hi Sergey,
    I'm trying to do the same, have you found a solution to solved it?
    thanks for your help.
    Regards.
    Jonathan

  • How to get Pivot table in 10g ?

    Hi,
    I have a table with data like this
    Exe_Name Deal_name Contract_No
    Mark ALF Ent C1001
    Sam ALF Ent C1002
    Mimie D&B Prod C1003
    phoen ALF Ent C1004
    Mark ALF Ent C1005
    Mark D&B Prod C1006
    Roger BlueBus Ent c3005
    I have to get an output as follows
    Exe Name ALF Ent D&B Prod BlueBus Ent RozHold ....... Pi Ent
    Mark 103 4 5 33
    Sam 23 15 33 53 24
    Mimie 3 44 13 22 1
    I work with Both Oracle 9i and 10g .I know that Oracle 11 has Something called PIVOT. I tried with Decode but it was
    not feasible since my executives are almost 50 in numbers and dealer vary between 90 to 130
    I need to use the query in Forms as well as Reports
    Is there any possible way of getting this ?
    Thanking you
    With Warm Regards
    ssr

    hi,
    This is table structure with data ,
    Executive name, Dealer Name and contract Number created by executive for the Dealer
    Exe_Name Deal_name Contract_No
    Mark ALF Ent C1001
    Sam ALF Ent C1002
    Mimie D&B Prod C1003
    phoen ALF Ent C1004
    Mark ALF Ent C1005
    Mark D&B Prod C1006
    Roger BlueBus Ent c3005
    The Following is the required Output
    The top Row has the Dealer Name
    and First col has the Executive Name . For every Executive we have to list the count of Contracts for each and every Dealer.
    Exe Name ALF Ent D&B Prod BlueBus Ent RozHold ....... Pi Ent
    Mark 103 4 5 33
    Sam 23 15 33 53 24
    Mimie 3 44 13 22 1
    as i told in my first post, Decode is not exactly working out as there are many dealers .
    Can any one pull me out ?
    With Warm Regards
    ssr

  • How to get the name of a Data Element of a generic Table!

    Hi guys!
    In my function i have the following import paramenter
    i_outtab type standard table
    now i import a table and i want to get the dataelement of the fields.
    is there a way to do this??

    Hello Thomas
    Perhaps the following sample report may be useful for you.
    *& Report  ZUS_SDN_RTTI_STRUCT_COMPONENTS
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1145711"></a>
    *& Thread: How to get the name of a Data Element of a generic Table!
    REPORT  zus_sdn_rtti_struct_components.
    TYPE-POOLS: abap.
    TYPES: BEGIN OF ty_s_outtab.
    TYPES: bukrs    TYPE bukrs.
    TYPES: kunnr    TYPE kunnr.
    TYPES: END OF ty_s_outtab.
    DATA: gdo_data    TYPE REF TO data.
    DATA: gs_outtab   TYPE ty_s_outtab.
    DATA: go_typedescr  TYPE REF TO cl_abap_typedescr,
          go_structdescr  TYPE REF TO cl_abap_structdescr,
          go_datadescr    type ref to cl_abap_datadescr.
    DATA: gs_comp        TYPE abap_compdescr,
          gd_dtel        type string,
          gt_dfies        type ddfields.
    FIELD-SYMBOLS:
      <gs_struct> TYPE ANY.
    START-OF-SELECTION.
      BREAK-POINT.
      GET REFERENCE OF gs_outtab INTO gdo_data.
      ASSIGN gdo_data->* TO <gs_struct>.
      go_typedescr = cl_abap_typedescr=>describe_by_data( <gs_struct> ).
      go_structdescr ?= go_typedescr.
      BREAK-POINT.
      LOOP AT go_structdescr->components INTO gs_comp.
        go_datadescr = GO_STRUCTDESCR->GET_COMPONENT_TYPE( gs_comp-name ).
        gd_dtel = go_datadescr->get_relative_name( ).
        write: / syst-tabix, 'Data element =', gd_dtel.
      ENDLOOP.
    END-OF-SELECTION.
    Regards
      Uwe

  • I-photo:  I used 2 cameras to take pictures on a trip --- i have put the pictures from both cameras into an album --- when i click on view and then sort by date, the pictures do not sort by date --- any ideas on how to get the pics sorted by date?

    I-photo:  I used 2 cameras to take pictures on a trip --- i have put the pictures from both cameras into an album --- when i click on view and then sort by date, the pictures do not sort by date --- any ideas on how to get the pics sorted by date?

    Select all the photos that you need to change, then click the "Photos" menu and choose "Adjust Date and Time".
    If you add a year, it will adjust all the photos that you selected by adding a year (so if you accidentally select one of the photos that already has "2012", that will change to "2013"). 

  • Pivot table that uses a Stored Procedure parameter and filters the data based on it

    Hello, my 1st post.  I am lost.  Please help.
    I am trying to create an Excel Pivot Table that has data that comes from an ODC but needs to be filtered based on a parameter from a Stored Procedure.  This involves Project Server.  I need to filter the results based on the RBS value of the logged
    in user.  My Stored Procedure can return the RBS as long as the ResourceNTAccount value is given.  I cant figure out how to tie this all together.

    Hi,
    Based on your description,I think this issue should be  more related to Programming/coding, you can sumbit a new case to MSDN forum.
    As I'm not quite formular with Project Server, all I can tell you is that it is easy to running a Stored Procedure within Excel, however, if you have to pass dynamic parameters you’ll have to turn to VBA.For detailed information,please refer
    to:
    http://blogs.office.com/2010/06/07/running-a-sql-stored-procedure-from-excel-no-vba/
    Wind Zhang
    TechNet Community Support

  • How to get nested table meta data

    how to get nested table column name, column type and column size
    by using java. i need code for this.
    please help me.

    The Follopwing program does display the the details of table. Hope you get the solution
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.Statement;
    public class Main {
      public static void main(String[] args) throws Exception {
        Connection conn = getOracleConnection();
        System.out.println("Got Connection.");
        Statement st = conn.createStatement();
        st = conn.createStatement();
        ResultSet rs = st.executeQuery("SELECT * FROM SCHEDULE_SET");
        ResultSetMetaData rsMetaData = rs.getMetaData();
        int numberOfColumns = rsMetaData.getColumnCount();
        System.out.println("resultSet MetaData column Count=" + numberOfColumns);
        for (int i = 1; i <= numberOfColumns; i++) {
          System.out.println("column MetaData ");
          System.out.println("column number " + i);
          // indicates the designated column's normal maximum width in
          // characters
          System.out.println(rsMetaData.getColumnDisplaySize(i));
          // gets the designated column's suggested title
          // for use in printouts and displays.
          System.out.println(rsMetaData.getColumnLabel(i));
          // get the designated column's name.
          System.out.println(rsMetaData.getColumnName(i));
          // get the designated column's SQL type.
          System.out.println(rsMetaData.getColumnType(i));
          // get the designated column's SQL type name.
          System.out.println(rsMetaData.getColumnTypeName(i));
          // get the designated column's class name.
          System.out.println(rsMetaData.getColumnClassName(i));
          // get the designated column's table name.
          System.out.println(rsMetaData.getTableName(i));
          // get the designated column's number of decimal digits.
          System.out.println(rsMetaData.getPrecision(i));
          // gets the designated column's number of
          // digits to right of the decimal point.
          System.out.println(rsMetaData.getScale(i));
          // indicates whether the designated column is
          // automatically numbered, thus read-only.
          System.out.println(rsMetaData.isAutoIncrement(i));
          // indicates whether the designated column is a cash value.
          System.out.println(rsMetaData.isCurrency(i));
          // indicates whether a write on the designated
          // column will succeed.
          System.out.println(rsMetaData.isWritable(i));
          // indicates whether a write on the designated
          // column will definitely succeed.
          System.out.println(rsMetaData.isDefinitelyWritable(i));
          // indicates the nullability of values
          // in the designated column.
          System.out.println(rsMetaData.isNullable(i));
          // Indicates whether the designated column
          // is definitely not writable.
          System.out.println(rsMetaData.isReadOnly(i));
          // Indicates whether a column's case matters
          // in the designated column.
          System.out.println(rsMetaData.isCaseSensitive(i));
          // Indicates whether a column's case matters
          // in the designated column.
          System.out.println(rsMetaData.isSearchable(i));
          // indicates whether values in the designated
          // column are signed numbers.
          System.out.println(rsMetaData.isSigned(i));
          // Gets the designated column's table's catalog name.
          System.out.println(rsMetaData.getCatalogName(i));
          // Gets the designated column's table's schema name.
          System.out.println(rsMetaData.getSchemaName(i));
        st.close();
        conn.close();
      public static Connection getOracleConnection() throws Exception {
        String driver = "oracle.jdbc.driver.OracleDriver";
        String url = "jdbc:oracle:thin:@son15644:1521:CXPqa1";
        String username = "ess4qa2";
        String password = "ess4qa2pw";
        Class.forName(driver); // load Oracle driver
        Connection conn = DriverManager.getConnection(url, username, password);
        return conn;
    }

  • How to get sharepoint online (office 365) data in cloud/windows azure (provider) hosted app using Javascript?

    How to get sharepoint online (office 365) data in cloud/windows azure (provider) hosted app using Javascript?
    I wish to retrieve sharepoint online data in html page (hosted in windows azure) using javascript and then need to play with AngularJS

    Hi,
    According to your description, you might want to get data from Office 365 SharePoint Online(also known as host web) and pass to the Provider Hosted App which is hosted
    in Windows Azure site.
    I would suggest you take a look at the links below about accessing data from the host web
     for a quick start:
    https://msdn.microsoft.com/en-us/library/office/fp179927(v=office.15).aspx#SP15Accessdatafromremoteapp_Codeexample
    http://dannyjessee.com/blog/index.php/2014/07/accessing-sharepoint-data-from-provider-hosted-apps-use-the-right-context/
    Aother sample solution for your reference:
    https://code.msdn.microsoft.com/SharePoint-2013-Get-the-0ec36bb6
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to get the table of value field? and can we expand the technical limits

    Dear
    I have created value field in COPA with KEA6. And now, I need the table which the value fields are saved. Yet, I have tried a lot to find it and get failure? Can any guy help me? Please tell me how to get the table of a value field.
    And another question is that, can we extend the technical limits for the number of value field for ECC6.0?
    We have a note for R.4.x Please see below:
    OSS note 160892
    You can display the length of a data record using Transaction KEA0 ('Maintain Operating Concern'). After you have navigated to the 'Characteristics Screen' or to the 'Value field Screen' choose menu path 'Extras -> Technical Limits'.
    The maximum displayed here under 'Length in bytes on the DB' is the maximum length permitted by the Dictionary. The reserve required for the release upgrade must be subtracted from this value.
    To increase the allowed number of the value fields, increase the value that is assigned to field ikcge-bas_max_cnt (FORM init_ikcge_ke USING fm_subrc, approx. line 165) in Include FKCGNF20. It specifies the number of the possible value fields. The corresponding part of the source code is attached to the note as a correction.
    David Sun
    Regards!

    how to extend the limit of value numbers? please see the original question.

  • How to get header when we use CL_GUI_FRONTEND_SERVICES= GUI_DOWNLOAD

    Hi SDN's,
    Can u tell me how to get headers when we download data to excel with using (we are using DBF as file type in the following method )
    CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
    (We can't use GUI_DOWNLOAD)
    Thanks in advance..
    BR

    Hi,
    I m giving u a bdc code i hope ur prob ll be solved.
    *& Report  ZDTK_BDC_LT01
    *& PROGRAME TITLE : LT01
    *& AUTHOR         : D TARUN KUMAR
    *& MM CONSULTANT  : Mr. MRINMOYE CHAKRABORTY
    *& REQUEST NO.    : RD1K901995
    *& TRANSACTION ID : ZLT01
    *& PACKAGE        : ZTARUN
    *& DESCRIPTION : BDC REPORT TO UPLOAD INITIAL STOCK POSTING AND
    *&               STORAGE BINS THROUGH LT01.
    REPORT  ZDTK_BDC_LT01
           no standard page heading line-size 255.
    TYPE-POOLS: TRUXS.
    STRUCTURE DECLARATION
    TYPES : BEGIN OF TY_UPLOAD,
                     LGNUM(3),
                     BETYP(1),
                     BENUM(10),
                    BWLVS(3),
                     MATNR(18),
                    BISMT(18),
                     ANFME(16),
                    WERKS(4),
                    LGORT(4),
                     CHARG(10),
                    LETYP(10),
                    VLTYP(3),
                    VLBER(3),
                    VLPLA(10),
                    VLQNR(10),
                     NLTYP(3),
                    NLBER(3),
                     NLPLA(10),
                    NLQNR(10),
              END OF TY_UPLOAD.
    INTERNALTABLE & WORKAREA DECLARATION
    DATA : T_UPLOAD TYPE STANDARD TABLE OF TY_UPLOAD,
           T_BDCDATA TYPE STANDARD TABLE OF BDCDATA,
           T_BDCMSGCOLL TYPE STANDARD TABLE OF BDCMSGCOLL,
           W_UPLOAD TYPE TY_UPLOAD,
           W_BDCDATA TYPE BDCDATA,
           W_BDCMSGCOLL TYPE BDCMSGCOLL,
    GLOBLE DECLARATION
           G_FLNAME TYPE STRING,
           G_MESSAGE(70) TYPE C,
           IT_RAW TYPE TRUXS_T_TEXT_DATA,
    GLOBLE DECLARATION
           WA_OPT TYPE CTU_PARAMS.
           WA_OPT-UPDMODE = 'A'.
           WA_OPT-DEFSIZE = 'X'.
           WA_OPT-DISMODE = 'A'.
    SLECTION SCREEN DECLARATION
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 2.
    PARAMETER : P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN : END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    PERFORM GET_FILENAME.
    START-OF-SELECTION.
    PERFORM UPLOAD_DATA.
    *PERFORM GET_FINAL.
    *PERFORM GET_MIGO.
    PERFORM SESSION.
    *PERFORM TEST.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR W_BDCDATA.
      W_BDCDATA-PROGRAM  = PROGRAM.
      W_BDCDATA-DYNPRO   = DYNPRO.
      W_BDCDATA-DYNBEGIN = 'X'.
      APPEND W_BDCDATA TO T_BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
    IF FVAL <> NODATA.
        CLEAR W_BDCDATA.
        W_BDCDATA-FNAM = FNAM.
        W_BDCDATA-FVAL = FVAL.
        APPEND W_BDCDATA TO T_BDCDATA.
    ENDIF.
    ENDFORM.
    *&      Form  GET_FILENAME
          TEXT
    FORM GET_FILENAME .
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = SYST-CPROG
       DYNPRO_NUMBER       = SYST-DYNNR
       FIELD_NAME          = 'P_FILE'
    IMPORTING
       FILE_NAME           = P_FILE
    ENDFORM.                    " GET_FILENAME
    *&      Form  UPLOAD_DATA
          text
    form UPLOAD_DATA .
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
      I_FIELD_SEPERATOR          =
        I_LINE_HEADER              = 'X'
        I_TAB_RAW_DATA             = IT_RAW
        I_FILENAME                 = P_FILE      "WORK TABLE
      TABLES
        I_TAB_CONVERTED_DATA       = T_UPLOAD[]    "ACTUAL DATA
    EXCEPTIONS
       CONVERSION_FAILED          = 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.
    endform.                    " UPLOAD_DATA
    *&      Form  SESSION
          text
    FORM SESSION .
    *sort t_upload by bismt.
    LOOP AT T_UPLOAD INTO W_UPLOAD.
    REFRESH T_BDCDATA.
    *CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
       input         = W_UPLOAD-CHARG
    IMPORTING
      OUTPUT        = W_UPLOAD-CHARG .
    *CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
       input         = W_UPLOAD-VLBER
    IMPORTING
      OUTPUT        = W_UPLOAD-VLBER .
    *CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
       input         = W_UPLOAD-NLTYP
    IMPORTING
      OUTPUT        = W_UPLOAD-NLTYP .
    *CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
       input         = W_UPLOAD-NLBER
    IMPORTING
      OUTPUT        = W_UPLOAD-NLBER .
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input         = W_UPLOAD-CHARG
    IMPORTING
       OUTPUT        = W_UPLOAD-CHARG .
    DATA : BWLVS(3),
           LGORT(4),
           WERKS(4),
           CHARG(10),
           LETYP(10),
           VLTYP(3),
           VLBER(3),
           VLPLA(10),
           VLQNR(10),
           NLTYP(3),
           NLBER(3),
           NLQNR(10).
    DATA : W_MATNR(18).
    *SELECT SINGLE MATNR FROM MARA INTO W_MATNR
                      WHERE BISMT = W_UPLOAD-BISMT.
    BWLVS = '999'.
    LGORT = '3500'.
    WERKS = '1030'.
    LETYP = 'E1'.
    VLTYP = '998'.
    VLBER = '001'.
    VLPLA = 'AUFNAHME'.
    NLTYP = '354'. "(packaging material)
    *NLTYP = '353'. "(spareparts material)
    NLBER = '001'.
    *include bdcrecx1.
    *start-of-selection.
    *perform open_group.
    perform bdc_dynpro      using 'SAPML03T' '0101'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LTAP-CHARG'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LTAK-LGNUM'
                                  W_UPLOAD-LGNUM.  "'350'.
    perform bdc_field       using 'LTAK-BENUM'
                                  W_UPLOAD-BENUM.  "'1000000000'.
    perform bdc_field       using 'LTAK-BETYP'
                                  W_UPLOAD-BETYP.  "'P'.
    perform bdc_field       using 'LTAK-BWLVS'  BWLVS.    "'999'.
    perform bdc_field       using 'LTAP-MATNR'
                                  W_upload-MATNR.    "'40000009'.
    perform bdc_field       using 'RL03T-ANFME'
                                  W_UPLOAD-ANFME.    "'1,000'.
    perform bdc_field       using 'LTAP-WERKS' WERKS.    "'1030'.
    perform bdc_field       using 'LTAP-CHARG'
                                  w_upload-charg.
    perform bdc_dynpro      using 'SAPML03T' '0102'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LTAP-NLPLA'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RL03T-ANFME'
                                  W_UPLOAD-ANFME.    "'1,000'.
    *perform bdc_field       using 'LTAP-ALTME'
                                 'KG'.
    perform bdc_field       using 'LTAP-LETYP' LETYP.    "'E1'.
    *perform bdc_field       using 'LTAP-CHARG' W_UPLOAD-CHARG.    "'0000000101'.
    perform bdc_field       using 'LTAP-VLTYP' VLTYP.    "'998'.
    perform bdc_field       using 'LTAP-VLBER' VLBER.    "'001'.
    perform bdc_field       using 'LTAP-VLPLA' VLPLA.    "'AUFNAHME'.
    perform bdc_field       using 'LTAP-NLTYP'
                                   W_UPLOAD-NLTYP.       "'351'.
    perform bdc_field       using 'LTAP-NLBER' NLBER.    "'001'.
    perform bdc_field       using 'LTAP-NLPLA'
                                  W_UPLOAD-NLPLA.    "'01 00 01'.
    *perform bdc_transaction using 'LT01'.
    *perform close_group.
    CALL TRANSACTION 'LT01' USING T_BDCDATA
                            MODE 'A'
                          UPDATE 'A'
                            OPTIONS FROM WA_OPT
         MESSAGES INTO T_BDCMSGCOLL.
    IF SY-SUBRC <> 0.
    READ TABLE T_BDCMSGCOLL INTO W_BDCMSGCOLL INDEX 1.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            ID        = SY-MSGID
            LANG      = 'EN'
            NO        = SY-MSGNO
            V1        = SY-MSGV1
            V2        = SY-MSGV2
            V3        = SY-MSGV3
            V4        = SY-MSGV4
          IMPORTING
            MSG       = G_MESSAGE
          EXCEPTIONS
            NOT_FOUND = 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.
          WRITE : / W_upload-matnr ,'-----' , G_MESSAGE.
          REFRESH T_BDCMSGCOLL.
        ENDIF.
        ENDIF.
    *clear : w_matnr, w_upload.
    ENDLOOP.
    ENDFORM.                    " SESSION

  • How to get a time part from Date datatype

    Hi,
    I would like to know how to extract the timestamp alone from DATE datatype? If my input is '27-SEP-2011 23:59:00' I need the output as 23:59:00. I am surprised to see that there are no in-built functions for this or may be I am wrong. Basically I need to remove the date part from DATE data type and get the time.Please assist.
    -Thanks
    Edited by: user9546145 on Sep 27, 2011 2:24 PM
    Edited by: user9546145 on Sep 27, 2011 2:25 PM

    Hi,
    user9546145 wrote:
    Hi,
    I would like to know how to extract the timestamp alone from DATE datatype? Be careful! In Oracle, TIMESTAMP means a datatype, similar to but distinct from DATE. You'll avoid confusion if you don't use the word "timestamp" to mean anything else.
    There is a built-in function, TO_CHAR:
    TO_CHAR (dt_col, 'HH24:MI:SS')Depending on how you plan to use the time, TRUNC is another handy built-in function:
    dt_col - TRUNC (dt_col)is a NUMBER (not less than 0, but less than 1) which is suitable for many tasks, such as finding the average time.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.

  • How to get the table with no. of records after filter in webdynpro

    Dear Gurus,
    How to get the table with no. of records after filter in webdynpro?
    Thanks in advance.
    Sankar

    Hello Sankar,
    Please explain your requirement clearly so that we can help you easily.
    To get the table records from your context node use method get_static_attributes_table()
    data lo_nd_mynode       type ref to if_wd_context_node. 
    data lt_atrributes_table  type wd_this->elements_mynode. 
    lo_nd_mynode = wd_context->get_child_node( name = wd_this->wdctx_mynode ). 
    lo_nd_mynode->get_static_attributes_table( importing table = lt_atrributes_table ). 
    Note: You should have already defined your context node as a Dictionary Structure.
    BR,
    RAM

  • How to get fiscal period based on date and Fiscal year?

    Hi Guys,
               Can anybody tell me how to get Fiscal period based on date and Fiscal Year or fiscal year variant?
    Thanks,
    Gopi.

    Hi,
    Please refer the code below:
    *: Report:  ZFISCALYR                                                  :
    *: Date  :  2004                                                       :
    *: Description: Demonstrates how to return the corresponding fiscal    :
    *:              year and posting period for a company code and posting :
    *:              date or posting date and fiscal year variant.          :
    REPORT  zfiscalyr NO STANDARD PAGE HEADING.
    TABLES: ekko.
    PARAMETERS:     p_bukrs TYPE ekko-bukrs,
                    p_bedat TYPE ekko-bedat.
    DATA: gd_fiscalyr  TYPE bapi0002_4-fiscal_year,
          gd_fiscalp   TYPE bapi0002_4-fiscal_period.
    DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
          gd_fiscalp2  TYPE bapi0002_4-fiscal_period.
    DATA: gd_periv     TYPE t009-periv.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * get fiscal year and period - (requires date and company code)
      CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
        EXPORTING
          companycodeid = p_bukrs
          posting_date  = p_bedat
        IMPORTING
          fiscal_year   = gd_fiscalyr
          fiscal_period = gd_fiscalp.
    * Alternative fiscal year function module
    * - (requires date and fiscal year variant code from T009 table)
    * gets first entry in fiscal year variant table (will need to choose
    * correct one from table rather than just using first entry)
      SELECT SINGLE periv
        FROM t009
        INTO gd_periv.
    * get fiscal year and period
      CALL FUNCTION 'DETERMINE_PERIOD'
        EXPORTING
          date                      = p_bedat
    *    PERIOD_IN                 = '000'
          version                   = gd_periv
       IMPORTING
          period                    = gd_fiscalp2
          year                      = gd_fiscalyr2
       EXCEPTIONS
          period_in_not_valid       = 1
          period_not_assigned       = 2
          version_undefined         = 3
          OTHERS                    = 4.
    *END-OF-SELECTION.
    END-OF-SELECTION.
      WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr,
            / 'Fiscal period is:', gd_fiscalp.
      SKIP.
      WRITE:/ 'From function module: DETERMINE_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr2,
            / 'Fiscal period is:', gd_fiscalp2.
    Thanks,
    Sriram Ponna.
    Edited by: Sriram Ponna on Apr 17, 2008 8:59 PM

  • How to get updated table values from objectlistdataproviders

    how to get updated table values from objectlistdataproviders

    Hi,
    Here is a sample code
    start-of-selection.
    *Select the data you need into an internal table
      loop at it_mara into wa_mara.
    data that needs to be displayed in the output list
        write:/ box as checkbox,
                wa_mara-matnr under text-001,
                wa_mara-maktx under text-002,
                wa_mara-lgort under text-003.
    Hide the data that needs to moved to internal table
        hide:wa_mara-matnr, wa_mara-maktx, wa_mara-lgort.
      endloop.
      clear wa_mara.
    end-of-selection.
      lines = sy-linno.
    at line-selection.
      clear:it_matnr. 
      do lines times.
        check sy-index > 1.
        box = space.
        read line sy-index field value box.
        if box = 'X'.
    *data selected using check box is moved to internal table
          append wa_mara to it_matnr.
        endif.
      enddo.
    Regards,
    Jisha.

  • How to display smartforms table lines useing different background colour

    Hi all:
    How to display smartforms table lines useing different background colour .
    for example:
    line1:green
    line2:red
    line3:green
    line4:red
    line5:green
    line6:red
    line7:green
    line8:red
    Any help is highly appreciated!!
    启明星

    Hi,
    Create a two lines one for header and second for data in the table.
    1)In table painter we can find the pencil mark.
    2)select the pencil mark
    3)now select the line which you need to shade
    4) now select the shading colour in the table painter and the provide the resolution up to 100% and select table pattrn for that line.
    5) Now you can use this for the header now only the header gets shaded and the remaining gets unshaded.
    reward points if useful
    Thanks and Regards,
    Nishant

Maybe you are looking for

  • Please HELP! Macbook pro (15" mid.2010) restarts randomly.

    Hi, I've got a problem and I hope you can help me. Macbook Pro 15" mid. 2010 (recently updated to os x Mountain Lion) restarts on its own "because of a problem". It's been a major issue in the last months, causing big troubles and preventing me from

  • How to pass the selected Pernr from Portal to WDA iview dynamically ?

    Hi , How we can pass the selected Pernr from portal page to the webdynpro application dynamically? Ex: If a manager select a employee id of an employee then it should display all the related document regarding the employee in the ivew. For that we ne

  • Error in Downloading Office using ODT

    dear all, i downloaded the latest ODT from this link http://www.microsoft.com/en-eg/download/details.aspx?id=36778 ,,, the ODT version is 15.0.4623.1001 i'm running this command to download the office setup.exe /download C:\odt\configuration.xml belo

  • TV Guide on-Screen not working over-the-air

    Just recently revived a 42HL196 (see thread "Red light flashing on 42L196"), the first TV I've repaired that features TVGuide On Screen.  I was all excited about this until reading on the web that Rovi, the owner company of TVGuide service, phased ou

  • Synaptics Touchpad Tap Lag, FastTaps Option Gone

    I own an Asus Zenbook Prime UX31A with a clickpad. Under the Synaptics driver, I'm trying to use tap-to-click. With the default settings, there is a very noticeable lag between when I tap and the tap is registered, which I'm sure many of you have hea