cancel
Showing results for 
Search instead for 
Did you mean: 

How to create assignment block which show DATA in TREE format

raza_imran
Active Participant
0 Kudos

Hi Frds,

Please suggest. How can we achieve the assignment block which is in TREE form ,Might b its not fully TREE form there will be some easy way to achive my tesk. I have a custom table with contain User id and name of each Role(ROLE_NAME).   Below is the tast example.

Assignment block display different lavel of approver list.

ROLE_NAME1
1User_name1
2User_name2
ROLE_NAME2
100USER_NAME01
200USER_NAME02
ROLE_NAME3
101USER_NAME10
102USER_NAME20
103USER_NAME30

ROLE_Name is a fixed text.

Please help how can we achive this task.

Thanks

Imran


Accepted Solutions (0)

Answers (5)

Answers (5)

raza_imran
Active Participant
0 Kudos

Hi Robert,

Actually i want to know that is there any way in proxy class that we can handle every attribute of child node at one place. Like Do_prapare_output where we can handle attribute before display.

Thanks

Imran

robert_kunstelj
Active Contributor
0 Kudos

in get_children method you can handle such logic, because here you define, what you want to return as result

raza_imran
Active Participant
0 Kudos

Thanks Robert, Its very helpful...

Thanks alot.

Regards

Imran

former_member198132
Active Participant
0 Kudos

H I imran,

i  I have also same requirement .Could   you please  provide the GET_CHILDREN code.

how to add the required attributes to particular parent .?

thanks

rama

raza_imran
Active Participant
0 Kudos

Hi Robert,

It working now.

Robert do we have any method in the proxy class where i can set value to each attribute. Actually in the proxy class i have lots of attribute , so putting logic in each attribute is really painful and not good for performance.

Please advice.

Thanks

Imran


robert_kunstelj
Active Contributor
0 Kudos

Not sure what you are asking. The logic is set in GET_CHILDREN method. If you want to do it by attributes, you could try using also method SET_ATTRIBUTE.

former_member198132
Active Participant
0 Kudos

Hi  Robert,  I am  working on same requirement . But I am  not able to figure how to add the Attributes to parent node .

Node1

Attr1        Att2    Attr3

ATT4      att5     attt6

Node2

Attr1        Att2    Attr3

ATT4      att5     attt6

ATT7     att8    attt9


thanks

rama

robert_kunstelj
Active Contributor
0 Kudos

Hi.

Define get methods in class of parent or children. By defining get method in appropriate class that is assigned to tree level, you define new attributes for that level. Define get method by coping standard get method.

former_member198132
Active Participant
0 Kudos

Hi Robert , Yes I did that . New attributes are added to child class.

But I am unable to append attributes as childs rows  to Node level.

your help is appreciated .

thank,srama

robert_kunstelj
Active Contributor
0 Kudos

can you be more precise, what you mean?

raza_imran
Active Participant
0 Kudos

Hi Robert,

I am using http://wiki.scn.sap.com/wiki/display/ABAP/Development+of+a+transaction+history+in+form+of+a+tree+vie... to create TREE table.

Issue is that when i click on the arrow button (to check sccuessor) the data get copied to predecessor.

I am populating the data in GET_CHILDREN method.

Please Advice.

Thanks

Imran

robert_kunstelj
Active Contributor
0 Kudos

In get_children method is performed recursive call of the class method. So you must do the check in method, which level was clicked. Also in the code sample of the blog, that you mentioned, is done the check. So you have to do the check and eliminate the processing of same entity again.

It is all up to the coding, so you have all the freedom.

Best regards, Robert

raza_imran
Active Participant
0 Kudos

Hi Robert,

One Query, In my object i dont have Header data and Item data. Moto of my this dev is to differenciate User into 3 catagories. so i have maintain 3 Heading Text into 3 line of table(done in Do_inti_context).

Now i am trying to create entires under these Heading text. But problem is that whenever i am maintaining entries in the successor it reflecting in the maintain Heading text also.

Note: Using same structure of both Heading Line and Successor . At Header, only maintaining Colomn text.

Please suggest.

Thanks

Imran 

robert_kunstelj
Active Contributor
0 Kudos

It might be the problem with the logic that you wrote in do_init_context method. I usually use inbound plug to set some initial values. Maybe it would be better to put logic to set 3 categories in  do_prepare_output method and within condition...

   IF iv_first_time = abap_true.

     (set initial values for headings)

   ENDIF

raza_imran
Active Participant
0 Kudos

Hi Krishnan,

I already search. there every thing was with parants object and its dependent object. Here my Role Text are Hard coded and corresponding User ID and and is in custom table.

Thats a tricky part, how can i built tree view with these data.

Please suggest.

Thanks
Imran

robert_kunstelj
Active Contributor
0 Kudos

Hi.

Just follow the steps described in blog


In copy of CL_BSP_WD_TREE_NODE_PROXY class just write the appropriate logic in GET_CHILDREN method.

That is all.

Best regards, Robert

former_member191572
Contributor
0 Kudos

Hi ,

Please search in SDN already a blog available for TREE view creation.