cancel
Showing results for 
Search instead for 
Did you mean: 

screen personas VA01 hide sales tab

0 Kudos

Hi,

In VA01, I have merged required fields onto item overview tab and have hidden all other tabs including the sales tab. I understand that because the sales tab is the default tab, it is being displayed even though I have hidden it.

After entering mandatory fields (ship to etc), when I click enter, the sales tab disappears.

My requirement is to view only item overview tab

To hide sales tab, I have created a script as below and assigned it to screen event 'onload'.

However this has not worked. Could you please advise if my script is incorrect, or if I need to do something else.

if (session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW").selectedTab.id === "wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\\01") {
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\\02").select();
}

Thanks in advance for your help,

Robyn

Accepted Solutions (1)

Accepted Solutions (1)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert

In case of VA01, the problem is that you have required fields, and as soon as your script tries to switch the tab, the required field check kicks in which will interrupt the script execution, resulting in an error message "Please enter sold-to party" or something like that.

So, to get around this issue, you will have to add some additional steps. Before the tab switching, fill any required fields with a value that's accepted. Let's assume that the sold-to and ship-to party "1" do exist. Depending on your system configuration, there may be some additional required fields - for instance, it's pretty common that the PO Number field is also required.

In this situation, your script has to populate the required fields first, do the tab switching for the hiding action to take effect, then remove the temporary values from the required fields. You may want to set the focus to the desired input field once the script ran. This would look like:

session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4021/subPART-SUB:SAPMV45A:4701/ctxtKUAGV-KUNNR").text = "1";
session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4021/subPART-SUB:SAPMV45A:4701/ctxtKUWEV-KUNNR").text = "1";
session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4021/txtVBKD-BSTKD").text = "whatever";


if (session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW").selectedTab.id === "wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\\01") {    
	session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\\02").select(); 
}

session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4021/subPART-SUB:SAPMV45A:4701/ctxtKUAGV-KUNNR").text = "";
session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4021/subPART-SUB:SAPMV45A:4701/ctxtKUWEV-KUNNR").text = "";
session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4021/txtVBKD-BSTKD").text = "";
session.findById("wnd[0]/usr/subSUBSCREEN_HEADER:SAPMV45A:4021/subPART-SUB:SAPMV45A:4701/ctxtKUAGV-KUNNR").setFocus();
DouglasCezar
Contributor
0 Kudos

Excellent approach, thank you Tamas!

Answers (0)