cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Unable to Use Account Assigmt "U" with Documt Type RV in BAPI_PR_CREATE

Haris_Yusop
Explorer
0 Kudos
118

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(srvINTO 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.


Accepted Solutions (0)

Answers (0)