Application Development 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: 

Multiple service line items price issue using BAPI_PO_CREATE1

0 Kudos

Hi,

I am sending PO from non sap to sap system with multiple service line items, but the problem is updating the same net price in all service line items.

Regards,

RK

6 REPLIES 6

mynynachau
Community Advocate
Community Advocate
0 Kudos

Thank you for visiting SAP Community to get answers to your questions. Since you're new in asking questions here, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers (if you haven't already), as it provides tips for preparing questions that draw responses from our members. For example, you can outline what steps you took to find answers (and why they weren't helpful), share screenshots of what you've seen/done, make sure you've applied the appropriate tags, and use a more descriptive subject line. The more details you provide, the more likely it is that members will be able to assist you. You should also make sure you're using all the appropriate tags, so the right experts can find your question.

Should you wish, you can revise your question by selecting Actions, then Edit (although once someone answers your question, you'll lose the ability to edit the question -- but if that happens, you can leave more details in a comment).

Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it: https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS . By personalizing your profile with a photo of you, you encourage readers to respond.

Best regards

Mynyna

SAP Community moderator

Abinathsiva
Active Contributor
0 Kudos

Hi, Can you add the code - Service Item internal table loaded..

0 Kudos

Hi Abinath,

below is the code for service lines I am passing to BAPI_PO_CREATE1.

PO is creating in SAP successfully but same net price is reflecting all line items .

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING nr_range_nr = '01'

object = 'SERVICE'

IMPORTING

number = lv_pack

EXCEPTIONS

interval_not_found = 1

number_range_not_intern = 2

object_not_found = 3

quantity_is_0 = 4

quantity_is_not_1 = 5

interval_overflow = 6

buffer_overflow = 7

OTHERS = 8.

ls_serv-pckg_no = lv_pack.

ls_serv-line_no = '0000000001'.

ls_serv-ext_line = ''.

ls_serv-outl_ind = 'X'.

ls_serv-outl_no = '0'.

ls_serv-subpckg_no = '0000000002'.

ls_serv-from_line = 1.

APPEND ls_serv TO lt_serv.

CLEAR ls_ser.

ls_serv-pckg_no = '0000000002'.

ls_serv-line_no = '0000000002'.

ls_serv-ext_line = '0000000010'.

ls_serv-outl_level = '0'.

ls_serv-subpckg_no = '0'.

ls_serv-base_uom = item-po_unit.

ls_serv-uom_iso = item-po_unit_iso.

ls_serv-quantity = item-net_price.

ls_serv-net_value = item-net_price.

ls_serv-price_unit = '1'.
ls_serv-gr_price = '1'.

ls_serv-short_text = item-short_text.

ls_serv-matl_group = item-matl_group.

APPEND ls_serv TO lt_serv.

CLEAR ls_serv.

ls_sval-pckg_no = lv_pack.

ls_sval-line_no = '0'.

ls_sval-serial_no = '01'.

ls_sval-serno_line = '01'.

APPEND ls_sval TO lt_sval

CLEAR : ls_sval.

ls_sval-pckg_no = '0000000002'.

ls_sval-line_no = '0000000002'.

ls_sval-serial_no = '01'.

ls_sval-serno_line = '01'.

APPEND ls_sval TO lt_sval.

0 Kudos
Hi Abinath

Please find the below code used inside the item loop. PO is creating successfully in sap but same net price is updating in all the service line items.

        ls_serv-pckg_no = lv_pack.
        ls_serv-line_no = '0000000001'.
        ls_serv-ext_line = ''.
        ls_serv-outl_ind = 'X'.
        ls_serv-outl_no = '0'.
        ls_serv-subpckg_no = '0000000002'.
        ls_serv-from_line = 1.


        APPEND ls_serv TO lt_serv.
        CLEAR ls_serv.
        ls_serv-pckg_no = '0000000002'
        ls_serv-line_no = '0000000002'.
        ls_serv-ext_line = '0000000010'. 
        ls_serv-outl_level = '0'.
        ls_serv-subpckg_no = '0'.
        ls_serv-base_uom = item-po_unit.
        ls_serv-uom_iso  = item-po_unit_iso.
        ls_serv-quantity = item-net_price.
        ls_serv-net_value = item-net_price.
        ls_serv-price_unit = '1'.
        ls_serv-gr_price = '1'.
        ls_serv-short_text = item-short_text.
        ls_servmatl_group = item-matl_group.
        APPEND ls_serv TO lt_serv.
        CLEAR ls_serv.


        ls_svalues-pckg_no = lv_pack.
        ls_svalues-line_no = '0'.
        ls_svalues-serial_no = '01'.
        ls_svalues-serno_line = '01'.
        APPEND ls_svalues TO lt_svalues.
        CLEAR : ls_svalues, ls_account.
        ls_svalues-pckg_no = '0000000002'.
        ls_svalues-line_no = '0000000002'.
        ls_svalues-serial_no = '01'.
        ls_svalues-serno_line = '01'.
        APPEND ls_svalues TO lt_svalues.

Thank You.

RK

0 Kudos
Hi Abinath

Please find the below code used inside the item loop. PO is creating successfully in sap but same net price is updating in all the service line items.

        ls_serv-pckg_no = lv_pack.
        ls_serv-line_no = '0000000001'.
        ls_serv-ext_line = ''.
        ls_serv-outl_ind = 'X'.
        ls_serv-outl_no = '0'.
        ls_serv-subpckg_no = '0000000002'.
        ls_serv-from_line = 1.


        APPEND ls_serv TO lt_serv.
        CLEAR ls_serv.
        ls_serv-pckg_no = '0000000002'
        ls_serv-line_no = '0000000002'.
        ls_serv-ext_line = '0000000010'. 
        ls_serv-outl_level = '0'.
        ls_serv-subpckg_no = '0'.
        ls_serv-base_uom = item-po_unit.
        ls_serv-uom_iso  = item-po_unit_iso.
        ls_serv-quantity = item-net_price.
        ls_serv-net_value = item-net_price.
        ls_serv-price_unit = '1'.
        ls_serv-gr_price = '1'.
        ls_serv-short_text = item-short_text.
        ls_servmatl_group = item-matl_group.
        APPEND ls_serv TO lt_serv.
        CLEAR ls_serv.


        ls_svalues-pckg_no = lv_pack.
        ls_svalues-line_no = '0'.
        ls_svalues-serial_no = '01'.
        ls_svalues-serno_line = '01'.
        APPEND ls_svalues TO lt_svalues.
        CLEAR : ls_svalues, ls_account.
        ls_svalues-pckg_no = '0000000002'.
        ls_svalues-line_no = '0000000002'.
        ls_svalues-serial_no = '01'.
        ls_svalues-serno_line = '01'.
        APPEND ls_svalues TO lt_svalues.

Thank You.

RK

0 Kudos
Hi Abinath

Please find the below code used inside the item loop. PO is creating successfully in sap but same net price is updating in all the service line items.

        ls_serv-pckg_no = lv_pack.
        ls_serv-line_no = '0000000001'.
        ls_serv-ext_line = ''.
        ls_serv-outl_ind = 'X'.
        ls_serv-outl_no = '0'.
        ls_serv-subpckg_no = '0000000002'.
        ls_serv-from_line = 1.


        APPEND ls_serv TO lt_serv.
        CLEAR ls_serv.
        ls_serv-pckg_no = '0000000002'
        ls_serv-line_no = '0000000002'.
        ls_serv-ext_line = '0000000010'. 
        ls_serv-outl_level = '0'.
        ls_serv-subpckg_no = '0'.
        ls_serv-base_uom = item-po_unit.
        ls_serv-uom_iso  = item-po_unit_iso.
        ls_serv-quantity = item-net_price.
        ls_serv-net_value = item-net_price.
        ls_serv-price_unit = '1'.
        ls_serv-gr_price = '1'.
        ls_serv-short_text = item-short_text.
        ls_servmatl_group = item-matl_group.
        APPEND ls_serv TO lt_serv.
        CLEAR ls_serv.


        ls_svalues-pckg_no = lv_pack.
        ls_svalues-line_no = '0'.
        ls_svalues-serial_no = '01'.
        ls_svalues-serno_line = '01'.
        APPEND ls_svalues TO lt_svalues.
        CLEAR : ls_svalues, ls_account.
        ls_svalues-pckg_no = '0000000002'.
        ls_svalues-line_no = '0000000002'.
        ls_svalues-serial_no = '01'.
        ls_svalues-serno_line = '01'.
        APPEND ls_svalues TO lt_svalues.

Thank You.

RK