Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Sapscript Totals by Subroutine Error

Hi Everybody,

PROGRAM Z_GET_PRICE.

FORM F_GET_PRICE TABLES INTAB STRUCTURE ITCSY OUTTAB STRUCTURE ITCSY.

DATA FIELD1 TYPE CHAR25.

STATICS TOT_PRICE TYPE CHAR25.

READ TABLE INTAB WITH KEY 'RF140-WRSHB'.

IF SY-SUBRC = 0 .

FIELD1 = INTAB-VALUE.

ENDIF.

TOT_PRICE = TOT_PRICE + FIELD1.

READ TABLE OUTTAB WITH KEY 'TOT_PRICE' .

IF SY-SUBRC = 0 .

OUTTAB-VALUE = TOT_PRICE.

MODIFY OUTTAB INDEX 1 .

ENDIF.

ENDFORM.

I am getting error while using this code . I debugged this code, for first record its passing out from routine, but at second record at TOT_PRICE = TOT_PRICE + FIELD1 this place throwing to dump. Can you please suggest me on this issue?

at first record field1 = 45.00 ,TOT_PRICE = 0 + 45.00 = 45.00

second record 1631.28 ,TOT_PRICE = 45.00 + 1631.28 --> error

In sapscript at main window i diclare perform, is fine. if i dont use TOT_PRICE = FIELD1 only Its printing data, but a wrong data.

Thanks in Advance.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question