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: 

How to display total amount field in PO layout

Former Member
0 Kudos

Dear All,

I have a query related to Purchase Order Printing.

I copied the standard programme SAPFM06P as ZSAPFM06P. I didn't make any changes to standard program.

I copied the standard layout MEDRUCK as ZMEDRUCK.

I am able to display all the data of PO but I am facing problem in displaying <b>Total Amount</b> field (i.e sum of amount and tax value).

How can we display the Total Amount in the layout without changing the Standard program. I want to make the changes only in ZMEDRUCK for this field.

My main window details are as follows :

MatNo MatDesc Uom Quantity rate amount <b>Total amount</b>

Here I am not able to print Total amount(amount + tax value)

Please help me on this .

Thanks & Regards

Rajvinder

5 REPLIES 5

Former Member
0 Kudos

u can write a subroutine to perform the addition of the two if u have the values in the 2 fields:

in script:

PERFORM GET_SHIP_TO IN PROGRAM Zxxxxx

USING &VBDKL-ADRNR_WE&

CHANGING &NAME_1&

CHANGING &NAME_2&

CHANGING &NAME_3&

CHANGING &NAME_4&

ENDPERFORM

in program Zxxxxx u can perform watever ur requirement is.

Hope it helps,

Regards,

Bikash

0 Kudos

Hi Bikash,

Thanks for the input.

I will write the perform statement in the SAPSCRIPT but I don't want to do any changes in the ZSAPFM06P to call that perform statement as it is copied from the standard program.

<b>Please guide me how to add the value of two fields to output Total amount in PO layout without changing the ZSAPFM06P.</b>

Thanks & Regards

Rajvinder

0 Kudos

Hi Rajvinder,

u need not be so much against changing the program.. infact it s the best way to get the desired output if its done properly...to be completely safe,wat u can do is insert a subroutine somewhere after the values have been populated in the program n then add these inside the subroutine to get the total in a different variable..in this way ur original data s intact n u can use ur new variable in the script as total..

neways if u dont want to change ur program, then u need to keep these things in mind..

the value of total & tax shud be available at the point of calling the perform from the sapscript so that u can pass those to a new program for addition.

eg :

while writing this in script

😕 perform add in program znew using &total& &tax& changing &final&

before this command u need to make sure that total & tax values r ther to pass to the program..

then u can write a FORM in ur znew to add these two n pass to final..

in sapscript u can then print &final&

Hope it helps,

Regards,

Bikash

Former Member
0 Kudos

Hi,

you can call a subroutine that will be made in a new program . Pass the item values to this .

Write code for calculating the tax value for that item and then return its value to the sapscript .

But remember , this subroutine will be called for every line item .

If you want the syntex of that subroutine call , then please tell me I will provide you that.

For any further queries , please get back.

Thanks and Regards

Gurpreet Singh

Former Member
0 Kudos

Hello Rajvinder,

U can write the perform in the layout and the program name u can create a fresh. However u wil have to remember that this program needs to be protected from accidental delete or modification. Secondly if u have identifyed as what constitues a TOTAL amt and if those fields are available through the ZSAPFM06P then u can play arround in the perform otherwise u will have to do the entire logic of getting those necessary fields in the new include which u are going to write for the perform.