Skip to Content
author's profile photo
Former Member

How do you call a business object method in an ABAP?

I have been asked to call a method that exists in BUS2080 called 'ServiceNotification.CreatesingleContainerDialog'. This is to do with service notifications.

Basically I need to be able to default in customer and contact information from an ABAP similar to what appears in IW51 after you have input notification type and defaulting in customer and contact information without filling in the mandatory fields as these will be filled in by the customer once the screen appears after the call.

Reason I am trying to use the method and not call transaction iw51 is that the users want the functionality similar to how they call IW51 from CIC0 where CRSN is the call for service notification which defaults in the customer and contact information leaving the required fields empty. When the customer goes in they see sold to party and contact persons information and can fill in the relevant fields. This call in CIC uses the method I have stated above. I have tried locating the class but to no avail.

Thanks

Larissa

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Feb 01, 2006 at 10:12 PM

    You can do it with Macro Instructions for Accessing Objects, Attributes and Methods

    here is an example code:

    REPORT  ZSWC.
    
    INCLUDE <CNTN01>.
    DATA: obj TYPE SWC_OBJECT.
    SWC_CONTAINER CONTAINER.
    
    SWC_CREATE_OBJECT obj 'BUS2080' ''.
    
    SWC_CREATE_CONTAINER CONTAINER.
    SWC_SET_ELEMENT CONTAINER 'NotificationType' 'S1'.
    
    SWC_CALL_METHOD obj 'CreatesingleContainerDialog' CONTAINER.

    More details on this macros at:

    http://help.sap.com/http://help.sap.com/saphelp_nw04/helpdata/en/c5/e4acef453d11d189430000e829fbbd/frameset.htm">http://help.sap.com/>

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 02, 2006 at 05:51 AM
    REPORT ZTEST_MSS.
    
    INCLUDE <CNTN01>.
    DATA: OBJ TYPE SWC_OBJECT.
    DATA: PO_ITEMS TYPE TABLE OF BAPIEKPOC.
    DATA: PURCHASEORDER	TYPE	BAPIEKKO-PO_NUMBER VALUE '4500000004'.
    
    SWC_CONTAINER CONTAINER.
    
    SWC_CREATE_OBJECT OBJ 'BUS2012' ''.
    
    SWC_CREATE_CONTAINER CONTAINER.
    
    SWC_SET_ELEMENT CONTAINER 'NotificationType' 'S1'.
    
    SWC_SET_ELEMENT CONTAINER 'PurchaseOrder' PURCHASEORDER.
    
    SWC_SET_TABLE CONTAINER 'PoItems' PO_ITEMS.
    
    
    SWC_CALL_METHOD OBJ 'GetItems' CONTAINER.
    
    SWC_GET_TABLE CONTAINER 'PoItems' PO_ITEMS.
    
    WRITE:/ 'Wait'.
    

    Message was edited by: Mandar Shete

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Feb 02, 2006 at 04:20 PM

    Thanks a lot for the suggestions. It worked a treat!

    Larissa

    Add comment
    10|10000 characters needed characters exceeded