Skip to Content

Hopw to fetch the data through ID from another Business Object ?

I am created 2 BO.

1.Customer_details

2.SearchProg.bo

I want fetch the data through id from Customer_details

Customer_details.bo

import AP.Common.GDT as apCommonGDT; import AP.FO.BusinessPartner.Global; businessobject Customer_details { [AlternativeKey] element Customer_Id:ID; element Customer_Name1:Name; element Customer_Add1:AddressTypeCode; association ToSearchProg to SearchProg; }

SearchProg.bo-

businessobject SearchProg { element Customer_Id2:ID; element Customer_Name2:Name; element Customer_Add2:AddressTypeCode; }

In Script Level of SearchProg.bo-

var obj; var RetriveData:Customer_details.Customer_Id; obj = Customer_details.Retrieve(RetriveData); //RetriveData.Contains="1"; this.Customer_Name2 = obj.Customer_Name1; this.Customer_Id2 = obj.Customer_Id; this.Customer_Add2 = obj.Customer_Add1;

I tried ,Bt it's not coming the data on screen and it gives some Incidents.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Nov 21, 2016 at 12:44 PM

    Hi Nihar,

    Before assigning check if obj is not initial , obj.IsInitial();

    Thanks, Pradeep.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 22, 2016 at 08:41 AM

    Thank you so much.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 22, 2016 at 08:45 AM

    Hi Pradeep,

    How to find , the technical Id of sales order on screen lable?Can you Ping me .

    Thanks & Regards

    Nihar

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 22, 2016 at 11:25 AM

    Hi Nihar,

    You could go to Repository explorer in the studio and select the BO:

    https://answers.sap.com/questions/66647/how-to-know-technical-name-for-salesorderid-in-sal.html

    Thanks, Pradeep.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 23, 2016 at 06:12 AM

    Hi Pradeep,

    With a very good morning.I knew that you sent,Id is the technical name of Sales Order Id.

    But, If that Id is not present in the Repository explorer,then how to find the sales order Id in technically by the use of Debugging.please heme me out.ping me.

    thanks

    Nihar

    Add comment
    10|10000 characters needed characters exceeded