‎2006 Oct 06 2:16 PM
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.
‎2006 Oct 06 2:20 PM
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
‎2006 Oct 06 2:27 PM
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.