Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to call a method from class interface

Hi ,

I want to call a method from a 'class interface' in a BADI .

Class Interface -- /SAPSRM/CL_PDO_DO_BASE

Method -- /SAPSRM/IF_PDO_DO_PARTNER_BASE~UPDATE_ITEM_PARTNERS

Please let me know how can I call this method in my BADI.

Thanks-

Former Member
Former Member replied

Hi Harmeet,

Follow these simple steps.

1. Create an instance of class interface /SAPSRM/CL_PDO_DO_BASE if method /SAPSRM/IF_PDO_DO_PARTNER_BASE~UPDATE_ITEM_PARTNERS is instance method and

call instance -> /SAPSRM/IF_PDO_DO_PARTNER_BASE~UPDATE_ITEM_PARTNERS

2.if method /SAPSRM/IF_PDO_DO_PARTNER_BASEUPDATE_ITEM_PARTNERS is static method ,call directly using class interface like /SAPSRM/CL_PDO_DO_BASE=> /SAPSRM/IF_PDO_DO_PARTNER_BASEUPDATE_ITEM_PARTNERS.

If you feel any dificulty in declaring instances and call methods,

Goto EDIT-> Pattern ->ABAP Object Patterns, Give class name , instance name and method, you got the required code.

Thanks,

Prasad.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question