Skip to Content
author's profile photo Former Member
Former Member

Methods inside object types WORKFLOW

Hi workflow gurus

I am trying to implement my own method in a subtyped object type, my requirement is that

if a particular condition is true then a particular outcome should be active.

For example

begin_method mymethod changing container.

select * from xxx where fff = ccc.

case xxx-ggg.

when 'aaa'.

//I want the corresponding outcome to be active

when 'bbb'.

//I want the corresponding outcome to be active

endcase.

end_method.

these outcome should show up in my workflow step.

Can any of the gurus help me out on this.

Regards

Narendiran Rathinavelu

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2006 at 04:52 PM

    Hi,

    I am giving you sample code with which your issue will be resolved. in case if you have any problem please ask.

    CALL FUNCTION 'Y_WF_PREQ_AUTO_PO_CHG_POSSIBLE'

    EXPORTING P_BANFN = OBJECT-KEY-PURCHASEREQUISITION

    P_EKGRP = OBJECT-KEY-PURCHASINGGROUP

    TABLES T_EBAN_REDUC = T_EBAN_REDUC

    T_EKPO_REDUC = T_EKPO_REDUC

    T_COMPARISON = T_COMPARISON

    T_DIFFERENCE = T_DIFFERENCE

    T_MESSAGES_TEXT = T_MESSAGES

    T_ENDORSER = T_ENDORSER

    EXCEPTIONS PURCHASE_REQ_FIELD_EMPTY = 1

    NO_PURCHASE_REQ_DATA_FOUND = 2

    NO_PURCHASE_ORDER_DATA_FOUND = 3

    FUNCTION_PROBLEM = 4

    CURRENCY_CONVERSION_FAILED = 5

    NO_ENTRY_IN_T024 = 6

    NO_VALID_BUYER_FOUND = 7

    QTY_UNIT_CONVERSION_FAILED = 8

    NOT_ALL_ITEMS_APPROVED = 9

    ALL_CHANGED_REQ_ITEMS_DELETED = 10

    SEVERAL_PO_ITEMS = 11.

    IF SY_SUBRC <> 0.

    CASE SY_SUBRC.

    WHEN 1.

    EXIT_RETURN 9001 W_SY-MSGV1 W_SY-MSGV2 W_SY-MSGV3 W_SY-MSGV4.

    WHEN 2.

    EXIT_RETURN 9002 W_SY-MSGV1 W_SY-MSGV2 W_SY-MSGV3 W_SY-MSGV4.

    WHEN 3.

    EXIT_RETURN 9003 W_SY-MSGV1 W_SY-MSGV2 W_SY-MSGV3 W_SY-MSGV4.

    WHEN 4.

    EXIT_RETURN 9004 W_SY-MSGV1 W_SY-MSGV2 W_SY-MSGV3 W_SY-MSGV4.

    WHEN 5.

    EXIT_RETURN 9005 W_SY-MSGV1 W_SY-MSGV2 W_SY-MSGV3 W_SY-MSGV4.

    WHEN 6.

    EXIT_RETURN 9006 W_SY-MSGV1 W_SY-MSGV2 W_SY-MSGV3 W_SY-MSGV4.

    WHEN 7.

    EXIT_RETURN 9007 W_SY-MSGV1 W_SY-MSGV2 W_SY-MSGV3 W_SY-MSGV4.

    WHEN 8.

    EXIT_RETURN 9008 W_SY-MSGV1 W_SY-MSGV2 W_SY-MSGV3 W_SY-MSGV4.

    WHEN 9.

    EXIT_RETURN 9009 W_SY-MSGV1 W_SY-MSGV2 W_SY-MSGV3 W_SY-MSGV4.

    Also at Object's Method level you have to define the exceptions which the method can throw.

    now when you select the method in your task level, then exceptions defined at this method level will be shown at Task level.

    Thanks,

    sksingh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.