I've defined the data source based on BEx query with Load in Script = 'False'. BEx query has 3 below variables for user input.
1. Plant - Mandatory
2. Calendar Week/Year - Optional
3. Fiscal Year/Period - Optional
I want to perform the validation to ensure that user has entered either Calendar Week or Fiscal period. If both are left blank then application should display popup and reopen the prompt dialog box. I tried below logic. It is giving me initial prompt screen and if Cal week and Fiscal period are left blank, it is throwing blank screen. Nothing happens. What am I doing wrong? I also tried BEx validation with I_STEP = 3, it is showing error at bottom with 'Ok' button disabled but error description mentioned in user exit code is not being displayed. I would ideally like to have Bex user exit approach to work. I believe we're not there yet. What is best way of handling prompt validation in design studio?
I created Button 'BTN_CHECK_VALIDATION' and added below code onClick. In Application startup, I call the script BTN_CHECK_VALIDATION.onClick();
BTN_CHECK_VALIDATION onClick event code;
G_ERROR = "";
G_CALWEEK = DS_SASUMMARY.getVariableValueExt("XVARPMCALWEEK");
G_FISCPER = DS_SASUMMARY.getVariableValueExt("XVARPSOSAFISCPER");
if ((G_CALWEEK == "") &&(G_FISCPER == "")) {
G_ERROR = "X";
G_MESSAGE = "Please Enter Either Calendar Week/Year of Fiscal Period/Year.";
}
if (G_ERROR == "X") {
TXT_WARN.setText(G_MESSAGE);
POP_CHECK.show();
APPLICATION.openPromptDialog(500, 500) ;
BTN_CHECK_VALIDATION.onClick();
}
Thanks,
Milind