Hi,
To understand your issue, please can you tell me:
1. Do you want to create schedule lines for multiple lines items linked to same contract header?
2. Are you processing multiple such contract headers ?
Ideally you should call FM CRM_ORDER_MAINTAIN only once for a contract header (with multiple line items). Pass all the required information in one go and clear the buffer, then process the next contract header.
I hope this helps.
Thanks,
Kapil