Quantcast
Channel: SCN : All Content - BOPF Application Framework
Viewing all 309 articles
Browse latest View live

E2E: BOPF-SADL-GW-SAPUI5 - Mappping Associations

$
0
0

This is the forth step of the series. You'll find an overview in the document Introduction.

 

In this step we will create the third entity set, the business partner one. Just creating another one is not very interessting but with this example we will see how to use BOPF associations to implement associations in the GW project. This feature will be used to implement the detail page of the service. So let's start.

 

Using associations in BOPF is a comfortable mean to navigate through the space of business objects without having to know how exactly the data relates - for it is implemented once in the association. The same advantage applies for associations in an OData service: The UI developer does not have to know about the relational constraints between the data but can just use an association.

 

To begin with the business partner entity set will be mapped to the business object  /BOBF/EPM_BUSINESS_PARTNER. This BO has an foreign key association to the main address. The business partner entity type will be enriched by attributes of the main address - just like the product name in the step before.

 

The new feature introduced here is the definition of associations and the implementation via an association mapping with SADL. On the detail page of the product we want to display further informations about the supplier, hence the business partner. This means that we have to navigate using the foreign key relationship from the product to the supplier.

 

dataModel_1.png

 

This video illustrates the step.


Modifying the Gateway Service

We will again modify the service as in the previous step Implicit Viewbuilding with the Gateway Service Builder (transaction SEGW). We go roughly through the data model definition and implementation before focusing on Associations. Last but not least we test the navigation in the Gateway test client.

 

Definition and Implementation of the Business Partner Entity Set

As already described in the previous step, we need an entity type and an entity set.


The entity type for the business partner consists of some properties which can be provided by the root node of the business partner BO - like business partner ID, company name and legal form. Then we need some properties which will be populated by the address node following the ToMainAddress association.

So select the Create button in the right mouse menu of the Data Model folder and define the properties. The Business Partner ID is the key - as human readable and unique identifier.

 

e_type.PNG

The wizard creates already the related entity set.

 

e_set.PNG

 

Set the flags accordingly.

 

Now again we will use the implementation wizard 'Map to Data Source' and select BOPF als source type and /BOBF/EPM_BUSINESS_PARTNER~ROOT as source entity. This opens the mapping editor and we define the mapping using drag and drop.

 

m_type.PNG

So far nothing new compared to the previous step.

 

Creating and Implementing an Association


I already mentioned that we want to follow a foreign key relationship from the product to the supplier. Hence we are going to define an association from the product to the supplier.

First we have to enhance the data model of the service and second to implement the association. So open the right mouse menu in the Data Model folder and select the create function.

 

a_create.png

This starts a wizard where you can enter the association name and its attributes.

a_create_2.PNG

The Principal Entity is the source of the association - the ProductHeader. The Dependent Entity is the target of the association, hence the BusinessPartner. Define the cardinality and mark Create related Navigation Property for your convenience.

 

Normally you define the referential constraints in the next step. As we want to map the association to a BOPF one, we must not define them redundantly. So delete the proposal.

a_create_3.png

 

You can just finish the wizard.

p1.PNG


The wizard has created the related Association Set and a Navigation Property for the ProductHeader entity type. That's it for the definition. It follows the mapping.

 

Associations are attributes of the source entity. So we open now the mapping editor for the ProductHeaderSet.

 

p2.PNG

On the left hand side of the editor, the associations are displayed. Just drag and drop the BOPF association to map it. That's it. Save and activate the service and go for testing.

 

Testing the Service

Back to the Gateway client you can test the new entity set just like in the step before. And now you can follow the association from a product to its supplier. Select a product. Memorize the supplier id to verify the result of the next step. Then add the navigation property name (BusinessPartner in the example) to the URI for the product.

 

p3.PNG

 


Execute the GET method and you will navigate to the supplier.

 

p4.PNG

 

The metadata section contains information about the navigation and a direct link to the target of the association. This will be needed in the step about the Creates and Updates.

 

To learn more about SAP NetWeaver Gateway go here.

 

Creating the SAPUI5 page

 

Let's go ahead with using these new capabilities of the OData service in our UI  and create the product detail page.

 

The video illustrates this step.

 

First we have to create a new view for the product details - just like in the previous step. But this time it is a detail page and we add it as such to our splitter application in the index.html file.


