Skip to Content

Table maintenance generation problem

Jan 20, 2017 at 10:17 PM


avatar image

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,


10 |10000 characters needed characters left characters exceeded

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


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 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,....

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,



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,



table1.jpg (20.2 kB)
new-row.jpg (15.4 kB)
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Sandra Rossi 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>.
assign total to <yourtable> casting.

<yourtable>-matnr ...
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hello Sandra and Bruce and thanks for your answer.

@Sandra I tried your solution, and it works, the problem is that the table TOTAL doesn't have structure, is a string, so i can not read of there's redundancy... I mean, if I'm inserting a new row I have to read the table TOTAL and check if there's an entry with Material order empty .. but how can I do that? the key is a string and I neef to check without the field Material Order.... do u understand what I mean

@Bruce, but then, should I also need to have an internal table which contains the new rows added before the saving is done? Sorry I do not understand your help...

Thanks both of u for your support.




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.

Bruce Tjosvold Jan 23, 2017 at 08:37 PM


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.


10 |10000 characters needed characters left characters exceeded
Rebeca . Jan 27, 2017 at 01:08 PM

Solved with event 01.

10 |10000 characters needed characters left characters exceeded