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

BAPI_PROJECT_MAINTAIN

Former Member
0 Likes
488

Can somebody provide me code to crate both project and wbs elements at one run of the bapi BAPI_PROJECT_MAINTAIN,

The follwing code is ging me a dump....

This is urgent.....

WA_PRJDEF-PROJECT_DEFINITION = 'X00003'.

WA_PRJDEF-DESCRIPTION = 'DESC'.

WA_PRJDEF-PROJECT_PROFILE = 'DSI0001'.

*WA_PRJDEF-BUS_AREA = WA_MAIN-BUS_AREA.

WA_PRJDEFUP-PROJECT_DEFINITION = 'X'.

WA_PRJDEFUP-DESCRIPTION = 'X'.

WA_PRJDEFUP-PROJECT_PROFILE = 'X'.

*WA_PRJDEFUP-BUS_AREA = 'X'.

WA_METPRJ-REFNUMBER = '000001'.

WA_METPRJ-OBJECTTYPE = 'ProjectDefinition'.

WA_METPRJ-METHOD = 'Create'.

WA_METPRJ-OBJECTKEY = 'X00003'.

APPEND WA_METPRJ TO ITMETPRJ.

WA_METPRJ-REFNUMBER = '000001'.

WA_METPRJ-OBJECTTYPE = 'WBS-Element'.

WA_METPRJ-METHOD = 'Create'.

WA_METPRJ-OBJECTKEY = 'X00003'.

APPEND WA_METPRJ TO ITMETPRJ.

WA_METPRJ-REFNUMBER = ''.

WA_METPRJ-OBJECTTYPE = ''.

WA_METPRJ-METHOD = 'Save'.

WA_METPRJ-OBJECTKEY = ''.

APPEND WA_METPRJ TO ITMETPRJ.

CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'

EXPORTING

I_PROJECT_DEFINITION = WA_PRJDEF

I_PROJECT_DEFINITION_UPD = WA_PRJDEFUP

IMPORTING

RETURN = RETURN

TABLES

I_METHOD_PROJECT = ITMETPRJ

E_MESSAGE_TABLE = MSG.

1 REPLY 1
Read only

Former Member
0 Likes
376

See the following example :

REPORT Z_TEST_PMB .

DATA: ipd type BAPI_PROJECT_DEFINITION,

imp type table of BAPI_METHOD_PROJECT with header line,

iwbs type table of BAPI_WBS_ELEMENT with header line,

em type table of BAPI_METH_MESSAGE with header line.

ipd-project_definition = 'PS02'.

imp-refnumber = '1'.

imp-objecttype = 'WBS-ELEMENT'.

imp-method = 'CREATE'.

imp-objectkey = ' PS024'.

append imp.

clear imp.

imp-method = 'SAVE'.

append imp.

iwbs-PROJECT_DEFINITION ='PS02'.

iwbs-WBS_ELEMENT = 'PS024'.

iwbs-DESCRIPTION = 'Preparation'.

append iwbs.

break mackowskit.

CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'

EXPORTING

i_project_definition = ipd

i_project_definition_upd = ''

tables

i_method_project = imp

I_WBS_ELEMENT_TABLE = iwbs

E_MESSAGE_TABLE = em.

Reward Points if it is useful

Thanks

Seshu