cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to get Engineering Record Number that Corresponding to a Recipe?

Former Member
0 Likes
1,691

Hi All,


I need to get the Engineering record number that was corresponding to the recipe.


In a brief,I have the recipe details like recipe key,change number,primary specification of the recipe and using that I need to get the corresponding Engineering Record Number of the recipe.


Is there any table relation or Function Module or BAPI available to get the above detail?


Expecting your quick replies.


Thanks in advance.


Regards,

Mahendran

Accepted Solutions (1)

Accepted Solutions (1)

former_member188458
Active Participant
0 Likes

Hi Mahendran,

Could you please confirm on below :

1) Do you mean engineering Record in PLM WUI ?

2) If so , then is the Recipe linked as "Change Items" in the "Engineering Record"(ER) .

If the answers to above are yes , you can use the  below api :

     Class :  /PLMI/CL_ECR_BO

     Method :  GET_ECR_BY_CHANGE_ITEMS

          Pass below in Parameter : IT_GOS_DETAILS

               GOS_OTYPE :  PLM_RCP

               GOS_KEY    : <Key of Recipe >

  ( Please Confirm the exact object type used by checking the config for exact ER type by checking the change item object types configured for the ER type in SPRO path

Logistics General->PLM -> PLM Web UI -> Objects in PLM UI -> Engineering Record -> Make Settings for Engineering Record

Get the "Item Profile ID" for the given ER type and check the "Object types" configured  for the "Item Profile Id"  )

Regards,

Rini

Former Member
0 Likes

Dear Rini,

First of all ,thank you very much for your quick response.

I am confirming on the first two points and I am not able to retrieve the ECR Details using that methods.

I will explain below with more details.

As you know,in the Recipe Menu,under the 'you can also' button,we have an option "Display Engineering Record" ,to view the ECR details.After clicking that ,we have to manually enter the ECR ID ,then it will navigate to ECR details.

My Requirement is to automatically get the ECR number corresponding to the recipe and navigate to that, by skipping initial display engineering record screen.

In order to achieve this functionality,I have done an enhancement in the post exit of method PROCESS_EVENT in COMPONENT CONTROLLER of the Webdynpro Component /PLMU/WDC_RCP. Here,I am able to set the parameter ECR_ID to call the engineering record.

Inside this method,I am passing the parameters to the method GET_ECR_BY_CHANGE_ITEMS,to get the ECR Number.But I am getting the Export table as initial only.

Is my approach correct or else missing something?

Regards,

Mahendran

former_member188458
Active Participant
0 Likes

hi Mahendran ,

Could you please send a snapshot of where do you see the recipe in Engineering Record .

I would be then better able to provide with the exact method .

Regarding the approach , usually enhancing the Standard component controller is not a recommended approach . Probably you can use the /PLMU/EX_FRW_CONSUMER_APPCC BADI to overwrite the process event .for the event Id raised .

However lets first fetch the Engineering Record Id , and then we can discuss on the above approach . So Please attach the screenhot .

Regards,

Rini

Former Member
0 Likes

Dear Rini,

As you asked ,below is the screen shot where the recipe in engineering record.

Regards,

Mahendran

former_member188458
Active Participant
0 Likes

Hi Mahendran,

1) The method GET_ECR_BY_CHANGE_ITEMS is good to fetch the ECR in your case

Please ensure to pass the correct value in GOS_KEY , as I see in the standard object type , PLM_RCP for Recipe , the object key is structure -  /PLMI/S_ECR_RCP_ID.

You need to follow the below steps basically if you are using std object type PLM_RCP :

a) Get the value for the fields in a structure ls_ecr_rcp_id (type /PLMI/S_ECR_RCP_ID) from the recipe

b) Call the    /PLMI/CL_ECR_SERVICES , method KEY_TO_INTERN_ITM

       IS_KEY = ls_ecr_rcp_id

c) Pass the key value (EV_INTERNAL_KEY) returned in step 2 to

     Class :  /PLMI/CL_ECR_BO

     Method :  GET_ECR_BY_CHANGE_ITEMS

          Pass below in Parameter : IT_GOS_DETAILS

               GOS_OTYPE :  PLM_RCP

               GOS_KEY    : EV_INTERNAL_KEY

Check what do you get in ET_MESSAGES returned by the above method , just to ensure you have authorizations to fetch the data or else it will not return any result .

Note : In case you have any issues in getting the key , you can put a debug point while opening an ECR , in class /PLMI/CL_ECR_CHGITM_FED_ON ( If this is the feeder class for object type PLM_RCP  , as mentioned in the spro mentioned in my previous reply) , method /PLMI/IF_ECR_CHG_ITM~GET_OBJECT_ATTRIB , checj parameter IT_INTERNAL_KEY_INTID , field INTERNAL_KEY .

2)  Second thing is as you mentioned currently user is entering the ECR id manually . So where does he get the know the value from . Is it somewhere in the Recipe also ? If so , then it would make your task very simple

Hope it resolves your issue . In case of any issues still , Please do let me know .

Best Regards,

Rini

Former Member
0 Likes

Dear Rini,

Now I am able to retrieve the ECR ID using the steps you mentioned and Thank you very much.

You told that enhancing the Standard component controller is not a recommended approach.

Can you please tell me the right approach to achieve this functionality.

Thanks in Advance.

Regards,

Mahendran

former_member188458
Active Participant
0 Likes

Super Mahendran. Glad to know your issue is resolved.

Regarding the approach instead of enhancing the webdynpro component , probably you can create an implementation for BADI //PLMU/FRW_CONSUMER_APPCC ( If I can recollect the name correctly , else do an F4 with /PLMu/*APPCC*) .

In their you will find a method PROCESS_EVENT ; you can put your code there , by keeping your code there and skip the sap standard method run by passing CV_SKIP_STANDARD = 'X' .

Please let me know if you need any other pointers.

Regards,

Rini

P.S: Please mark the previous answer as correct/helpful .

Answers (0)