The index.html file

source_index.JPG

The view creation wizard provided already the detail view and controller files, so we can first focus on the navigation to the page. The navigation starts with the selection of a product on the product master page - hence in the listItemTriggered callback function of the product controller.


The Product Controller

 

source_product.JPG

 

We are using the same binding context for the details view. The path is referenced in the binding context. We have to set it now. As it changes with every selection we first destroy the old one. We have to configure the http request so that it expands the data selection via the navigation property BusinessPartner. Hence we set the expand parameter accordingly.

So the details view is now bound to the selected product and the related business partner information.


The Details View

 

In the view itself we have to define a form for the product and business partner details.

 

source_view.JPG

 

We are using a grid with two columns, one showing product details, the other one showing business partner details. The interesting thing is the data binding. In the product controller we've already set the path to the selected product and expanded the data retrieval to the business partner. We now have to use it on this page. The properties of the product can be referenced by its name, even if they originate from a joined BOPF node. The properties of the business partner are referenced using the navigation property: <navigation property>/<property name of the navigation target entity set> - hence BusinessPartner/CompanyName for example.


The Details Controller

 

Just a quick view on the details controller file: it binds the data model with the view.

 

source_controller.JPG

After having saved and submitted the files, we are ready for tests.

 

test.JPG

You can see the two columns and the detail data which is displayed after having selected a product.

 

The application is not very nice. The detail form is displayed independently if a product is selected or not - just without any data displayed if nothing has been selected. We will not continue on improving this, as it is not important in the context of the backend connection. It's pure work on the UI part. See some ideas of improving the UI in step 6.


For the navigation from the categories to the products, we used the search function of the OData service in setting a filter. For the navigation from the product list to the product details we used a navigation property of the OData service. Which one is the appropriate mean depends on your backend. Any way you can combine the methods and choose always the best suited.

 

Now we want to enable editing the product and business partner details. There are some specials to be considered and this is the topic of the next blog: Modifying Associated Data.

 

Need for some background, visit the spacesBOPF Application Framework,SAP Gateway or UI Development Toolkit for HTML5 Developer Center.


E2E: BOPF-SADL-GW-SAPUI5 - Modifying Associated Data

$
0
0

This is the fifth step of the series. You'll find an overview in the document Introduction.


Up to now we have modified or created a product root node in the Gateway Client. But looking closely to the results we notice that there are some challenges. When it comes to modifications on joined data - like the product name - or on associated data - like the business partner - we have to pay attention to the service calls. Let's have a look on the effects and then on how to deal with them.

 

The following video illustrates this step. 

 

Update along an association path


Symptom

 

In the previous step, we have seen that we can follow an association to navigate form a product instance to the business partner details without having to know how to join the data. This is quite comfortable. And we can easily believe it to be possible to use the navigation property also for updating the business partner details.

 

Try it and you will end with a dump in the backend.

bp_modif.PNG


The update using the direct addressing via the business partner entity set works fine.

 

bp_modif_ok.PNG


And this is already the way how to solve the problem.

 

Solution

 

The OData specification does not precisely specify updates along navigation paths. So the SAP OData library does not support it. You have to use the direct addressing via the association target entity set, hence the business partner entity set in our case. This sounds uglier than it is in reality: you do not have to know how the data is related neither in this case as the response of a navigation request contains the direct link to the navigation target.

 

bp_link.PNG

 

Just take it from the response metadata and use it in the modification request.

 

OData specifies clearly the create method along association paths: this is supported and we will use it later on.

 

Update of Implicit Views


Creating the entity types ProductHeader and BusinessPartner entity sets we used the capability of SADL to join data of associated nodes. We called that implicit view building. This was quite nice but it does not work in modification scenarios. Currently we face a SADL limitation in 7.40.

But let me first illustrate the symptom.

 

Symptom

 

In the fourth step we modified the product, but only the price. If you modify the product name - you will see that the modification is just ignored.

 

prod_modif.PNG

In the modification request, we change the price and the product name. And here we are with the result:

 

prod_modif_res.PNG

 

The modification of the price works well the modification of the name is just ignored.

 

If you create a new product, it works for the data mapped to the product root node but not for the product name.

 

prod_crea.PNG

 

As I already mentioned, this is a limitation of SADL in 7.40.

 

