Showing results for 
Search instead for 
Did you mean: 

How to output separately based on item-level?

0 Kudos

Hi experts,

In professional service, whenever a project is created automatically, a sales order service will be created.

Every after 6 months, one more line item will be added to the project customer reference. When outputting the sales order service, we need to base it only on the latest line item. However, we are now getting all the line items as per standard.

We'd like to know how to output separately based on item-level.


Below is more background info:

Suppose client gets the sales order for the year 2024, it will be added as a work package and assigned within the billing element.

For 2025 when they get to renew the same, they will create another work package and link to a second billing element.

We'd like to share the sales order preview with our customer. We are looking for options to get the print preview based on item-wise.

In the professional service customer project, the limitation is: unable to add multiple sales order for the same project. For this reason, we are creating multiple work packages and link to the same sales order.

How to realize the above output requirement?

Thanks and regards.

Learn more about the SAP Support user and program here.
View Entire Topic
0 Kudos

* To be noticed:

This is not an official responsible approach by SAP to use the output form template.

Please reach out to your local consultants and developers to decide its usage and handle any future issues on it.


Below steps are provided as a reference to customize the sales order form template in order to only print the last index item.

0. Prerequisites:

1. Open the downloaded template in LiveCycle Designer

Click the Hierarchy palette, choose node "tabInnerTable", following the path: Form->bdyMain->frmTableBlock->tblRemarkRowTable->rowItem-> tabInnerTable.

2. Then open the Script Editor (click the "Window" tab and choose "Script Editor") for the chosen node. Select "calculate*" from the dropdown list. Add the below code to realize "only printing the last index item".

    var tblrow = frmTableBlock.tblRemarkRowTable.resolveNodes("rowItem[*]").length - 1;

    if ( $.parent.parent.rowItem[tblrow].tblInnerTable.rowItem.colItem.rawValue <> $.rowItem.colItem.rawValue )


       $.presence = "inactive"


3. Save the template and then upload it to the S/4HANA Cloud system.

Best Regards