Hi Hussain,
I agree with Carine, why not use AMDPs here :-).
Yet, you've been asking for example coding. All this can be found in the ABAP Language Help:
- ABAP Keyword Documentation (on DB Procedure Proxy Calls) and the corresponding example program in ABAP Keyword Documentation.
Same holds for documentation about AMDPs, have a look at ABAP Keyword Documentation (and subpages).
Best,
Jasmin