cancel
Showing results for 
Search instead for 
Did you mean: 

SAP SCRIPT: How to print multiple line items in customized PO ?

Former Member
0 Kudos

Hi Experts,

I have customized the standard PO (ME21n - Tcode). I want to print all the lines which has data in my customized PO. Currently i am able to print only the first line. I have copied the standard MEDRUCK and I am also using the standard PO print program.

For example I have a table with 6 columns and 5 rows.

1st row will be headings

Remaining 4 rows should print data as entered in standard PO.

Pls help me.

How can I proceed further ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In your customised program of medruck, first check that how its printing the multiple line items.....

then accordin to that make changes in your copied z program,........

Former Member
0 Kudos

Hi,

I also need the batch field (CHARG) also to print.

But that particular does not appear in standard PO o/p.

It actually point to a structure (MEPO... ).

Can I call that structure to get the values ?

Thanks in advance

Former Member
0 Kudos

Hi,

Please get in touch with your functional consultant for the logic behind fetching the batch in the output. As far as i know the batch number will be given only in suitable cases. if not it is not requird, then it will not be given.

Thanks,

Venkatesh.

Former Member
0 Kudos

Hi,

Old PO no is entered in the batch field. While printing the customized PO, the data in the batch field has to flow.

I found 3 tables containing batch number.

MCH1, MCHA, MCHB.

Im also using the standard print program, SAPFM06P.

Can anyone pls help me how to get the values stored in bacth field (CHARG) to my script.

Former Member
0 Kudos

Hi,

Normalyy we will not know a Batch number while creating a PO. This value is inserted while doing PGI only.

But if you want to bring the value in the output. You can use PERFORM ENDPERFORM in the same window of the custom script that you have copied and print it in the output.

Thanks,

Venkatesh.

Former Member
0 Kudos

Hi,

I know we can use perform,... But the thing is I want to get all the item lines batch field data one below the other, as it appears in me21n Tcode.

How can we use subroutine pool and loop and get the data, can u pls explain me that part.

May be if there is any other method than that will also be very helpful.

Thanks in advance.

Former Member
0 Kudos

Hi,

Sry I do not have much idea about Looping the sub routine pool.

Unsure if this is helpful: As the medruck is already printing the line item data and you only need to print the batch number. i think you can take the batch number from MCH1 table that you have mentioned. but you need to pass other key values too using PERFORM and ENDPERFORM.

But there can be a case where each line item may have multiple batch numbers. In that case may be you have to use more selection criteria like plant and storage location number as in MCHB.

This is just for your information:

But as you will be showing suppose a batch number 12345 for this PO now in the output. Later while doing PGA of the respective delivery thay may use a different batch number. so there will be a Mismatch and confusion.

Thanks,

Venkatesh.

Answers (0)