Application Development 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: 

bapi_project_maintain

Former Member
0 Kudos

I create a project with 7 WBS using function bapi_project_maintain.

Everything is going well until I have to set a WBS hierarchie.

I need to set a level 1 for the first WBS and level 2 for the rest.

I get the error: 'The transfer hierarchie is inconsistent'

I code table like this:

I_WBS_HIERARCHIE_TABLE-WBS_ELEMENT = PROJECT.

DLUGOSC = strlen( PROJECT ).

I_WBS_HIERARCHIE_TABLE-WBS_ELEMENT+DLUGOSC = '-BDG'.

I_WBS_HIERARCHIE_TABLE-PROJECT_DEFINITION = PROJECT.

I_WBS_HIERARCHIE_TABLE-UP = ''.

I_WBS_HIERARCHIE_TABLE-DOWN = PROJECT.

I_WBS_HIERARCHIE_TABLE-DOWN+DLUGOSC = '-CP'.

I_WBS_HIERARCHIE_TABLE-LEFT = ''.

I_WBS_HIERARCHIE_TABLE-RIGHT = ''.

APPEND I_WBS_HIERARCHIE_TABLE.

I_WBS_HIERARCHIE_TABLE-WBS_ELEMENT = PROJECT.

DLUGOSC = strlen( PROJECT ).

I_WBS_HIERARCHIE_TABLE-WBS_ELEMENT+DLUGOSC = '-CP'.

I_WBS_HIERARCHIE_TABLE-PROJECT_DEFINITION = PROJECT.

I_WBS_HIERARCHIE_TABLE-UP = PROJECT.

I_WBS_HIERARCHIE_TABLE-UP+DLUGOSC = '-BDG'.

I_WBS_HIERARCHIE_TABLE-DOWN = ''.

I_WBS_HIERARCHIE_TABLE-LEFT = ''.

I_WBS_HIERARCHIE_TABLE-RIGHT = ''.

APPEND I_WBS_HIERARCHIE_TABLE.

I_WBS_HIERARCHIE_TABLE-WBS_ELEMENT = PROJECT.

DLUGOSC = strlen( PROJECT ).

I_WBS_HIERARCHIE_TABLE-WBS_ELEMENT+DLUGOSC = '-SA'.

I_WBS_HIERARCHIE_TABLE-PROJECT_DEFINITION = PROJECT.

I_WBS_HIERARCHIE_TABLE-UP = PROJECT.

I_WBS_HIERARCHIE_TABLE-UP+DLUGOSC = '-BDG'.

I_WBS_HIERARCHIE_TABLE-DOWN = ''.

I_WBS_HIERARCHIE_TABLE-LEFT = ''.

I_WBS_HIERARCHIE_TABLE-RIGHT = ''.

APPEND I_WBS_HIERARCHIE_TABLE.

When I use only first 2 all goes well. Problem starts when a third WBS is added.

2 REPLIES 2

Former Member
0 Kudos

Hello,

Try like this,

wa_wbs_hierarchie-project_definition = p_project_definition.

FOr the level 1 wbs

p_wa_wbs_hierarchie-wbs_element =

p_wa_new_hierarchie-wbs_element.

p_wa_wbs_hierarchie-right =

wa_new_hierarchie-wbs_element.

For others

p_wa_wbs_hierarchie-wbs_element =

p_wa_new_hierarchie-wbs_element.

p_wa_wbs_hierarchie-left =

wa_new_hierarchie-wbs_element.

If it is useful rewaed the points.

Regards,

Vasanth

Former Member
0 Kudos

The definition of the fields in the structure

BAPI_WBS_HIERARCHIE is as below. Please go through it and analyze if you are populaing the structure in your program correctly.

Description

Information about WBS hierarchy is transfered in this table.

Table structure

WBS_ELEMENT - WBS element whose hierarchy information is to be transfered

PROJECT_DEFINITION - Project definition it belongs to

UP - Superior WBS element for the relevant WBS element

DOWN - First WBS element (in the hierarchy graphic furthest left) that belongs to the same superior WBS element)

LEFT - Previous WBS element (next to the left) that belongs to the same superior WBS element.

RIGHT - Next WBS element (to the right) that belongs to the same superior WBS element.

-Kiran

*Please reward useful answers