CM25: Sort standard table based on custom table.

Hi Experts,
I need to sort the CM25 capacity table based on a ZTABLE where we will define the sequence number of each material. So when CM25 is executed the material should get sorted based on sequence number maintained in Ztable. Now the challenge is how to achieve this sorting before we display the capacity table.
anybody has faced such scenerio please help us.
There are few user exits available but not able to find out how to achieve the required functionality.
Regards,
Raghav
Edited by: Julius Bussche on Jul 30, 2009 9:29 AM
In future threads with meaningless subject titles will simply be deleted as you appear to be doing this intentionally

First, let me say that I have no experience with this CM25 table and where/how it is used or displayed, but here's how I look at it:
But what is the real problem?
1. Don't know the user exit / BAdI to be used?
2. Don't know how to do the sorting?
3. .....?
Answer:
1. This will be a matter of trying I would say and reading the documentation of the exit/BAdI.
2. You can do dynamic sorting of an internal table (if it is an internal table that is used before displaying it).
DATA: lv_sort1 TYPE CHAR10 VALUE 'NAME_OF_COLUMN_FROM_ZTABLE',
           lv_sort2 TYPE CHAR10 VALUE 'NAME_OF_OTHER_COLUMN_FROM_ZTABLE'.
SORT itab BY (lv_sort1) ASCENDING (lv_sort2) DESCENDING.
Edited by: Micky Oestreich on Jul 30, 2009 7:34 AM

