Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

PROBLEM WITH BAPI_PO_CREATE1

0 Likes
1,046

Hi Experts,

I have a requirement to create purchase orders with services for ME21N. I´m using BAPI_PO_CREATE1 but i failed to work properly and i get the following message: "No account assignment exists for service line 0000000010".

I'm using BAPI_PO_CREATE1 like this.

CALL FUNCTION 'BAPI_PO_CREATE1'

         EXPORTING

           poheader   = wa_poheader

           poheaderx  = wa_poheaderx

           testrun    = 'X'

         TABLES

           return     = gt_return

           poitem     = gt_poitem

           poitemx    = gt_poitemx

           poaccount  = gt_poaccount

           poaccountx = gt_poaccountx

           poservices = gt_poservices.

Thanks in advice,

Alejandro Alvarado.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
745

HI,

Which is the account assignment category you are using? Please check the category and the corresponding fields that have been populated. Generally this account assignment is used for costing elements and you also need to check if all the mandatory costing elements are filled. This error occurs when there is some discrepancy in the account assignement category and the populated fields.

Regards,

Hardik Mehta

4 REPLIES 4
Read only

Former Member
0 Likes
746

HI,

Which is the account assignment category you are using? Please check the category and the corresponding fields that have been populated. Generally this account assignment is used for costing elements and you also need to check if all the mandatory costing elements are filled. This error occurs when there is some discrepancy in the account assignement category and the populated fields.

Regards,

Hardik Mehta

Read only

0 Likes
745

Hi Hardik,

I´m using 'N (Network)' for account assignment category, and i´m filling the following fields in the PO_ACCOUNT and PO_ACCOUNTX tables.

       wa_poaccount-po_item = g_item.

       wa_poaccount-serial_no = 01.

       wa_poaccount-creat_date = sy-datum.

       wa_poaccount-quantity = '1.00'.

       wa_poaccount-net_value = '50.00'.

       wa_poaccount-gl_account = wa_estructuras-value31.

       wa_poaccount-co_area = 'GMMM'.

       wa_poaccount-network = wa_estructuras-value32.

       wa_poaccount-activity = wa_estructuras-value33.

       APPEND wa_poaccount TO gt_poaccount.

I think that those field are that te BAPI require.

Thanks for your reply.


Read only

0 Likes
745

Hi experts,

I solved my problem. For PO with services it's necesary to populate POSRVACCESSVALUES table.

The correct BAPI is like this.

CALL FUNCTION 'BAPI_PO_CREATE1'

         EXPORTING

           poheader          = wa_poheader

           poheaderx         = wa_poheaderx

           testrun           = 'X'

         TABLES

           return            = gt_return

           poitem            = gt_poitem

           poitemx           = gt_poitemx

           poaccount         = gt_poaccount

           poaccountx        = gt_poaccountx

           poservices        = gt_poservices

           posrvaccessvalues = gt_posrvaccessvalues.

Greetings.

Read only

0 Likes
745

Yes but what are the values ?