Solution

 

The solution to this issue is to introduce new entity sets for each joined node - hence the product name node and the business partner address node and to relate them with an association in the gateway service.

dataModel.png

Now you can handle the updates on the product name and the business partner address data like the update on the business partner root node: navigate to the association target and get the direct link from the metadata of the service. Use this link to update the secondary node's data.

 

Creation of Secondary Nodes

Creating a new product in our example means that we not only create the root node but also the product name node. But how can we do this? We do not find the links in some meta data files, as they do not yet exist. They are only created in the backend.

 

The OData specification says to use "deep create" using the navigation properties. This means that in the create case, you can use the associations.

 

Note that you can use the SADL features from 7.40 SP08 on. But the deep creation is only supported by SADL in 7.40 SP10.

 

Use of Implicit View Building with SADL

 

In the beginning it looked quite comfortable to use the implicit view building capabilities of SADL. We worked only with three entity sets, which seemed to be quite natural. Now we have to deal with five and they are mirroring the BOPF BOs. In addition we have the attributes twice in the entity types. So you may ask why to use SADL implicit view building at all.

 

Don't throw out the baby with the bath water. SADL implicit view building is very comfortable for all read only scenarios, like object work lists or factsheets. That's already half the battle or even more. But if you have to work on update scenarios, mirror the BOPF nodes in entity sets and the necessary BOPF associations in OData navigation properties; and keep the entity types normalized to avoid redundant definitions. (Don't worry, we are not going through a refactoring step now - but in a real application this should be done for supportability reasons.)


Enhancing the SAPUI5 page

 

If you prefer to follow this step in a video go here:

 

Using these findings in the SAPUI5 page needs some preparations because we have to introduce edit features. Just let me show, where we want to go with the UI before we step into the code.

 

We will introduce edit buttons on the product details page.

 

target1.JPG

 

If you press edit or create product, the form is replaced by a product edit form.

 

target2.JPG

 

The same for the business partner edit button: if you press the button, the form is replaced by a business partner edit from.

The save button updates the respective changes.

You can change the view dynamically, but this gets soon confusing. On the display form, we have for example one text element displaying street and house number. In edit mode this would be quite cumbersome as you would have to guess the correct separator. So we want to use two input elements, one for the street and one for the house number.

 

To avoid too much logic in the view we are going to use the fragment technique: we put some parts of the UI in separate files which we include dynamically into the content of the view accordingly to the mode.

So we first start with a glance at the view and the fragments.

The Details View

 

As we outsourced the content of the view into fragments, the code of the view is quite simple:

source_view.JPG

We put a toolbar on top with the Create and Delete button and the registration of the related callback functions. Otherwise the main part of the view definition, the content tag is empty.

 

Now we have to create the two fragments.

 

The Product Display Fragment


The display fragment contains now the code formerly placed between the content tag.

 

fragment_display.JPG

 

The enclosing tag is the FragmentDefinition one.

 

The Product Edit Fragment

 

The product edit fragment contains the edit form for the product - not really a surprise.


fragment_editProduct.JPG

 

You will see the difference: we have to use <Input> tags instead of <Text>. There is a save button and instead of price and currency in one text element, we have two input fields.

 

There is also a dynamic adaptation of the view: if the create button has been pressed on the initial page (without any category selected) the category input field is enabled. If a category has been selected it is read only.

 

The Business Partner Edit Fragment

 

The same applies for the business partner fragment.

fragment_editBuPa.JPG

 

So far for the fragment definitions. The switch of fragments is handled in the details controller. But first we check the product controller.


The Product Controller

 

We have to set the initial fragment in the product controller, when we select a product (callback listItemTriggered).

 

source_product.JPG

In our callback listItemTriggered we set the Display fragment using a function of the details controller - which we have to define later on.

 

As we discussed in the beginning, we cannot use navigation paths for update operations. We must address the respective entity sets directly. Therefore we have to enhance the expand attribute by two new navigation properties to the new entity sets: BusinessPartner/BPAddress and ProductName02.

 

By the way: the code line 41 cares for initially selecting a product.

 

The Details Controller

 

In the details controller we have to care for the callback functions of the button events. That's a piece of work. We do not go through the whole code, just through one example to get an impression.

 

But first we have to complete the fragment handling in the onInit function...

 

source_controller_1.JPG


... and in the callback function assigned to the button pressed event.

source_controller_2.JPG


In this piece of code there are also some examples on how to change the attributes of a field dynamically. For example in line 57, the input field ProductId is enabled in the create mode.

 

Now to the save event: line 86 distinguishes between the update and the create case: the context is set to the selected product in the update case. In the create case the context is not defined hence the expression (oContext) is false.

 

source_controller_3.JPG

 

So we are looking closer to the update branch. We get the path to the selected product form the context object. Then we update the model using the data binding to the input fields of the view. We register two anonymous callback functions: in case of a successful execution of the http request, we set a flag fo the closure. In case of an error the callback function shows an error message. The OData method is a merge.

 

That's it for the update of the product ROOT node. If the product has been updated successfully we have to care for the update of the product name. The metadata of the OData service contains the path to the product name via the ProductName entity set directly. Get it and use it for updating the data. It's the same procedure as for the product ROOT node: we get the modified name form the input field and register two anonymous functions. This time we send a success message in case of successful execution.

 

The complete code is quite lengthy but I hope that you got an idea of how to update data via OData.

 

The next part of the code shows some helper functions to compose the fragment name and to display the correct fragment according to the status.

source_controller_4.JPG

 

Our application lacks now some beautification. Most of it can be done purely on the UI but one requires that we modify the OData service again. Our end users want to see the location of the business partner in a map. Therefore we need more data to display the map. And that is the topic of the next step: Enhancing Entity Types.

 

Need for some background, visit the spacesBOPF Application Framework,SAP Gateway or UI Development Toolkit for HTML5 Developer Center.

E2E: BOPF-SADL-GW-SAPUI5 - Enhancing Entity Types and More

$
0
0

This is the sixth step of the series. You'll find an overview in the document Introduction.

 

In the previous steps we struggled through the update business. But what if the data contained in an entity set is not sufficient. In the supplier details for example we displayed the main address. Now our business user wants to see the location in a map. Hence we need geo location data which is not yet provided by the entity set. To provide it is the content of this step. So let's start.

 

The following video illustrates this step

 

 

Adding Geo Location Data to the Gateway Service

The BOPF data model of the business partner provides already geo location data in the address node. So our only task is to enhance the entity type of the business partner in the Gateway service, to map the added properties and finally to use it in the UI.

 

Reworking the Entity Type

 

Open the Gateway project in Edit mode and select the properties of the BusinessPartner entity type. Just add the new properties with their attributes. Take care that the ABAP field name is maintained. If the tool doesn't provide it automatically enter it manually. And you can continue with enhancing the mapping.

 

entity.PNG


Reworking the Mapping

 

Select the mapping node in the Service Implementation Folder of the business parter entity set via double click. The mapping editor opens and you can just complete the mapping. Use the BOPF association MAIN_ADDRESS. That's it, save and generate the service.

 

mapping1.png


Testing


Open the Gateway Client and select the BusinessPartner entity set. Execute the GET method and you get the list of business partners with geo location data.

 

test.PNG

 

No we can use this new properties in the UI.

 

Adding a Map to the Product Detail Page


The OData service is providing the geo location data. So we can proceed and add a map to the product detail page.

 

The Details View

 

Maps require a new library. In the view xml we introduce a namespace for this library. Then we place a map on the view containing a list of spots. This list will be filled dynamically with the geo location data of the backend.

 

map_1.JPG

The index.html File

 

The library with the maps (sap.ui.vbm) must be added in the index.htm file. Then we have to define a data model for the spots and add it to the core.

 

map_2.JPG

 

The Products Controller

 

In the listItemTriggered function of the products controller, we have set the context for the detail page. We have to complete it now with the data for the map. We concatenate the geo location data of the service in the format the spot controll requires the position data: "<longitude>;<latitude>;0". We delete the list of spots from a former selection and add the new spot. The text should be the business partner Id and the tooltip the company name. That's it for the spot configuration.

 

map_3.JPG

But the code will not yet work. The geo data is currently still unknown. It is part of the address and the address is not expanded in the product controller context. But you can see the expand statement two lines above the spot handling? Yes correct, this is the binding registration for the details view. The expand request is executed when the details view requires the data - this is definitively not the case in a products controller callback function.

 

So we have to add a further expand command in the onInit function of the product controller.  With the following expand statement we can use BusinessPartner/Longitude but not BusinessParter/BPAddress/Longitude.

map_4.JPG


Finally we are done and the map is displayed.

map_5.JPG

Further UI imporovements


If you like you can now continue improving the UI. To get an impression of what you can do now to make the application more user friendly, to introduce new features and embellish it without changing the backend application or the OData service, browse the following lines.

 

Selected Category in the Product Title

If the user has selected a category it may be helpful to display it in the title as the selection is some kind of filter. For this little help we need a lable in the product view:


The Product View

selection_1.JPG

The Product Controller

 

And we have to compose the text dynamically in the product controller when we react on the navigation event.

 

selection_2.JPG

As result we display the selected category in the title.

selection_3.JPG

 

And the user knows now which category he has selected on the previous page.

 

 

Search of Products

The list of Notebooks is quite long and the user wants to search in this list. So we need a search form on the view and an additional filter. The category and search filter have to be treated separately foreas if the user changes the search, the category must remain selected.


The Product View


We add a search form in the product view and register a handler function.

 

search_1.JPG

The Product Controller

In the product controller we implement the handler.

 

search_2.JPG

 

So that the user can search in the product list.

 

search_3.JPG

 

Welcome page

 

Finally we want to embellish the application. Currently the form page is always visible. The user would expect to see only the categories without an ugly empty form. To achieve this target, we create a new view explaining the application to display it as long as the user does not have a product selected.


We start adding a new view. As the view is a welcome page, it is free style: place a picture in a new folder of your project and use it. Add some text.

 

The Welcome View

welcome_1.JPG

We do not need a controller - the links are local in the project and used directly in the view. But we have to add the new page in the index.html file and set it as initial default. So open the index.html file.


The index.html File

 

Welcome_2.JPG

Beside the integration of the new view we added a stylesheet to embellish the welcome page. Both stylesheet and picture are moved to the referenced folder in the project structure.

 

Welcome_4.JPG

 

 

And here we are with the result:

 

 

welcome_5.JPG

 

Now we are done with our end to end scenario. The next blog summarizes briefly the most important topics and gives an outlook of what you can expect in the next release: go to the next step.

 

Need for some background, visit the spacesBOPF Application Framework,SAP Gateway or UI Development Toolkit for HTML5 Developer Center.

E2E: BOPF-SADL-GW-SAPUI5 - Back and Forth

$
0
0

Summary

 

Here we are with the summary. You'll find an overview in the document Introduction.

 

We have seen how to create a Gateway service based on a BOPF BO using SADL - and how this service is used in an UI application. There are open issues. The integration of BOPF in SEGW could be smarter. There could be for example some help to import the BOPF data model and to map the entities and the associations. There is no support for BOPF actions. This is all manual work. And we have seen that you can use implicit joins in read scenarios but not in modifying ones. And what about error handling? No single line on this in the series. Facing these gaps you may ask the following question.

 

Why using this technology at all?

 

Advantages in Read Only Scenarios

 

Let's first talk about read only scenarios. There are not only the view building capabilities of SADL which allows creating easily the work lists and fact sheets the user needs. But you get a lot more.

 

The SADL engine is the same engine which is behind the scene of ALV and FPM on HANA. It is a proven, wide spread technical component caring for pushing down date centric operations to the database. Especially in SAPUI5/OData scenarios this is even more important than in SAPGUI or WebDynpro applications. Later profit from the data copied to the application server: the second request could be considerably faster than the first one. But OData services are stateless, the data you copy to the application server should be as suitable for the actual UI request as possible - the rest is waste and cost unnecessarily performance.

 

You get this out of the box in just defining the service as we have seen it in the blog: SADL provides the paging, the top 10 list, aggregates data, supports search, sorts the data, expands it - you do not have to implement a single one of these operations. Authority checks? No problem if they are modeled in BOPF or CDS SADL transforms them into an additional where clause in the SELECT statement.


I think these are already quite convincing reasons.

 

Advantages in Update Scenarios

 

In modifying scenarios you normally do not have to handle mass data but single instances in depth. This is another dimension of complexity. Pageing and so on is not so important but navigating to dependent nodes and executing the CUD operations consistently - meaning handling the composition constraints for example are the challenges. SADL solves it for you.

 

So even if the data model is more complex, the advantages are given, you do not have to implement the navigation and deep create method of the service for example.

 

But the most important reasons of all is that ABAP and the Business Suite are going this way. And here we are with a perfect transition to the outlook.

 

Outlook

 

Let's start the outlook with a reference to Oliver Jägle's blog TechEd 2014 - some thoughts on UI5 and its impact on business application development where he discusses the stateless/stateful programming model. It's really worth reading it. One of his point is that if you have 'real' applications beyond some kind of approval scenarios, the application is not stateless - actually no application is stateless. The question is who is keeping the state. BOPF is well known for managing transactional buffers and all kind of images an application developer could need. And this state is in the ABAP memory. Isn't that some kind of a conflict?

 

If you have stateless request, the state is either in the UI or on the database. The challenge with existing applications is, that they very often do not allow saving inconsistent data - the BOPF demo BO is with this respect very indulgent: it doesn't check anything. But normally you will face problems if you just want to dump the UI input into the persistency.

 

You will need some kind of staging area on the database for existing applications where you keep the state which you do not want to keep on the UI and cannot keep in the original persistency. In 7.50 we are working on a programming model in this respect. And BOPF plays a central part for the persistency handling. A good UI is responsive, meaning that there is early feedback for erroneous input, that sums are immediately updated and so on. In the BOPF terminology you would say, that we need validations and determinations on the staged data. This is where BOPF shows its strengths. BOPF will not only be used for new applications, but for existing one to handle the objects in the staging area - currently we call them drafts. (Of course in the case of drafts BOPF will not use the buffers but communicate directly with the database.)

 

And there are lots of questions resulting of this approach on all levels: persistent locking and releasing the locks consistently, the interaction of SAPUI5 UIs and vanilla ones: one can handle drafts, the other one not. Does a user want to (or should he) see all drafts of all persons or only his ones. How to solve conflicting changes and so on.


To work on these challenges is the main focus for the next release, beside the move of BOPF from Business Suite Foundation layer to SAP Basis, some tool improvements like the usage of CDS views for the definition of the data tree of BOPF and the better support for GW model definition based on BOPF.

 

With this approach we are already beyond the question stateful - stateless. These are categories of a protocol, not of an application. An application has normally a state. But the draft concept based on CDS-SADL-BOPF brings a new quality to the applications: the fact that you can always save your data independently if you run a stateful or stateless protocol.

 

The BOPF - Gateway Integration based on SADL in 7.40 is the first step on this bigger construction area - and you can use it already. Stay tuned´.

 

Need for some background, visit the spacesBOPF Application Framework,SAP Gateway or UI Development Toolkit for HTML5 Developer Center.

Assigning default values to root and subnode attributes

$
0
0

Hello,

 

I created a BO with a root node. In order to assign some default values after a root instance is created, I've implemented a determination. Everything is working as expected. When the instance is created (and only then) the init method is processed and the default values get assigned.

 

As a next step, I added a subnode. I need to assign some default values to a new instance as well. So, I've created a determination for this subnode, in the same way as I did it for the root node.

 

Now, when a new instance is created, the init method of the root is processed, but not the init method of the subnode. Only when I change a value of a subnode attribute and do a save, the init method of the subnode is processed and the init method of the root node as well (overwriting any changes with the default values, which is wrong).

 

How can I achieve that after instance creation (and only at this point), the init method of the root and then the init method of the subnode are processed?

 

Thanks for any advice.

regards,
Ulli

Download of Attachment with Action - Confused...

$
0
0

Hi All,

 

I'm building custom Gateway objects for EH&S Incident related BOPF and am trying to figure out how to trigger the action to download an attachment and get the contents of the file to stream back.  While I can test this in the test tool and see the content being returned from the Action in the Attachment BO, I'm unclear how to get a hold of this content when using the service manager API's.

 

Current non-working code looks like this:

data(o_attachment_node) = o_root_node->get_subnode_by_key( if_ehhss_inc_c=>sc_association-root-att_document ).      if o_attachment_node->has_more_rows( ) = abap_true.        o_attachment ?= o_attachment_node->get_next_row( ).        append INITIAL LINE TO it_key ASSIGNING FIELD-SYMBOL(<s_key>).        <s_key>-key = o_attachment->key.        o_service_mngr->execute_action(          exporting            iv_act_key       = if_ehhss_inc_c=>sc_action-att_document-download_document     " Action            it_key           = it_key    " Key Table        ).        o_attachment ?= o_attachment_node->get_row( 1 ). “ Attempting to refresh the data but this doesn’t help.        s_stream-value = o_attachment->content. “ Content is still empty after action, though in action debug, it is definitely retrieved.

Can anyone:

a) Tell me how to get a hold of this precious content? and

