on 08-19-2015 5:53 AM
Hi All,
I have a requirement for which I have to throw an error when the RFx is moved to Award phase.
I tried to do with the Document Lifecycle event option and target-> Pre Phase Change. But I was not able to retrieve the next phase name while doing the phase transition.
I have used other_phase variable to get the next phase.
I have used this check:
if (other_phase.equals("Award")){
throw error;
}
But the above code is not working as expected.
I came to know that this works only for Phase configurable business objects like projects and UDOs. So then I need to use Validation script to implement my requirements. But I am not sure how I can get the next phase in Validation script.
Kindly help me with this.
Thanks
Rahul
Hi Rahul,
You can do it with the Document Lifecycle event option and target Pre Phase Change.
Try changing the code to the following in the script :
if (other_phase.equals("Accepted")){
throw error;
}
I don't know why the award phase appears as "Accepted". You can check "printing" the other_phase variable in a log file with the following code in the same script:
import com.sap.odp.api.common.log.LogMessageIfc;
import com.sap.odp.api.common.log.Logger;
debug = true;
log = Logger.createLogMessage(session);
logInfo(message) {
if (debug) {
log.setLogMessage("Test "+ message);
Logger.info(log);
}
}
logInfo("Other Phase " + other_phase);
These log files can be viewed from the log viewer NW. You can find more details in the blog below
http://scn.sap.com/community/sourcing/blog/2011/11/28/viewing-the-logs-in-sap-sourcing-70-on-premise
Regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Michael,
That is actually very good information, that PrePhaseChange script triggers also for RFX. Previous info on SCN said otherwise.
I can explain why it is showing as "Accepted":
- the variables current_phase and other_phase refer to the "internal ID of current/target phase of document". In RFX this is an Enum, the string ID is highlighted below:
Regards,
Bogdan
Hi Michael,
I have used Document Lifecycle event option and target Pre Phase Change but still I am not able to get things done.
The other_phase variable is not working as expected. The value for other_phase variable is not changing when the phase is changed to Award phase. Kindly check this from your side.
Thanks
Rahul
Hello Rahul,
I think there are 2 options for this, but I am not sure which will be valid:
For option 2 you can try below code to see if it works:
import com.sap.eso.api.rfx.RfxSchedPhaseEnumType;
//
if(doc.getCurrentPhase().equals(new RfxSchedPhaseEnumType(6))) {
// throw error
}
Alternatively you will have to investigate the use of RfxDocEventHandler and RfxDocCallback.
Regards,
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.