cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Cloud Application Studio How to retrieve the details based on OVS in Product ID

Former Member
0 Kudos

Hi Experts,

I have small requirements in AdvanceListPanel. I have custom BO as mention below,

businessObject Demo {

               element ID : ID;

               node Sporoduct [0,n] {

                    element P_ID : ProductID;

                    element P_DES :   SHORT_Description;

                    element P_QTY : Quantity;

                    element P_NET :  Amount;   

               }

              

}

I have attached the OVS on Product ID (P_ID) element.

I want to auto-fill the details under the AdvanceListPanel ( Product Desc , Product Net value ( Price) ) 

1) How to get the details of Product ( Prod Descr, Product Price etc ).

Please anyone have idea about this share your thoughts.

Many Thanks,

Mithun

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member200567
Active Contributor
0 Kudos

Hi, Mithun

     What you want is to auto-fill the related details when you select a product from your OVS.

     That means you have to write your codes in Event After Modify.

     We normally use QueryByElements or some other query options given for a particular standard BO.

     It would be like that.

     var query=Product.QueryByElements;

     var selParams=query.CreateSelectionParams();

     selParams.Add(query.ProductID ,"I","EQ",this.P_ID );

     var result=query.Execute(selParams);

     for(var product in result){

     this.P_DES =product.Description;

     }

What I have just written is just a sample code. You have to find the exact name of the attributes of a standard BO in Repository Explorer.

Hope this helps,

Fred.

Former Member
0 Kudos

Hello Fred,

Thanks for your reply....

I tried but there is no any Query like QueryByElement but there is query exist "QueryByDescription" with parameter ProductID and Description.

I have tried using this code but it gives the error " Query does not exist".

prod = Material.QueryByDescription();

Can you please tell me the other way to retrieve the product details?

Many Thanks,

Mithun

Former Member
0 Kudos

Mithun,

Make sure you import the namespace for Material in your script file.

It should be:

import AP.FO.ProductDataMaintenance.Global;

Also, note that QueryBy... is not a function, so there's no "()" after it in the statement.

Former Member
0 Kudos

Hi Fred,

Additional Question on the same topic.

Is it possible to Return multiple values from OVS using OVS outport ? In OVS outport we can bind more than one field I guess. In this case from the calling view (could be QC or EC) how do we read the Outport of OVS.

Thanks a lot for this discussion

Regards

Ganesh

former_member200567
Active Contributor
0 Kudos

Hi, Ganesh

     I can't find any documentation for that.

     And I have never done that before.

     And I can't say it is possible or not. But that is interesting.

     If it is possible, we don't have to use Query. That would be great.

Sorry.

Regards,

Fred.

Former Member
0 Kudos

Thanks Fred.

It would have been good in the same place where we select OVS , along with passing of inport parameters there is option of receiving OVS outport values and map to local fields. 

Hope to see this feature soon.

0 Kudos

Hi Fred,

My query is same as yours.

I want to get Product price and Product description based on Product ID.

in run time i am not able to get description and price details.

var QueryMaterial = Material.QueryByDescription;
var SelectionParams = QueryMaterial.CreateSelectionParams();
SelectionParams.Add(QueryMaterial.ProductID.content, "I", "EQ", this.InternalID);
var QueryResult = QueryMaterial.Execute(SelectionParams);
var product_price;
var count = QueryResult.Count();

foreach ( instance in QueryResult )

{
this.Description = instance.Common.Description;

//product_price = instance.;
this.product_Price.currencyCode = instance.Common.product_Price.currencyCode;

this.product_Price.content = instance.Common.product_Price.content;

Can you please give me the solution?.

Regards,

Vijay.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Vijay,

The description of a Material is at the Description node. Attention: This is language dependent

The price is at the PriceDocument BO.

HTH,

   Horst

0 Kudos

Hello Horst,

Thanks for your suggestion!!!!!.

I want fetch Product price based on product ID. But in PriceDocument  Bo the is no QueryByElement , so how write the query for fetching product price based on Product ID. Could you please help in this issue.

Regards,

Vijay.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Vijay,

I've talked with the pricing colleagues and they told me that the PriceDocument is the result of the calculation.

The base price is at the BO SalesPriceList.

It is stored in a property-value manner. So you should use a property based query from there.

HTH,

    Horst