‎2014 Jan 30 7:58 AM
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
‎2014 Feb 03 8:59 PM
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
‎2014 Feb 04 1:57 PM
Hi,
I'm sorry but I have not solved the problem. Please, if you find a solution share it with me.
Regards,
Mira
‎2014 Feb 07 5:45 PM
Hi SDNers , anyone know solution for this , any idea would be appreciated.
‎2014 Feb 28 4:57 AM
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
‎2014 Mar 05 5:56 PM
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.
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.
‎2019 Aug 20 3:11 AM
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