Application Development and Automation 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: 
Read only

Material Report

Former Member
0 Likes
805

I practicing a report where I prompt user to enter for MATNR range and display output for that range...

TABLES: MARA

DATA : BEGIN OF ITAB OCCURS 0

MATNR LIKE MARA-MATNR,

ERSDA LIKE MARA-ERSDA,

ERNAM LIKE MARA-ERNAM,

MTART LIKE MARA-MTART,

ENDOF ITAB.

*SELECT OPTION FOR USER TO ENTER MATERIAL RANGE

LOOP AT ITAB

WRITE 😕 ITAB-MATNR, ITAB-ERSDA,ITAB-ERNAM,ITAB-MTART

ENDLOOP.

Could someone help me how to proceed after select-options...

6 REPLIES 6
Read only

Former Member
0 Likes
709

Hi,

Check this..

TABLES: MARA

DATA : BEGIN OF ITAB OCCURS 0

MATNR LIKE MARA-MATNR,

ERSDA LIKE MARA-ERSDA,

ERNAM LIKE MARA-ERNAM,

MTART LIKE MARA-MTART,

ENDOF ITAB.

<b>SELECT-OPTIONS: SO_MATNR FOR MARA-MATNR.

  • GET THE VALUES

SELECT MATNR ERSDA ERNAM MTART

FROM MARA

INTO TABLE ITAB

WHERE MATNR IN SO_MATNR.</b>

LOOP AT ITAB

WRITE 😕 ITAB-MATNR, ITAB-ERSDA,ITAB-ERNAM,ITAB-MTART

ENDLOOP.

Thanks,

Naren

Read only

0 Likes
709

<b>SELECT-OPTIONS: SO_MATNR FOR MARA-MATNR.

  • GET THE VALUES

SELECT MATNR ERSDA ERNAM MTART

FROM MARA

INTO TABLE ITAB

WHERE MATNR IN SO_MATNR.</b>

Can you explain what this part does

Read only

0 Likes
709

Hi Alxendar,

It will fetch the data from the database table MARA(Material master) into internal table ITAB where MATNR(Material number) is specified under SO_MATNR(what you input at your selection-screen).

Thanks,

Vinay

Read only

Former Member
0 Likes
709

Hi Alexander,

Write a SELECT in START-OF-SELECTION event to get the data into internal table and display the contents in END-OF-SELECTION event.

Try with this code.

SELECT-OPTIONS: R_MATNR FOR MARA-MATNR.

START-OF-SELECTION.

SELECT MATNR ERSDA ERNAM MTART

FROM MARA

INTO TABLE ITAB

WHERE MATNR IN R_MATNR.

END-OF-SELECTION.

IF ITAB[] IS NOT INITIAL.

LOOP AT ITAB.

WRITE 😕 ITAB-MATNR, ITAB-ERSDA, ITAB-ERNAM, ITAB-MTART.

ENDLOOP.

ENDIF.

Thanks,

Vinay

Read only

Former Member
0 Likes
709

Hi,

SELECT-OPTIONS: SO_MATNR FOR MARA-MATNR.

Defines a range in the selection screen for the material..Where the user can enter range or multiple material.

  • GET THE VALUES

SELECT MATNR ERSDA ERNAM MTART

FROM MARA

INTO TABLE ITAB

<b>WHERE MATNR IN SO_MATNR.</b>

For the input material entered in the selection-screen...Getting the material master details from the table MARA...IN is used for select-options in the WHERE clause of the select statement to filter the data based on the input..

Thanks,

Naren

Read only

Former Member
0 Likes
709

hi,

DATA : BEGIN OF ITAB OCCURS 0

MATNR LIKE MARA-MATNR,

ERSDA LIKE MARA-ERSDA,

ERNAM LIKE MARA-ERNAM,

MTART LIKE MARA-MTART,

ENDOF ITAB.

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

select-options : s_matnr for itab-matnr.

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

start-of-selection.

select matnr ersda ernam mtart from mara into table

itab where matnr in s_matnr.

end-of-selection.

loop at itab.

write : / itab-matnr, itab-ersda, itab-ernam.

endloop.

if helpful get some points.

regards.

Praveen