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_BUS2054_CREATE_MULTI

Former Member
0 Likes
2,554


Hi,

I want to creat Wbs elements from Bapi BAPI_BUS2054_CREATE_ MULTI and I need to fill GJAHR -  Approval year of the investment program, PRNAM investment program and POSID position ID in dynpro 0620 - Assignment to investment program position.  I creat wbs element but I do not know how to transmit those fields.  Can anybody help me on this?

Thanks in advance

6 REPLIES 6
Read only

Former Member
0 Likes
2,040

Hi Mira,

I am also facing the same Problem currently, Do you find out any solution for this. Could you please share how did you achieve this .


Regards

Chinnaiya Pandian

Read only

Former Member
0 Likes
2,040

Hi,

I'm sorry but I have not solved the problem. Please, if you find a solution share it with me.

Regards,

Mira

Read only

Former Member
0 Likes
2,040

Hi SDNers , anyone know solution for this , any idea would be  appreciated.

Read only

vamsixk
Active Participant
0 Likes
2,040

you cannot map those fields from the BAPI.

i have not been able to find any other BAPi to do that either.

We used BDC recording to load this data into the system.

we used the transaction CJ02 for this.

after marking the WBS element we need to go to the Extras (in menu)--> investment Program and here we can map the fields PRNAM Position and approval yea.

regards,

Vamsi

Read only

Former Member
2,040

Hi,

Just want to share how did I achieved this , since I am creating WDA application for  creating WBS, I convinced the client to make those fields non-mandatory in  cj02 and

Made those investment management fields mandatory WDA screen, I explained them since BDC is not good practice and not easy to maintain if some change happens in future.

  1. 1. Created WBS using BAPI_BUS2054_CREATE_MULTI  after that
  2. 2. Updated  IM fields using FM - AIPP_ALLOCATE_POSITION_DARK

Below is the sample code :




*project creation

CALL FUNCTION 'BAPI_PROJECTDEF_CREATE'

   EXPORTING

     project_definition_stru = ls_project_definition

   IMPORTING

     return                  = ls_bapireturn1_pro_defi

   TABLES

     e_message_table         = lt_message_table.

*WBS creation

CALL FUNCTION 'BAPI_PS_INITIALIZATION'.

CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'

   EXPORTING

     i_project_definition = lv_proj_no

   TABLES

     it_wbs_element       = lt_wbs_element

     et_return            = lt_wbs_msg.

CALL FUNCTION 'BAPI_PS_PRECOMMIT'

   TABLES

     et_return = lt_pre_commit.

COMMIT WORK AND WAIT .




*Invesmnet management field update


DATA : lt_dyn_tab TYPE  im_alloc_dyn_tab_type,

        ls_dyn_tab TYPE  im_alloc_dyn_type.

ls_dyn_tab-prnam    'Z1'.

ls_dyn_tab-posid   'Z1.1.1.1.1.1'.

ls_dyn_tab-gjahr   = '2007'.

APPEND ls_dyn_tab TO lt_dyn_tab.

CALL FUNCTION 'AIPP_ALLOCATE_POSITION_DARK'

   EXPORTING

     i_aktyp                = 'V'     V= create

     i_obart                = 'PR'   " WBS = PR

     i_kokrs                = 'ABC'  " company

     i_objnr                = lv_objnr

*   I_AUART                =

     i_posid                = lv_wbs2

*   I_PRART_IQ             =

     i_dyntab_dark          = lt_dyn_tab[]

*   I_FLG_BUDG_CTG_DIALOG  = ' '

*   I_FLG_REASSIGN_MR      = ' '

*   I_FLG_YRCHG_IGNORE     =

     i_flg_upd_on_commit    = 'X'

*   I_FLG_TEST_RUN         = ' '

   IMPORTING

     e_update               = lv_flag

   EXCEPTIONS

     alloc_already_exists   = 1

     alloc_no_proposal_made = 2

     error_occured          = 3

     OTHERS                 = 4.

IF sy-subrc <> 0.

* Implement suitable error handling here

ENDIF.




Read only

vamsixk
Active Participant
0 Likes
2,040

hi,

Thanks for the update, i have used this and now it works with the code you provided above.

It only works for assigning the first time, i have not used it to change existing ones.

Kind regards,

Vamsi