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

Agent Determination for Service Entry

Hi Guys,

I created a workflow based on BO BUS2901 to send approval notification to an approver and I am having an issue with the agent determination. I am using the cost centre owner from the PR associated with the PO for the service entry as the approver.

I am using the following code in the FM of the rule I created for determining the agent:

*"*"Local Interface:

  INCLUDE <cntain>.

  TABLES: eban, essr_rel, essr, ekpo, ebkn, csks.

  DATA: object TYPE swc_object.

  DATA: BEGIN OF essrkey,
           lblni LIKE essr-lblni,
           ebeln LIKE essr-ebeln,
        END OF essrkey.
  DATA: verak_user TYPE csks-verak_user, kostl TYPE ebkn-kostl.

  REFRESH actor_tab.
  CLEAR actor_tab.

  swc_get_element ac_container 'ServiceEntry' object.

  IF sy-subrc EQ space.

    essrkey-lblni = object-objkey(10).
    essrkey-ebeln = object-objkey+10(10).

      select * from ekpo where ebeln = essrkey-ebeln.
        select single * from ebkn where banfn = ekpo-banfn.
          kostl = ebkn-kostl.

    select * from csks where kostl = kostl.
      verak_user = csks-verak_user.
    actor_tab-otype = 'US'.
    actor_tab-objid = verak_user.
    APPEND actor_tab.



When I debug, sy-subrc = 8 at swc_get_element ac_container 'ServiceEntry' object.

What could be the problem?



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Aug 15, 2011 at 04:37 PM

    Hi Darlington,

    You need to fill in the AC_CONTAINER structure with the value of your Service Entry sheet key. Do this in the FM test bed, and to save yourself pain in the future, save the test data. You will need to enter the element name (exactly as defined), the Tab_In (sequential index, so a 000001 should suffice) and the Element Length, as well as the element value (your 20 char Service Entry sheet number).

    Hope this helps,


    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Sarvesh, T

      This thread was already answered some time ago. Please open a new Discussion marked as a question. If the thread you originally posted to has material related to your question, include a link. Your content is attached below to make it easy for you to simply paste it into the new Discussion. It is recommended to read the Rules of Engagement and other documents in the Getting Started link at the top right. If you have any questions, feel free to respond to this DM (Direct Message) and I will be happy to try to assist.


      Jocelyn (SCN moderator)

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.