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: 

Reg. Output for the simple programme

Former Member
0 Kudos

Dear Experts

I am new to ABAP. I wrote simple coding but there is no output and Input screen only coming. There is no required fields display.

Report ZPR.

Tables:MARA,MAKT.

Data:begin of PR occurs 0,

MATNR like MARA-MATNR,

ERSDA like MARA-ERSDA,

ERNAM like MARA-ERNAM,

LAEDA like MARA-LAEDA,

AENAM like MARA-AENAM,

LVORM like MARA-LVORM,

MAKTX like MAKT-MAKTX,

End of PR.

data:PR1 like PR occurs 0 with header line.

selection-screen begin of block b1 with frame.

select-options:MAT for MARA-MATNR.

selection-screen end of block b1.

MAT = MAT+3(15).

select MARAMATNR MARAERSDA MARAERNAM MARALAEDA MARA~AENAM

MARALVORM MAKTMAKTX into (PR1-MATNR, PR1-ERSDA, PR1-ERNAM, PR1-LAEDA,

PR1-AENAM, PR1-LVORM, MAKT-MAKTX) from MARA inner join MAKT on

MARAMATNR = MAKTMATNR where MARA~MATNR eq MAT.

endselect.

Loop at PR1.

write:/ PR1-MATNR,

PR1-ERSDA,

PR1-ERNAM,

PR1-LAEDA,

PR1-AENAM,

PR1-LVORM,

PR1-MAKTX.

endloop.

Pls check the above coding and help me.

Thanks

Rajakumar.K

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Raja.

Just append the header line to your internal table.

Append pr1.

Just above the endselect.

5 REPLIES 5

Former Member
0 Kudos

please put a break point on loop statement and check if your table has some data or not

then let me know

we will try it out

Regards,

kushagra

Former Member
0 Kudos

Dear,

Please check the below select query.

You are missing APPEND statement.

select MARA~MATNR MARA~ERSDA MARA~ERNAM MARA~LAEDA MARA~AENAM
MARA~LVORM MAKT~MAKTX into (PR1-MATNR, PR1-ERSDA, PR1-ERNAM, PR1-LAEDA,
PR1-AENAM, PR1-LVORM, MAKT-MAKTX) from MARA inner join MAKT on
MARA~MATNR = MAKT~MATNR where MARA~MATNR eq MAT.
APPEND PR1.
endselect.

Regards,

Edited by: chandra madapati on Sep 10, 2008 8:08 AM

Former Member
0 Kudos

Hi Raja.

Just append the header line to your internal table.

Append pr1.

Just above the endselect.

Former Member
0 Kudos

hii

change your code like below..you will get your data.

TABLES:mara,makt.
DATA:BEGIN OF pr OCCURS 0,
matnr LIKE mara-matnr,
ersda LIKE mara-ersda,
ernam LIKE mara-ernam,
laeda LIKE mara-laeda,
aenam LIKE mara-aenam,
lvorm LIKE mara-lvorm,
maktx LIKE makt-maktx,
END OF pr.
DATA:pr1 LIKE pr OCCURS 0 WITH HEADER LINE.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
SELECT-OPTIONS:mat FOR mara-matnr.
SELECTION-SCREEN END OF BLOCK b1.


SELECT mara~matnr mara~ersda mara~ernam mara~laeda mara~aenam
mara~lvorm makt~maktx INTO TABLE pr1 FROM mara INNER JOIN makt ON
mara~matnr = makt~matnr WHERE mara~matnr IN mat.


LOOP AT pr1.
  WRITE:/ pr1-matnr,
  pr1-ersda,
  pr1-ernam,
  pr1-laeda,
  pr1-aenam,
  pr1-lvorm,
  pr1-maktx.
ENDLOOP.

regards

twinkal

Former Member
0 Kudos

Hi,

in this program you did n't APPEND STATEMENT after select statement.

Please put this statement after the innerjoin condition. otherwise that internal table PR1 has no values.

APPEND PR1.