Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BAPI_REQUISITION_CHANGE

Hi all, I have to change a purchasing group of a purchase requisition number, I tried with the above bapi but I am getting a run time error as type conflict.

REPORT ZPRCHANGE .

DATA : I_ITEM LIKE BAPIEBAN OCCURS 0 WITH HEADER LINE,

I_OLD LIKE BAPIEBANV OCCURS 0 WITH HEADER LINE,

I_NEW LIKE BAPIEBANV OCCURS 0 WITH HEADER LINE,

I_return LIKE BAPIRETURN OCCURS 0 WITH HEADER LINE.

DATA : W_MSG TYPE STRING.

CALL FUNCTION 'BAPI_REQUISITION_GETDETAIL'

EXPORTING

NUMBER = '0010003246'

  • ACCOUNT_ASSIGNMENT = ' '

  • ITEM_TEXTS = ' '

  • SERVICES = ' '

  • SERVICE_TEXTS = ' '

TABLES

REQUISITION_ITEMS = I_ITEM.

  • REQUISITION_ACCOUNT_ASSIGNMENT =

  • REQUISITION_TEXT =

  • REQUISITION_LIMITS =

  • REQUISITION_CONTRACT_LIMITS =

  • REQUISITION_SERVICES =

  • REQUISITION_SERVICES_TEXTS =

  • REQUISITION_SRV_ACCASS_VALUES =

  • RETURN =

.

move-corresponding I_ITEM TO I_OLD.

MOVE-CORRESPONDING I_ITEM TO I_NEW.

APPEND I_OLD.

APPEND I_NEW.

LOOP AT I_NEW.

I_NEW-PUR_GROUP = '002'.

MODIFY I_NEW.

ENDLOOP.

CALL FUNCTION 'BAPI_REQUISITION_CHANGE'

EXPORTING

NUMBER = '0010000003'

TABLES

REQUISITION_ITEMS_OLD = I_OLD

REQUISITION_ITEMS_NEW = I_NEW

  • REQUISITION_ACCOUNT_OLD =

  • REQUISITION_ACCOUNT_NEW =

  • REQUISITION_TEXT_OLD =

  • REQUISITION_TEXT_NEW =

  • RETURN =

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

IMPORTING

RETURN = i_return.

LOOP AT i_return.

WRITE :/ I_RETURN-MESSAGE.

  • CALL FUNCTION 'FORMAT_MESSAGE'

  • EXPORTING

    • ID = return-id

    • LANG = '-D'

    • NO = RETURN-NUMBER

  • V1 = i_return-message_v1

  • V2 = i_return-message_v2

  • V3 = i_return-message_v3

  • V4 = i_return-message_v4

*

  • IMPORTING

  • MSG = W_MSG

    • EXCEPTIONS

    • NOT_FOUND = 1

    • OTHERS = 2

  • .

  • IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

*

*WRITE : / W_MSG.

thanks

regards

johny

Former Member
Not what you were looking for? View more on this topic or Ask a question