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: 

Not able to chnage PR data using BAPI_PR_CHANGE

Former Member
0 Kudos

Dear All,

I have a requirement, that need to change PR data.

I am using BAPI: BAPI_PR_CHANGE. to change the PR data.

i am trying to change below fields.

i.      Suppl_plnt = wrk02

ii.      Item category = U

iii.      Release date = today (mandatory in the BAPI)

iv.      Desired vendor = fixed vendor = info record = contract = contract item = assignment flag = BLANK

  But finally i am getting below three errors

  Purchase requisition still contains items with errors

Instance XXXXX359 of object type PurchaseRequisition could not be changed

Processing status  invalid

If some one faced same type of situation, suggest me the solution.

Thanks and regards

Aumprakasharya T

1 ACCEPTED SOLUTION

0 Kudos

Hi,

Have you already do the same data changes in transaction ME52N ? I believe that in PR change in ME52N the erros will be the same and there you will be able to see what's wrong.

David

7 REPLIES 7

0 Kudos

Hi,

Have you already do the same data changes in transaction ME52N ? I believe that in PR change in ME52N the erros will be the same and there you will be able to see what's wrong.

David

0 Kudos

Hello David,

Thanks for reply...

I have done the same by ME52N, there data has been changed. with out any errors.

Could you please provide exact process to use this BAPI_PR_CHANGE function module?

means... what are the steps need to follow, what are the mandatory fields need to use e.t.c..

expecting your guidance will help us in a right way.

Thanks in advance.

Aumprakash

0 Kudos

hi Aumprakash ,

Take this example of usage, hepe it helps you:

  CALL FUNCTION 'BAPI_PR_CREATE'

    EXPORTING

      prheader              = ls_prheader

      prheaderx             = ls_prheaderx

      testrun               = p_test

    IMPORTING

      number                = lv_banfn

*     PRHEADEREXP           =

    TABLES

      return                = lt_return

      pritem                = lt_bapi_items

      pritemx               = lt_bapi_itemsx

      prheadertext          = lt_prheadertext

      extensionin           = gt_extensionin

*     PRITEMEXP             =

*     PRITEMSOURCE          =

*     PRACCOUNT             =

*     PRACCOUNTPROITSEGMENT =

*     PRACCOUNTX            =

*     PRADDRDELIVERY        =

      pritemtext            = lt_texts.

  IF lt_return IS NOT INITIAL.

    APPEND LINES OF lt_return TO gt_return.

    REFRESH lt_return.

  ENDIF.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

* EXPORTING

*   WAIT          =

* IMPORTING

*   RETURN        =

            .


mahesh_madhavan
Participant
0 Kudos

Hi,

I just thought this discussion might be useful to you. It talks about some OSS notes.

http://scn.sap.com/thread/201636#2239977

By the way, which SAP system are you using?

Cheers,

Mahesh

Former Member
0 Kudos

Thanks for all and yours every reply has helped me.

I got the answer from SAP, it has not worked because of previously implemented OSS note.

And SAP has provided a correction to it. And it is working fine.

Thanks

0 Kudos

Hello Aumprakasharya,

Can you please share the note number provided by SAP? I am even facing the same issue.

Regards,

Praveen T

0 Kudos

Hello,

The correction is the following note:

1705810 No update happened when executing BAPI_PR_CHANGE

Regards,

Rod