Hey Rita -
Do you already know the Sales Order numbers and the line items you want to read the long text for? If so, then an rFM might be easier, using RFC_READ_TEXT. You need to provide the Text Name, which is the concatenation of the sales order number and the line item number (including the leading zeroes), and then you would also tell it which specific long texts you wanted to download. This info is available if you go into the specific long text and go to menu option Goto > Header.
You could hard code those within the script or map them if you want them to be changeable.
I've attached my example for Sales Order > Line Item > Item note. I've hard coded everything in my example except the Text Name.
Thank you!
------------------------------
JENNIFER HWANG | SE
Winshuttle North America
------------------------------