Geovane
Geovane

Reputation: 63

SAP B1 - Get Purchase Orders and Sales Orders containing item

I need to find PO and SO using item code through Service Layer, but was not able to find a way to retrieve the items using a contain clause in child items. Any ideas on how to build this query?

Upvotes: 0

Views: 1103

Answers (1)

Özer Aydın
Özer Aydın

Reputation: 11

for sales order you should create view and expose service layer, and get view sl with parameter

1- create view create view ORDERLINEB1SLQuery as select ord.*, r1.ItemCode from ORDR ord inner join RDR1 r1 on r1.DocEntry=ord.DocEntry

2- expose this view in service layer https://....:50000/b1s/v1/SQLViews('ORDERLINEB1SLQuery')/Expose

3- run view with ItemCode parameter https://....:50000/b1s/v1/view.svc/ORDERLINEB1SLQuery?$filter=ItemCode eq 'A00006'

Upvotes: 0

Related Questions