Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table Control Help required

arvind_soni
Participant
0 Likes
422

Hi,

Right now I am working in table control.

I have an internal table that is getting displayed onto the table control,the internal table has the primary key MATNR in it.

When the user enters an identical MATNR in the second row the validation should throw a message that'Entry already exists' and the entry should get deleted.

The internal table is filled up from the database table using the WBS Element.Then before saving the new entry ,the database entry for the WBS element is deleted.

After updating the Internal table the internal table is inserted into the database table.

Can anyone let me know how to validate the new entry against the entries already existing in the internal table.

Hope i am able to make the problem clear to you.

2 REPLIES 2
Read only

Former Member
0 Likes
392

In the PAI Event write the code inside the CHAIN & ENDCHAIN.

PROCESS AFTER INPUT.

*pai flow logic for tablecontrol 'MPRN'

LOOP AT i_mprn.

CHAIN.

FIELD: i_mprn-select,

i_mprn-mprn,

i_mprn-post_code,

i_mprn-dm_ndm

MODULE validate_mprn.

ENDCHAIN.

MODULE tabctrl_modify.

ENDLOOP.

MODULE validate_mprn INPUT.

IF sy-ucomm EQ 'MPSB'.

PERFORM validate_mprn.

ENDIF.

ENDMODULE. " validate_mprn INPUT

Read only

0 Likes
392

Hi Prakash,

Can you tell me how will i know which is the latest entry in the internal table made so that i can use the matnr of that row to hit the database table and check whether that entry exists or not.