b) If possible, explain the relationship of the action to the reading of the node (get_row) - if any, and how you would even know what the result is from this action since in the configuration for this action, it just shows the class which handles the functionality without any export parameters. e.g. How do you know how to get the result of o_attachment from the execute_action based on the definition.

 

Thanks,

Matt

Error When opening Design studio templates / Dash boards from Business studio

Many-To-Many Relationships

$
0
0

Hi all,

 

We have a scenario where many-to-many relationships between business objects are required. We’d like to use the goodies of BOPF, since our requirements include, e.g., web services to read and update business objects (using OData).

 

Right now we are struggling to model such an n:m relationship. I know, that, on the one hand, business objects are hierarchically structured and therefore only support 1:n relationships. On the other hand, OData supports n:n relationships: Both …/Orders?$expand= Products and …/Products?$expand= Orders are possible if implemented correctly.

 

Is there a way to model an n:m relationship using business objects/BOPF, so that one OData service offering both associations can be generated automatically?

 

The only possibility we see right now includes:

  • Modeling both business objects separately
  • Modeling one “association class” business object to store the associations between those business objects
  • Create an OData service, having two entities representing exactly the business objects
  • Implement the getEntitySet of both entities: For expand use the “association class” business object to find all related business objects of the other entity

This looks like an unnecessary effort since all this could be generated, right?

 

