How to update custom field of PRPS table

BAPI to update PRPSimage source: productivitypupil.com (modified)
Share on Facebook24Share on LinkedIn12Tweet about this on TwitterShare on Google+0
Please Share!!

Or How to update custom fields of CJ20N t-code?

At the outset, you might feel why is the need of this topic. It is such a common requirement where we need to update custom field of a screen (or table). There should be plenty of FMs and BAPis available to do this work.

In this post, we are talking about custom field in WBS screen (transaction CJ02 or CJ20N).

Recently, when I received this enhancement requirement to add two custom fields in CJ20N screen and then another conversion requirement to populate these custom fields using a batch program. I thought it would be a cake walk. Adding the custom field was easy. I enhanced structure CI_PRPS and SAP Project (t-code SMOD) CNEX0007 ‘PS customer specific fields WBS element’.

Enhance PRPS table

The enhanced project’s detail from t-code CMOD is below:

Bapi function module to update PRPS table

After implement this exit, you see a new tab Cust Enhancement in CJ20N with the custom fields.

User-defined fields are not displayed

In case, you do not see user defined fields in the screen, then you might be missing this step.

Use transaction SE51 to create the user-defined screen SAPLXCN1 0700 and develop the layout. In particular, you can get fields from the ABAP Dictionary (from the table PRPS):
Choose “Goto -> Dict./program fields”.
Maintain the table/field name PRPS and select the fields that are to be displayed on the screen.

Activate and you would see the custom fields.

For more details to implement project CNEX0007, refer SAP Note 522581 – User-defined fields are not displayed.

But my intention to write this post was not to show how to enhance WBS screen. This is well documented and easily available in internet. I wanted to show how to update these custom fields from custom program (batch conversion jobs). You can do the BDC and achieve the functionality, but we did not want to take the BDC route. We wanted to achieve it using standard FM or BAPI (preferably). I found the BAPI ‘BAPI_BUS2054_CHANGE_MULTI‘ which would do the job. But passing the correct parameters to the BAPI was tricky.

Also the internet is flooded with queries regarding how to make BAPI ‘BAPI_BUS2054_CHANGE_MULTI’ update the custom fields using EXTENSIONIN. But all are not answered clearly. Some even suggest to implement a BADI to make this BAPI work. Friends, if you want to just update the custom fields, you do not need to implement the BADI ‘BAPIEXT_BUS2054′ (Enhancement for BAPIs for BO WBSPI). You need the BADI for some other requirements.

Check some of the questions and answers from SCN and other sites.

Bapi function module to update PRPS table.
How to Update Multiple WBS elements. 
How can I pass extensionin for BAPI_BUS2054_CHANGE_MULTI to enhance. 
Bapi function module for updating data into PRPS table.

There is no clear answer/solution and working code provided in the communities (at least I did not find one).

Actual solution:
The tricky part was to pass the Key Field (WBS_ELEMENT) to the EXTENSIONIN structure which would make the custom field entries unique. Please read the BAPI documentation properly. 🙂

Now it looks so obvious. Is n’t it? Trust me, I wasted an evening to figure this out. Our goal at SAPYard is to help our readers know about such small tricks and not to reinvent the wheel.

Please find the working code below to update the custom fields in t-code CJ20N (CJ02) or PRPS table.

If you want to get such practical issues and resolutions straight to your inbox, please SUBSCRIBE. We respect your privacy and take protecting it seriously.

If you liked this post, please hit the share buttons.

Thank you very much for your time!!

Share on Facebook24Share on LinkedIn12Tweet about this on TwitterShare on Google+0
Please Share!!

About the Author

SAP Yard
SAP Yard
SAPYard is one stop page for all Technical Folks in SAP. You would find un-conventional explanations, tutorials, and tricks. Please like our Facebook Page and also join our LinkedIn Group.

7 Comments on "How to update custom field of PRPS table"

  1. Hello, you can help me, I currently have the following requirement, from the transaction CJ40 update the PRPS table the field PRPS-USR06, for when enter by the transaction CJ20N is reflected that value in the tab user fields.

  2. Good piece of knowledge and well documented. However like Ansumesh says this has been lying around in the SAP Help Documentation for many years. ABAP is one of the best documented Languages around and there is plenty and evolving. Hopefully it is to stay in the times of S/4 HANA.

  3. Thanks you so ku h for the information. Its very helpful and the only to.e have worked with sap projects system i just enhanced using smod, I didn’t know if this bapi. Many thanks to you.

  4. Good!!
    Referring to BAPI documentation for like this requirement is ultimate help and more than sufficient.

    Customer Enhancements of the BAPIs
    For the BAPIs used to create and change project definitions, WBS elements, networks, activities, and activity elements, you can automatically fill the fields of the tables PROJ, PRPS, AUFK, and AFVU that have been defined for customer enhancements in the standard system.

    For this purpose, help structures that contain the respective key fields, as well as the CI include of the table are supplied. The BAPIs contain the parameter ExtensionIN in which the enhancement fields can be entered and also provide BAdIs in which the entered values can be checked and, if required, processed further.

    CI Include Help Structure Key
    CI_PROJ BAPI_TE_PROJECT_DEFINITION PROJECT_DEFINITION
    CI_PRPS BAPI_TE_WBS_ELEMENT WBS_ELEMENT
    CI_AUFK BAPI_TE_NETWORK NETWORK
    CI_AFVU BAPI_TE_NETWORK_ACTIVITY NETWORK ACTIVITY
    CI_AFVU BAPI_TE_NETWORK_ACT_ELEMENT NETWORK ACTIVITY ELEMENT

    Procedure for Filling Standard Enhancements
    Before you call the BAPI for each object that is to be created or changed, for which you want to enter customer-specific table enhancement fields, add a data record to the container ExtensionIn:

    STRUCTURE: Name of the corresponding help structure
    VALUEPART1: Key of the object + start of the data part
    VALUEPART2-4: If required, the continuation of the data part
    VALUPART1 to VALUPART4 are therefore filled consecutively, first with the keys that identify the table rows and then with the values of the customer-specific fields. By structuring the container in this way, it is possible to transfer its content with one MOVE command to the structure of the BAPI table extension.

    Note that when objects are changed, all fields of the enhancements are overwritten (as opposed to the standard fields, where only those fields for which the respective update indicator is set are changed). Therefore, even if you only want to change one field, all the fields that you transfer in ExtensionIn must be filled.

    Checks and Further Processing
    Using the methods …CREATE_EXIT1 or. …CHANGE_EXIT1 of the BAdI BAPIEXT_BUS2001, BAPIEXT_BUS2002, and BAPIEXT_BUS2054, you can check the entered values (and/or carry out other checks).

    In the BAdI’s second method, you can program that the data transferred to the BAPI is processed further (if you only want to transfer the fields of the CI includes, no more action is required here).

    • Thanks Ansumesh.. True, we need to read the document carefully.

      Somehow I missed to read Key of object (VALUEPART1: Key of the object + start of the data part).. 🙂

      Regards,
      Team SAPYard.

Leave a comment

Your email address will not be published.


*