Similar Messages

  • How to update standard table based on the custom table

    Hi,
    I have requirement , I have custom table whatever changes done to the custom table must be updated in the standard table
    i have tried the table maintenance events but unable to handle delimit , what is the base solution for this.
    1) create
    2) change
    3) delimit
    4) delete
    6)copy

    the table im updating is t710
    the custom table is same as the standard table except for one field . whatever the user maintains the values in custom table except for the one field everything should update back to the standard table. Im able to update when we create delele but the problem is delimition. when im delimiting the record in custom table its just changing the startdate and it is not actually delimiting the record itself .I want both records the latest one and previous one and should be update back into the standard table same as the custom table

  • Can we enter data in any standard table directly through custom form??

    Dear All,
    Can we enter data in any standard table directly through custom form??
    I have create custom form in R.12. I want to insert data in quality standard table directly through custom form. Need experts guideline.
    Awaiting regards,

    Hi,
    Can we enter data in any standard table directly through custom form??
    I have create custom form in R.12. I want to insert data in quality standard table directly through custom form. Need experts guideline.
    Awaiting regards,
    I would not recommend touching the standard tables at all unless you are being guided by the SR. For a record to be in the standard table it should go through series of validations based on the what operation you are performing and some times datas are dependent upon the other tables, and also some times the same records are hit to so many other tables simultaneously.
    Therefore I would not recommend this brother.
    Thanks &
    Best Regards,

  • Wht r the standard tables for vendor customer and sales order report/

    Hi wht r the standard tables for vendor and customer reports and is how in normal we cannot use them for vendor reporting and etc ?

    Hi
    Customer is related to Sales Module
    So for a customer we fetch the reports of Sales orders , Deliveries and Billing doc's
    CUstomer and Vendor related tables with important fields:
    KNA1: Customer Master-General(KUNNR,NAME1,LAND1)
    KNB1: Customer Master(Company Code)(KUNNR,BUKRS,PERNR)
    KNC1: Customer Master Data (Transaction Figures)(KUNNR,BUKRS,GJAHR)
    KNVK: Customer Master Contact Partner(PARNR,KUNNR,NAME1)
    KNVV: Customer Master sales data(KUNNR,VKORG,VTWEG,KDGRP)
    KNBK: Customer Bank Details(KUNNR,BANKS,BANKL,BANKN)
    KNVH: Customer Hierarchy (HITYP,KUNNR,VKORG,VTWEG,SPART)
    KNVP: Customer Master Partner Functions(KUNNR,PARVW,KUNN2)
    KNVS: Customer Shipment data(KUNNR,VSTEL,TRANS)
    KNVI: Customer Tax data(KUNNR,ALAND,TATYP)
    LFA1: Vendor Master-General (LIFNR,NAME1,ORT01)
    LFB1: Vendor Master(Company Code)(LIFNR,BUKRS,PERNR)
    LFC1: Vendor Master (Transaction Figures)(LIFNR,BUKRS,GJAHR)
    Sales related Tables for a customer
    VBAK: Sales Document(Header Data) (VBELN, KUNNR)
    VBAP: Sales Document(Item Data) (VBELN,POSNR,MATNR,ARKTX,CHARG)
          Enquiry, Quotation, Sales Order are differentiated based on Doc.
          Type(VBTYP field) in VBAK,VBAP Tables( for Enquiry VBTYP = A,
          for Quotation 'B' & for Order it is 'C'.)
    LIKP: Delivery Table (Header Data)(VBELN,LFART,KUNNR,WADAT,INCO1)
    LIPS: Delivery Table (Item Data)(VBELN,POSNR,WERKS,LGORT,MATNR,VGBEL)
          (LIPS-VGBEL = VBAK-VBELN, LIPS-VGPOS = VBAP-POSNR)
    VTTK: Shipment Table (Header Data)(TKNUM)
    VTTP: Shipment Table (Item Data)( TKNUM,TPNUM,VBELN)
          (VTTP-VBELN = LIKP-VBELN)
    VTFA: Shipping Document Flow(TKNUM,VBELV,VBELN)
    VTPA: Shipping Partners data(VBELN,PARVW,KUNNR,PERNR)
    VTTS: Stages in Shipment(TKNUM,TSNUM,TSTYP)
    VTSP: Transport Stage/Shipment Item Allocation(TKNUM,TSNUM,TPNUM)
    VEKP: Handling Unit: Header(Packing)(VENUM,VSTEL)
    VEPO: Handling Unit: Item (Packing)(VENUM,VEPOS,VBELN)
    VBRK: Billing Table(Header Data)(VBELN,FKART,BELNR)
    VBRP: Billing Table(Item Data)(VBELN,POSNR,FKIMG,NETWR,VGBEL,VGPOS)
          (VBRP-AUBEL = VBAK-VBELN, VBRP-VGBEL = LIKP-VBELN)
          Apart from these tables there are lot of other tables which starts with
          ‘V’, but we use the following tables frequently.
    VBUK: All Sales Documents status & Admn. Data(Header)(VBELN,VBTYP)
          VBTYP= ‘C’(Sales Order) VBTYP=’J’(Delivery) VBTYP=’M’(Invoice) 
    VBUP: Sales Documents status & Admn. Data(Item)(VBELN,POSNR)
    VBEP: Sales Doc. Schedule Lines Data(VBELN,POSNR,EDATU,WMENG)
    VBKD: To get sales related Business data like Payment terms etc.(VBELN,ZTERM)
    VBFA: sales document flow data(VBELV,VBELN,POSNV,VBTYP)
    VBPA: Partner functions Data(VBELN,PARVW,KUNNR,LIFNR)
    VEDA: Contract Data(VBELN,VPOSN)
    VEDAPO: Contract Data(VBELN,VPOSN)
    Vendor related MM tables
    EBAN-- Pur.Reqn. Data (BANFN,BNFPO,BADAT,MATNR)
    EBKN-- Purchase Requisition Account Assignment(BANFN,BNFPO,VBELN)
    EINA—- Purchase Info.Record (General Data)(INFNR,MATNR,LIFNR)
    EINE-- Purchase Info.Record (Pur.Orgn Data )(INFNR,EKORG)
    ELBK-- Vendor Evaluation Header Data(LIFNR,EKORG,KLASS)
    EKKO-- Purchase Order Data (Header)(EBELN,BSTYP,BSART)
    EKPO-- Purchase Order Data (Item)(EBELN,EBELP,MATNR)
           RFQ and PO are differentiated by Doc Type(BSTYP)in EKKO table.
           For RFQ it is ‘A’ and for PO it is ‘F’.
    MKPF-- GRN Data (Header) (EBELN,BLDAT,BUDAT,XBLNR,BKTXT)
    MSEG-- GRN Data (Item)(MBLNR,BWART,LIFNR,MATNR,EBELN)
           Apart from this there are lot of tables which begin with 'M'& 'E', but we
           use the following very often.
    EKBE--PO History Data (EBELN,EBELP,BELNR,BLDAT,MATNR,VGABE)
    EKBZ--PO History with delivery Costs(EBELN,BELNR,LIFNR,XBLNR)
    EKET--Schedule lines data of a PO (EBELN,EINDT,SLFDT)
    EKES--Vendor Confirmations Data(EBELN,EBTYP,EINDT,XBLNR)
    Reward points if useful
    Regards
    Anji

  • Usage of Sorted Keys in standard tables

    Hi,
      If I have a sorted secondary key (unique or non-unique) in my internal table, and use the secondary key with my DELETE statement (DELETE ... WITH TABLE KEY <secondary_key_name> COMPONENTS ... = ...), I still get a prio 2 checkman error saying possible sequential read. My question:
    1. What's the difference between usages of sorted key and a sorted table with regards to a READ statement?
    2. Would I still have to do a SORT on the standard table by the secondary key components and then do a BINARY search to avoid the possible sequential read? (in that case why should i mention the key to be "sorted"?
    Thanks in advance,
    Best Regards
    Anantharaman L

    Hi Anantharaman ,
    When we define sorted secondary keys, we do not have to sort it explicitly and use a binary search. we just have to define the sorted secondary keys and read based on that keys. The read statement should be as follows:
    read TABLE <internal table>INTO <work area/field symbol>WITH KEY <secondary key name> COMPONENTS <comp1 = value>.
    eg : read TABLE lt_tab INTO lw_tab WITH KEY key_1 COMPONENTS carrid1 = 'CC'
    Complete Code :
    REPORT  YTEST.
    DATA: lt_tab TYPE YSTRU1_TT,
          lw_tab LIKE LINE OF lt_tab.
    lw_tab-carrid1 = 'BB'.
    lw_tab-connid =  '50'.
    APPEND lw_tab to lt_tab.
    lw_tab-carrid1 = 'ZZ'.
    lw_tab-connid =  '50'.
    APPEND lw_tab to lt_tab.
    lw_tab-carrid1 = 'WW'.
    lw_tab-connid =  '50'.
    APPEND lw_tab to lt_tab.
    lw_tab-carrid1 = 'AA'.
    lw_tab-connid =  '50'.
    APPEND lw_tab to lt_tab.
    lw_tab-carrid1 = 'XX'.
    lw_tab-connid =  '50'.
    APPEND lw_tab to lt_tab.
    lw_tab-carrid1 = 'CC'.
    lw_tab-connid =  '50'.
    APPEND lw_tab to lt_tab.
    CLEAR lw_tab.
    read TABLE lt_tab INTO lw_tab WITH KEY key_1 COMPONENTS carrid1 = 'CC'.
    Note : Table type ystru1_tt is defined with a unique-sorted secondary key carrid1.
    Hope this will be helpful.
    Warm Regards,
    Jenny

  • Standard Table to be updated based on User action

    Hi Friends ,
    i have a requirement , its a report and in that based on the user action ( if the user checks a check box that is available in the output screen of the report and saves it)  the value should be updated in a standard table as 'X'. I have appended the field in the standard table and now i need to write a logic at user command to populate the zfield that i have added in the table based on the user's input. Can someone suggest me how to proceed further on this ? Kindly let me know if you have any sample piece of code related to this scenario...
    thanks in advance.

    HI,
    Usually we can udpate the tables using UPDATE statement.
    But SAP will not suggest to use these statements which will hit the table directly. We need to use the standard transactions to create or update the standard tables.
    For eg: you are using a ztable.
    then once your report is ready, then use the user_command form ( for ALV) .
    fetch the records where the user have selected the records ( check box = 'X").
    *&      Form  USER_COMMAND
    FORM user_command USING g_ucomm     TYPE sy-ucomm
    gs_selfield TYPE slis_selfield                                          .
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = ls_ref1.
      CALL METHOD ls_ref1->check_changed_data .
    this will update the check box values in your internal table.
    now you can use
    loop at itab into wa where check eq 'X'.
    fill your final internal table where you need to update the table.
    endloop.
    loop at newtable.
    update ztable set value = 'X'
    where keyfield = w_keyfield.
    if sy-subrc eq 0.
    message s000.
    endif.
    endloop.
    endform.
    regards,
    Venkatesh

  • Adding custom fields to standard table control in IW51

    Hi,
    I have added 4 custom fields to the standard table QMEL through the structure CI_QMEL .
    In transaction IW51 there is a table control as show in the screenshot below.
    The 4 custom fields which i have added in the standard table should also be added to this table control.
    Can this achieved by making adjustments in SPRO settings or can it be acheived technically by using some exit?
    Thanks in advance.
    Regards,
    Vignesh Sunkasi.K

    Hi Vignesh,
    Adding new fields is not possible, but custom subscreens can be added.
    Check enhancements QQMA0001 (subscreen for notification header) and QQMA0008 (subscreen for additional data).
    It might help you.
    Thanks & Regards,
    Swati

  • Regarding adding a Custom field to Standard Table

    Hi ABAPers,
    Can any one explain the below spec-description.
    "The purpose of this design is to provide the foundation for a more automated solution to the invoice reconciliation process.  This design calls for adding a custom field to the standard SAP table EINE as well as a data maintenance tool for the same.  There will also be a new custom table for storing values associated with the new EINE field.  These new tables will also provide users with the ability to determine which PIR are soon to expire."
    We have to add one custom field to standard table EINE, how we can add this custom field to STND table.
    According to me we can add it through append structure. is it correct or not.
    and what is data maintenance tool.
    Pls.............Explain in details.
    Thanks in advance.
    Regards,
    Ramana Prasad. T

    Hi,
    Goto SE11 ,give ur table name.Then press display button.Then in the application tool bar press on append structure ...Now create a zstructure and add ur custom field and then activate the table.
    Regards,
    nagaraj

  • Can we update oracle standard table Attributes column by custom trigger?

    Can we update the oracle Standard table's Attributes column using custom trigger? Is it allowed by oracle? Is this supported?
    Thanks

    ATTRIBUTE columns store DFF information and therefore custom code can be used to update their contents. Care must be taken that such updates do not cause "logical" corruption (an ATTRIBUTE column may be designed to store the color of a product, for example, but an incorrect SQL statement can update the value to a numeric one, thus causing corruption - Oracle does not have a means to check the validity of these update statements). Also, some localizations, such as Brazil and India, reserve some ATTRIBUTE columns for their use - updating such columns is not supported. More information may be found in the Flexfields Guide for your release at http://www.oracle.com/technology/documentation/applications.html
    HTH
    Srini

  • Updating a standard table from a custom tableq

    hi to all experts,
    My requirement is to update a standard table from the maintenance screens of the custom table whatever the data the user maintains in the custom table and save should automatically saved in the standard table
    for that i decided to use the table maintenance events (event 05 ) ( while saving data) how to capture the data from the screens to the form of the table maintenance events.

    Hi gautham,
    The requirement is like that actually user want to maintain value in z table ( with one extra field ) . the table updation of table is important

  • Creating a custom change document for a standard table field

    Hi
    Is it possible to create a change document for a field in a standard table?
    I have searched the forum and only found threads about creating change document to a custom table.
    Will the creation of change documents to a standard SAP table be a modification?
    Thanks.
    Regards
    Sowbhagya.L

    Yes it will be a modification on standard table, but you can always create change document for any field by assigning it to custom change object.
    Regards,
    Krishna.

  • Memory and performance  when copying a sorted table to a standard table

    Hello,
    As you all probably know, it's not possible to use a sorted table as a tables parameter of a function module, but sometimes you want to use a sorted table in your function module for performance reasons, and at the end of the function module, you just copy it to a standard table to return to the calling program.
    The problem with this is that at that moment, the contents of the table is in memory twice, which could result in the well known STORAGE_PARAMETERS_WRONG_SET runtime exception.                                                                               
    I've been looking for ways to do this without using an excessive amount of memory and still being performant.  I tried four methods, all have their advantages and disadvantages, so I was hoping someone here could help me come up with the best way to do this.  Both memory and performance are an issue. 
    Requirements :
    - Memory usage must be as low as possible
    - Performance must be as high as possible
    - Method must work on all SAP versions from 4.6c and up
    So far I have tried 3 methods.
    I included a test report to this message, the output of this on my dev system is :
    Test report for memory usage of copying tables    
    table1[] = table2[]                                        
    Memory :    192,751  Kb                                    
    Runtime:    436,842            
    Loop using workarea (with delete from original table)      
    Memory :    196,797  Kb                                    
    Runtime:  1,312,839        
    Loop using field symbol (with delete from original table)  
    Memory :    196,766  Kb                                    
    Runtime:  1,295,009                                                                               
    The code of the program :
    I had some problems pasting the code here, so it can be found at [http://pastebin.com/f5e2848b5|http://pastebin.com/f5e2848b5]
    Thanks in advance for the help.
    Edited by: Dries Horions on Jun 19, 2009 1:23 PM
    Edited by: Dries Horions on Jun 19, 2009 1:39 PM
    Edited by: Dries Horions on Jun 19, 2009 1:40 PM
    Edited by: Dries Horions on Jun 19, 2009 1:40 PM

    I've had another idea:
    Create a RFC function like this (replace SOLI_TAB with your table types):
    FUNCTION Z_COPY_TABLE .
    *"*"Lokale Schnittstelle:
    *"  IMPORTING
    *"     VALUE(IT_IN) TYPE  SOLI_TAB
    *"  EXPORTING
    *"     VALUE(ET_OUT) TYPE  SOLI_TAB
    et_out[] = it_in[].
    ENDFUNCTION.
    and then try something like this in your program:
    DATA: gd_copy_done TYPE c LENGTH 1.
    DATA: gt_one TYPE soli_tab.
    DATA: gt_two TYPE soli_tab.
    PERFORM move_tables.
    FORM move_tables.
      CLEAR gd_copy_done.
      CALL FUNCTION 'Z_COPY_TABLE'
        STARTING NEW TASK 'ztest'
        PERFORMING copy_done ON END OF TASK
        EXPORTING
          it_in = gt_one[].
      CLEAR gt_one[].
      WAIT UNTIL gd_copy_done IS NOT INITIAL.
    ENDFORM.
    FORM copy_done USING ld_task TYPE clike.
      RECEIVE RESULTS FROM FUNCTION 'Z_COPY_TABLE'
       IMPORTING
         et_out        = gt_two[].
      gd_copy_done = 'X'.
    ENDFORM.
    Maybe this is a little bit faster than the Memory-Export?
    Edited by: Carsten Grafflage on Jul 20, 2009 11:06 AM

  • How to store custom data in standard tables?

    How can I to store data in standard tables without creating a Z table?
    I want to store the next rows:
    SRD 100 R3D 100
    SRD 110 R3D 110
    SRD 120 R3D 120
    SRD 130 R3D 130
    But I prefer to avoid to use a Z table because the maintenance in a upgrade system.
    Somebody knows if some standard data type exists?
    Or how to make it to avoid the creation of a Z table?

    Hi Juan,
    The data store in the standard table is also custom data. If it is a customizing table then you can very easily add data using SM30 or if it is transaction table then use any transaction to create the data.
    If you want to add more fields in the existing table (extra columns) then you can use APPEND or INCLUDE structure.
    Regards,
    Atish

  • Can we create roles/permission list based on custom table

    I wanted to create Roles and Permission list based on custom table (which holds Business Logic),like if column value is 3 then certain roles and 2 then certain............ is it possible in PS?
    Thanks

    Are you looking at restricting the data that is shown or access to pages? Please elaborate your requirements so that a solution can be provided.

  • Want to sort the records based on non-base table item

    I have a multi-record block and I am trying to sort the data based on nbt item
    I have a table called X which has x_type,x_code fields.
    The table on which the block is created is Y. the table Y has x_type and y_desc as its fields
    form layout is like below .the x_type is key field on which I have to query the records
    and x_code is a non-base item in the form.I want to sort the records by X_code.
    x_code y_desc
    A     xyz
    c par
    B     lmn
    my pre-query has this code
    select x_type from y
    where
    x_type := x_type;
    post-query has this code
    select x_code from x
    where x_type = :x_type;     
    It works fine in Enter-Queryand execute query mode. but when I am sorting the records on
    nbt item x_code by SET-BLOCK-PROPERTY it doesn't do any thing

    Hi Tony ,
    I have created a function and in Pre-Query & have add this
    SET_BLOCK_PROPERTY('b1', ORDER_BY, 'fn_get_code(x_type)');
    and the function created is as below
    Function fn_get_code (p_x_type in varchar2) return varchar2 is
    v_code varchar2(40);
    begin
    select x_code into v_code
    from X, Y
    where X.x_type = Y.x_type
    and y.x_type = p_x_type
    return v_code;
    end;
    when I run the form and execute query it comes up with the error message
    FRM-40505 and when I pressed display error it shows
    SQL Statement error:
    SELECT ROWID,X_TYPE,X_CODE
    FROM Y order by fn_get_code(x_type)
    Error:
    "ORA-00904: "FN_GET_code": invalid identifier"
    Is it that I need to create a function on the database?. As I have created function
    in program unit section

Maybe you are looking for