Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] retreive values from multiselect drop down list, hold in a temporary table

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] retreive values from multiselect drop down list, hold in a temporary table
 Login/Join
 
Member
posted
I am having a multiselect listbox named "listbox".
The list box holds the values as "DDD-CC-IIII". So if there are three items selected in listbox by user on submitting the form, i need to hold in a table like below.
Say Item1 in listbox->DDD-CC-III
Item2 in listbox->DDD-CC-III
Item3 in Listbox->DDD-CC-III

Now, I need an output like

Hold file or any other file/table such as
Columns DDD, CC, IIII containing values like
|DDD|CC|III
|DDD|CC|III
|DDD|CC|III

containing 3 rows and I need to use it for further processing.
To achieve this,
I am calling a fex file which in turn retrieve the selected values from the list box thro a repeat loop and assigning the splitted values to the dynamic variables set thro GETTOK function. Now, I am stuck with how to move this dynamic SET variables to TABLE/FILE/or a hold.

Please find below my code:

SQL SQLMSS PREPARE SQLOUT2 FOR
SELECT * FROM PMR_RPT_PMTN_ITEM_DISC
END


-TYPE &customselect6_selectto0
-REPEAT END_1 FOR &N FROM 1 TO &customselect6_selectto0 STEP 1
-TYPE &N
-SET &PARAM=&customselect6_selectto.&N;
-SET &PLEN=&PARAM.LENGTH;
-TYPE &PARAM
-SET &DEPT.&N=GETTOK(&PARAM, &PARAM.LENGTH,1,'-',&PARAM.LENGTH,'A&PARAM.LENGTH');
-SET &CLAS.&N=GETTOK(&PARAM, &PARAM.LENGTH,2,'-',&PARAM.LENGTH,'A&PARAM.LENGTH');
-SET &ITEM.&N=GETTOK(&PARAM, &PARAM.LENGTH,3,'-',&PARAM.LENGTH,'A&PARAM.LENGTH');
-TYPE DEPT:&DEPT.&N
-TYPE CLAS:&CLAS.&N
-TYPE ITEM:&ITEM.&N
-TYPE &PLEN

-END_1

this code will give the value of Dept1, dept2, dept3, class1, class2, class3 and so for item.

Please correct me if my approach is wrong. Please respond soon. Thanks for the big help!

Eeker

This message has been edited. Last edited by: <Kathryn Henning>,


Webfocus 7.6
Excel, HTML, PDF
 
Posts: 13 | Registered: May 23, 2013Report This Post
Member
posted Hide Post
Here is something to get you started:
  
FILEDEF MASTER DISK dataset.mas
-RUN

-WRITE MASTER FILE=DATASET, SUFFIX=FIX, $
-WRITE MASTER SEGNAME=DATASET, SEGTYPE=S0, $
-WRITE MASTER FIELDNAME=DEPT, ALIAS=DEPT, USAGE=A03, ACTUAL=A03, $
-WRITE MASTER FIELDNAME=CLASS, ALIAS=CLASS, USAGE=A02, ACTUAL=A02, $
-WRITE MASTER FIELDNAME=ITEM, ALIAS=ITEM, USAGE=A03, ACTUAL=A03, $

FILEDEF DATASET DISK dataset.txt
-RUN

-WRITE DATASET DDDCCIII
-WRITE DATASET DDDCCIII



When executing the -WRITE to the file DATASET simply create a loop that runs the number of entries/options the user selected.

Erfan


WebFOCUS 77, Windows, HTML PDF EXCEL
 
Posts: 11 | Registered: November 28, 2011Report This Post
Member
posted Hide Post
Will it be possible to have the sql query inside repeat loop?

Like Repeat
Set=Dynamic variable
**SQL QUERY where col_name="&_dynamic variable*
hold output in a temp file
END REPEAT


Webfocus 7.6
Excel, HTML, PDF
 
