Skip to Content
0
Former Member
Feb 03, 2014 at 09:15 AM

AT END OF (pernr) Statement

67 Views

Hi All ;

The problem is that;i want to show the data with dynamic table,the codes like below.

For ex: I have 3 records with one pernr .The alv have to be one line ,but in the loop

the at end of statemen isnt working.Could you help about that.

****************************************************************************************************

DATA: LS_DONEM LIKE LINE OF GT_DONEM,

LV_FNAME(10),

LV_DMBTR TYPE BSEG-DMBTR.

CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE

EXPORTING

IT_FIELDCATALOG = GT_FCAT

IMPORTING

EP_TABLE = MITAB.

ASSIGN MITAB->* TO <ITAB> .

CREATE DATA MLINE LIKE LINE OF <ITAB>.

ASSIGN MLINE->* TO <LINE>.

LOOP AT GT_DONEM INTO LS_DONEM.

LV_FNAME = LS_DONEM-BDATE.

ASSIGN COMPONENT LV_FNAME OF STRUCTURE <LINE> TO <FIELD>.

IF SY-SUBRC = 0.

<FIELD> = LS_DONEM-BTIME.

ENDIF.

ASSIGN COMPONENT 'VORNA' OF STRUCTURE <LINE> TO <FIELD>.

IF SY-SUBRC = 0.

<FIELD> = LS_DONEM-VORNA.

ENDIF.

ASSIGN COMPONENT 'NACHN' OF STRUCTURE <LINE> TO <FIELD>.

IF SY-SUBRC = 0.

<FIELD> = LS_DONEM-NACHN.

ENDIF.

AT END OF PERNR .

ASSIGN COMPONENT 'PERNR' OF STRUCTURE <LINE> TO <FIELD>.

IF SY-SUBRC = 0.

<FIELD> = LS_DONEM-PERNR.

ENDIF.

CLEAR GT_DONEM.

APPEND <LINE> TO <ITAB>.

CLEAR: <LINE>.

ENDAT.

ENDLOOP.

ENDFORM. " PRP_ITA


****************************************************************************************************


Regards

Fırtına