If you want to post only a subset of the quantities of each row just change the deliverNow/invoiceNow field of the salesId and set the proper specQty enum value
SalesFormLetter salesFormLetter;
QueryRun queryRun;
Query query;
;
ttsbegin;
salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter.transDate(systemdateget());
salesFormLetter.specQty(SalesUpdate::All);
salesFormLetter.printFormLetter(false);
salesFormLetter.createParmUpdate(false);
salesFormLetter.sumBy(AccountOrder::Account);
query = new Query(QueryStr(SalesUpdate));
query.dataSourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable, SalesId));
queryRun = new QueryRun(query);
salesFormLetter.chooseLinesQuery(queryRun);
queryRun.query().dataSourceTable(tablenum(SalesTable)).findRange(fieldnum(SalesTable, SalesId)).value('A15000438');
salesFormLetter.chooseLines(null, true);
queryRun.query().dataSourceTable(tablenum(SalesTable)).findRange(fieldnum(SalesTable, SalesId)).value('A15000439');
salesFormLetter.chooseLines(null, true);
// insert here other orders
// ...
salesFormLetter.reArrangeNow(true);
salesFormLetter.run();
ttscommit;