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

Error when update Scheduling Agreement using bapi "BAPI_SAG_CHANGE"

Former Member
0 Likes
849

Hi all,

I used bapi "BAPI_SAG_CHANGE" to update header text and item texts of the Scheduling Agreement as follow:

CALL FUNCTION 'BAPI_SAG_CHANGE'
  EXPORTING
    PURCHASINGDOCUMENT           =  p_sanum
    TESTRUN                      =  ' '
  IMPORTING
    EXP_HEADER                   =  s_sahdrrtn
  TABLES
    RETURN                       =  t_return
    ITEM_TEXT                    =  t_saitemtext
    HEADER_TEXT                  =  t_saheadertext
          .
" Then commit the update

The header text of the SA was updated successfully but when I attempted to open the item text (from Tcode ME33L) the following error occured and prevented to open:

"Plant yyyy does not belong to company code xxxx .Only one Company Code is allowed per PO."

Please suggest me to resolve this.

Thanks,

Khanh

Hi all,

I used bapi "BAPI_SAG_CHANGE" to update header text and item texts of the Scheduling Agreement as follow:

CALL FUNCTION 'BAPI_SAG_CHANGE'
  EXPORTING
    PURCHASINGDOCUMENT           =  p_sanum
    TESTRUN                      =  ' '
  IMPORTING
    EXP_HEADER                   =  s_sahdrrtn
  TABLES
    RETURN                       =  t_return
    ITEM_TEXT                    =  t_saitemtext
    HEADER_TEXT                  =  t_saheadertext
          .
" Then commit the update

The header text of the SA was updated successfully but when I attempted to open the item text (from Tcode ME33L) the following error occured and prevented to open:

"Plant yyyy does not belong to company code xxxx .Only one Company Code is allowed per PO."

Please suggest me to resolve this.

Thanks,

Khanh

1 REPLY 1
Read only

Former Member
0 Likes
586

Hi,

This error message comes from an user exit not the standard SAP.

Thanks,

Khanh