• Sábado 20 de Abril de 2024, 12:27

Autor Tema:  Problemas con Select  (Leído 1691 veces)

alexandra rondon

  • Nuevo Miembro
  • *
  • Mensajes: 1
  • Nacionalidad: co
    • Ver Perfil
Problemas con Select
« en: Jueves 3 de Diciembre de 2009, 21:55 »
0
Buenas tardes a todos:

Estoy haciendo un reporte... en el select quiero que me traiga todos los estados de cuenta de un estudiante, por lo cual necesito que los que tienen documento de compensación (pagos) queden en mi reporte negativos, de tal manera que cuando hagan la suma se pueda ver si el estudiante se encuentra al día con la Universidad.

Si alguien me puede ayudar muchisimas gracias... el siguiente es el codigo que tengo, pero no me trae el valor negativo...
_____________________________________________________

form obtener_datos.

  data: ti_dfkkop_aux like standard table of zbanner,
        e_dfkkop type table of zbanner with header line,
        wbetrh  type betrh_kk.

  select * from zbanner
    into corresponding fields of table ti_dfkkop
    where persl in persl and
    partner in partner.


  loop at ti_dfkkop.

      append e_dfkkop.
      check e_dfkkop-augbl is not initial.
      e_dfkkop-partner        = ti_dfkkop-partner.
      e_dfkkop-opbel          = ti_dfkkop-opbel.
      e_dfkkop-name_last      = ti_dfkkop-name_last.
      e_dfkkop-name_first     = ti_dfkkop-name_first.
      e_dfkkop-bu_group       = ti_dfkkop-bu_group.
      e_dfkkop-psobtyp        = ti_dfkkop-psobtyp.
      e_dfkkop-hvorg          = ti_dfkkop-hvorg.
      e_dfkkop-tvorg          = ti_dfkkop-tvorg.
      e_dfkkop-betrh          = ti_dfkkop-betrh * -1.
      e_dfkkop-augbt          = ti_dfkkop-augbt.
      e_dfkkop-augbl          = ti_dfkkop-augbl.
      e_dfkkop-persl          = ti_dfkkop-persl.
      e_dfkkop-blart          = ti_dfkkop-blart.
      e_dfkkop-xblnr          = ti_dfkkop-xblnr.
      e_dfkkop-fistl          = ti_dfkkop-fistl.
      e_dfkkop-bldat          = ti_dfkkop-bldat.
      e_dfkkop-budat          = ti_dfkkop-budat.



      append e_dfkkop to ti_dfkkop_aux.
  endloop.

  select * from zbanner
    into corresponding fields of table ti_dfkkop
    where persl in persl and
    partner in partner.


  select *
  from dfkkopw
  into corresponding fields of ti_dfkkop
  for all entries in ti_dfkkop
  where opbel = ti_dfkkop-opbel.

    loop at ti_dfkkop.
      move-corresponding ti_dfkkop to e_dfkkop.


      loop at ti_dfkkop where opbel = ti_dfkkop-opbel.
        e_dfkkop-faedn = dfkkopw-faedn.
        append e_dfkkop to ti_dfkkop_aux.
      endloop.

        if sy-subrc <> 0.
          append ti_dfkkop.
        endif.


        check e_dfkkop-augbl is  not initial.
        e_dfkkop-partner        = ti_dfkkop-partner.
        e_dfkkop-opbel          = ti_dfkkop-augbl.
        e_dfkkop-name_last      = ti_dfkkop-name_last.
        e_dfkkop-name_first     = ti_dfkkop-name_first.
        e_dfkkop-bu_group       = ti_dfkkop-bu_group.
        e_dfkkop-psobtyp        = ti_dfkkop-psobtyp.
        e_dfkkop-hvorg          = ti_dfkkop-hvorg.
        e_dfkkop-tvorg          = ti_dfkkop-tvorg.
        e_dfkkop-betrh          = ti_dfkkop-betrh * -1.
        e_dfkkop-augbt          = ti_dfkkop-augbt.
        e_dfkkop-augbl          = ti_dfkkop-augbl.
        e_dfkkop-persl          = ti_dfkkop-persl.
        e_dfkkop-blart          = ti_dfkkop-blart.
        e_dfkkop-xblnr          = ti_dfkkop-xblnr.
        e_dfkkop-fistl          = ti_dfkkop-fistl.
        e_dfkkop-bldat          = ti_dfkkop-bldat.
        e_dfkkop-budat          = ti_dfkkop-budat.

        append e_dfkkop to ti_dfkkop_aux.
    endloop.


______________________________________________________________________________________________

Que tengan un feliz día,



Alexandra Rondón Daza   :hitcomp: