cancel
Showing results for 
Search instead for 
Did you mean: 

CJ20N : Add Component for WBS with procurement type 8

yoppy_santoso
Participant
0 Kudos

Hi all,
I have Network and WBS like below pict



And I use bapi BAPI_NETWORK_COMP_ADD for automatic add component material

My case is :
Procurement type = Reservation for Network ( I want : Reservation for WBS Element )
Is there BAPI or FM for cover my case?

Thanks

yoppy_santoso
Participant
0 Kudos

Any solution, please

Accepted Solutions (0)

Answers (4)

Answers (4)

sammar81
Employee
Employee
0 Kudos

Hi Yoppy,

Check this please..

Transfer

1. You should always specify the network number NUMBER. The system transfers component data to the table I_COMPONENTS_ADD. You should always specify the following for each components: a. To which activity the component should be added

b. The procurement type (network reservation, WBS reservation...). See the data element documentation for TYPE_OF_PUR_RESV.

You can get it fromvorm: bapi_components_add and In line 90 of the code check for this

check input type of Purchasing or Reservation

IF flg_error_occured IS INITIAL. PERFORM check_procument USING i_resbd-type_of_pur_resv.

Hope this clears your issue..

Regards

Sammar

yoppy_santoso
Participant
0 Kudos

This is my code :

    ls_compadd-activity       = <fs_data>-activity.
    ls_compadd-item_cat       = <fs_data>-item_cat.
    ls_compadd-item_number    = <fs_data>-item_number.
    ls_compadd-material       = <fs_data>-material.
    ls_compadd-entry_quantity = <fs_data>-entry_quantity.
    ls_compadd-req_date       = <fs_data>-req_date.
    ls_compadd-gr_rcpt        = <fs_data>-gr_rcpt.
    ls_compadd-plant          = <fs_data>-plant.
    ls_compadd-mrp_relevant     = '1'.
    ls_compadd-wbs_element      = <fs_data>-wbs_element.
    ls_compadd-type_of_pur_resv = '8'.
    ls_compadd-req_date         = sy-datum.
    ls_compadd-manual_requirements_date = 'X'.

    APPEND ls_compadd TO lt_compadd.

    CALL FUNCTION 'BAPI_NETWORK_COMP_ADD'
      EXPORTING
        number           = <fs_data>-network
      IMPORTING
        return           = ls_return
      TABLES
        i_components_add = lt_compadd
        e_message_table  = lt_emess.

yesterday I was debugging, actually the line position was at 161 (for wbs)
In that line states that based on network elements, activities and wbs do not have a reservation. So the effect is no_proj eq 'X'

sammar81
Employee
Employee
0 Kudos

You got to change it in configuration not from FM.. I don't think we have the field available in FM.

yoppy_santoso
Participant
0 Kudos

Current condition :

If Manual Add from CJ20N = Automatic for WBS Element
If from Bapi = Default for Network

what I want is, execute from bapi and will be "for WBS Element"
like below pict

yoppy_santoso
Participant
0 Kudos
sammar81
Employee
Employee
0 Kudos

Hi Yoppy,

This comes from configuration of Network profile. check in t-code OPUU for your profile what is maintained in the field Procurement.

This is setting is maintained in the Material procurement in the below SPRO Node

Project systems->Material->Procurement->Define Procurement Indicators for Material Components

hope it helps..

Regards

Sammar

yoppy_santoso
Participant
0 Kudos

Okay, I've seen it.
is there fm / bapi for my solution?

mateuszadamus
Active Contributor
0 Kudos

Hello yoppy.santoso

Have a look at BAPI_PROJECT_MAINTAIN function.

Kind regards,
Mateusz
yoppy_santoso
Participant
0 Kudos

Have you tried it? I tried it but it didn't work.

mateuszadamus
Active Contributor
0 Kudos

Oh, sorry, I missed that you use BAPI_NETWORK_COMP_ADD function.

In that function, in parameter I_COMPONENTS_ADD there is a field called TYPE_OF_PUR_RESV which corresponds to the screen field you marked. The value for "Reservation for WBS Element" is 8.

Does that not work? If no, then do you get any error message?


Kind regards,
Mateusz
yoppy_santoso
Participant
0 Kudos

This is the error when assign 8

mateuszadamus
Active Contributor
0 Kudos

I see this message being used in two places only. Both of them are in LCNIF_MATF43 include.

I propose you debug this logic and see exactly why the error message is returned.

Kind regards,
Mateusz
yoppy_santoso
Participant
0 Kudos

I have done debugging, but what's the solution?
I don't know what needs to be fixed yet.

mateuszadamus
Active Contributor
0 Kudos

What did you find out from the debugging? Why is the error message raised? Please share that information.

Kind regards,
Mateusz
yoppy_santoso
Participant
0 Kudos

I am not sure
but I think it just outlines the message and maybe not the point of this case

yoppy_santoso
Participant
0 Kudos

If manual create comp. material in CJ20N, this is happening :
Procurement type default for " Reservation to WBS Element "

mateuszadamus
Active Contributor
0 Kudos

Do you provide the same information in your BAPI call as you do when entering the material by hand? What information did you get when debugging? Have you found the reason for the error message? What is the reason?

Kind regards,
Mateusz
yoppy_santoso
Participant
0 Kudos

because value of variable project_stock is default 2 and compare with flag_stock
I dont know where the variable is filled in
are u have solution? very appreciate for this

mateuszadamus
Active Contributor
0 Kudos

No, I don't have a generic solution for this. Check and see why the NO_PROJ variable is equal 'X', because I suppose it is.
This is the reason why you're getting the error message.


Kind regards,
Mateusz
yoppy_santoso
Participant
0 Kudos

No, not because of that parameter

yoppy_santoso
Participant
0 Kudos