In comparison, JPA has a @manyToMany-association, which automatically creates the association class and table. Is something similar possible using business objects/BOPF?

 

Thanks,

Svenja


Determination in Delegated Node.

$
0
0

Hi Experts,

 

I am trying to determine the STUDENTID in the delegated Node. Determination is working fine but after determination it is Setting All Host Keys i.e. HOST_BO_KEY, HOST_KEY, HOST_NODE_KEY to '00000000000000000000000000000000'. The below is my code.

 

DATA  :   ls_key          TYPE          /bobf/s_frw_key,

               ls_modify       TYPE          /bobf/s_frw_modification,

               lt_modify       TYPE          /bobf/t_frw_modification,

               lr_ref_data     TYPE REF TO   zst_s_student1.

 

 

  READ TABLE it_key INTO ls_key INDEX 1.

  CHECK ls_key IS NOT INITIAL.

  CREATE DATA lr_ref_data.

 

 

*Getting lr_ref_data->studid  from SNRO.

 

     ls_modify-key = ls_key-key.

     ls_modify-change_mode = /bobf/if_frw_c=>sc_modify_update.

     ls_modify-data = lr_ref_data.

     ls_modify-node = zif_st_zstudent_c=>sc_node-student.

 

     APPEND zif_st_zstudent_c=>sc_node_attribute-student-studid  TO  ls_modify-changed_fields.

     APPEND ls_modify TO lt_modify.

    

    io_modify->do_modify( it_modification = lt_modify ).

 

 

