We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-abap] Interactive Report in ABAP

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from TrishDV on Apr 28 at 8:31 AM
bhaskar-lvb770 is right in telling you that the work area must match the structure of the internal table you are looping thru. You should change EKKO to WA_EKKO in the following code:

DATA :BEGIN OF EKKO,
EBLEN LIKE EKKO-EBELN,
BSART LIKE EKKO-BSART,
BEDAT LIKE EKKO-BEDAT,
LIFNR LIKE EKKO-LIFNR,
END OF EKKO.

should be
DATA :BEGIN OF WA_EKKO,
EBLEN LIKE EKKO-EBELN,
BSART LIKE EKKO-BSART,
BEDAT LIKE EKKO-BEDAT,
LIFNR LIKE EKKO-LIFNR,
END OF WA_EKKO.

And change your one loop from
LOOP AT IT_EKKO INTO WA_EKPO
to
LOOP AT IT_EKKO INTO WA_EKKO

That should clear up the message you described above.

---------------Original Message---------------
From: ittoolbox007
Sent: Tuesday, April 22, 2014 8:07 AM
Subject: Interactive Report in ABAP

Hi Have wonderful day.

I am doing program for interactive report in abap but it showing error can any one correct this program

*&-------------*
*& Report ZASSIGNMENT3_INTRACTIVEREPORT
*&
*&-------------*
*&
*&
*&-------------*

REPORT ZASSIGNMENT3_INTRACTIVEREPORT.
DATA V1 LIKE LFA1-LIFNR.

SELECT-OPTIONS S_LFNR FOR V1.

DATA: BEGIN OF WA_LFA1,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
ORT01 LIKE LFA1-ORT01,
END OF WA_LFA1.

DATA IT_LFA1 LIKE TABLE OF WA_LFA1.

DATA :BEGIN OF EKKO,
EBLEN LIKE EKKO-EBELN,
BSART LIKE EKKO-BSART,
BEDAT LIKE EKKO-BEDAT,
LIFNR LIKE EKKO-LIFNR,
END OF EKKO.

DATA IT_EKKO LIKE TABLE OF EKKO.

DATA: BEGIN OF WA_EKPO,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MENGE LIKE EKPO-MENGE,
MEINS LIKE EKPO-MEINS,
NETPR LIKE EKPO-NETPR,
END OF WA_EKPO.

DATA IT_EKPO LIKE TABLE OF WA_EKPO.

SELECT LIFNR NAME1 ORT01 FROM LFA1 INTO TABLE IT_LFA1.

LOOP AT IT_LFA1 INTO WA_LFA1.

WRITE:/ WA_LFA1-LIFNR,
WA_LFA1-NAME1,
WA_LFA1-ORT01.

HIDE : WA_LFA1-LIFNR,
WA_LFA1-NAME1,
WA_LFA1-ORT01.
ENDLOOP.

AT LINE-SELECTION .
IF SY-LSIND = '1'.

SELECT EBELN BSART BEDAT LIFNR FROM EKKO INTO TABLE IT_EKKO WHERE
LIFNR = WA_LFA1-LIFNR.
LOOP AT IT_EKKO INTO WA_EKPO.

WRITE :/ WA_EKKO-EBELN,
WA_EKKO-BSART,
WA_EKKO-BEDAT,
WA_EKKO-LIFNR.

HIDE : WA_EKKO-EBELN,
WA_EKKO-BSART,
WA_EKKO-BEDAT,
WA_EKKO-LFNR.
ENDLOOP.

ELSEIF SY-LSIND = '2'.
SELECT EBELN EBELP MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
LOOP AT IT_EKPO INTO WA_EKPO.

WRITE :/ WA_EKPO-EBELN,
WA_EKPO-EBELP,
WA_EKPO-MENGE,
WA_EKPO-MEINS,
WA_EKPO-NETPR.
ENDLOOP.
ENDIF.


Error description :

*&-------------*
*& Report ZASSIGNMENT3_INTRACTIVEREPORT
*&
*&-------------*
*&
*&
*&-------------*

REPORT ZASSIGNMENT3_INTRACTIVEREPORT.
DATA V1 LIKE LFA1-LIFNR.

SELECT-OPTIONS S_LFNR FOR V1.

DATA: BEGIN OF WA_LFA1,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
ORT01 LIKE LFA1-ORT01,
END OF WA_LFA1.

DATA IT_LFA1 LIKE TABLE OF WA_LFA1.

DATA :BEGIN OF EKKO,
EBLEN LIKE EKKO-EBELN,
BSART LIKE EKKO-BSART,
BEDAT LIKE EKKO-BEDAT,
LIFNR LIKE EKKO-LIFNR,
END OF EKKO.

DATA IT_EKKO LIKE TABLE OF EKKO.

