on 09-08-2012 11:02 AM
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ITS WORKING
OMG T_T finally
Thank you all for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you send me your logic pls
i think i need to use both
SWC_SET_TABLE and SWC_GET_TABLE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
dear,
I can't understand problem please explain me again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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 !!
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
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 :
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
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
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.