Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Table PERNR-PERNR and use of Get PERNR

former_member384574
Active Participant
0 Kudos
275

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

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos
114

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.

2 REPLIES 2

former_member188685
Active Contributor
0 Kudos
115

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.

Former Member
0 Kudos
114

START-OF-SELECTION.

" UR CODE

GET PERNR.

"UR CODE

END-OF-SELECTION

" the above block will act as loop.

get pernr event must lie between start-of-selection event and end-of-selection event, in order for it to work properly

Edited by: Amit Gupta on Oct 16, 2008 2:25 PM