cancel
Showing results for 
Search instead for 
Did you mean: 

Assign split from Networkactivity to a person

pabloschewe
Explorer

Hello experts,

im creating network activitys with the bapi "BAPI_NETWORK_MAINTAIN".

After that i want to assign the split to a person.

I got the KBED and KBEZ entry from the activity.

How am i able to change the PERNR in the KBED, to assign the split to a person?

Is there any Function Module / BAPI or anything else I can try?

Kind regards,

Pablo

Accepted Solutions (1)

Accepted Solutions (1)

pjl
Participant

Hi Pablo,

I don't see any standard functions released to public to be used. But the following is working for me to assign a single ressource:

 DATA(ls_kbed) = VALUE cykbed_tab( bedid = l_bedid
                                        bedzl = l_bedzl
                                        index = l_indbt
                                        pernr = l_pernr ).
      CALL FUNCTION 'CY01_CAP_REQ_ASSIGN'
        EXPORTING
          in_kbed_entry              = ls_kbed  " Structure with cap.req.rec. and assignment data
          kbedd_imp                  = ls_current_kbed
        EXCEPTIONS
          OTHERS                     = 10.

        CALL FUNCTION 'CY_BT_VB_CHECK'
          EXPORTING
            i_bedid_1           = l_bedid
            i_aufpl             = l_aufpl
          IMPORTING
            e_bedid_1           = l_bedid_r
            e_aend_flag         = l_flag
          EXCEPTIONS
            OTHERS              = 2.

COMMIT WORK.

But this actually needs some scafolding to work, since this approach relies on existing memory structure to be filled properly. And for example the variable l_indbt is an index into the internal table pointing to the row of the original KBED entry.

To set up a working environment there are a couple of reads to be done:

    ls_objects = VALUE #( flg_alt = abap_true
                          flg_seq = abap_true
                          flg_opr = abap_true 
                          flg_bed = abap_true ).
    lt_aufnr = VALUE #( ( aufnr = l_aufnr ) ).
    CALL FUNCTION 'CO_ZF_ORDER_READ'
      EXPORTING
        flg_enqueue       = abap_true
        objects_imp       = ls_objects    " Liste der Auftragsobjekte, die zu lesen sind
      IMPORTING
        flg_escape        = l_escape
        flg_enqueue_ok    = l_flg_enqueue_ok    " Alle übergebenen Aufträge wurden gesperrt
      TABLES
        aufnr_tab_imp     = lt_aufnr    " Zu bearbeitende Aufträge
      EXCEPTIONS
        OTHERS            = 3.

* this shouldn't be necessary since flg_bed was set.
    lt_pre_tab = VALUE #( ( bedid = l_bedid ) ).
    CALL FUNCTION 'CY_BT_KBED_PRE_READ'
      TABLES
        bedid_pre_tab = lt_pre_tab.


This is some scetch how It worked for me. Though I cannot give the full source code of what I have done here. But I guess this is the essence of what is needed.

Feel free to ask for details.

Cheers,

Peter

Answers (2)

Answers (2)

NTeunckens
Active Contributor
0 Kudos

Nothing Standard so you must code your way around it.

I've done something similar as mentioned by pjl,but made use of FM "CY_BT_KBED_POST_IN_OTHER_TASK". This FM can update the Tables "KBED" "KBKO" "KBEZ" for Multiple Resources (Like a Team of Pernrs) ...

Set a BREAKPOINT in the FM and do some Debugging to see how the Logic works in the Standard SAP Transactions ...


Hope this helps

Nic T.

former_member346846
Discoverer
0 Kudos

Hi pjl,

Do you mind to share all source code for this functionality ? Thanks in advance.

pjl
Participant
0 Kudos

Hi jcarolas ,

I am sorry, this is all source code I have. It was a fragment I used to experiment with. I understand, that there is a lot missing in order to get a full solution.

Cheers,
Peter