Skip to Content
avatar image
Former Member

Read Inactive Entity Data of Change Request in USMD_RULE_SERVICE~CHECK_ENTITY

Hi,

We want to read inactive entity data specific to a CR in USMD_RULE_SERVICE~CHECK_ENTITY and We have a parallel processing scenario as such:

There is a CR(#1) in progress for a Supplier BP, Purchasing Org and Company Code is extended in the CR but not yet activated. A new CR(#2) is created for the same BP and new purchasing org and company code is extended.

We use IF_USMD_MODEL_EXT~READ_CHAR_VALUE to read inactive data with readmode=gc_readmode_no_act(4) by specifying BP ID and CR number in IT_SEL. Although CR(#2) number is specified, the value returned are all the inactive data for the BP, instead of specific CR.

According to API guide https://www.sap.com/documents/2015/07/666e4158-5b7c-0010-82c7-eda71af511fa.html, usage of API is forbidden in Rule Service BAdI. However, we have tried to use IF_USMD_CONV_SOM_GOV_API~GET_CREQUEST_DATA, it did return the inactive data specific to the CR but it causes other issues related to entity mandatory check errors.

Any pointers how we can read inactive entity data specific to CR in Rule Service BAdI?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 05 at 07:19 AM

    Hi all,

    What I have done to resolve the issue of reading inactive entity data in Rule Service BAdI is by reading the Active data (readmode = no_inact) and Default data (readmode = default) first, and then filter off the active data from the default data, the remaining ones will be the inactive data specific to the CR.

    Basically, by passing BP number and CR number into IT_SEL, active data will always be the one activated for the BP and appear in the parallel CRs, and for default data, it will return what is shown in the CR screen, which means active data for the BP and inactive data of current CR.

    If anyone has the same requirement and different resolution, please feel free to drop a comment. Till then, we will leave this as our primitive solution.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 02 at 06:52 AM

    Hi Sharon,

    Just pass key fields in it_sel.no need to add change request number as this method will get current CR object at run time. Get changes method should not be used as it is used by SAP in other classes and for someother purposes.This method will Reset Buffer as a result backend check wont be performed if you use.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi, do you mean pass bp number to it_sel? For example, during entity check triggered for entity BP_HEADER, if_usmd_model_ext will return all purorgs including other cr when passing in bp_header/bp id into it_sel. I think Sharon only interested to get the purorg belong to the current process cr only. You may share some sample code on how to achieve this if possible. Appreciate your reply on this.

  • avatar image
    Former Member
    Feb 05 at 01:45 AM

    Hi Loga,

    I did tried to pass in the BP number if that is the key field that you mean, is there any other key fields required to read inactive entity data, e.g. purchasing org and company code?. By only passing in BP number into IT_SEL, without passing in the CR number, it would return data from all CRs pertaining to this BP as mentioned by Ching Hong.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 05 at 06:07 AM

    Hi Sharon,

    You have chosen correct method.All you need is to pass key values in it_sel.To read complete po pass Bp Id and multiple assignment id.To read exact po ,pass Bp Id ,assignment id ,po number.If you still not sure ,put breakpoint in the po feeder class getdata method and check data and key fields coming in.

    Thanks and Regards,

    Logan.D

    Add comment
    10|10000 characters needed characters exceeded