on 12-13-2018 10:47 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi pjl,
Do you mind to share all source code for this functionality ? Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.