cancel
Showing results for 
Search instead for 
Did you mean: 

Rejection reasons pop-up - Urgent help please .

Former Member
0 Kudos

Hello ,

I need your help to replace the popup in code below instead i want to use the user decision reject option/button , and how can get the text in the popup

to show it in the mail that will be sent to the initiator  :

Ive added the code using a method in my BO the popup is showing with text box ..

---------------------------------------------------------------------------------------------------------------------------------------------------------

Select Dialog, Synchronous, Result Paraments

In tab Result type: table SWF_IFAPPR and field: SWF_APPRES

DATA: L_ANSWER LIKE SY-INPUT.

  DATA: APPROVE LIKE SWF_IFAPPR-SWF_APPRES.

data : text type CATSXT_LONGTEXT_ITAB ,
         title type SYTITLE ,
  l_text(72) .
  data : v_text(1000) .

CALL FUNCTION 'POPUP_TO_DECIDE'
        EXPORTING
  TEXTLINE1     = 'Notification Approval?'(001)
  TEXT_OPTION1  = 'Approved'(002)
  TEXT_OPTION2  = 'Rejected'(003)
  TITEL         = 'Please provide your Comments also'(004)
          IMPORTING
  ANSWER        = L_ANSWER
          EXCEPTIONS
  OTHERS        = 1.


     CASE L_ANSWER.
       WHEN '1'.
         APPROVE = 0.

          WHEN '2'.
  APPROVE = 4.

      title = 'Reason for Rejection' .

      CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDITOR'
         EXPORTING
  IM_TITLE = title
  IM_START_COLUMN       = 20

IM_START_ROW          = 20
          CHANGING
            CH_TEXT = text .

       if text is not initial.
        rej1text = text.
        endif.


         WHEN 'A'.
  EXIT_CANCELLED.
        ENDCASE.


   * set result parameter
      SWC_SET_ELEMENT CONTAINER RESULT APPROVE.

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member389853
Participant
0 Kudos

Hi,

I have the same requirement.

Am getting the pop-up to give the rejection reason.

But, When
the “cancel” icon is selected, with or without text, the user should be returned
to the workflow task. 

How can i do this.

Am using  FM 'CATSXT_SIMPLE_TEXT_EDITOR'.

Please advice.

Former Member
0 Kudos

ITS WORKING   

OMG  T_T  finally

Thank you all for your help 

Former Member
0 Kudos

Thanks the lot...

Finally got it...

Former Member
0 Kudos

can you send me your logic pls

i think i need to use both

SWC_SET_TABLE and SWC_GET_TABLE

Former Member
0 Kudos

Please refer before posting i mentioned my coding...

Former Member
0 Kudos

im using the same code same every thing .. i tested in the BO i run the method once i change the code

SWC_SET_TABLE  CONTAINER  to    SWC_SET_TABLE RESULT

i get the values but with container nothing ...

Former Member
0 Kudos

Where u r getting values ?

SWC_SET_TABLE CONTAINER 'CONTAINER_VARIABLE' FUNTIONMODULE_OUTPUT_VARIABLE

Former Member
0 Kudos

The value is populated in CONTAINER[]  while debugging throw BO ..


Former Member
0 Kudos

thanks all foe your help ... and sorry again for any inconvenience

this the code in method :


data : text1 type CATSXT_LONGTEXT_ITAB  ,

        title type SYTITLE ,

        text type Catsxt-1st_ltext_line

data wa_text like line of text1 .

    Title = 'Reason for Rejection' .

      CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDI

       EXPORTING

         IM_TITLE              = title

        IM_START_COLUMN       = 20

        IM_START_ROW          = 20

        CHANGING

           CH_TEXT               = text1 .

read table text1 into wa_text index 1 .

move wa_text to text .

  SWC_GET_ELEMENT CONTAINER RESULT text .

END_METHOD.

in the WF the container (import multiline) :


the bindling in the activity step :

i get this dump :

What happened?

    Error in the ABAP Application Program

    The current ABAP program "CL_SWF_EXP_SERVICE============CP" had to be

     terminated because it has

    come across a statement that unfortunately cannot be executed.

Error analysis

    You attempted to assign a field to a typed field symbol,

    but the field does not have the required type.

Trigger Location of Runtime Error

    Program                                 CL_SWF_EXP_SERVICE============CP

    Include                                 CL_SWF_EXP_SERVICE============CM002

    Row                                     110

    Module type                             (METHOD)

    Module Name                             ELEMENT_GET_ATTRIBUTES


anjan_paul
Active Contributor
0 Kudos