Thanx in Advance,

Pankaj

is it possible to traverse every nodes in bopf modeling?

$
0
0

Hi,

 

I have bopf model . Is to possible to traverse from bottom to top .

Can leaf node  access any nodes in the BOPF model.

what are the differences b/w bopf and crm

$
0
0

Hi,

I would like to know the differences between crm and bopf?.

what is  the query object(crm) and queries(bopf)?

BOPF: filling ET_FAILED_KEY in determination dumps

$
0
0

Hi,

 

I created a BOPF model.

I added a determination at 'save'.

In the determination I want to update a standard SAP table (via a standard function module).

Now I want to prevent that the BOPF model is updated if the update of the standard table fails.

So in case the update of the standard table fails I add a message to parameter EO_MESSAGE.  The message is displayed in the test tool but the record is saved in the BOPF model.

I thought parameter ET_FAILED_KEY could prevent that the record is saved in the model. But when I fill the key of the record in ET_FAILED_KEY the system dumps.

Any idea how I can do this?

What is the meaning of parameter ET_FAILED_KEY in a determination?  If I fill it it always dumps!

 

Thanks for any suggestions!

 


can we create query in a single node that can access another node attributes in BOPF?

$
0
0

Hi experts,

 

i want to get a all records of different nodes in a single query.

