get data selection

sviardot

sviardot

Reputable Poster
for free usage
 

Attachments

  • 146188-getselection.zip
    3.6 KB · Views: 1,439
Nice work. I would just add a couple of things:
1-Check for date type columns and format using the FormatDate api
2-You don't account for the comparisons: IN, BETWEEN, NOT IN, NOT BETWEEN
 
Thanks for sharing with the list!!

Apart from whatever Jeremy told still we need enhance the function reading multiple values from right operand in case of LIST of values/ RANGE of values given. For now it is reading only one value.
 
right
i have to work on this for now.
But not easyto find as there is no documentation on that in JDE.
 
Can't uncompress using winzip.. it gives an error
kipping B5500430.c: this file was compressed using an unknown compression method.
Please visit www.winzip.com/wz54.htm for more information.
The compression method used for this file is 98
error: no files were found - nothing to do
 
the source is attached
 

Attachments

  • 147017-b5500430.TXT
    7.9 KB · Views: 927
Thanks for the good work...
the .H file is not included... in the attachment
I'm having the same probs too when i do Unzip.
 
Hi Serge,

I found the following compare parameters been used in BSFN coding while retrieving data selection. Hope this helps you!!

typedef enum tagJDEDB_CMP {
JDEDB_CMP_LE = 0, /* <= */
JDEDB_CMP_GE = 1, /* >= */
JDEDB_CMP_EQ, /* == */
JDEDB_CMP_LT, /* < */
JDEDB_CMP_GT, /* > */
JDEDB_CMP_NE, /* != */
JDEDB_CMP_IN, /* IN */
JDEDB_CMP_NI, /* NOT IN */
JDEDB_CMP_BW, /* BETWEEN */
JDEDB_CMP_NB, /* NOT BETWEEN */
JDEDB_CMP_LK, /* LIKE */
/* 7041551 - Verity Start */
JDEDB_CMP_MATCH_ALL, /* TextSearch MatchAll*/
JDEDB_CMP_MATCH_ANY, /* TextSearch MatchAny*/
JDEDB_CMP_MATCH_EXACT, /* TextSearch MatchExact*/
JDEDB_CMP_CONTAINS, /* TextSearch CONTAINS*/
/* 7041551 - Verity End */
JDEDB_CMP_BOGUS = 99999 /* force 4 byte ENUM on AS/400 */
} JDEDB_CMP;

B/n I see in the 8.97/8.98 tool set there is a BSFN exist for retrieving the data selection.

Thanks,
 
Hi, ALL!
I had time for free coding and tried to revise Serge's code.
smile.gif
. I added ability to set parameters szProgramId, szVersion and mnSectionID. Also added printing list and range values and join constraint (i.e. F4101.ITM = F4102.ITM).
 

Attachments

  • 153978-GetUBEDataSelection.zip
    3.9 KB · Views: 426
Hi,

I'm really interested in this BSFN, I'm not familiar with BSFN in C, how do I know tha Alias I must use to construct my data structure ? And How do I use the return of the fonction with the pointer ?

Thanks a lot.

JohnFuss
 
Hi, John. You can create DS using this hints.

typedef struct tagDSD5600430
{
JCHAR szVersion[11]; /*[VERS]*/
JCHAR szProgramId[11]; /*[PID]*/
ID idSection; /*[GENID] or other applicable DD with OneWorld Type (OWTP) = 7 (ID)*/
JCHAR cErrorCode; /*[EV01]*/
JCHAR cMode; /*[EV01]*/
ID idDataPointer; /*[GENLNG] still don't actually used*/
JCHAR szAdditionalText[5001]; /*[ADDTEXT]*/
} DSD5600430, *LPDSD5600430;

