Skip to Content
avatar image
-1
Former Member

Table maintenance generation problem

Hello Experts,

I'm having a problem with a table maintenance view and how to check the whole table. I try to explain the problem. We are on 4.6C.

When a new entry is created, I need to check that there isn't any other line with the same values for all fields except for location one.

This example will be wrong cause there's a blank entry which is generic and the location is the same in both lines.

Ord.material Component Location

mat1 mat2 YYYY

blank mat2 YYYY

I can not create the table key with Ord. Material, Component and Location cause I can insert the same line with orden material or without it.

So I think the only possible solution will be to create a validation and check when we have this kind of situations.

I've tried with event 01 and check the whole table when the new entries are saved, but I'm having several problems to read the tables.... Could you please help me to identify which table is the complete table (I think is TOTAL) and which table or structure contain the new entry to be inserted? Also, could you please help me how this validation could be done?

I hope you can understand my problem...

Thanks in advance,

Best regards,

Rebeca

Add comment
10|10000 characters needed characters exceeded

  • Former Member

    please give the screenshots what you are trying to tell....

  • Former Member

    Hello Abid Ali,

    First of all, thanks for your answer. I'm sorry but I do not have screenshots, I will try again...

    This is a good table example. As you can see, depending on the material order and the component (as key table) I can choose a different storage location. So, if my production order has material order AAAA and has component1 the storage location will be LLL, if my production order has material order BBBB and has component1 the storage location will be QQQQ and if my production order has any other value (CCCC, DDDD...whatever), the table will read the empty column and will set Storage location ZZZZ.

    Material Order Component material Storage Location AAAA Comp1 LLLL BBBB Comp1 QQQQ empty Comp1 ZZZZ

    What we want to avoid is that the user can insert a row like this:

    Material Order Component material Storage Location CCC Comp1 ZZZZ

    Because as you can see on table 1, this situation will be included on the third row of table one (the empty one) which will be the generic, so this entry wil be a redundancy in the table values.

    I've think about changing the table key, but I have always the same problem...so finally I thought it will be better to do it using an event and a validation. I've tried with event 01, but the problem I've here is that, first, I'm on 4.6C version non-unicode, so the field-symbols are diffferent than on 6.0 and also, I do not know how to use tables TOTAL and EXTRACT.

    I've checked this link, and I've seen that my pointers are a long character field with all the data together, so I want to avoid to use offsets to get the values of the fields, but I'm thinking I do not have other way,....

    http://help.sap.com/erp2005_ehp_04/helpdata/en/33/96613cb44b6c4de10000000a11405a/content.htm

    Also my problem is that in this version, I can't identify which table is the whole table (in my example table 1) and which table/structure has the new values the user is inserting....

    Do you understand now better my problem? Could you please help me with this strange behaviour?

    Thanks in advance for your support.

    BEst regards,

    Rebeca

  • Former Member

    Sorry I've seen the tables are not correct uploaded. I send you some screenshots on word.

    This is table 1

    This is new row will be redundancy with the empty value of table 1

    Thanks again,

    Regards,

    Rebeca

    table1.jpg (20.2 kB)
    new-row.jpg (15.4 kB)
  • Get RSS Feed

3 Answers

  • Jan 23, 2017 at 07:16 AM

    TOTAL is both an internal table containing all lines of the table, and a structure initialized by LOOP AT TOTAL, for which the field symbol <ACTION> defines whether the line is unchanged (space), new (N), modified (U), compared to what is in database.

    You may easily code your event 01 using table field names using ASSIGN CASTING, as follows:

    field-symbols <yourtable> type name_of_your_table.
    LOOP AT total.
    CASE <action>.
    WHEN NEUER_EINTRAG OR AENDERN. " new or modified
    assign total to <yourtable> casting.

    <yourtable>-matnr ...
    Add comment
    10|10000 characters needed characters exceeded

    • With the code I have provided, and with ABAP debugging, you'll see that the TOTAL "string" is mapped to the field symbol <yourtable> (right after ASSIGN ... CASTING), which contains fields. You can then easily test each field.

  • avatar image
    Former Member
    Jan 23, 2017 at 08:37 PM

    Rebeca,

    One thing to keep in mind, the table TOTAL contains only the records from the database table that were returned from the select. Your validation may need to take into account the records from the database table that were not returned from the select as well as everything populated on the screen.

    Bruce

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 27, 2017 at 01:08 PM

    Solved with event 01.

    Add comment
    10|10000 characters needed characters exceeded