on 06-16-2010 9:37 AM
Hello together,
I created a simple bol object. My problem is, I cann't get an instance of my bol object with:
DATA:
lr_entity TYPE REF TO cl_crm_bol_entity,
lr_entity ?= me->typed_context->Zobject->collection_wrapper->get_current( ).
With current, I can read it
lr_current TYPE REF TO if_bol_bo_property_access.
lr_current = typed_context->Zobject->collection_wrapper->get_current( ).
The type cast to entity (lr_entity ?= ) makes some troubles. I found in debug mode, that my context node with the my simple object is apperaring as value node. Could this be the problem?
Can anyone help me?
Regards,
Harris
Hi,
Zobject is a value node and that is why you are not able to type cast to cl_crm_bol_entity reference type.
Change it to,
Data: lr_entity type ref to cl_bsp_wd_value_node.
Regards,
Arun
Edited by: Arun Kumar on Jun 16, 2010 10:57 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Arun,
I realized my issue with simple objects. As I said before, my problem is, that I can not get an instance of the model node. I have not redefined the IF_BSP_MODEL~INIT method and also not redifined the DO_INIT_CONTEXT method. But anyway, I can not get an instance of my model node.
Do you know an idea, what the problem is?
regards,
Harris
Hello,
You must create the instance of the root object yourself. You should then add it to the collection wrapper. While creating, you should fill the attributes of the "create" structure that you specified when creating the BOL. The article below shows how to create a root entity. Replace the build parameters and the BOL object name with your own.
[http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e0ddd4e6-32f9-2c10-9d88-d993c4b0008d]
Regards,
Arun Prakash
Hii Arun,
Thank you very much.
Have I understood it correctly? The point is, I need to create my root entity first, because the bol object is new created and is also a root object. Thatswhy I need to create my bol entity first.
Is it right?
I created know my bol object with:
l_core TYPE REF TO cl_crm_bol_core,
lr_root_col TYPE REF TO if_bol_entity_col,
l_tx TYPE REF TO if_bol_transaction_context,
lr_entity TYPE REF TO cl_crm_bol_entity,
lr_root_col ?= l_core->root_create( iv_object_name = 'ZSimple_Object'
iv_create_param = li_param
iv_number = 1
).
lr_entity ?= lr_root_col->get_current( ).
l_core->modify( ).
Unfortunately, I cann't not give certain guid with the internal table li_param to use by creating my bol object. My intention is to save for example the partner guid by creating my bol object with "root_create" and fill after creating the bol object the other columns of my table.
But the method root_create, generates obviously automatically a guid by creating my bol object, .
Ok, I could insert a second column to my database table to save my partner guid in a different column. Is there a way to give a different guid by creating my bol object?
reagards,
Harris
Edited by: Harris81 on Jun 17, 2010 4:08 PM
Hi Harris,
That depends on how the GenIL class has been written. You can certainly make the GUID part of the create structure and pass the value when you execute root_create. Look in the generated GenIL class whether a new GUID is generated or if the incoming GUID is accepted in the method for creating objects. You can influence the behaviour however you want.
Regards,
Arun Prakash
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.