cancel
Showing results for 
Search instead for 
Did you mean: 

Printing problem

Former Member
0 Kudos

Hi all,

I am printing PO details using a smartform...here i am having line items for every PO...so my problem is i have displayed all the header data and now coming to line item i printing a hard coded line "Please note the below chnaged adres..." for line items having tax code as 'M3' here i want to print the hard coded lines at the header block,the hard coded line is printing fine but the thing i want to print the line only once if the one or more line items contain the tax code 'M3'...for example if a PO has 4 line items in which 2 line items contain Tax code as 'M3'so while in the printing it is showing the hard coded lines twice..how to make it as single time as different line items contains same tax code...Pls help

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi!

Try it this way:

/: IF &printed& <> 'T'

/: DEFINE &printed& = 'F'

/: ENDIF

/:IF &printed&= 'F' AND &tax_code& = 'M3'.

AA Please note the below chnaged adres...

/: DEFINE &printed& = 'T'

/: ENDIF.

Regards

Tamá

Former Member
0 Kudos

Hi Tamas,

Can u pls write the code in details...i didnt understand the way u wrote...

Thanx

Former Member
0 Kudos

Try this code :::

keep the EXIT command whne ever u have acheived same tax_code

LOOP AT SF_PO-IT_ITEM INTO WA_ITEM.

IF WA_ITEM-TAX_CODE = 'I2'.

*MOVE 'X' TO GV_TAX_FLAG.

GV_TAX_FLAG = GV_TAX_FLAG + 1.

EXIT.

ENDIF.

ENDLOOP.

Answers (1)

Answers (1)

former_member196280
Active Contributor
0 Kudos

Try to do it like this...

Define a varaible called flag with value 'Y'.

IF FLAG= 'Y' AND tax code = 'M3'.

***PRINT YOUR TEXT ""Please note the below chnaged adres..."

Flag = 'N'.

ENDIF.

I guess text gets print only once.

Regards,

Sairam