Hi,
My suggestions is dont rwite your statements in AMDP method, just create a HANA procedure containing local temporary tables to process your data how you want (insert update do what ever you want) and export your result tables.
Later on AMDP just call this procedures and get the results tables to your output parameters.