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

help me pls

Former Member
0 Likes
1,082

hi,

my code has some modification.

please help me!

a classical report in Material master that outputs Material Vaulted Stock GROUPED BY mATERIAL type and plant.The output shud show Material No., Storage Location, Unit of Measure and Description in addition to group totals.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,031

Hi Jaya,

This is Kiran Kumar.G.(working in SAP)I will develop a small code for u for ur problem.plz copy the below code and execute .In that i have taken some field i.e NTGEW for weights because u cannot mention which field i have to subtotal.if u want u can change that filed ok.

If ur satisfy with my answer plz give me REWARD POINTS.

HAVE A NICE DAY..

CODE :

----


  • Tables

----


TABLES:mara,mard,makt.

----


  • Global Variables

----


DATA:total TYPE i.

----


  • Internal Table

----


DATA: BEGIN OF g_itab OCCURS 0,

matnr LIKE mara-matnr, "Material Number

mtart LIKE mara-mtart, "Material Type

meins LIKE mara-meins, "Base Unit Of Measure

lgort LIKE mard-lgort, "Storage Location

werks LIKE mard-werks, "Plant

maktx LIKE makt-maktx, "Material Description

ntgew LIKE mara-ntgew, "Net Weight

END OF g_itab.

----


  • Selection-screen

----


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

SELECT-OPTIONS: s_matnr FOR mara-matnr.

SELECTION-SCREEN: END OF BLOCK b1.

----


  • Initailizaition

----


INITIALIZATION.

PERFORM initial.

----


  • Fetch Data

----


START-OF-SELECTION.

PERFORM fetch_data.

----


  • Display Data

----


END-OF-SELECTION.

SORT g_itab BY matnr.

PERFORM display_data.

&----


*& Form initial

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM initial .

s_matnr-sign = 'I'.

s_matnr-option = 'BT'.

s_matnr-low = '38'.

s_matnr-high = '747'.

APPEND s_matnr.

ENDFORM. " initial

&----


*& Form fetch_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM fetch_data .

SELECT a~matnr

a~mtart

a~meins

b~lgort

b~werks

c~maktx

a~ntgew

FROM mara AS a

INNER JOIN mard AS b ON amatnr = bmatnr

INNER JOIN makt AS c ON amatnr = cmatnr

INTO TABLE g_itab

WHERE a~matnr IN s_matnr.

ENDFORM. " fetch_data

&----


*& Form display_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display_data .

LOOP AT g_itab.

AT FIRST.

WRITE: / 'MATERIAL NO',

20 'MATERIAL TYPE',

40 'UNIT MEASURE',

60 'STORAGE LOCATION',

80 'PLANT',

100 'MATERIAL DESCRIPTION',

120 'NET WEIGHT'.

ENDAT.

AT NEW matnr.

WRITE:/ g_itab-matnr.

ENDAT.

WRITE:/20 g_itab-mtart,

40 g_itab-meins,

60 g_itab-lgort,

80 g_itab-werks,

100 g_itab-maktx,

120 g_itab-ntgew.

total = total + g_itab-ntgew.

AT END OF matnr.

ULINE.

WRITE:/110 'TOTAL = ',total.

ULINE.

SKIP.

CLEAR total.

ENDAT.

ENDLOOP.

ENDFORM. " display_data

hi,

my code has some modification.

please help me!

a classical report in Material master that outputs Material Vaulted Stock GROUPED BY mATERIAL type and plant.The output shud show Material No., Storage Location, Unit of Measure and Description in addition to group totals.

6 REPLIES 6
Read only

Former Member
0 Likes
1,032

Hi Jaya,

This is Kiran Kumar.G.(working in SAP)I will develop a small code for u for ur problem.plz copy the below code and execute .In that i have taken some field i.e NTGEW for weights because u cannot mention which field i have to subtotal.if u want u can change that filed ok.

If ur satisfy with my answer plz give me REWARD POINTS.

HAVE A NICE DAY..

CODE :

----


  • Tables

----


TABLES:mara,mard,makt.

----


  • Global Variables

----


DATA:total TYPE i.

----


  • Internal Table

----


DATA: BEGIN OF g_itab OCCURS 0,

matnr LIKE mara-matnr, "Material Number

mtart LIKE mara-mtart, "Material Type

meins LIKE mara-meins, "Base Unit Of Measure

lgort LIKE mard-lgort, "Storage Location

werks LIKE mard-werks, "Plant

maktx LIKE makt-maktx, "Material Description

ntgew LIKE mara-ntgew, "Net Weight

END OF g_itab.

----


  • Selection-screen

----


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

SELECT-OPTIONS: s_matnr FOR mara-matnr.

SELECTION-SCREEN: END OF BLOCK b1.

----


  • Initailizaition

----


INITIALIZATION.

PERFORM initial.

----


  • Fetch Data

----