As you can see idDataPointer don't used - for this time. In my version of BSFN you can pass in szProgramId, szVersion, idSection - they aren't required (If they are'nt pass in - used current Report, Version and SectionID and they pass back in DS). You may use fhis BSFN in Advance Section or in any section before processing of actual Section (in this case you have pass in idSection - find it in BrowseER).
 
Hi,

it's works ! Thanks a lot to all of you for your help on this very interesting BSFN.

JohnFuss.
 
Hi,
the BSFN give me by example :
F4101.STKT != O
and I prefered :
F4101.IMSTKT != 'O'
Is it possible to modify the C BSFN or is it a limitation of ubeSection_GetDataSelection() ?

Thanks

JohnFuss.
 
Hi,

I succeded to add in the .c the addition of quote before and after the string and jchar data but how can I obtain the table prefixe to transforme the F4101.STKT in F4101.IMSTKT. Lecture of ol810.F9860 ? But how ?

Thanks.

JohnFuss.
 
Hi,
I added your wishes in the code. In addition I have an idea to add alias compressed description after table column. But I'm not sure that it is someone needs.
wink.gif
 

Attachments

  • 154593-GetUBEDataSelection.zip
    4.6 KB · Views: 324
Hello,

it's working so nice ! Now I can use directely the return of the BSFN and use it in Toad. So nice.

Thanks a lot.

JohnFuss.
 
Hi, All!
I have some rework. First of all I added BF Y56RetrieveUBEDataSelectionLine for work with Data Selection line by line. This may be helpful if you want to print DS by line (e.g. in CSV) or if you have to localize your print. BF uses memory for store retrieved Data Selection and this requires additional BF call for delete allocated memory (with Mode = 9).
Any other suggestion would be appreciated.

Some example of using this BF:

=======================================================================
SECTION: Page Header [PAGE HEADER] (S3)
=======================================================================
OBJECT: SECTION
EVENT: After Last Object Printed
-----------------------------------------------------------------------
evt_LineNumber_INT01
evt_LineCount_INT01
OPT: Using Defaults
0001 //
0002 VA evt_LineNumber_INT01 = "0"
0003 Retrieve UBE Data Selection Line
<Zero> -> BF cMode
VA rpt_GenericLong <> BF idDataPtr
"1" -> BF idSection
VA rpt_ErrorCode_DTAI <- BF szErrorCode
RV Message Text <- BF szSelectionLine
VA evt_LineCount_INT01 <- BF nLineCount
VA evt_LineNumber_INT01 -> BF nLineNumber
"1" -> BF nLineIncrement
VA evt_LineNumber_INT01 <- BF nNextLineNumber
0004 While VA evt_LineNumber_INT01 is less than or equal to VA evt_LineCount_INT01 And VA rpt_ErrorCode_DTAI is equal to <Blank>
0005 Do Custom Section(RS Print Message)
0006 Retrieve UBE Data Selection Line
<Zero> -> BF cMode
VA rpt_GenericLong <> BF idDataPtr
"1" -> BF idSection
VA rpt_ErrorCode_DTAI <- BF szErrorCode
RV Message Text <- BF szSelectionLine
VA evt_LineNumber_INT01 -> BF nLineNumber
"1" -> BF nLineIncrement
VA evt_LineNumber_INT01 <- BF nNextLineNumber
0007 End While
0008 Retrieve UBE Data Selection Line
"9" -> BF cMode
VA rpt_GenericLong <> BF idDataPtr
 

Attachments

  • 155058-GetUBEDataSelection.zip
    7.1 KB · Views: 356
Hi,

when we use a selection "Not egual to" and multiples values the BSFN give back [WHERE ALIAS != ('Value1', 'Value2')] instead of [WHERE ALIAS NOT IN ('Value1', 'Value2')] so I change the lines

default:
jdeStrncat(lpDS->szAdditionalText,_J("!="),DIM(lpDS->szAdditionalText));

by :

default:
if (lpSelect.nValues > 1)
{
jdeStrncat(lpDS->szAdditionalText,_J("NOT IN"),DIM(lpDS->szAdditionalText));
}
else
{
jdeStrncat(lpDS->szAdditionalText,_J("!="),DIM(lpDS->szAdditionalText));
};

JohnFuss.
 
Hi,

I try to modify this BSFNs to work and read every selection maked by user. I have 2 problems :
1. The <Null Date> is read as an empty char instead of "0"
2. The dates are in gregorian format instead of julien

Here are the lines concerned by the two points :

lpSelectValue = (LPJDEDATE) (lpSelect.lpValue) + j;
FormatDate(szValue, (LPJDEDATE) lpSelectValue, (JCHAR *) NULL);

How to replace an empty szValue by "0" (I tried but I have warnings when compiling) and how for a date like '15/03/11' can I translate it into 111074 ?

Thanks a lot.

JohnFuss.
break;
 
Hi,

I use with success an other BSFN to transform my gregorien date into julien date.

JohnFuss.
 
Back
Top