Hi,

  In code you need to change this w

Instead of  SWC_GET_ELEMENT CONTAINER RESULT text

write SWC_SET_ELEMENT CONTAINER RESULT text.

(you need to use SWC_SET_ELEMENT not SWC_GET_ELEMENT)

Also share the source code where you are gettin dump

Former Member
0 Kudos

Hi,

If you are following my code logic.

create result parameter in methods as i mentioned declaration.

Once u mention this method inside the task do binding as following

Method ---> Task

Task ----> Workflow

Please refer my coding as mentioned before posting.

SWC_SET_TABLE will get the rejection text assign to the method variable.

Regards,

Ragav

Former Member
0 Kudos

i didnt get this part

Method ---> Task

Task ----> Workflow

Former Member
0 Kudos

Hi Nora,

I mean to say Binding.

Are u created Result parameter inside Method ?

Method Container ---> Task Container

Task Container----> Workflow Container

Regards,

Ragav

Former Member
0 Kudos

no ..

the only binding i did is in the task step in the WF as below screen shoot

&TEXT_EDIT& is the container name ...

Former Member
0 Kudos

Hi,

Create new parameter inside the Task 'Text_edit' declared same like Workflow container

Map(Do only this binding)

Workflow container        Task Container

&Text_edit&       <-----     &Text_edit&

Before that have u checked BO alone to get rejection reason ?

Regards,

Ragav

Former Member
0 Kudos

yea the table came back empty  my code

DATA : text type CATSXT_LONGTEXT_ITAB  ,

          title type SYTITLE , .

    Title = 'Reason for Rejection' .

      CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDITOR

       EXPORTING

          IM_TITLE              = title

          IM_START_COLUMN        = 20

          IM_START_ROW          = 20

        CHANGING

           CH_TEXT               = text .

  SWC_SET_TABLE CONTAINER 'text_edit' text .

END_METHOD.


Former Member
0 Kudos

Hi,

text type CATSXT_LONGTEXT_ITAB  occurs 0,

Inside method,

Define 'text'  field like tis

 

If you are not getting,Please debug and find.

Then check binding.

Finally reject one scenario then check the variable is updated or not using workflow log.

Thanks,

Ragav

bharat_rathod2
Active Participant
0 Kudos

dear,

I can't understand problem please explain me again.

Former Member
0 Kudos

i want the text box popup to show when the user clicks on

kindly refer to the code

and how can i get the text in popup

CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDITOR'
         EXPORTING
  IM_TITLE = title
  IM_START_COLUMN       = 20

IM_START_ROW          = 20
          CHANGING
            CH_TEXT = text .


bharat_rathod2
Active Participant
0 Kudos

I think you want pushbutton insted of text editor after select rejected wirte?

Former Member
0 Kudos

i need the text box to show or popup after the user selects Reject so he can write down his rejection reasons and save it ,  then the initiator can review the reasons either throw a push button or text included in mail .. the client dosnt want to use the attachment / create stander button  .

bharat_rathod2
Active Participant
0 Kudos

Dear,

your first code is working fine.

means when i execute then it give me popup with three button and when i press rejected one text editor is open where I can write reason.

Former Member
0 Kudos

i dont want the popup with three buttons is it possible show the text box after clickin the stranded button in screen shot above ,  .

how can i get the entered text from the method to pass it to WF mail ?

keohanster
Active Contributor
0 Kudos

Hi Nora,

