Skip to Content
0
Former Member
May 05, 2010 at 12:47 PM

Release Edit lock in Display Mode for ESS Personal Info Address WD screen

73 Views

Hi, expert.

-


I have a requirement to create a Display Roadmap for the ESS Personal Info - US Address screen. Basically, I need to customize the standard US Address screen to have both Edit roadmap (out of the box) and Display roadmap (new requirement).

-


What I ahve done is:

1) In the BizCard view (Overview perspective), I have added a new "Display" button.

2) I have added a new logic to gray out (set to Read Only) for all fields in the DetailView when user click on "Display" button.

3) I have grayed out the "Review" button in DetailView when teh user click on the "Display" button in Overview screen.

-


The above logic mean the requirement in a short delivery time.

-


During the unit testing, I have discovered that this "Display Rpadmap" solution will actually place a "lock" on US Address infotype, and user will not able to Edit from another session or through ECC backend.

-


I am trying to trace the codes to see how can I control to release or avoid the "lock" of the US Address infotype.

Line: -


Here are few method in Wed Dynpro components I tried to analyze, but I still cannot find the exact codes who send the lock parameter to ECC backend.

Line: -


I am guessing the method "setModeEdit" in FPM has something to do with the lock, since it is about setting the Edit Mode. What if I create a new "setModeRead" method, and set the mode ="R" (Read Only)?

Line: -


Please kindly advise how and where do I control the lock info in Web Dynpro frontend.

Line: -


public void setModeEdit( java.lang.String subtype )

{

//@@begin setModeEdit()

wdContext.currentTextElement().setConfirmationMessage(wdThis.wdGetAPI().getTextAccessor().getText("EditConfirmation", new Object[] { infotypeName }));

wdContext.currentTextElement().setReviewInstruction(wdThis.wdGetAPI().getTextAccessor().getText("EditReview", new Object[] ));

wdContext.currentTextElement().setReviewButton(wdThis.wdGetAPI().getTextAccessor().getText("EditButton", new Object[] ));

this.mode = "E";

setModeForSubtype(subtype, mode);

this.isDirty=true;

//@@end

}

-


BizCardsView

public void onActionEdit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, int index )

{

//@@begin onActionEdit(ServerEvent)

wdThis.wdGetVcPerAddressUSOverviewController().edit(index);

//@@end

}

VcPerAddressUSOverview

public void edit( int index )

{

//@@begin edit()

selectedRecord=index;

wdThis.wdGetFcPersInfoInterface().setSelectedRecord(index);

fpm.raiseEvent(IFPM.EVENT_EDIT, thisVAC);

//@@end

}

FPMComponent

public void raiseEvent(String eventName, VAC raisingVAC) {

EventData eventData = new EventData(EventData.TYPE_USER, eventName, raisingVAC, null);

doEventLoop(eventData, false, false);

}

public void setModeEdit( java.lang.String subtype )

{

//@@begin setModeEdit()

wdContext.currentTextElement().setConfirmationMessage(wdThis.wdGetAPI().getTextAccessor().getText("EditConfirmation", new Object[] { infotypeName }));

wdContext.currentTextElement().setReviewInstruction(wdThis.wdGetAPI().getTextAccessor().getText("EditReview", new Object[] ));

wdContext.currentTextElement().setReviewButton(wdThis.wdGetAPI().getTextAccessor().getText("EditButton", new Object[] ));

this.mode = "E";

setModeForSubtype(subtype, mode);

this.isDirty=true;

//@@end

}

FcPersInfo

private void setModeForSubtype(java.lang.String subtype, java.lang.String mode) {

String usecase = "B2"; //default to B2

String subtypeDebug = subtype;

for (int i = 0; i < wdContext.nodeSubtypes().size(); i++) {

ISubtypesElement subtypeElement = wdContext.nodeSubtypes().getSubtypesElementAt(i);

if (subtypeElement.getSubtype().equals(subtype)) {

usecase = subtypeElement.getCase();

defaultDate = subtypeElement.getDefault_Begda();

wdContext.nodeSubtypes().setLeadSelection(i);

break;

}

}

if (usecase.substring(0, 1).equals("A")) {

GregorianCalendar calendar_default = new GregorianCalendar();

GregorianCalendar calendar_today = getDateOfToday();

calendar_default.setTime(defaultDate);

if (calendar_default.after(calendar_today)) {

wdContext.currentFutureDateElement().setIsValidAsOfVisible(WDVisibility.VISIBLE);

wdContext.currentFutureDateElement().setIsRadiobuttonVisible(WDVisibility.NONE);

wdContext.nodeAs_of_radiobutton().getAs_of_radiobuttonElementAt(1).setIsBegdaVisible(WDVisibility.NONE);

} else {

wdContext.currentFutureDateElement().setIsValidAsOfVisible(WDVisibility.NONE);

wdContext.currentFutureDateElement().setIsRadiobuttonVisible(WDVisibility.VISIBLE);

wdContext.nodeAs_of_radiobutton().getAs_of_radiobuttonElementAt(1).setIsBegdaVisible(WDVisibility.VISIBLE);

if (calendar_default.equals(calendar_today)) {

wdContext.nodeAs_of_radiobutton().getAs_of_radiobuttonElementAt(1).setText(wdThis.wdGetAPI().getTextAccessor().getText(AS_OF_FUTURE_DAY));

} else { // default date in past

wdContext.nodeAs_of_radiobutton().getAs_of_radiobuttonElementAt(1).setText(wdThis.wdGetAPI().getTextAccessor().getText(AS_OF_DAY));

}

}

wdContext.currentFutureDateElement().setIsReviewDateVisible(WDVisibility.VISIBLE);

} else { // B use cases i.e B1, B2, B3

wdContext.currentFutureDateElement().setIsValidAsOfVisible(WDVisibility.NONE);

wdContext.currentFutureDateElement().setIsRadiobuttonVisible(WDVisibility.NONE);

wdContext.nodeAs_of_radiobutton().getAs_of_radiobuttonElementAt(1).setIsBegdaVisible(WDVisibility.NONE);

wdContext.currentFutureDateElement().setIsReviewDateVisible(WDVisibility.NONE);

}

// Turn off as-of-date radio for create time constraint 1 record

if (usecase.substring(1, 2).equals("1") && mode.equals("C")) {

wdContext.currentFutureDateElement().setIsRadiobuttonVisible(WDVisibility.NONE);

wdContext.currentFutureDateElement().setIsValidAsOfVisible(WDVisibility.NONE);

wdContext.nodeAs_of_radiobutton().getAs_of_radiobuttonElementAt(1).setIsBegdaVisible(WDVisibility.NONE);

}

}