JBA Customer Inquiry (or should that be Enquiry)
Prompting a list of all customers defined in Sales Ledger (or Account Receivable as its also known) is simple from within any JBA RPG program.
A call to SL016 - JBA Customer Inquiry - pops a window up, you select you customer using various subset, selection functions and it will be returned to the calling program via the *LDA
Sample RPGLE code could be:
L#CUSN is the returned customer code defined at:
D L#CUSN 482 489
And you can display the customer selection window like this:
* If customer prompt has been requested, do so.
* Note: oslsl* needs to be in *libl
C Move CUSN L#CUSN
C IF *INKD = *ON
C Out LDA
C Call 'SL016'
C In LDA
C Move L#CUSN CUSN
C EndIf
Obviously the Selected customer code is returned via *LDA variable L#CUSN (defined earlier) and in this case you can see that the window looks like this:

You may be interested in another Customer Prompt Window (and my customer selection of choice)
It's OE420 - SOP Customer selection.
the selection window is a lot more advanced allowing the user to select customers based on subset of name, postcode or phone number for example:

The code is just as simple. Add these fields to your *LDA definition:
D U#CUSN 295 302
D U#DSEQ 303 305
and then this to process it:
* if customer prompt has been requested, do so.
* note: osloe* needs to be in *libl
C Clear U#CUSN
C Out LDA
C Call 'OE420' 99
C In LDA
* populate screen values
C IF U#CUSN <> *BLANKS
C Eval CUSN=U#CUSN
C EndIf
Heres the RPGLE for a tidy little windowed customer inquiry written by one of the guys here. Nicely allows subsets of customer name and sequence number. Dead Simple and does the job:
|
h datfmt(*iso) timfmt(*iso) option(*nodebugio) debug ?*===============================================================* C Exsr #CLR C Write F02 B01 C Dow PGMSTS<>'RTN' B02 C IF *IN40=*ON B02 C IF PGMSTS<>'RTN' E01 C EndDo C Out LDA B02 C IF *IN31=*ON C Reset X C X Chain F01SFL 99 B03 C Dow *IN99=*OFF B04 C IF SELCSF<>*BLANK C Eval U#CUSN=CUSNSF C Eval PGMSTS='RTN' C Other C Update F01SFL C Eval *IN20=*OFF C Eval X=(X+1) C Eval *IN20=@IN20 E02 C EndIf C Endsr S01 C Select E01 C EndSl C Endsr C Reset X C Eval CNAM=%TRIM(CNAMDS) C L#CONO Reade SLR05 34 B01 C Dow *IN34=*OFF AND ?* assuming both scan words (seq and cnam) are found then load C Clear SELCSF C Add 1 RRN E03 C EndIf C L#CONO Reade SLR05 34 C Endsr C Movel *OFF *IN52 B01 C IF CUSNDS<>*BLANKS C Clear CUSNDS C Endsr C *DTAARA Define *LDA LDA C Movel 'OK ' PGMSTS 3 C Endsr |
|
And here is the DSPF for it: A DSPSIZ(24 80 *DS3)
|
- Post Reply
Recent comments
- I'm using IE6 now and I can
4 hours 33 min ago - dinosaur techies
6 hours 6 min ago - each new version of
3 days 5 hours ago - IE6 works perfectly with adsense injections
4 days 22 hours ago - Sorry - I'm using Vista 32
6 days 23 hours ago - yeah it a great tool, but I
1 week 3 hours ago - quick question
Will the new
1 week 16 hours ago - wowowowowow!!!!!!!!!!!!!
1 week 16 hours ago - Uncle Buck - you are
2 weeks 4 days ago - First Up, I'm Nicks younger
2 weeks 5 days ago


