cancel
Showing results for 
Search instead for 
Did you mean: 

Incorporating F4 lookup ability on a web input field

Former Member
0 Kudos

We have web applications developed for a BW 3.1C SP18 system. I was wondering if the following request is possible or worth trying at all.

Our cockpits developed for a given area allow the users to pick various filter values from selection boxes (e.g. Division, Plant, etc.) and then we use JavaScript and the Web API to format command lines when they choose various menu reports. This works very well and allows them to make selections without having to fill in a variable screen every time.

However, there are some characteristics like Customer or Material which would contain far too many values to think about putting in a dropdown to choose from. I know the easiest thing to do is just have the user fill these on selected queries through a variable screen before the report comes up. But would it be possible to give the user a lookup (like the F4 on the variable screen) on an input field in an initial web page?

I tried some experimentation with this by placing an image beside the field that mimics the regular variable lookup. Then I was trying to pop-up a window that would give them the standard variable value selection -- passing in the CMD=PROCESS_VARIABLES, SUBCMD=VAR_VALUE_HELP, and hard-coding the variable name involved. This worked fine and allowed for selection of a specific value.

Where this breaks down is once they make the selection. It then takes over standard variable functionality by returning to the variable entry screen. I do not know how to capture the value they select & pass this back to the calling page.

Does anyone have any ideas on whether or not this is doable? I'm guessing SAP would not recommend trying to call some of this functionality in a way other than what it is used as standard. And there is not a web item in the Designer to create a basic input field off a query characteristic.

Any input would be appreciated. Thanks...

Jody Chassereau

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Repost to see if anyone has ideas... Thanks

Former Member
0 Kudos

Hi Joseph,

We are using F4 help in web input field. To pass the value back to the main screen populate the following in your second screen return function:

window.opener.document.form1.field1.value

Regards,

RB

Former Member
0 Kudos

RB,

Thanks for your reply -- that is encouraging to know that someone else is doing this. Unfortunately, I don't know that I fully understand your suggestion & was hoping to get a few more details if you don't mind. I thought it might help if I explained a little more too on what I was trying.

I was trying to emulate standard functionality in the variable entry screen by referencing some of the SAP statements that you would find in that source. On my web page, I added a form id="VARI" with an action="/sap/bw/BEx?SAP-LANGUAGE=E&CMD=PROCESS_VARIABLES&PAGENO=1&REQUEST_NO=0". I have a hidden input field "VAR_ID_1" with a value of the characteristic "ZPSCOCOD0001". Then another input field "VAR_VALUE_EXT_1" to allow input or selection of the value. Beside the input field, I placed an image linked to a JavaScript function. Within it is the following:

document.VARI.action=document.VARI.action"&SUBCMD=VAR_VALUE_HELP""&VAR_VALUE_EXT="f4"&INDEX="index"&VAR_VALUE_HELP_SET_LINE="index"&VAR_ID_"+index "="varid;

SAPBWWForm("VARI_F4","VARI",650,580);

So basically when they click this link, it will pop open a small window in which they can see the values available to select for 'PS Co. Code'. This would be identical to what you would normally see on an F4 lookup off a variable screen for this, complete with search capability. So at this point, it is doing what I wanted.

However from here is where I cannot figure out what to do. If you choose one of the values on this screen, it closes the pop-up list and clears my original screen with a standard-type variable entry screen for the query. The URL contains the following at the end of it: &REQUEST_NO=1&VAR_VALUE_EXT_1=02&F4CMD=FINISHED

I haven't figured out how to control what it is doing. The value does appear populated in the variable screen. If I then choose Execute, it refreshes my original page, but with no value returned where I need it. Ideally I really don't want to see that intermediate display at all.

I did some debugging and never see where window.opener gets any value assigned. Is the approach I described heading in the right direction? Or do you have a different way to get to the F4 list in your environment?

Thanks in advance for any advice... Jody

Former Member
0 Kudos

Hi Jody,

We opened another WAD to display the Value Help and this WAD is opened in the new window. When you select your value there from the selection list and press the return button then on that point we are passing value to above variable. It is a very easy method with some complex coding which I think is different from the one you are using.

Regards,

RB