For ex.   i have     1.>root

                            1.1>A

                            1.2>B

i want to retrieve all records of node B in node A  through queries.

 

Thanks.

BOPF Determination based on requested fields

$
0
0

I've a performance intensive calculation implemented in a BOPF Determination. This determination calculates a transient field value.

 

In my OData DPC_EXT class I'm doing the retrieve_by_association. And passing the $select parameters to the it_requested_attributes. But BOPF is still selecting all fields irrespectively to the requested fields. And especially it's still calculating the transient field even if it's not requested.

 

I've redefined the /BOBF/IF_FRW_DETERMINATION~check but the requested fields are not available there,

 

Does anyone have any idea?

Parent key of a root node

$
0
0

Hello!

Is there any way that i can fill i.e., overwrite the Parent key filed of a root node?

Scenario : I am using a representation node(X) as a child under a Standard node(P). As X is a root node of a separate BO , its parent key is null always. But since i am making it as a child , can i manually overwrite it?


getting root data in item node

$
0
0

Hi all,

          i am created 2 nodes . They are root node and item as subnode.

Initially i entered root data then i went to item data ,here i want to read the root data .

How i can read the root data in item node.  ???

 

ex: root node and item node i am having emp_id field.. here once i enter the root data emp id ,then i go to item node here emp_id filled by default with  emp id entered in root node.

 

