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

BAPI_PR_CHANGE

Former Member
0 Likes
2,466

Hi Guys,

Im new in SAP ABAP Development.

Recently I've been assigned to enhance some BAPIs for customer

Im working for BAPI_PR_CREATE and BAPI_PR_CHANGE.

Im using ECC6 with latest updates. Which means both BAPIs that I mentioned above already enhanced with service line items, service limits and service line account assignments.

Below are the sample of BAPI_PR_CHANGE pattern.


CALL FUNCTION 'BAPI_PR_CHANGE'
  EXPORTING
    number                       =
*   PRHEADER                     =
*   PRHEADERX                    =
*   TESTRUN                      =
* IMPORTING
*   PRHEADEREXP                  =
* TABLES
*   RETURN                       =
*   PRITEM                       =
*   PRITEMX                      =
*   PRITEMEXP                    =
*   PRITEMSOURCE                 =
*   PRACCOUNT                    =
*   PRACCOUNTPROITSEGMENT        =
*   PRACCOUNTX                   =
*   PRADDRDELIVERY               =
*   PRITEMTEXT                   =
*   PRHEADERTEXT                 =
*   EXTENSIONIN                  =
*   EXTENSIONOUT                 =
*   PRVERSION                    =
*   PRVERSIONX                   =
*   ALLVERSIONS                  =
*   PRCOMPONENTS                 =
*   PRCOMPONENTSX                =
*   SERVICEOUTLINE               =
*   SERVICEOUTLINEX              =
*   SERVICELINES                 =
*   SERVICELINESX                =
*   SERVICELIMIT                 =
*   SERVICELIMITX                =
*   SERVICECONTRACTLIMITS        =
*   SERVICECONTRACTLIMITSX       =
*   SERVICEACCOUNT               =
*   SERVICEACCOUNTX              =
*   SERVICELONGTEXTS             =
*   SERIALNUMBER                 =
*   SERIALNUMBERX                =

Im testing the BAPI_PR_CREATE by running the bapi test sequence via T-CODE SE37 and used the BAPI_TRANSACTION_COMMIT as well.

I managed to change the value of PRITEM in the EBAN table.

But I encountered some problems when I want to change the service line table which is 'SERVICELINES' in the above BAPI. After testing the BAPI, I checked the PR via TCODE ME53N, the service line havent affected at all but the BAPI's successfully run without any error.

I have no problem to change the SERVICELIMIT tables. I've tried to debug but still doesnt find any solution.

Has anyone encounter this problem before?

Appreciate any info and helps.

9 REPLIES 9
Read only

madhu_vadlamani
Active Contributor
0 Likes
1,935

Hi Songo,

Welcome to scn.

But I encountered some problems when I want to change the service line table which is 'SERVICELINES' in the above BAPI

Did you check with indicators like I,U.

Regards,

Madhu.

Read only

0 Likes
1,935

Hi madhurao

thanks for your reply.

If you dont mind, can you please elaborate what is the I,U indicator? Im sorry for such question, Im totally fresh in ABAP.

Thanks,

Regards,

Songo

Read only

0 Likes
1,935

Hi,

These are the indicators will affect like create ,delete.

The following entries are available:

' ': Create a new document item

I: Create a new document item

U: Change an existing document item

😧 Delete an existing document item

Are you passing data in both tables . SERVICELINES , SERVICELINESX .

Regards,

Madhu.

Edited by: madhurao123 on Sep 30, 2011 4:27 PM

Read only

0 Likes
1,935

Hi madhurao

Currently im using TCODE SE37 to test the BAPI_PR_CREATE

Im not sure where can I find those indicator.

and Yes, im passing data in both tables . SERVICELINES , SERVICELINESX.

I have done the same thing for SERVICELIMIT and SERVICELIMITX. It was successfully update when i check in the ME53N.

The only problem is the SERVICELINES. It cannot change any value in the service tab in ME53N.

Have u encountered this problem?

Regards,

Songo

Read only

0 Likes
1,935

Hi Songo,

I am using ecc and in my system there is no SERVICELINES in table parameter. You just check the long message in SERVICELINESX.Here you can use that indicators what ever you want to change in that table.

Regards,

Madhu.

Read only

0 Likes
1,935

Hi

Below are the long text for the SERVICELINESX

Description

Change parameter for Enjoy purchase order change - item data

You can use this change parameter (for example, PrItemX) in the

following ways:

1. Initialization of fields

This can be achieved by leaving the field in the data structure

initial and populating the corresponding field of the change

parameter with an X.

2. Insertion of values via the interface

This can be achieved if the fields in both the data structure and

the corresponding change parameter are not initial.

3. Adoption of default values (for example, from Customizing or the

master data)

This can be achieved if both the fields from both the data structure

and the change structure are initial.

Value range

This is only an import parameter.

Only 'X' parameter are accepted in the SERVICELINEX and its indicate the item that we want to change right?

I have double checked the entries and its tele with the SERVICELINE.

im not sure whats the problem with this SERVICELINE table.

Read only

0 Likes
1,935

Hi Songo,

Check these notes :499627,1312947 .

Regards,

Madhu.

Read only

madhu_vadlamani
Active Contributor
0 Likes
1,935

Hi Songo,

Is it resolved.

Regards,

Madhu.

Read only

0 Likes
1,935

I've found a thread discussing this matter

Im still searching on how to solve this matter.

but thanks alot for your info and help.

Currently your BAPI_PR_CHANGE doesn't have the SERVICELINES table right?

Do you have any customize solution on how can I create and change the PR with the servicelines?

Edited by: songoten86 on Oct 3, 2011 6:06 AM