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

Try Delete Root node but edit authorization for sub node needed

$
0
0

Hello,

 

i try to the delete a BO instance. For that the user need the delete authorization (Activity = 06).

 

For the root note the check will be executed with activity '06' and for the subnode with activity = '02' (Edit).

 

But i dont want give the user the "Edit" authoriztion.

 

How can i switch the check for that use case? Why does BOBF check agains "Edit" and not "Delete"?

 

It is a "Business Process Object" which have a super object. We redefine something on root node and re-use the sub node.

 

 

Kind regards

 

Christian Scheffel


Get Specific Error Messages After An BOPF Operation

$
0
0

Hello community,

 

I have a question: How is it possible to get specific error messages after an BOPF operation?

 

In my case I modify data and I want to get only the lock error messages, I mean the errors which arise if the record is locked.

 

Here my code snippet:

 

CALL METHOD mo_servman->modify

  EXPORTING

    it_modification = lt_changes

  IMPORTING

    eo_change       = lr_changesmade

    eo_message      = lr_errormsg.

 

IF lr_errormsg IS BOUND.

  lr_errormsg->get_messages( IMPORTING et_message = lt_errormsg ).

  IF lt_errormsg IS NOT INITIAL.

    LOOP AT lt_errormsg ASSIGNING <ls_errormsg>.

 

 

    ENDLOOP.

  ENDIF.

ENDIF.

 

 

Thanks for tips and hints.

 

Cheers

Stefan

Generate dictionary objects

$
0
0

Hello experts!

Could you please explain, what does mean checkbox "Node Category on Database". When should I use this checkbox?

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!

 


BOPF: How to check authorization in data access class (DAC)

$
0
0

Hi,

 

I am writing a data access class to provide a BOPF Interface for existing database tables.

 

I discovered how to implement authorization checks within the methods (Reuse of existing tables using data access classes):

/BOBF/IF_BUF_DATA_ACCESS~QUERY

/BOBF/IF_FRW_QUERY~QUERY

 

The code I use looks like:

########################################

IF io_query_authorities IS BOUND.

       DATA ctx TYPE /bobf/s_frw_ctx_query.

       ctx-bo_key         = zif_lip_pa_c=>sc_bo_key.

       ctx-root_node_key  = zif_lip_pa_c=>sc_node-root.

       ctx-node_key       = iv_node_key.

       ctx-query_key      = iv_query_key.

       io_query_authorities->check_authority(

         EXPORTING

           is_ctx = ctx

           it_key = et_key

         IMPORTING

           et_failed_key = DATA(failed)

           ).

########################################

 

Now I am implementing the method /BOBF/IF_BUF_DATA_ACCESS~READ_BY_ATTRIBUTES. To my understanding this method is called by the BOPF framework when executing "retrieve by association" and needs an authorization check before returning information about nodes the user is not allowed to access. Unfortunately this method does not have the parameter io_query_authorities and therefore I do not know how to implement the authority check.

 

Is there any advice I can follow?

 

Kind Regards,

Thomas

How to Create modelled Association between 2 child node using Parent key?

$
0
0

Hello,

  i am new here my requirement is to create a modelled association bewteen 2 child  using parent key.

 

it should go like this

node.PNG

i want to get  data  of child 2  at child 1 using the association that share the same parent key .for example parent key for child 1 is abc

now when i call this assocaiton  it should give me the data of child where parent key is abc .

 

can this be achieved using association attribute binding.

 

Regards

LK

et_failed_key in retrieve_by_association method

$
0
0

Hello experts!

I have a determination, which in some cases return error message and failed keys.

If I use RETRIEVE:

lo_srv_mngr->retrieve(

   EXPORTING

     iv_node_key             = zif_yh_c=>sc_node-item

     it_key                      = lt_key

     iv_edit_mode            = /bobf/if_conf_c=>sc_edit_read_only

   IMPORTING

     eo_message              = lo_message

     et_data                      =   lt_root

     et_failed_key             = lt_failed_key ).

 

lt_failed_key contains failed keys from determination and lo_message contains messages from determination.

 

But if I use RETRIEVE_BY_ASSOCIATION:

lo_srv_mngr->retrieve_by_association(

     EXPORTING  

          iv_node_key             = zif_yh_c=>sc_node-root  

          it_key                          = lt_key                                     

          iv_association          =zif_yh_c=>sc_association-root-item   

          iv_fill_data               = abap_true                                  

          iv_edit_mode           = /bobf/if_conf_c=>sc_edit_read_only       

     IMPORTING   

          eo_message              = lo_message                                

          et_data                        = lt_item                                    

          et_key_link                 = lt_link                                    

          et_target_key             = lt_item_key                                

          et_failed_key             = lt_failed_key ).

 

lt_failed_key is INITIAL, but lo_message contains messages from determination

Could you please explain, why in method retrieve_by_association failed key is initial?

No authorization to create instances

$
0
0

Hi all,

 

We've created a BO with authorization checks. Our authorization object has three fields : ACTVT, BO_SERVICE and an extra field VKORG (sales org). In our roles we want to allow our user to perform CRUD operations, but only for specific sales organizations.

 

For instance:

ACTVT : 01, 02, 03

BO_SERVICE : (blank)

VKORG : XYZ

 

We thought that this would allow the user to create/change/display instances of our BO for sales organization XYZ. But unfortunately we receive an error that says that we don't have the authorization to create instances of our ROOT.

 

Apparently the authorization check is executed when we click on the create button in BOBT (or start our FPM application with CHANGE_MODE = C). All the fields of our ROOT are blank at that moment, so the authorization check fails because the user does not have the authorization to create an instance with a blank value for VKORG.

 

Does this mean that we have to grant all users the ACTVT 01 for a blank VKORG? This doesn't feel right? Instead, we'll create our own version of /BOBF/CL_LIB_AUTHCHECK_W_QUERY to avoid this check.

 

Or is there another solution to this problem?

 

Best regards

Liesbeth


How to achive saving draft BO entity ?

$
0
0

Dear Community Members,

 

we would like to use Business Objects in OData service. Since the OData service is based on REST protocol, we've no session memory between user interactions during updating the values through the UI. It means as soon as the user push the edit button, we need to keep the saved instance of the BO, but in addition save the changes done by the user, without memory in ABAP, so have no possibility to simply reset the changes.

This kind of Draft management is done using a darft flag as key in our tables. When user push the Edit button, we copy the active version(without draft flag) and set the draft flag in the copied  table entries. All changes of the user is done on the draft version, and when the User push save, we delete the current active version, and remove the draft flag from the entries updated by teh user.

Do you know, how to cover this draft management requirement using BOPF, where the backend data is managed by BO, and have to be saved after each change, and both active and temporary version have to be managed ? My idea would be to copy the instance when the user push the edit button. To support this for example, Is there a default copy operation provided by the BOPF API ? Might not this is the best solution, just an idea. If you have better suggestion, just tell me

 

Thank you,Attila

Viewing all 309 articles
Browse latest View live


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