2008 Oct 16 11:04 AM
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
2008 Oct 16 11:36 AM
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.
2008 Oct 16 11:36 AM
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.
2008 Oct 16 1:21 PM
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