Skip to Content
0
Jan 21, 2008 at 08:30 PM

What is wrong with this code?

24 Views

I am modifying a sapscript print program to suppress certain characteristics; we don't want them to print. To do this I am looping through the characteristic table and doing a case statement on the name. If I wish to suppress the characteristic I delete it from the table. When it runs I get a run-time error (no dump, one of those message errors). It doesn't like the delete statement. I am also putting several characteristics on one line to save space, you will see in the code below:

LOOP AT tkomcon.

CASE tkomcon-atnam.

WHEN 'Z_LENGTH'.

temp_length = tkomcon-atwtb.

  • CONCATENATE ztempstring tkomcon-atwtb INTO ztempstring.

WHEN 'Z_WIDTH'.

temp_width = tkomcon-atwtb.

DELETE tkomcon.

WHEN 'Z_THICKNESS1'.

temp_height1 = tkomcon-atwtb.

DELETE tkomcon.

WHEN 'Z_THICKNESS2'.

temp_height2 = tkomcon-atwtb.

DELETE tkomcon.

WHEN 'Z_THICKNESS3'.

temp_height3 = tkomcon-atwtb.

DELETE tkomcon.

WHEN 'Z_THICKNESS4'.

temp_height4 = tkomcon-atwtb.

DELETE tkomcon.

WHEN 'Z_PCS'.

temp_pcs = tkomcon-atwtb.

WHEN 'Z_BFT_PCE'.

DELETE tkomcon.

WHEN 'Z_BOARD_FT'.

DELETE tkomcon.

WHEN 'Z_PRICE_PASS'.

DELETE tkomcon.

WHEN 'Z_PRICE_PCE'.

temp_price = tkomcon-atwtb.

WHEN 'Z_GRIND'.

DELETE tkomcon.

WHEN 'Z_BORATE'.

DELETE tkomcon.

ENDCASE.

ENDLOOP.

READ TABLE tkomcon INDEX 1.

tkomcon-atwtb = ''.

CONCATENATE temp_length ' x ' temp_width ' x ' temp_height1 ' x ' temp_height2 ' x ' temp_height3

' x ' temp_height4 ' x ' INTO ztempstring.

tkomcon-atbez = ztempstring.

MODIFY tkomcon.

Regards,

Davis