Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Table PERNR-PERNR and use of Get PERNR

Hi experts!!

I've a doubt, I have a program with a get of pernr, in the selection screen I put two differents PERNR and the PROVIDE I have only read the first of them...does anybody know why?

This is my code...

GET PERNR.

 CASE BOTON.

* Caso de tiempos

    WHEN 'FED'.

      PERFORM OBTENER_DATOS.

      IF G_ALV_TREE IS INITIAL.

        PERFORM INIT_TREE.

        CALL METHOD CL_GUI_CFW=>FLUSH
          EXCEPTIONS
            CNTL_SYSTEM_ERROR = 1
            CNTL_ERROR        = 2.
      ENDIF.

CALL SCREEN 100.

FORM OBTENER_DATOS.

  REFRESH T_TABLA.

  PROVIDE * FROM P0002 * FROM P0001  * FROM P0050 * FROM P2011 BETWEEN PN-BEGDA AND PN-ENDDA WHERE P0002-PERNR EQ PERNR-PERNR.
  RP_PROVIDE_FROM_LAST P0002 SPACE PN-BEGDA PN-ENDDA.

  CLEAR T_TABLA.

  MOVE-CORRESPONDING P0002 TO WA_TABLA.
  MOVE-CORRESPONDING P0001 TO WA_TABLA.
  MOVE-CORRESPONDING P0050 TO WA_TABLA.
  MOVE-CORRESPONDING P2011 TO WA_TABLA.

  APPEND WA_TABLA TO T_TABLA.
  CLEAR WA_TABLA.

  ENDPROVIDE.



  IF SY-SUBRC EQ 0.

    LOOP AT T_TABLA ASSIGNING <TABLA>.
      MOVE <TABLA>-PERNR TO T_HEADER-PERNR.
      APPEND T_HEADER.
    ENDLOOP.

    SORT T_HEADER.
    DELETE ADJACENT DUPLICATES FROM T_HEADER.
  ENDIF.


ENDFORM.                    "OBTENER_DATOS

Thanks and regards!

Rebeca

Former Member
replied

GET PERNR is a kind of loop. so it should call 2 times, since you entered 2 pernr in the selection screen. keep a break point and see what is happening exactly.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question