Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

STREE_EXTERNAL_DISPLAY --- get structure id dynamically

Former Member
0 Likes
2,960

Hi ,

I have used 'STREE_EXTERNAL_DISPLAY' function module for to call customized IMG.

I have hard coded the structure ID but my requirement is get the structure id dynamically

Is there any possibilities to get structure id dynamicallly using project id (Table --TOBJECTP, field name -- Project ID).

Thanks,

Vimal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,436

Hi,

Any function module used for getting structure ID dynamically ?

Thanks,

Vimal

Hi ,

I have used 'STREE_EXTERNAL_DISPLAY' function module for to call customized IMG.

I have hard coded the structure ID but my requirement is get the structure id dynamically

Is there any possibilities to get structure id dynamicallly using project id (Table --TOBJECTP, field name -- Project ID).

Thanks,

Vimal

11 REPLIES 11
Read only

Former Member
0 Likes
2,437

Hi,

Any function module used for getting structure ID dynamically ?

Thanks,

Vimal

Read only

0 Likes
2,436

Hi,

I did a quick debug, SAP uses SPROJECT_GET_OBJECT (nothing more than a SELECT to TOBJECTP anyway).

Sandra

Read only

0 Likes
2,436

Hi Sandra,

SPROJECT_GET_OBJECT (Function Module) returns Object id only, I need ID value ( Table name  - TTREE, Field Name - ID),  is there any realtionship between TOBJECTP-Object ID and TTREE-ID ?

My input for this requirement is project ID (Table --TOBJECTP, Field Name - Project ID) OR Object ID (Table --TOBJECTP, Field Name - Object ID), Based on the project ID or Object ID i need to get  ID value ( Table name  - TTREE, Field Name - ID).

Any function module is available OR  any table relationship is there?

Thanks,

Vimal

Read only

0 Likes
2,436

Hi Vimal,

Finally, I'm not sure to understand exactly what is your requirement.

I repeat again, but with more details: by calling the function module above and passing parameters PROJECT_ID = your custom project ID of 10 characters, and, I forgot to mention, OBJ_TYPE = 'PLAN' (but I guess you saw it in table TOBJECTP), it returns a structure ID (a GUID) in parameter OBJECT_ID, that you can pass to parameter STRUCTURE_ID of STREE_EXTERNAL_DISPLAY. This structure ID also corresponds to TTREE-ID. It works well for me.

Regards,

Sandra

Read only

0 Likes
2,436

Hi Sandra,

For my case STREE_EXTERNAL_DISPLAY (Function module) return a guid (OBJECT_ID) when i pass the guid into table TTREE-ID it does not show any data that's why i am asking any relationship between OBJECT_ID (Funtion Module return guid) and TTREE-ID.

Thanks,

Vimal

Read only

0 Likes
2,436

I don't understand what you say: why are you talking about the returned values of STREE_EXTERNAL_DISPLAY? You just use this FM for display. Why do you pass the "guid into table TTREE-ID"? Please show your code.

Read only

0 Likes
2,436

Hi Sandra,

Sorry...  I wrongly update the funtion module name.

For my case SPROJECT_GET_OBJECT (Function module) return a guid (OBJECT_ID) when i pass the guid into table TTREE-ID it does not show any data that's why i am asking any relationship between OBJECT_ID (Funtion Module return guid) and TTREE-ID.

Thanks,

Vimal

Read only

0 Likes
2,436

You answered to my first point. There are 2 other ones

Read only

0 Likes
2,436

Hi Sandra,

I have used the following code..

data : g_id like ttree-id.

case sy-tcode.

  when 'YTEST_IMG'.
    g_id = 'E1A59393739A4CF19ECA005056A70010'.

ENDCASE.

CALL FUNCTION 'STREE_EXTERNAL_DISPLAY'
  EXPORTING
    structure_id               = g_id
   LANGUAGE                    = SY-LANGU
   DISPLAY_STRUCTURE           = 'X'.
*   NO_COMMIT_WORK              = 'X'
*   USE_REMOTE_CONNECTION       = ' '
*   RFC_DESTINATION             = 'NONE'
*   POSITION_ON_NODE            = ' '
*   POSITION_ON_NODES           =
*   ID_FOR_USE_AS_FILTER        = ' '
* IMPORTING
*   MESSAGE                     =
*   TOGGLE                      =
* TABLES
*   USER_PARAMETERS             =
*   POSITION_HIERARCHY          =
          .

the above code working fine. My requirement is i dont want hard code the structure ID.

I have to fetch the structure ID dynamically is it possible ?

Thanks,

Vimal

Read only

0 Likes
2,436

This answer is the same than my first one, but even even more detailed.

Do you have this in table TOBJECTP?

PROJECT_ID
OBJ_TYPEOBJECT_ID
YTEST_IMGPLANE1A59393739A4CF19ECA005056A70010

If yes, then simply call

PARAMETERS project TYPE project_id DEFAULT 'YTEST_IMG'.
TYPE-POOLS spro.
DATA lt_object_id TYPE spro_object_id_tab.
DATA ls_object_id TYPE spro_object_id_struc.
CALL FUNCTION 'SPROJECT_GET_OBJECT'
  EXPORTING
    project_id = project
    obj_type   = 'PLAN'
  TABLES
    object_id  = lt_object_id.
READ TABLE lt_object_id INTO ls_object_id INDEX 1.
CALL FUNCTION 'STREE_EXTERNAL_DISPLAY'
  EXPORTING
    structure_id = ls_object_id-object_id.

Otherwise, I don't know, and give up.

Sandra

Read only

0 Likes
2,436

Hi Sandra,

No Need to fetch structure ID dynamically because while creating a customizing IMG the structure ID captured in CTS so it does not change if we move the object into quality or production .

The solution for this requirement we have to hard code the structure ID in the 'STREE_EXTERNAL_DISPLAY' (Function Module) .

Thanks for your timely help.

Vimal