DATA: BEGIN OF WA_EKPO,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MENGE LIKE EKPO-MENGE,
MEINS LIKE EKPO-MEINS,
NETPR LIKE EKPO-NETPR,
END OF WA_EKPO.

DATA IT_EKPO LIKE TABLE OF WA_EKPO.

SELECT LIFNR NAME1 ORT01 FROM LFA1 INTO TABLE IT_LFA1.

LOOP AT IT_LFA1 INTO WA_LFA1.

WRITE:/ WA_LFA1-LIFNR,
WA_LFA1-NAME1,
WA_LFA1-ORT01.

HIDE : WA_LFA1-LIFNR,
WA_LFA1-NAME1,
WA_LFA1-ORT01.
ENDLOOP.

AT LINE-SELECTION .
IF SY-LSIND = '1'.

SELECT EBELN BSART BEDAT LIFNR FROM EKKO INTO TABLE IT_EKKO WHERE
LIFNR = WA_LFA1-LIFNR.
LOOP AT IT_EKKO INTO WA_EKPO.

WRITE :/ WA_EKKO-EBELN,
WA_EKKO-BSART,
WA_EKKO-BEDAT,
WA_EKKO-LIFNR.

HIDE : WA_EKKO-EBELN,
WA_EKKO-BSART,
WA_EKKO-BEDAT,
WA_EKKO-LFNR.
ENDLOOP.

ELSEIF SY-LSIND = '2'.
SELECT EBELN EBELP MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
LOOP AT IT_EKPO INTO WA_EKPO.

WRITE :/ WA_EKPO-EBELN,
WA_EKPO-EBELP,
WA_EKPO-MENGE,
WA_EKPO-MEINS,
WA_EKPO-NETPR.
ENDLOOP.
ENDIF.



*&-------------*
*& Report ZASSIGNMENT3_INTRACTIVEREPORT
*&
*&-------------*
*&
*&
*&-------------*

REPORT ZASSIGNMENT3_INTRACTIVEREPORT.
DATA V1 LIKE LFA1-LIFNR.

SELECT-OPTIONS S_LFNR FOR V1.

DATA: BEGIN OF WA_LFA1,
LIFNR LIKE LFA1-LIFNR,
NAME1 LIKE LFA1-NAME1,
ORT01 LIKE LFA1-ORT01,
END OF WA_LFA1.

DATA IT_LFA1 LIKE TABLE OF WA_LFA1.

DATA :BEGIN OF EKKO,
EBLEN LIKE EKKO-EBELN,
BSART LIKE EKKO-BSART,
BEDAT LIKE EKKO-BEDAT,
LIFNR LIKE EKKO-LIFNR,
END OF EKKO.

DATA IT_EKKO LIKE TABLE OF EKKO.

DATA: BEGIN OF WA_EKPO,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MENGE LIKE EKPO-MENGE,
MEINS LIKE EKPO-MEINS,
NETPR LIKE EKPO-NETPR,
END OF WA_EKPO.

DATA IT_EKPO LIKE TABLE OF WA_EKPO.

SELECT LIFNR NAME1 ORT01 FROM LFA1 INTO TABLE IT_LFA1.

LOOP AT IT_LFA1 INTO WA_LFA1.

WRITE:/ WA_LFA1-LIFNR,
WA_LFA1-NAME1,
WA_LFA1-ORT01.

HIDE : WA_LFA1-LIFNR,
WA_LFA1-NAME1,
WA_LFA1-ORT01.
ENDLOOP.

AT LINE-SELECTION .
IF SY-LSIND = '1'.

SELECT EBELN BSART BEDAT LIFNR FROM EKKO INTO TABLE IT_EKKO WHERE
LIFNR = WA_LFA1-LIFNR.
LOOP AT IT_EKKO INTO WA_EKPO.

WRITE :/ WA_EKKO-EBELN,
WA_EKKO-BSART,
WA_EKKO-BEDAT,
WA_EKKO-LIFNR.

HIDE : WA_EKKO-EBELN,
WA_EKKO-BSART,
WA_EKKO-BEDAT,
WA_EKKO-LFNR.
ENDLOOP.

ELSEIF SY-LSIND = '2'.
SELECT EBELN EBELP MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
LOOP AT IT_EKPO INTO WA_EKPO.

WRITE :/ WA_EKPO-EBELN,
WA_EKPO-EBELP,
WA_EKPO-MENGE,
WA_EKPO-MEINS,
WA_EKPO-NETPR.
ENDLOOP.
ENDIF.

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2014 Ziff Davis, LLC. and message author.
Ziff Davis, LLC. 28 E 28th Street New York, NY 10016
TrishDV  

achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Have a technical question? Need to find IT solutions? Ask your peers in the Toolbox for IT community.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language