Posts: 13 | Registered: May 23, 2013Report This Post
Member
posted Hide Post
Thanks ebaig.. Can u please explain how this filedef is working?

This message has been edited. Last edited by: Sivakumaran Elangovan,


Webfocus 7.6
Excel, HTML, PDF
 
Posts: 13 | Registered: May 23, 2013Report This Post
Member
posted Hide Post
Thanks Ebaig.

Issue resolved with your help.Thanks a lot! Smiler


FILEDEF MASTER DISK dataset.mas
-RUN

-WRITE MASTER FILE=DATASET, SUFFIX=FIX, $
-WRITE MASTER SEGNAME=DATASET, SEGTYPE=S0, $
-WRITE MASTER FIELDNAME=DEPT, ALIAS=DEPT,USAGE=A50,ACTUAL=A50,$
-WRITE MASTER FIELDNAME=CLASS, ALIAS=CLASS,USAGE=A50,ACTUAL=A50,$
-WRITE MASTER FIELDNAME=ITEM, ALIAS=ITEM, USAGE=A50,ACTUAL=A50,$

FILEDEF DATASET DISK dataset.FTM (APPEND
-RUN


-REPEAT END_1 FOR &N FROM 1 TO &customselect6_selectto0 STEP 1
-SET &PARAM=&customselect6_selectto.&N;
-SET &PLEN=&PARAM.LENGTH;
-SET &DEPT.&N=GETTOK(&PARAM, &PARAM.LENGTH,1,'-',&PARAM.LENGTH,'A&PARAM.LENGTH');
-SET &CLAS.&N=GETTOK(&PARAM, &PARAM.LENGTH,2,'-',&PARAM.LENGTH,'A&PARAM.LENGTH');
-SET &ITEM.&N=GETTOK(&PARAM, &PARAM.LENGTH,3,'-',&PARAM.LENGTH,'A&PARAM.LENGTH');
-RUN
-WRITE DATASET &DEPT.&N &CLAS.&N &ITEM.&N
-RUN
-END_1

TABLE FILE DATASET
PRINT *
END


By this code above, I could able to get all the parameters that the user select in the UI and I could able to store them in the hold file. Thanks a lot!

This message has been edited. Last edited by: Sivakumaran Elangovan,


Webfocus 7.6
Excel, HTML, PDF
 
Posts: 13 | Registered: May 23, 2013Report This Post
Member
posted Hide Post
Ebaig, But I would like to know how this filedef works.. i wanna know in detail about the usage.

why we are giving two filedef's herE?

FILEDEF MASTER DISK dataset.mas
-RUN

-WRITE MASTER FILE=DATASET, SUFFIX=FIX, $
-WRITE MASTER SEGNAME=DATASET, SEGTYPE=S0, $
-WRITE MASTER FIELDNAME=DEPT, ALIAS=DEPT,USAGE=A50,ACTUAL=A50,$
-WRITE MASTER FIELDNAME=CLASS, ALIAS=CLASS,USAGE=A50,ACTUAL=A50,$
-WRITE MASTER FIELDNAME=ITEM, ALIAS=ITEM, USAGE=A50,ACTUAL=A50,$

FILEDEF DATASET DISK dataset.ftm (APPEND
-RUN

Can u pls elaborate from the above code?

How RUN Command works?


Webfocus 7.6
Excel, HTML, PDF
 
Posts: 13 | Registered: May 23, 2013Report This Post
Platinum Member
posted Hide Post
You'll find all yu need to know about FILEDEF in documentation. Alternatively go to the IBI tech support site and search on FILEDEF. You get several pages of hits.


WF 7.7.04, WF 8.0.7, Win7, Win8, Linux, UNIX, Excel, PDF
 
Posts: 175 | Location: Pomona, NY | Registered: August 06, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] retreive values from multiselect drop down list, hold in a temporary table

Copyright © 1996-2020 Information Builders