Creation of a ztable

Hi,
what is the purpose of a ztable. when would we be pushed to create one. how do we create it like is it going to se11 enter a table name and create.
centrino

Hi Centrino,
Most of the tables in SAP are appliaction specific. Suppose you want a cross application table having data from FI, MM, SD in 1 table the you could design your own table. You might also create a ztable to fill your own data.
In BW context a ztable is created as a staging table on the R/3. It would contain data that is extracted from various other tables using function modules based on some logic. This table would then be used as a datasource for passing data to BW.
Bye
Dinesh

Similar Messages

  • BAPI and Ztable COMMIT

    Dear Experts
    In a RFC, our codes are as follows:
         CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
         CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
         MODIFY Ztable FROM TABLE it_ztable.
         COMMIT WORK.
    We wonder to know that how do we pack above actions into a LUW for the consistency of commit or rollback.

    Hi Custodio de Oliveira   
    I have followed your suggestion and written sample codes to create sales order.
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in    = lt_order_header
        TABLES
          return            = lt_return     
          order_items_in    = lt_order_item
          order_partners    = lt_order_partner
          order_schedules_in = lt_order_schdl.
      READ TABLE lt_return WITH KEY TYPE    = 'S'
                                    ID      = 'V1'
                                    NUMBER  = '311'.
      IF SY-SUBRC EQ 0.
        MODIFY ZT_PROG_MSG FROM TABLE lt_msg.
        IF SY-SUBRC EQ 0.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              WAIT  = 'X'
            IMPORTING
              RETURN = lt_return2.
        ELSE.
          IF SY-SUBRC NE 0.
            CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          ENDIF.
        ENDIF.
      ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ENDIF.
    And I manually adjust duplication number range for causing an update error.
    In debug mode, I check the return type in "lt_return", and then I can get 'S'.
    However, after BAPI_TRANSACTION_COMMIT, there is update error for sales order creation, but our Ztable(ZT_PROG_MSG)is still updated successfully. How can we assure consistency, if there is any system error making bapi commit failure?

  • T.code creationn for ztable.

    i need to create t.code for (ztable)table maintance...
    in that t.code creation we should not use SM30 .
    since the user doesnot have access to SM30.
    pls help me out..

    1)Write a program and give it a tcode
    2)Call the following FM to maintain the table:
    CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
      EXPORTING
        action                               = 'S'
    *   CORR_NUMBER                          = '          '
    *   GENERATE_MAINT_TOOL_IF_MISSING       = ' '
    *   SHOW_SELECTION_POPUP                 = ' '
        view_name                            = 'ZSLO_RET_DISPO'
    *   NO_WARNING_FOR_CLIENTINDEP           = ' '
    *   RFC_DESTINATION_FOR_UPGRADE          = ' '
    *   CLIENT_FOR_UPGRADE                   = ' '
    *   VARIANT_FOR_SELECTION                = ' '
    *   COMPLEX_SELCONDS_USED                = ' '
        CHECK_DDIC_MAINFLAG                  = 'X'
    *   SUPPRESS_WA_POPUP                    = ' '
    * TABLES
    *   DBA_SELLIST                          =
    *   EXCL_CUA_FUNCT                       =
      EXCEPTIONS
        CLIENT_REFERENCE                     = 1
        FOREIGN_LOCK                         = 2
        INVALID_ACTION                       = 3
        NO_CLIENTINDEPENDENT_AUTH            = 4
        NO_DATABASE_FUNCTION                 = 5
        NO_EDITOR_FUNCTION                   = 6
        NO_SHOW_AUTH                         = 7
        NO_TVDIR_ENTRY                       = 8
        NO_UPD_AUTH                          = 9
        ONLY_SHOW_ALLOWED                    = 10
        SYSTEM_FAILURE                       = 11
        UNKNOWN_FIELD_IN_DBA_SELLIST         = 12
        VIEW_NOT_FOUND                       = 13
        MAINTENANCE_PROHIBITED               = 14
        OTHERS                               = 15
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    and you job is done...

  • In Ztable creation, How can we display error message for a 'To date' field.

    Hi all,
    I have a requirement like this.
    There r two fields in ztable. From date and To date.
    The field 'To date' in table ZKM007 is taking before date than From date field.
    To date should always be greater than from date i need to throw an  error or don't  allow to enter date  if date is less than From date.
    How can we do this?
    Can any one help on this?
    Rewards to all.
    Thanks & Regards,
    Anu.

    I have written below code at event "Creating a new entry" (05) in table maintainance generator.But it is not working. If we give the to date < From date ,
    it is saving.
    Can any one help on this code? Pls Give me code And which event i have to put this?
    ***INCLUDE LZEXE3F01 .
    FORM AT_entry.
    IF ZEXE3-TODATE LT ZEXE3-FROMDATE.
      MESSAGE I001(0) WITH 'ENTER TO DATE GREATER THAN FROM DATE'.
    ENDIF.
    ENDFORM.
    Rewards to all.
    thanks
    Anu.

  • Creation of ztable

    Hi,
    I am creating ztable with field 
                    zemail  data element as 'URL'  getting error as
    Table ZTABLE: Key length > 120 (Restricted functionality)
    Message no. DT214
    Diagnosis
    The key length, i.e. the sum of the field lengths of all the key fields of the table, is more than 120 bytes.
    System Response
    This is a warning.
    Procedure
    Note the following restricted fuctionality for this table:
    - Table contents cannot be transported by specifying key values, at
      best by specifying generic key values with a maximum length of 120
      bytes.
    - The table may not be used as the base table of a lock object.
    Thanks,
    Asha

    Asha,
    Warning in SE11 - Defining tables.

  • Creation of function module for updating the ztable

    Hi,
    I am sending the requirement for ceation of function module for updating the ztable.
    Requirement----
    Table Updation rule (New record)
    While creating a new record the calling function will export the following to the table handling function.
    Table field     Probable Values
    ZORDERNO------->     Sales Delivery no in case of sales orderShipment no in case of transfer order
    UNAME----
    >     User ID
    ZORDTYPE----
    >     SALEOR in case of sales orderTRANSF in case of transfer order
    ZREFDOCNO----
    >Sales Order no in case of sales orderPurchase Order no in case of transfer order
    ZREFDOCNO1----
    >Delivery no in case of transfer order
    The table handling function will calculate the following fields
    Table field     Probable Values
    ZREQNO----
    >Running serial number (incremented by 1 for each new record)
    ZREQDAT     -
    >System date
    ZREQTIME----
    >     System time
    ZSTATUS----
    >OPEN (for all new records)
    Before inserting a new record the table handling function will always check if a previous record exists for the same order / shipment no. if record exists the function will not insert a new record.
    Table Updation rule (Status Update)
    While updating a record the calling function will export the following to the table handling function.
    Table field     Probable Values
    ZORDERNO----
    >Sales order no in case of sales orderShipment no in case of transfer order
    ZSTATUS----
    >CANCEL if cancellation successfulERROR if cancellation not possible (order already processed)
    The table handling function will calculate the following fields
    Table field     Probable Values
    ZSTATDAT----
    >System date
    ZSTATTIME----
    >     System time

    Do you have to create/update new record in Ztable through Function Module ?
    or you need to write FM only for validation?
    Any how, you need to create a Program with Input values for the fields of Ztable, and for rest of fields the Value can be calculated based on input as per your requirement.
    Let me know clearly what exactly u need ?
    Regards,
    Kiran

  • Ztable creation & deletion error

    Hi
    I had a ztable which I had deleted from DEV,but when i am trying to craet a new ztable with same name,its not activating it,& giving me a error that already the same name table is there in database.
    So i want to know how to delete this table from database completely,so that I can make its as a new & activate it,I have same table in PRD too,i need to make it with same name.
    In se14 the table delete options are non-editable,so from where to delte it completly.
    Please tell me how to do this?
    regds
    vipin

    I m working in development server,initily deleting the table from se11 i tryed to create the new one,but after creating its wa snot letting me to activate me,& giving me the same error or aleary same name database exits,so I tried to activate it through se14,which was also not happeing,& even not letting me to delete the database,as every thing was disbaled.
    so how shd i work it out.

  • Tcode creation for Ztable

    Hi,
    I got a requirement that to create a transaction ZAM0007_D for table zam007
    a.Authorization object:  S_TCODE with transaction ZAM0007_D
    b.Use Query generated as program name
    how can i add these requirements to the ztable .Please let me know

    Hi,
    Follow below steps.
    1. Create the table maintanance generator for your table.
    2. You need to create a "Parameter Transaction".
    What this means is that you will have a transaction (let's call it "ZMAINT") which calls "SM30" and passes in your table name.
    Go to transaction SE93 and enter your new transaction code. Enter in the Tcode description and choose "Transaction with Parameters" (it shouldbe the last radio button).
    Enter in the default transaction "SM30" and tick the "Skip Initial Screen" check box. Hit Enter.
    Now scroll to the bottom of the screen and you will see a Table Control where you will need to enter in the values to the SM30 selection screen.
    Because you hit ENTER, the program will have loaded in the Selection Screen parameters into it's memory. Hit the drop down for "Name of Screen Field" and select "VIEWNAME" and then enter in your Z Table in the "Value" column.
    Now go to the next line and hit the drop down and select "UPDATE" in the "Name of Screen Field". Enter in a "X" in the value column.
    Regards,
    kishore

  • SOX complaince for ZTABLES creation

    Dear All,
    Is there any restriction on creating ZTables in SAP (not about naming conventions)
    Does ZTABLES has to be created only to meet funcitonal perspective so that in complaince with SOX,,
    is it true that ZTABLES should not be created for techncial purposes as they are not in line with SOX complaince
    REason for coming up with these questions is my peers are finding fault in my program stating that I had created  zTABLES for my techncial convneince and it should not be done
    My requirement is
    Actually I have to develop a Report which has to display  700 entries
    like
    Account num      descripton             amount
    10000                   desc1                      100
    145678                 desc2                      230
    And so onu2026..
    But  in no particular sequence like ascending order 1u2014700 and in that particualr sequence no table is holding data
    So in this case I have to fill a internal table itab
    Like
    Wa_itab-acountnum = 10000
    Wa_itab-description = desc1
    Wa_itab-amount  = 100
    Append wa_itab to itab.
    Like this 700 times right.
    So instead of writing 700 append statements what I have done is I uploaded them into ztable(through excel sheet
    Hardly 5min job ) and used a Select query to fetch 700 entries from the ZTABLE
    But my peers are objecting for  creating a ztable, they say according to SOX u cannot create ztables only for   tech requirements ZTABLES should be created only if they have functional requirement and et all they are saying
    So I want to know how far they are true

    >
    Sri Lakshmi Naidu wrote:
    > But my peers are objecting for  creating a ztable, they say according to SOX u cannot create ztables only for   tech requirements ZTABLES should be created only if they have functional requirement.
    > So I want to know how far they are true
    Absolutely rubbish. SAP has tables TVARV & TVARVC tables, please ask your colleagues what functional requirement do these tables serve?
    I have seen many a projects in which they have custom tables for maintaining constants. Pure technical purpose.
    Definitely creating tables eats into the valuable space of the database, but creating one table doesn't K.I.L.L anyone.
    BR,
    Suhas
    PS: I had worked on a project which was SOX complaint & nobody questioned us about the utility of a particular table as long as we had maintained proper authorization group in the TMG

  • Ztable creation

    Hi
    I have created a Z Table.
    i have updated this table with few entries.
    Now again i have created few more fields in this Table.
    While activating, an error is pronpting ..
    "table is not yet classified".
    I have used SE14 to adjust the table and activated..
    Still i am facing this error message.
    What to do now..????

    Hi,
    - Goto se11.
    - Then click on "Currency/Quantity Fields" tab. You can see the Reference table and Ref. field columns. You will notice that the currency field and quantity field is prompting for an entry.
    Otherwise, can you give us more information of the error from the activation log ? Thanks.
    Regards
    Kir Chern

  • Ztable creation & Query creation.

    Hi,
    Anyone please explain me what's the meaning for Z table.
    In what way it differs from standard SAP table?What are the stpes for creating the table.If it contains the datas of 2 or 3 tables,Why shouldn't I create a query?
    Under which situations I should create a query?and when to go for Z table?
    Thanks in advance
    Raj.S

    Hi Dear,
    Z table are those table which we create when we are not getting our company need fullfill from existing tables of SAP
    eg. table having fiels of PAN no will not be there in SAP then you may need to create your own.
    to create your new tabel try SE11-> give table mane -> press create -> if you have done SQL coding then you can work on it smoothly.
    2) for customized reports requirement of ur users you need to work for own queries work with SQ01, SQ02,SQ03
    regards
    Sumantra

  • Creation ztable

    hai all,
    my table name is zbatch.
    contains 3 fields.
    fields    dataelement
    zbatch    charg
    zmax      charg
    zmin       charg
    save   and check the syntax.
    raise the errors like,
    1)   field zbatch : structured type charg  cannot be used  in db  table zbatch
    2)   field zmax : structured type charg  cannot be used  in db  table zbatch
    3)    field zmin : structured type charg  cannot be used  in db  table zbatch
    4)   error in code generation for creating table zbatch in the db
    5)   table zbatch(statements could not be generated).
    please solve the errors

    CHARG is a structure and you are trying todeclare a field of structure type and this is incorrect way. If you want CHARG structure just include it in your ZBATCH.
    Give .INCLUDE as field name and give CHARG as dataelement... it will give all the fields copied into your table..

  • Dialogue program to create/modify entries of ztable

    hi experts,
    i want to create a ztable. After creating the ztable i want to create an dialogue program using that dialogue program i have to create/modify entries of that ztable using text box and push button options.
    can anybody having sample coding pls send me.....
    thanks in advance,
    ravi

    Hi  Ravi ,
    Instead creating the Dailog Program u can creat the Table Maintanance Generator (TMG). Here u will have all the option of creation, deleting , modifying the record.
    In se11 main screen go to utilities:-> Table Maintanance Generator .
    here u have to enteg the Function group name and screen NO. system wil generate the dialog program for u to maintan the data in that table. Then go to      T-CODE SM30 give the same table name and click on maintanance push button and maintain ur entries the table.
    IF helpfull reward points
    Anees
    9886358645

  • Multiple file creation

    Hi.
    I have to create multiple files for mulitiple plants entered through select-options.
    I have done this for single file but not getting the idea how to do it for multiple files.
    <u><b><b>My work:</b></b></u>
    *File creation
        CONCATENATE
                    c_path               "file path
                    c_qm                 " 'QM'
                    c_underscore         "underscore
                    c_results            " 'RESULTS'
                    c_underscore
                    s_werks              "plant
                    c_underscore
                    sy-datum+4(2)        "system date
                    sy-datum+6(2)
                    sy-datum+0(4)
                    c_underscore
                    sy-uzeit+0(2)        "system time
                    sy-uzeit+2(2)
                    c_ext                "file extension
               INTO g_file_name.
      ENDLOOP.
    Open File on the application server for processing
      OPEN DATASET g_file_name FOR OUTPUT IN TEXT MODE
      ENCODING DEFAULT.
      IF sy-subrc NE 0.
    *Display error message
        MESSAGE i055.              " Error in opening file
        LEAVE LIST-PROCESSING.
      ELSE.
        LOOP AT i_final INTO wa_final.
          TRANSFER wa_final TO g_file_name.
        ENDLOOP.
      ENDIF.
      CLOSE DATASET g_file_name.
    Then i am updating the database table using i_update
    Work Area for Z_DATADOWNLOAD table
    DATA: l_wa_update TYPE ztable
      l_wa_update-prog_name    = g_repid.
      l_wa_update-plant        = s_werks.
      l_wa_update-last_run_dt  = g_sysdate.
      l_wa_update-last_run_tm  = g_systime.
      MODIFY ztable FROM l_wa_update.
    Pls let me know how to manage this for multiple files.

    Hi Simran.
    Consider this code.
    REPORT zztest.
    TABLES : t001w.
    *Declare one Internal table for werks
    DATA :BEGIN OF it_werks OCCURS 0,
          werks TYPE t001w-werks,
          END OF it_werks.
    *Select options
    SELECT-OPTIONS : s_werks FOR t001w-werks.
    START-OF-SELECTION.
    *GEt all the plants entered in selection screen from
    *DB table <b>T001W (Plants/Branches)</b>
      SELECT werks FROM t001w INTO TABLE it_werks WHERE werks IN s_werks.
    *Loop that internal table
    <b>  LOOP AT it_werks.</b>
        CONCATENATE
        c_path "file path
        c_qm " 'QM'
        c_underscore   "underscore
        c_results      " 'RESULTS'
        c_underscore
       <b> it_werks-werks    "Plant</b>
        c_underscore
        sy-datum+4(2)    "system date
        sy-datum+6(2)
        sy-datum+0(4)
        c_underscore
        sy-uzeit+0(2)  "system time
        sy-uzeit+2(2)
        c_ext "file extension
        INTO g_file_name.
    <b>*Now you have the file path for the werks
    *Open File on the application server for processing</b>
        OPEN DATASET g_file_name FOR OUTPUT IN TEXT MODE
        ENCODING DEFAULT.
        IF sy-subrc NE 0.
    *Display error message
          MESSAGE i055. " Error in opening file
          LEAVE LIST-PROCESSING.
        ELSE.
          LOOP AT i_final INTO wa_final.
            TRANSFER wa_final TO g_file_name.
          ENDLOOP.
        ENDIF.
        CLOSE DATASET g_file_name.
    * Then i am updating the database table using i_update
    * Work Area for Z_DATADOWNLOAD table
        DATA: l_wa_update TYPE ztable
        l_wa_update-prog_name = g_repid.
        l_wa_update-plant = s_werks.
        l_wa_update-last_run_dt = g_sysdate.
        l_wa_update-last_run_tm = g_systime.
        MODIFY ztable FROM l_wa_update.
    *Pls let me know how to manage this for multiple files.
    <b>  ENDLOOP.</b>
    Regards,
    Arun Sambargi.

  • Update ZTable from editable ALV

    Hi All,
    i'm calling a Function Module from within a Badi Class ( Workorder_Update) which uses an ALV to Add Comments in a Field of the ALV for Transportation to a ZTable. Therefore the ALV is set to editable.
    The Problem is that if the User does not press 'enter' after she/he added the Comment, the value is not send back to the internal Table wich updates the ZTab. If the User presses 'enter' ONLY the Comment is transported but the remainder of the Fields are cleared.
    This is part of the Coding:
    Before Calling FM -->
      + IF wa_header_old-pronr NE wa_header-pronr.
            CLEAR wa_zthlog.
            wa_zthlog-uzeit     = sy-uzeit.
            wa_zthlog-aufnr     = wa_header-aufnr.
            wa_zthlog-objnr     = wa_header-objnr.
            wa_zthlog-vornr     = wa_operation-vornr.
            wa_zthlog-ktext     = wa_header-ktext.
            wa_zthlog-aenam     = sy-uname.
            wa_zthlog-aedat     = sy-datum.
            wa_zthlog-larnt     = wa_operation-larnt.
            wa_zthlog-pronr     = wa_header-pronr.
            wa_zthlog-arbei     = wa_operation-arbei.
            wa_zthlog-dauno     = wa_operation-dauno.
            wa_zthlog-dauno     = wa_operation-dauno.
            wa_zthlog-ltxa1     = wa_operation-ltxa1.
            wa_zthlog-arbid     = wa_operation-arbid.
            wa_zthlog-fieldname = 'PRONR'.
            wa_zthlog-matkl     = wa_operation-matkl.
            wa_zthlog-preis     = wa_operation-preis.
            wa_zthlog-waers     = wa_header-waers.
            wa_zthlog-old_value = wa_header_old-pronr.
            wa_zthlog-new_value = wa_header-pronr.
    Fill t_zthlog - Call FM
            APPEND wa_zthlog TO t_zthlog.
          ENDIF.
        ENDLOOP.
    Secure Values before change
        MOVE t_zthlog TO y_zthlog.+
    Calling FM -->
    +function z_thlog.
      t_zthlog[] = c_zthlog[].
      call screen 0100 starting at 10 3.
      c_zthlog[] = t_zthlog[].
    endfunction.+
    ALV Grid - Processing -->
    +module output_0100 output.
    Fill Fieldcatalog
      call function 'LVC_FIELDCATALOG_MERGE'
        exporting
          i_structure_name       = 'ZTHLOG'
        changing
          ct_fieldcat            = gt_fieldcat[]
        exceptions
          inconsistent_interface = 1
          program_error          = 2
          others                 = 3.
      if g_custom_container is initial.
    Prepare ALV
        create object g_custom_container
             exporting container_name = g_container.
        create object grid1
             exporting i_parent = g_custom_container.
        g_repid = sy-repid.
        gs_layout-grid_title = 'Änderungsprotokoll'.
        gs_layout-zebra      = 'X'.
        gs_layout-cwidth_opt = 'X'.
        gs_variant-report    = g_repid.
        gs_variant           = '/default'.
    gs_layout-edit = 'X'.
    Call ALV
        call method grid1->set_table_for_first_display
          exporting
            i_structure_name = 'ZTHLOG'
            is_layout        = gs_layout
            i_save           = 'A'
            is_variant       = gs_variant
          changing
            it_outtab        = t_zthlog
            it_fieldcatalog  = gt_fieldcat[].
    Ready for Input
        call method grid1->set_ready_for_input
          exporting
            i_ready_for_input = 1.
    Eventregistration
        call method grid1->register_edit_event
          exporting
            i_event_id = cl_gui_alv_grid=>mc_evt_enter.
        create object g_event_receiver.
        set handler g_event_receiver->handle_data_changed for grid1.
      else.
    Refresh, if filled
        call method grid1->refresh_table_display.
      endif.
    set Cursor
      call method cl_gui_control=>set_focus
        exporting
          control = grid1.
    endmodule.                 " output_0100  OUTPUT+
    There are alot of fields so the manual creation of the fieldcatalog should be avoided if possible.
    Any Help is appreciated!
    Best Regards
    Stefan

    Hi,
    Check this
    * Module Pai INPUT                                                     *
    * PAI module                                                           *
    module pai input.
      save_ok = ok_code.
      clear ok_code.
      call method grid1->check_changed_data
        importing
          e_valid = v_valid.
    " After this system will automatically update your changed data into
    " internal table t_zthlog
      case save_ok.
        when 'EXIT'.
          perform f_exit_program.
        when 'CANC'.
          perform f_exit_program.
        when 'BACK'.
          perform f_exit_program.
        when 'SAVE'.
          perform f_save_data.
      endcase.
    endmodule.                               " Pai INPUT
    aRs

Maybe you are looking for

  • How can i save differnts data in the same file?

        Hi all, i need some help.  I'm working  on a project  for students an th university. We have to devellop  a programm for LEDs measurement so that all the measure data must be save in de same file.  We have develloped the programm, but we have  a

  • Save As dialog issues: won't choose file format

    The file formats seem to be all jumbled in the Save As dialog box. If I choose TIFF, I get EPS files. If I choose JPEG, I get .CFM files, etc.

  • Attachment List Window

    Hi All, Just before displaying the sales order confirmation output a screen pops up (attachment list) to select the order confirmation output. How can I disable the screen from appearing and display the output of order confirmation directly?..... Bog

  • Recording/Copying vinyl records to a MacBookPro to CD

    Being new to Mac and iTunes, is there a recommended method to copy older vinyl records to CD via my MacBook Pro? Is there a device that plugs into a turntable or tuner that converts the signal to digital that can then be copied to a CD? I would appre

  • Guided Selling in B2C Webshop

    Hi All, We are implementing Guided Selling in B2C Webshop.Request you all to share knowledge/documents regarding the same. People who have worked on the same are requsted to share  some scenarios/config docs. Thank you in advance. Regards Sanjib Paul