Skip to Content
0
Former Member
Oct 28, 2005 at 07:31 AM

problem in internal table

25 Views

hi guys,

i have a peculiar problem.

i have a created a report whose final output is something like this for the date 01.08.2005 to 03.08.2005:

01.08.2005 1408000111 6.000

01.08.2005 _______ _____ 1408000129 11.000

02.08.2005 1408000297 9.000

03.08.2005 _______ ______ 1408000411 14.000

03.08.2005 1408000497 7.000 ________ _____

03.08.2005 1408000506 7.000 ________ ______

over here the space idenfies each columnand line as empty space.

my requirement is to condense the two rows which have same date. remember column 2 and column 3 execute one condition and column 4 and column 5 execute other condition for the same date. neither of the two condions may occur first depending on the data stored in r/3.

now pls tell me how to condense the rows with same date fields.

for you convienience i have pasted the code down below:

&----


*& Report ZRPT_SD_013 *

*& *

&----


*& *

*& *

&----


REPORT zrpt_sd_013 LINE-SIZE 250 NO STANDARD PAGE HEADING .

TABLES: likp, lips, vbuk, t001w.

DATA: BEGIN OF fs,

dat(10),

lfdat1 LIKE likp-lfdat,

vbeln LIKE likp-vbeln,

erdat LIKE likp-erdat,

vbeln1 LIKE likp-vbeln,

lfimg(10),

lfimg1(10),

END OF fs.

DATA: cnt(3) TYPE n.

DATA: ilikp LIKE TABLE OF likp WITH HEADER LINE.

DATA: itab LIKE TABLE OF fs WITH HEADER LINE.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: s_werks LIKE likp-werks OBLIGATORY.

PARAMETERS: s_kunnr LIKE likp-kunnr OBLIGATORY.

SELECT-OPTIONS: s_matnr FOR lips-matnr.

SELECT-OPTIONS: s_lfdat FOR likp-lfdat OBLIGATORY.

SELECTION-SCREEN: END OF BLOCK b1.

START-OF-SELECTION.

PERFORM get-data.

PERFORM display-data.

&----


*& Form get-data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get-data .

SELECT * FROM likp

INTO CORRESPONDING FIELDS OF TABLE ilikp

WHERE kunnr = s_kunnr

AND lfdat IN s_lfdat.

LOOP AT ilikp.

IF ilikp-lfart = 'ZELF'.

SELECT SINGLE * FROM lips

WHERE mtart = 'LEIH'

AND werks = s_werks

AND vbeln = ilikp-vbeln

AND pstyv = 'TAL'.

IF sy-subrc EQ 0.

MOVE: lips-erdat TO itab-lfdat1,

lips-vbeln TO itab-vbeln,

lips-lfimg TO itab-lfimg.

WRITE: itab-lfdat1 TO itab-dat.

ENDIF.

ELSEIF ilikp-lfart = 'ZRPR'.

SELECT SINGLE * FROM lips

WHERE mtart = 'LEIH'

AND werks = s_werks

AND vbeln = ilikp-vbeln

AND pstyv = 'LAN'.

IF sy-subrc EQ 0.

MOVE : lips-erdat TO itab-erdat,

lips-vbeln TO itab-vbeln1,

lips-lfimg TO itab-lfimg1.

WRITE: itab-erdat TO itab-dat.

ENDIF.

ENDIF.

APPEND itab.

CLEAR itab.

ENDLOOP.

ENDFORM. "get-data

&----


*& Form display-data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display-data .

LOOP AT itab.

WRITE:/ itab-dat,

itab-vbeln,

itab-lfimg,

itab-vbeln1,

itab-lfimg1.

ENDLOOP.

ENDFORM. "display-data