START-OF-SELECTION.

PERFORM fetch_data.

----


  • Display Data

----


END-OF-SELECTION.

SORT g_itab BY matnr.

PERFORM display_data.

&----


*& Form initial

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM initial .

s_matnr-sign = 'I'.

s_matnr-option = 'BT'.

s_matnr-low = '38'.

s_matnr-high = '747'.

APPEND s_matnr.

ENDFORM. " initial

&----


*& Form fetch_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM fetch_data .

SELECT a~matnr

a~mtart

a~meins

b~lgort

b~werks

c~maktx

a~ntgew

FROM mara AS a

INNER JOIN mard AS b ON amatnr = bmatnr

INNER JOIN makt AS c ON amatnr = cmatnr

INTO TABLE g_itab

WHERE a~matnr IN s_matnr.

ENDFORM. " fetch_data

&----


*& Form display_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display_data .

LOOP AT g_itab.

AT FIRST.

WRITE: / 'MATERIAL NO',

20 'MATERIAL TYPE',

40 'UNIT MEASURE',

60 'STORAGE LOCATION',

80 'PLANT',

100 'MATERIAL DESCRIPTION',

120 'NET WEIGHT'.

ENDAT.

AT NEW matnr.

WRITE:/ g_itab-matnr.

ENDAT.

WRITE:/20 g_itab-mtart,

40 g_itab-meins,

60 g_itab-lgort,

80 g_itab-werks,

100 g_itab-maktx,

120 g_itab-ntgew.

total = total + g_itab-ntgew.

AT END OF matnr.

ULINE.

WRITE:/110 'TOTAL = ',total.

ULINE.

SKIP.

CLEAR total.

ENDAT.

ENDLOOP.

ENDFORM. " display_data

Read only

0 Likes
1,031

thank u so much kiran.

u know anything regarding medruck sapscripts.

i have given u the reward points.

thanks again for ur help

Read only

0 Likes
1,031

U have any idea regarding user exit.

i got to do project....I need to do this very well.

Like i have got 4 data source exits and based on the requiremnt i need to do the coding.

Can u kindly help me with this..

Kindly guide me and once i recieve my requiremnt I shall ask u more questions.

Thanks a lot for ur help

Sincerely

Jaya

Read only

Former Member
0 Likes
1,031

hi Jaya,

This is kiran kumar.G.Thanks alot.I know medruck in SAPSCRIPTS.

MEDRUCK is a standard layout set SAP SCRIPT for PURCHASE ORDER.If u have any querys plz mail to my id.

[email protected]

PUT subject line as SDN.SAP.

HAVE A NICE DAY...JAYA EC..

Read only

Former Member
0 Likes
1,031

hi Jaya,

This is kiran kumar.G.How are u.I will develop a step by step information for u.Check it once ok.

If are satify with my procedure plz give me REWARD POINTS.

HAVE A NICE DAY..JaYa..

STEPS:

BASICS BEFORE WE GO TO MEDRUCK(PURCHASE ORDER):

EX: I WOULD TO EXPLAIN IN TERMS OF EXAMPLE OK.

BASIC TERMS:

ASSUMPTIONS :

1.If u r the cutomer(JAYA) and u want to buy 10 dresses.

Then u will make a PURCHASE REQUISION to vendor(kiran).

2.QUOTATION : vendor(kiran)sends a quotation based on ur PURCHASE

REQUISITION sent by customer(jaya).

3.PURCHASE ORDER: This is raised by the customer(jaya) once

the quotation is accepted.

READ THE ABOVE LINES CAREFULLY(these are the basic terminology)

OK.

4.GOTO ME22N transaction code(This is for Standard purchase order)

5.choose the menu path (or) press shift+F5

purchase order -


> other purchase order.

At that time u will get one pop-up window.

select the purchase order radio buttom

and enter a purchase order number there.

ex: 3000000099.

and click other document button.ok.

6.Then the screen will diplay with the information that information

tells about ur dresses information and the date to which u place

an order and the date which the vendor(kiran) deliver those things

to u.And the vendor(kiran) and customer(jaya) Address and also

shipping details.

7. In the screen itself there is a push button named "PRINT PREVIEW"

which is present in the application tool bar.click on that button

that is actual layout of the medruck.That means the vendor and

customer information is transfferd to medruck and print according

to that layout.

Better to check it once that is click the PRINT PREVIEW PUSH BUTTON.

8.If we want to see the layout of medruck.GOTO SE71 transaction code

and enter form : MEDRUCK AND CLICK ON DISPLAY u will get more information.

ok bye..

I will send a screen shots to ur mail check it once ok.If are any doubts plz mail to

my id ok...bye..

HAVE A NICE DAY..JaYa..

Read only

0 Likes
1,031

Hi Kiran,

Thank u so much.

Ur reply was very helpful and help me for my queries in future too.

Regrads

Jaya