cancel
Showing results for 
Search instead for 
Did you mean: 

Invoice not printing second line item. - Using SAPscript form

Former Member
0 Kudos

Hello All,

I have an invoice which is a Z** invoice and it was developed using SAPscript. The problem was that the form was not handling decimal places when printing the invoice. So I added few lines of code which works if there is only one line item and it prints the invoice using correct format and decimals places. But when I had second line item it is not printing the second line item. I have narrowed it down to the 'ELSE" statement. If I just use 'IF..ENDIF" it prints both line items. Here is my statement below.

/E ITEM_PRICE_ZD10

/: IF &KOMP-KMEIN& = 'TON'

Z1 ,,&VBDPR-MATNR(6CZ)&,,&VBDPR-ARKTX(38)&,,,,&KOMP-KMEIN&

= ,,,,,,&VBDPR-FKIMG(9.3)&,,,,&V_BASE(<12.4)&,,&V_EXTEND(<12.2)&

/: ELSE

M2 ,,&VBDPR-MATNR(6CZ)&,,&VBDPR-ARKTX(38)&,,,,&KOMP-KMEIN&

= ,,,,,,&VBDPR-FKIMG(6.0)&,,,,&V_BASE(<12.4)&,,&V_EXTEND(<12.2)&

/: END IF

Basically the invoice prints if it finds TON and uses 3 decimals places otherwise its in pounds and it rounds up the numbers. Please if someone can let me know if I am using the 'ELSE' statement correctly or not.

Thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Found the solution. My ENDIF statement had a space between End and IF. Removed the space and the code is working correctly.