help with listview

I need to know how to read a list view line by line, is to pass information to a report. use the GET-DATA-SUBITEM but I only read one line :?

For the ListView or ListBox, I recommend you see this reference will be very useful.

Within your NATURAL editor, working in the folders you select the folder “System Libraries” in the folder she sees SYSEXEVT from here take the folder “dialogs” and runs the object takes the option MENU CONTROLS → LISTBOX – > ListBox2 within this object you find the code you need and there are many more examples.

kind regards
Angel Mendoza O

Not so with the listbox, the listbox that the attribute string can get information but the list view with columns having different

Not sure if I understand your needs exactly, but would USR1058N help?
Here’s an example of using it to retrieve descriptors from a DDM:



* Get needed system info

CALLNAT 'USR1038N'  USR1038L  USR1038N.EXTENDED-PARMS

* Now read DDM source into #SRC(*)

/* Specify the object
IF #ObjLibrary SPECIFIED
    AND #ObjLibrary <> ' '
   USR1058L.LIBRARY    := #ObjLibrary
   USR1058N.V2-DBID    := #ObjDBnr
   USR1058N.V2-FNR     := #ObjFnr
ELSE
   USR1058L.LIBRARY    := *LIBRARY-ID
END-IF

/* Open the object
USR1058L.OBJECT-NAME   := #DDM-NAME
USR1058L.OPT-LINE-NUM  := 'Y'
USR1058L.OPT-REDEF-DIR := TRUE
USR1058L.OPT-AMOUNT    := #MAX-LINES
USR1058L.OPT-LINESIZE  := 79
USR1058N.V1-OPT-FORMAT := 'C'
USR1058L.OPT-ACCESS    := 'O'
CALLNAT 'USR1058N' USR1058L USR1058N.EXTENDED-PARMS NAD-MSG NAD-FLD
IF MSG-NR <> 0
  ...
  ESCAPE ROUTINE
END-IF

/* Read the object 250 lines at a time, up to 500 lines
USR1058L.OPT-ACCESS   := 'R'
CALLNAT 'USR1058N' USR1058L USR1058N.EXTENDED-PARMS NAD-MSG NAD-FLD
#SRC-LINES  := USR1058L.RETURNED
#SRC(1:250) := SRC-LINE(*)
IF MSG-NR = 0
   USR1058L.OPT-ACCESS   := 'R'
   CALLNAT 'USR1058N' USR1058L USR1058N.EXTENDED-PARMS NAD-MSG NAD-FLD
   ADD USR1058L.RETURNED TO #SRC-LINES
   #SRC(251:500) := SRC-LINE(*)
END-IF

/* Close the object
USR1058L.OPT-ACCESS := 'C'
CALLNAT 'USR1058N' USR1058L USR1058N.EXTENDED-PARMS NAD-MSG NAD-FLD

* Get keys from DDM source

FOR #LINE = 6 TO #SRC-LINES
  IF NOT SUBSTRING(#SRC(#LINE),52) = 'D' OR = 'S'
     ESCAPE TOP
  END-IF

The above is in module DDMKEYSN called by a dialogue to fill a ListBox:
(You’ll have to excuse any silly code, I am not OO-literate!)


            /* Get this +IN-DDM's Keys, to be displayed in the 2nd list
            PROCESS GUI ACTION CLEAR WITH #LB-KEY GIVING *ERROR
            ASSIGN #KEY-ITEM(*) = NULL-HANDLE
            CALLNAT 'DDMKEYSN' #DDMKEYSA +IN-DDM
            #KEYS := #DDMKEYSA.KEYS-RETURNED
            FOR #I = 1 TO #KEYS
                #KEY-ITEM.STRING(#I) := #DDMKEYSA.KEY-NAME(#I)
                PROCESS GUI ACTION ADD WITH #LB-KEY LISTBOXITEM #KEY-ITEM(#I) GIVING *ERROR
            END-FOR