Collect all the detail references

 
  • Hello All,

    What is the simplest way to collect all the SDTE of SPCO of the SPEC (from SPEC level) using lists? Anybody has macro to collect all the sdte of a particular SPEC and reallocate them to the new catagory (GTYPwise)?

    Thanks
    Alfred
  • This should help you in some way.

    Stay on a SPEC and run it. It should output GTYP wise list of SDTEs in the pdmsuser directory. File Name will be the same as spec name. From there, you should be able to take it further...

    !spcos = !!collectallfor('SPCO','',!!CE )
    !arrdetr = object ARRAY()
    !arrgtyp = object ARRAY()
    do !spco values !spcos
        !gtyp = !spco.catref.gtyp
        !detr = !spco.detref.Name
        If !arrdetr.findfirst(!detr).unset() then
            !arrdetr.append(!detr)
            !arrgtyp.append(!gtyp)
        endif
    enddo
    var !sort SORT !arrgtyp CIASCII FIRSTINGROUP !group
    !file = object FILE('%pdmsuser%\' & !!CE.Namn.Replace('\','').Replace('/','').Replace('.','') & '.csv')
    !file.open('OVER')
    do !i indices !sort
        !indx = !sort[!i].real()
        If defined(!group[!i]) then
               !file.WriteRecord(!arrgtyp[!indx] & ',' & !arrdetr[!indx])
         else
               !file.WriteRecord(',' & !arrdetr[!indx])
        endif
    enddo
    !file.close()
  • Many thanks Shrivallabha. That's working fine.