This can be done using the Modify method.
First get the correct syntax to add the column(s) to the DW.The best way to do this is to create a DW with the columns you want and then export it. You can find the correct syntax in the .SRD.
Next, in the code, add the column syntax to a variable.
eg. ls_cols = ls_cols + " column=(type=char(40) name=" + ls_new_col + " dbname=~'" + ls_new_col + "~' )"
where ls_new_col is the name of the column you want to add. You can add more than one column at a time by looping through and adding to ls_cols.
Final step is the modify:
ls_rc = dw_merge_data.Modify("table(" + ls_Cols + ")" )
Hope this helps