cancel
Showing results for 
Search instead for 
Did you mean: 

Calculation Program

Former Member
0 Kudos

Hi All,

Acc to my requirements, I have to print the total weight at the bottom of the page.

I tried with the following code,but its nor working out.

/: PERFORM GET_TOTAL IN PROGRAM ZSCM_GET_TOTAL

/:USING &LTAP-BRGEW&

/:CHANGING &VALUE1&

/:ENDPERFORM

ZL TOTAL: &VALUE1&

PROGRAM zscm_get_total.

&----


*& Form GET_TOTAL

&----


  • text

----


  • -->INT_COND text

  • -->OUT_COND text

----


FORM get_total TABLES int_cond STRUCTURE itcsy

out_cond STRUCTURE itcsy.

DATA : value LIKE ltap-brgew,

gv_total LIKE ltap-brgew.

STATICS value1 LIKE ltap-brgew.

READ TABLE int_cond WITH KEY 'LTAP-BRGEW'.

value = int_cond-value.

value1 = value1 + value.

READ TABLE out_cond WITH KEY 'VALUE1'.

out_cond-value = value1.

MODIFY out_cond INDEX 1.

ENDFORM. "GET_TOTAL

Please help me out with your valuable replies.

Thanks...

Praveen

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks all for your support...

Former Member
0 Kudos

Hi Praveen,

Put the &VALUE1& in a window without having any text element reference.

Call this window after your calculation stuff i.e at bottom.

Please try this and let us know ur comments.

Regards,

Nara

Former Member
0 Kudos

Hi Narasimha,

I didn't get you. I am using SAP Scripts here.

Thanks,

Praveen

Former Member
0 Kudos

Thanks...

I solved my problem...

I used LIKP-BTGEW, for total weight.

Br,

Praveen

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

VALUE1 needs to be defined in the sapscript and passed back from the FORM.

<b>/: DEFINE &VALUE1&</b>

/: PERFORM GET_TOTAL IN PROGRAM ZSCM_GET_TOTAL

/:USING &LTAP-BRGEW&

/:CHANGING &VALUE1&

/:ENDPERFORM

ZL TOTAL: &VALUE1&

PROGRAM zscm_get_total.

&----


*& Form GET_TOTAL

&----


  • text

----


  • -->INT_COND text

  • -->OUT_COND text

----


FORM get_total TABLES int_cond STRUCTURE itcsy

out_cond STRUCTURE itcsy.

DATA : value LIKE ltap-brgew,

gv_total LIKE ltap-brgew.

STATICS value1 LIKE ltap-brgew.

READ TABLE int_cond WITH KEY 'LTAP-BRGEW'.

value = value + int_cond-value.

*value1 = value1 + value.

READ TABLE out_cond WITH KEY 'VALUE1'.

out_cond-value = value.

MODIFY out_cond INDEX 1.

ENDFORM. "GET_TOTAL

Regards,

RIch Heilman

Former Member
0 Kudos

Thanks Rich,

I did all the changes as you mentioned.The code is working fine , in debug mode total is getting the right value.

But the value is not displaying on the script printout.

Please help me out in this.

Thanks,

Praveen