through determination i am trying to read the root data. in item level..

 

can anyone give me the code to read the root data in item node..?

FPM BOPF SPACE Between Fields and label

$
0
0

Hi,

 

I'm facing to an issue when I create my UIBB with the FPM_FORM_UIBB_GL2.

When I put the label on cell A and the input field in cell B. the tabel is placed between is placed in Cell A to end of B and the the same for the input field C to end D.

 

Because of this, I cannot put a lot of fieds in horizontal.

 

Do you have any solution ?

 

Thank you in advance.

 

M.

fetching records from different BO

$
0
0

Hi all,

 

I have two business objects for 'CUSTOMER' and 'TRANSCATIONS' ,

iam creating particular transcation records using the Customer id (guid) as one of its attribute.

but if i want to see all the transations done by a particular customer  what should i do?? (1 to n relation between bo's)

This is how i tried to achieve that:

-including the transcations node as a representation in the customer,

-in assosiation class call the query of transcation with filter option as cstmer id.

 

but the query is not returning anything..

 

 

is there any other way to achieve this?

 

Reply ASAP

 

 

Thanks & Regards,

Vipin V

Not able to access T code /BOBF/CUST_UI

$
0
0

Hi Experts,

Apologies for asking such a silly question at the forum, but did not find any other option to understand, hence posting my query.

 

When tried to execute T code, "/BOBF/CUST_UI, getting message stating that "Function is not possible", where as if I try executing this using SE93 it works.

Request your help in understanding how to execute this t code, are there any roles required or there is a different way in which we execute this t code.

 

Thanks in advance.

Mounesh

BOPF SCN Sitemap

$
0
0

The BOPF SCN space contains a lot of of discussions, useful blog posts and tutorials about the BOPF. This BOPF SCN Sitemap provides an overview so that you quickly find what you're searching or just for browsing the information. If you miss a ressource, please send me a message to keep this page up to date.

 

1. BOPF Design Time Tutorials
If you have not created your first BOPF Business Object, it is time to create one. BOPF Business Objects are created by the SAPGUI transaction "BOBX" or the new Eclipse design time tool. In addition, we provide the "BOB" transaction for easily extend existing Objects or create new customer objects. Finally, the Test UI allows to test existing BOPF Objects by the help of a generic user interface.


2. BOPF Overview Documents

Those documents provide you a high level overview about BOPF and its features.

 

3. Consumption of BOPF Objects at Runtime

 

4. BOPF Object Implementation

 

5. Development Aspects


6. Other Topics
Here is information about some specific issues, that might help you.

 

 

7. BOPF Training

You need more Information? Ask the community or take part at our BOPF trainings.

Viewing all 309 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>