cancel
Showing results for 
Search instead for 
Did you mean: 

GENIL PROGRAMMING CHILDREN DOUBT

Former Member
0 Kudos

Can you please help me with a GENIL programming doubt?

I have created a Custom BOL named ZCLASS, the root object of this BOL is “ClassStuHeader” which further has relation with “ClassStuMarks”.

I have a problem while retrieving the data from the child node.

Can you please check the following code snippet and suggest whether I have done right and what has to be done?

The following method is GET_OBJECTS method for my implementation class.

  DATA: LV_OBJECT TYPE REF TO IF_GENIL_CONTAINER_OBJECT, "Parent Node
LV_GUID
TYPE ZSTUDENT_DATA-GUID, "The key on the basis of data is fetch from DB
LV_STU_ATTR
TYPE REF TO IF_GENIL_OBJ_ATTR_PROPERTIES, " To set the attributes (Optional)
LV_CHILDREN
TYPE REF TO IF_GENIL_CONTAINER_OBJECTLIST, "Stores all the child nodes of the parent
LV_CHILD
TYPE REF TO IF_GENIL_CONTAINER_OBJECT,"Stores the instance of the child node that is processed
LS_RESULT
TYPE ZES_STU, "Structure of the parent table
LS_CHILD_RESULT
TYPE ZES_MARKS. "Structure of the child table


LV_OBJECT = IV_ROOT_LIST->GET_FIRST( ).
"Gets the first object from the list

WHILE LV_OBJECT IS BOUND. "Checks till the parent is bound
CALL METHOD LV_OBJECT->GET_KEY
IMPORTING
ES_KEY = LV_GUID.
" Gets the key for that table (Sent from Get_Dynamic Query )

SELECT SINGLE * FROM ZSTUDENT_DATA "Fetches data from table
INTO CORRESPONDING FIELDS OF LS_RESULT
WHERE GUID = LV_GUID.

LV_OBJECT->SET_ATTRIBUTES(  LS_RESULT ).
"Sets the attributes for the parent
LV_STU_ATTR = LV_OBJECT->GET_ATTR_PROPS_OBJ( ).
"Gets all the attributes
LV_STU_ATTR->SET_ALL_PROPERTIES( IF_GENIL_OBJ_ATTR_PROPERTIES=>CHANGEABLE ).
"Set Properties for Attributes


IF LV_OBJECT->CHECK_RELS_REQUESTED( ) = ABAP_TRUE. "Checks whether a child has been request
LV_CHILDREN = LV_OBJECT->GET_RELATION(
IV_RELATION_NAME =
'ClassStuMarks' IV_AS_COPY = ABAP_FALSE ). "Fetches list of objects for this relation

LV_CHILD = LV_CHILDREN->GET_FIRST( ).
"Gets the instance of the first child node.

WHILE LV_CHILD IS BOUND.
SELECT SINGLE * FROM  "Fetches the data from the database
ZCLASS_MARKS
INTO CORRESPONDING FIELDS OF
LS_CHILD_RESULT
WHERE GUID = LV_GUID.


LV_CHILD->SET_ATTRIBUTES( LS_CHILD_RESULT ).
"Sets the attributes
LV_CHILD = LV_CHILDREN->GET_NEXT( ).
"Fetches the next child if any
ENDWHILE.

ENDIF.


LV_OBJECT = IV_ROOT_LIST->GET_NEXT( ).
"Fetches the next parent if any

ENDWHILE.


When I set attribute for the LV_CHILD and check it in the database, the values are there but when I see them in GENI_BOL_BROWSER, it does not display anything.

Please HELP HELP HELP!!!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Got it,

I hadnt called two methods

  LV_CHILD->COPY_SELF_WITH_STRUCTURE( IS_OBJECT_KEY = LV_GUID ).

          LV_CHILD->SET_KEY( LV_GUID ).

Answers (1)

Answers (1)

Former Member
0 Kudos

Please help?? I ll give the maximum number of points that are available? please its urgent?