cancel
Showing results for 
Search instead for 
Did you mean: 

Total Value at the Footer.

Former Member
0 Kudos

Hi,

I am using the following sub routine to print the total weight of the transfer order pick list at the footer level.

but its printing only one items weight, not the total weight,please see into the code.

I appreciate your suggestions.this is really urgent,please help me out.

/: PERFORM GET_TOTAL IN PROGRAM ZSCM_GET_TOTAL3

/: USING &LTAK-TANUM&

/: USING &LTAP-BRGEW&

/: CHANGING &VALUE1&

/:ENDPERFORM

PROGRAM ZSCM_GET_TOTAL3.

&----


*& 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,

Q1(6) TYPE C.

STATICS VALUE1 LIKE LTAP-BRGEW.

BREAK PKONDAMADUGU.

LOOP AT INT_COND.

READ TABLE INT_COND WITH KEY 'LTAP-BRGEW'.

VALUE = VALUE + INT_COND-VALUE.

VALUE1 = VALUE1 + VALUE.

ENDLOOP.

READ TABLE OUT_COND WITH KEY 'VALUE1'.

Q1 = VALUE1.

OUT_COND-VALUE = Q1.

MODIFY OUT_COND INDEX SY-TABIX.

ENDFORM. "GET_TOTAL

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi!

Try not to confuse yourself and move the parameter values into different variables.

Your coding will be much more easy.



LOOP AT INT_COND.
  IF INT_COND-NAME = 'LTAK-TANUM'.
    MOVE INT_COND-VALUE TO lv_ltak_tanum.
  ENDIF.
  IF INT_COND-NAME = 'LTAP-BRGEW'.
    MOVE INT_COND-VALUE TO lv_ltap_brgew.
  ENDIF.
  IF INT_COND-NAME = 'VALUE1'.
    MOVE INT_COND-VALUE TO lv_value1.
  ENDIF.
ENDLOOP.

Then use these variables, and you will be not confused by the parameters tables.

BUT! There's a bug in your theory. What will happen if there are so many items, what cannot be fit on one page?

Your footer will keep the value only the sum of the items from the first page. I suggest you to write you summing into the printer program, if you can.

Regards

Tamá

Former Member
0 Kudos

Hi Tamas,

Thanks so much for your reply.

What you said is right.please explain me how to write the total code in the printer program.

The toral weight is there on the sales order, which is

RV45A-BTGEW.

Thanks,

Praveen

Former Member
0 Kudos

Hi!

I think you might use this version also, but do not print the sum of the values into the FOOTER window, just simply print it after the last item in your MAIN window. In this case the total will be only on the last page (and not on all pages), but its value will be correct.

Anyways if you wanted to do the summing in the printer program, check this:

You have to know the name of the printer program. If this is a standard, just copy it in SE38 to a Z... name, and modify the customizing also in SPRO, to make the transaction use your Z... printer program.

Regards

Tamá