Easiest question first, to get the text back into  your WF, create a container element in the workflow (let's call it Rejection_Text) and in the decision task (I use a multiline element based on a data dictionary type).  In your  task, this element should be marked as 'Export' and 'Multiline' (make it an export parameter)  After you collect the text, in your business object method, use the macro SWC_SET_TABLE container 'Rejection_Text' your-text-table-name.

In the binding from the task to the workflow, bind Rejection_Text from the task back into the Workflow (you will need to create a similar container element in the workflow container).

Then the rejection text is available for you to pass into subsequent tasks.

As to the other question, I am not sure what you are trying to do.  To me, this seems simple.  You give the user a decision, with three options,  They need to make a choice.  If they choose 'Reject', then you give them the pop-up to enter the reason for the rejection.    This is pretty standard stuff.  What is different about your scenario?


Good luck,

Sue

Former Member
0 Kudos

thanks sue ,

What i want to do is show the user the text editor after clicking the Reject button ,

instead of popup in the above code :

and how can i get the enterd text in

text editor


keohanster
Active Contributor
0 Kudos

Hi Nora,

OK, in the code you provided above, you have extra code to to a pop-up to decide.  This is redundant with the actual workflow task. 

When the user decides to Reject, add a task in the 'Rejected' path following your decision task, which will be a dialog task to capture the reason for rejection. In this task (perhaps the method could be named Get_Rejection_Reason) you can call a screen, and on user-command

call method editor->get_text_as_r3table

importing rejection_text

exceptions

others = 1.

Note, this code is not copied directly from any of my systems as I am prohibited from doing that, but you should be able to handle it. 


Good luck!
Sue

Former Member
0 Kudos

Sue thanks allot for your help

this my first WF ...

i cant use the method you mentioned above cus im using the FM 'CATSXT_SIMPLE_TEXT_EDITOR'   the text is already passed in the FM so im thinkin to use the macro : SWC_SET_ELEMENT after passing the text to WA pls correct me if im wrong .

Thanks

keohanster
Active Contributor
0 Kudos

Hi Nora,

You need to cut out the code:

CALL FUNCTION 'POPUP_TO_DECIDE'
        EXPORTING
  TEXTLINE1     = 'Notification Approval?'(001)
  TEXT_OPTION1  = 'Approved'(002)
  TEXT_OPTION2  = 'Rejected'(003)
  TITEL         = 'Please provide your Comments also'(004)
          IMPORTING
  ANSWER        = L_ANSWER
          EXCEPTIONS
  OTHERS        = 1.


     CASE L_ANSWER.
       WHEN '1'.
         APPROVE = 0.

          WHEN '2'.
  APPROVE = 4.

      title = 'Reason for Rejection' .

I am hoping this code is all in a custom function so that you can test it from SE37.

Good luck,Sue

Former Member
0 Kudos

i think i confused you my dear ...

ive already removed the popup part & every thing is working as needed  ive added activity step in the reject path , my question was how can i get the entered text from the text editor

the methoed below will not work :

call method editor->get_text_as_r3table

   importing rejection_text

exceptions

   others = 1.

this is the code ive added in my method  plus binding is active for the container in my WF

  SWC_GET_ELEMENT CONTAINER 'text_edit' l_text.

and I inserted the expression as below :


Dear &WF_INITIATOR& ,

Your Supervisor rejected your maintenance order No . &NEW_ORDER.NUMBER& , for rejection reasons ( &TEXT_EDIT& ) .

to get the text but it not working !!

Former Member
0 Kudos

Hi,

Please add the following code in u  r method of the Business object.

DATA:

       YREASON TYPE CATSXT-1ST_LTEXT_LINE OCCURS 0.

CALL FUNCTION 'CATSXT_SIMPLE_TEXT_EDITOR'

   EXPORTING

     IM_TITLE              = 'Please enter Rejection reason'

*   IM_DISPLAY_MODE       = ' '

    IM_START_COLUMN       = 10

    IM_START_ROW          = 10

   CHANGING

     CH_TEXT               = yreason.

   SWC_SET_TABLE CONTAINER 'Yreason' YREASON.

End of this map this Container field 'YREASON' inside workflow.

create the task using this method.Call this task once u r application get rejected form the approver..Created  Task should be me is 'Adavanced in workflow'[Popup will Arise once get rejected]

Regards,

Ragav

Former Member
0 Kudos

this is what i did n its working fine but when i insert the expression from the container the mail comes out empty without any reasons .. maybe is binding issue ?

this is the binding in the activity step noting for the text container  :

the binding for the mail step which contines the text_edit continer element :

Former Member
0 Kudos

Dear Nora,

Check Text_edit declaration part.

U need to declare export and multi line element.Before that do one thing Check method individually by executing the BO.

If method individually working fine means,Problem with the binding only.

All text_edit variable should be declared same.

Please check in workflow variable declaration for Text_edit.

Check workflow log variable is updating or not.

Thanks,

Ragav

Former Member
0 Kudos

the parameter type in method is

l_text(72) type c .

in the continer

ABAP Dict. Data type : CHAR72 .

also pls do you hve any idea how can i restrict the order not to be released at all cus ive added an activity to release the order after manger approval .

anjan_paul
Active Contributor
0 Kudos

HI,

   I am seeing this at the time of retrun Binding (Binding Wrokflow <- Step for the rejection reason ) no line is there. There should be binding which will retrun Rejection Text to workflow container

Former Member
0 Kudos

Hi Nora,

Please check multiline.Rejection reason more than one line.

Use like this.In all declaration part(Task method and workflow container)

Approver releasing the order in transaction or user decision ?

Normally If PO release strategy config, after all release from all approvers then only PO get release.(Default behaviour)

Regards,

Ragav