What I want to create a column named 'Module Name' is to display the module name; In this case, it is input and calculation (input and calculation are headlines). So basically all line items located after the headline X before the headline Y will be assigned the module name X.
Is there a way to deal with it without doing anything manually (for example, creating list to populate the module names?
I have no solution that helps your question perfectly. This is an idea which may suggest a little.
You have two modules (input & calculation). And add a line item in each module which sums all line items in the module. Names are 'input' and 'calculation' below. They become the parent of all other line items.
Then you set a line item subset (LIS_input&calc). Let all line items be into that subset.
Make a new module using that subset and set a formula below. Parent(=module_name) = PARENT(ITEM(LIS_input&calc))