Skip to Content
author's profile photo Former Member
Former Member

field sorting problem

I create a one vendor field in z table but this vendor field is data sort wrongly pls help me

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2008 at 05:22 AM

    Hi,

    If you want to sort the values while inserting into the z-table means, you want to

    to create a TMG for the table and you can use the events to sort the values before

    inserting into the table.

    Utilities -> Table Maintenance Generator

    and then Environment -> Modification -> Events.

    OR

    Bofore inserting and while accessing the values use

    SORT itab ASCENDING BY field_name.

    SORT itab DESCENDING BY field_name.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 20, 2008 at 05:01 AM
    SORT itab BY lifnr -- > if you want to sort ascending

    If you want to sort by dscending

    SORT itab DSCENDING BY lifnr.

    In case of Z tables it will get stored in the order how and when the tables gets updated.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2008 at 05:04 AM

    HI,

    you have to put your fields in an i_tab then use

    sort tablename by ( i_tab ).

    Here is an example:

    PARAMETERS dbtab TYPE c LENGTH 30.

    SELECT-OPTIONS columns FOR dbtab NO INTERVALS.

    DATA: otab TYPE abap_sortorder_tab,

    oline TYPE abap_sortorder,

    dref TYPE REF TO data.

    FIELD-SYMBOLS: <column> LIKE LINE OF columns,

    <itab> TYPE STANDARD TABLE.

    TRY.

    CREATE DATA dref TYPE STANDARD TABLE OF (dbtab).

    ASSIGN dref->* TO <itab>.

    CATCH cx_sy_create_data_error.

    MESSAGE 'Wrong data type!' TYPE 'I' DISPLAY LIKE 'E'.

    LEAVE PROGRAM.

    ENDTRY.

    TRY.

    SELECT *

    FROM (dbtab)

    INTO TABLE <itab>.

    CATCH cx_sy_dynamic_osql_semantics.

    MESSAGE 'Wrong database table!' TYPE 'I' DISPLAY LIKE 'E'.

    LEAVE PROGRAM.

    ENDTRY.

    LOOP AT columns ASSIGNING <column>.

    oline-name = <column>-low.

    APPEND oline TO otab.

    ENDLOOP.

    TRY.

    SORT <itab> BY (otab).

    CATCH cx_sy_dyn_table_ill_comp_val.

    MESSAGE 'Wrong column name!' TYPE 'I' DISPLAY LIKE 'E'.

    LEAVE PROGRAM.

    ENDTRY.

    Regards,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2008 at 05:09 AM

    Thank u sir,

    z table updated Correctly , but vender field showing worng.

    pls help me sir.,

    Edited by: siva kumar on Sep 20, 2008 7:12 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2008 at 05:22 AM

    Suppose xxxx vendor update in 15 records in z table.

    I give the same vendor in selection screen it showing 10 records.

    Whatu2019s the problem?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2008 at 05:34 AM

    Many records update in z table itu2019s not new table, itu2019s already created table I insert a vendor filed.

    that vendor filed is problem.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.