cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding- Badi for Copy Controls for Copying Standard Fields

former_member196521
Active Participant
0 Kudos

Hello All,

I have a scenario where a spare part service order gets saved in the system and closed, a follow up document called service quote is given to the customer, the service order number does get copied to the reference field(shown below in my second screen shot), however since the reference field is not present on the SAP ECC side as a field in the quote, we need to copy this no in the external reference field of the quote, please advice which BADI should I use to trigger the requirement

Attaching the screen shot of the service order

Now I am creating the quote as the follow up to the service order, since the reference field is not present in sap ecc, we need the service order number to get copied to the external reference no, please advice which badi we need to use, as per my technical team the badi crm_copy_badi is only used to copy z or customized fields.

Kind Regards

Atul

Accepted Solutions (1)

Accepted Solutions (1)

former_member186543
Active Contributor
0 Kudos

Hi Atul,

The methods in copy control badi : CRM_COPY_BADI are called if the data for that object is present, hence it's always a tricky situation. So for example if there is no SALES Set data in the previous transaction then the method SALES of this BADI won't be called.

So I advise you not to use this BADI. Instead you can use the CRM Events framework in tcode : CRMV_EVENT.

Create a new entry in

ORDERADM_H     AFTER_CREATE_WITH_REFERENCE     Z_FM

In this Z_FM , you can code to copy the number of previous transaction by using the method CRM_SALES_MAINTAIN_OW.

Also just for the knowledge part, CRM_COPY_BADI can be used to copy standard fields too

/Hasan

former_member196521
Active Participant
0 Kudos

Hi Hasan,

Thanks for the prompt reply, yes we did use the CRM Events framework CRMV_EVENT as per your post above and the same worked.

Thanks again for all your help.

Kind Regards

Atul

former_member186543
Active Contributor
0 Kudos

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Atul,

If I am not mistaking you are using an ERP Quotation, then I don't think CRM_COPY_BADI can be used and you will need to use the Lord APIs.

Regards,

Benoît

Former Member
0 Kudos

Hi Atul,

To copy that reference field from your spare part service order to follow up transaction then you have to write the coding in CRM_COPY_BADI as your team suggested.

Check which copying routine is used for your transaction in Define Copying Control for Transaction Types then go to that implementation in that BADI and place your code for that.

Thanks & Regards,

Rajya lakshmi CH


former_member196521
Active Participant
0 Kudos

Hi Rajya,

Thanks for the reply, I checked with my technical team, as per the technical consultant the above mentioned BADI is also used to copy Z Fields, can you please advice if the same BADI is also used to copy standard fields as well.

Kind Regards

Atul

Hi Benoit,

The quote is created in SAP CRM and would be replicated to SAP ECC, however the quote would be created as a follow up document to the service order in sap crm.

Kind Regards

Atul

Former Member
0 Kudos

Hi Atul,

Yes this BADI is also used to copy the Standard fields as well as zfields.

Just check the field you want to copy is in which BOL Object like BTAdminH like that and go to the corresponding method in that Copying routine Implementation and Place Your Code.

Also Check the methods importing parameters where you can get the field value from preceeding document and based on that you can keep your code. Just debug then you can understand what happening.

Thanks & Regards,

Rajya Lakshmi CH.