First read Top 10 ABAP crimes and add some error monitoring (at least write the error message text RETURN-MESSAGE and not a meaningless generic failure message)
Also you should (must) also
- Create some manterial with transaction MM01.
- Use search tool to find some sample
Regards,
Raymond