on 2025 Jan 02 1:50 PM
We encountered an error while attempting to create a mass creation tool for Purchase Requisition using BAPI_PR_CREATE. We found no issue with any other Document Type and Account Assignment combination except Document Type RV and Account Assignment U (Unknown). This combination works fine when using transaction ME51N but not when using BAPI_PR_CREATE.
The issue arises during check-in Class Interface CL_ACCOUNT_MMSRV, precisely in line 127. I highlighted it in blue. Does anyone encounter such an error using BAPI_PR_CREATE to create PR for material or services? Your help on this is very much appreciated.
CLASS: CL_ACCOUNT_MMSRV
METHOD: PROCESS
IF my_t_acc_line IS NOT INITIAL OR
my_t_service_data IS NOT INITIAL OR
my_limit_data IS NOT INITIAL OR my_ext_header-activity_type NE 'I'.
IF my_acc_category_cust-kzvbr = 'U' AND
( my_t_acc_line IS NOT INITIAL OR my_t_acc_totals IS NOT INITIAL ).
MESSAGE e005(srv) INTO lv_msg_dummy.
CALL METHOD my_sp_header-message_ref->add_msg_to_bal
EXPORTING
im_struct_name = 'SRV_EXT_HEADER'
im_field_name = 'ACCTASSCAT'
im_class_name = 'CL_ACCOUNT_MMSRV'
im_msgkey = my_msg_key.
RAISE error_account_process.
ENDIF.
CLEAR ls_acc_line.
LOOP AT my_t_acc_line INTO ls_acc_line WHERE outline IS INITIAL AND
srv_line IS NOT INITIAL .
ls_acc_line-outline = 1.
MODIFY my_t_acc_line FROM ls_acc_line.
ENDLOOP.
Request clarification before answering.
User | Count |
---|---|
17 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.