For a complete list of all my blogs regarding content management, please see here.

For more detail about CRM content management, please go to my wiki page CRM Content Management

During my recent project I found a strange behavior in attachments.

Click the hyperlink of Properties

http://farm3.staticflickr.com/2810/11200858386_bd70a61722_o.png

 

do not change anything, and click back

http://farm3.staticflickr.com/2843/11200843184_97e631df3c_o.png

After back to product overview page, the overview page looks exactly the same before you click Property hyperlink.

However, if you use SM12 to check in backend, you will find the current product is locked, although it still looks as under display mode in UI!

The same behavior could be observed in one order application. I would assume this as a bug.

 

http://farm3.staticflickr.com/2836/11200858266_ac466767ae_o.png

 

By debugging I found the parent node, Product instance, is explicitly locked by content management class.

http://farm4.staticflickr.com/3827/11200966453_9543f35a92_o.png

 

However, in my application I do not need this behavior – in my application, the whole attachment assignment block has read only mode, so I don’t want my BO to be locked after property hyperlink is clicked. The solution is very easy: do not bind my BO node to PARENTNODE of content management UI component GS_CM by commenting out the related code:

http://farm3.staticflickr.com/2876/11200966293_91f42ef6a4_o.png

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Pedro Morón

    Do you know if this “issue” has been solved?

    I have exactly the other problem around on this case the following lines are commented.

    TRY.

           lr_parent_entity ?= typed_context->parentnode->collection_wrapper->get_current( ).

           IF lr_parent_entity IS BOUND.

    *        IF lr_parent_entity->is_locked( ) EQ abap_false.

    **         if not changeable, exit

    *          CHECK lr_parent_entity->lock( ) EQ abap_false.

    **         calling application throws a message

    *          rv_valid = abap_false.

    *        ENDIF.

    Due to that when in an opportunity I just add an attachment, it is not saved, as the object has not been Locked?

    (0) 
    1. Jerry Wang Post author

      Hi Pedro,

      I  am a little confused. Would you please kindly tell me your problem? If you would like to attach a document to opportunity and save it, the host bo, that is opportunity, must be expected to be locked. So I could consider that you should not comment those lines of codes.

      Best regards,

      Jerry

      (0) 
      1. Pedro Morón

        Hi Jerry,

        I understand your confusion, cause I was also confused when reading your post.

        I’m on sap crm EHP 2 SP 7.

        I’m having an issue with attachments on transactions (Opportunities, quotations, campaigns…)

        When I create/update a attachment on a transaction, it is not saved unless I force another modification on the operation.

        This looks like a standard bug, I have been searching notes and scn, and the only thing I found is your post.

        But the funny thing is that you have exactly the opposite symptoms.

        I check on the method you mentioned and this is the original sap code on my system:CL_GS_CM_BSPWDCOMPONENT->CHECK_PARENTNODE

        TRY.

               lr_parent_entity ?= typed_context->parentnode->collection_wrapper->get_current( ).

               IF lr_parent_entity IS BOUND.

        *        IF lr_parent_entity->is_locked( ) EQ abap_false.

        **         if not changeable, exit

        *          CHECK lr_parent_entity->lock( ) EQ abap_false.

        **         calling application throws a message

        *          rv_valid = abap_false.

        *        ENDIF.

        I have amended the code on ZL_GS_CM_DOCLIST_IMPL->EH_ONNEW_URL_BTN.

        My question is if you know when and in which note was the code commented? I lost the version track due to the upgrade done.

        Regards,

        Pedro

        (0) 

Leave a Reply