Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Smartform debugging issue

Former Member
0 Likes
2,226

Hi Experts,

I have sales invoice sf in which I have to add one more tax i.e tcs (1%).

In the text of one of the cells in the main area it shows:

&itab-total-vat1&

&itab-total-et1&

&itab-total-cst1&

In its program lines, i have written code like total1 = total + total_vat1 + total_et1 + total_cst1.  If I debug this, the values are not coming and in the output its coming. I want the total of all this and calculate 1%. How to do it?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,187

In the text, its written

&itab-total-vat1&

&itab-total-et1&

&itab-total-cst1&

The output it coming fine. I want to add one more tax i.e tcs which is 1% of total + vat +et.

I have written this in the program code:

break-point.

total1 = total + total_vat1 + total_et1.

tcs = total1 * 1 / 100.

In debugging the values of total_vat1 and total_et1 are not coming. How to do it?

24 REPLIES 24
Read only

vinoth_aruldass
Contributor
0 Likes
2,187

hi,

assign local variable and calculate 1 % and display in the smartform.

hope it helps,

Vinoth.

Read only

0 Likes
2,187

total + total_vat1 + total_et1 + total_cst1.

Even I thought of it. But the values in this are not coming, Whats the use of assigning it to local variables?

Read only

0 Likes
2,187

hi,

in your itab values are coming ?

Read only

0 Likes
2,187

Sir, all the values are comingin output. I want to add 1 more tax i.e (tcs) 1% of total+vat1+et+cst1.

Read only

Former Member
0 Likes
2,187

Hi,

Put the break point manually as BREAK <USERID> or BREAK-POINT before your calculation in your program lines.then when ever you execute your smartform it will stop there then you can see what are the values coming And then do the calculation.

Thanks

Mani

Read only

0 Likes
2,187

The calculation of other taxes has been done in the report but the total is caluclated in sf. So, I am not able to calculate the total1 in the report. I dont want to change it much.

Read only

0 Likes
2,187

Hi,

First you keep the break point in the Report program and check wither the values for the variables total + total_vat1 + total_et1 + total_cst1 are coming or not if yes then you have to debug the smartform as i mentioned above.

Thanks

Mani

Read only

0 Likes
2,187

The output of the smartform is perfect. All the values are coming. I want to add one more tax for which I was doing the calculation.

total1 = total + total_vat1 + total_et1 + total_cst1

tcs = total1 / 100.

Am I doing right?

Read only

0 Likes
2,187

total1 = total + vat1 + et.(total + 2 taxes)

I have to calculate 1% of total1 and display it.

Read only

0 Likes
2,187

HI,

write the code in the program lines in the smartform as

var = total1 * 1/100.

and display var where ever you want.

Thanks

Mani

Read only

0 Likes
2,187

I appreciate your reply. Sir, I am facing issue in calculating total1. Pl suggest.

Read only

0 Likes
2,187

Hi ,

As i have understood you want to display the 1% of the total tax i.e not the actual tax (tax + 1%tax).

So you may use your existing variable in the

After the calculation of tax.

total1 = total + vat1 + et.(total + 2 taxes).

total1 = 1/100 * total1. (If you want to display 1% of tax).

total1 = total1 + 1/100 * total1. (If you want to display 1% of tax + tax).

Please try this and let us know.

Regards,

Amit

Read only

0 Likes
2,187

Sir, could you please guide me how to calculate total1. the values in vat and et and not coming in the program lines.

Read only

0 Likes
2,187

Hi ,

You'll not be able to see the value in program lines.

For that you'll have to put breakpoint in the FM of smartform.

But write your code as suggested above you'll get the proper output.

Regards,

Amit

Read only

0 Likes
2,187

I didnt get it. The values in the total_vat1 and total_et1 are not coming in sf.

Read only

Former Member
0 Likes
2,188

In the text, its written

&itab-total-vat1&

&itab-total-et1&

&itab-total-cst1&

The output it coming fine. I want to add one more tax i.e tcs which is 1% of total + vat +et.

I have written this in the program code:

break-point.

total1 = total + total_vat1 + total_et1.

tcs = total1 * 1 / 100.

In debugging the values of total_vat1 and total_et1 are not coming. How to do it?

Read only

0 Likes
2,187

Hi ,

Please check the driver program for the values of total_vat1 and total_et1.

Regards,

Amit

Read only

0 Likes
2,187

Sir, the values are coming in the driver prg and the output as well.

Read only

0 Likes
2,187

hi,

write the logic for loop itab and get the total in total_val1 and etc

then you will get the values ,

hope it helps,

Vinoth

Read only

0 Likes
2,187

*&---------------------------------------------------------------------*

*& Report  ZINV_REPORT1

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT  ZINV_REPORT1_rough.

" invoice report created by kushal

TABLES : VBRK.

TYPES : BEGIN OF TS_VBRK,

         VBELN TYPE VBRK-VBELN,

         KNUMV TYPE VBRK-KNUMV,

         KUNRG TYPE VBRK-KUNRG,

         FKDAT TYPE VBRK-FKDAT,

         END OF TS_VBRK.

TYPES : BEGIN OF TS_VBRP,

         VBELN TYPE VBRP-VBELN,

         FKLMG TYPE VBRP-FKLMG,

         VGBEL TYPE VBRP-VGBEL,

         AUBEL TYPE VBRP-AUBEL,

         WERKS TYPE VBRP-WERKS,

         ARKTX TYPE VBRP-ARKTX,

         MATNR TYPE VBRP-MATNR,

         POSNR TYPE VBRP-POSNR,

        END OF TS_VBRP.

TYPES : BEGIN OF TS_VBKD,

        VBELN TYPE VBKD-VBELN,

        BSTKD TYPE VBKD-BSTKD,

       END OF TS_VBKD.

TYPES : BEGIN OF TS_KNA1,

         KUNNR TYPE KNA1-KUNNR,

         NAME1 TYPE KNA1-NAME1,

         NAME2 TYPE KNA1-NAME2,

         name3 TYPE KNA1-NAME3,

         ORT01 TYPE KNA1-ORT01,

         STCEG TYPE KNA1-STCEG,

         END OF TS_KNA1.

TYPES : BEGIN OF TS_T001W,

         NAME1 TYPE T001W-NAME1,

         WERKS TYPE T001W-WERKS,

         END OF TS_T001W.

TYPES : BEGIN OF TS_KONV,

         KPOSN TYPE KONV-KPOSN,

         KNUMV  TYPE KONV-KNUMV,

         KSCHL TYPE KONV-KSCHL,

         KBETR TYPE KONV-KBETR,

        KWERT1 TYPE KONV-KWERT,

        KWERT2 TYPE KONV-KWERT,

         KWERT TYPE KONV-KWERT,

        END OF TS_KONV.

TYPES :BEGIN OF TS_LIKP,

        VBELN TYPE LIKP-VBELN,

        WADAT_IST TYPE LIKP-WADAT_IST,

        END OF TS_LIKP.

TYPES : BEGIN OF TS_FINAL.

         INCLUDE STRUCTURE ZSTRUCTURE.

TYPES : END OF TS_FINAL.

*

data: total1 type i.

*

* **************************************SMARTFORM DECLARTION***********************************************************************

DATA : FM_NAME TYPE RS38L_FNAM.

DATA : CHAR28 LIKE THEAD-TDNAME.

DATA : NAME LIKE STXH-TDNAME.

DATA : CONTROL TYPE SSFCTRLOP.

DATA : OUTPUT_OPTIONS     TYPE SSFCOMPOP,

XSFPARAM_LINE      TYPE SSFXSFP,

CONTROL_PARAMETERS TYPE SSFCTRLOP,

OUTPUT_DATA        TYPE SSFCRESCL.

*  ******************************************************************************************************

*                   INTERNAL TABLE DECLARATION

*  *****************************************************************************************************

DATA : IT_VBRK TYPE STANDARD TABLE OF TS_VBRK.

DATA : IT_VBRP TYPE STANDARD TABLE OF TS_VBRP.

DATA : IT_VBKD TYPE STANDARD TABLE OF TS_VBKD.

DATA : IT_KNA1 TYPE STANDARD TABLE OF TS_KNA1.

DATA : IT_T001W TYPE STANDARD TABLE OF TS_T001W.

DATA : IT_KONV TYPE STANDARD TABLE OF TS_KONV,

        IT_KONV_VAT TYPE STANDARD TABLE OF TS_KONV,

*       IT_KONV_CST TYPE STANDARD TABLE OF TS_KONV,

        IT_KONV_CET TYPE STANDARD TABLE OF TS_KONV,

         IT_KONV_CST TYPE STANDARD TABLE OF TS_KONV.

DATA : IT_LIKP TYPE STANDARD TABLE OF TS_LIKP.

DATA : IT_FINAL TYPE STANDARD TABLE OF TS_FINAL.

************************************************************************************************************

*            WORK AREA DECLARATION

**************************************************************************************************************

DATA : WA_VBRK TYPE TS_VBRK.

DATA : WA_VBRP TYPE TS_VBRP.

DATA : WA_VBKD TYPE TS_VBKD.

DATA : WA_KNA1 TYPE TS_KNA1.

DATA : WA_T001W TYPE TS_T001W.

DATA : WA_KONV     TYPE TS_KONV,

        WA_KONV_VAT TYPE TS_KONV,

        WA_KONV_CST TYPE TS_KONV,

        WA_KONV_CET TYPE TS_KONV.

DATA : WA_LIKP TYPE TS_LIKP.

DATA : WA_FINAL TYPE TS_FINAL.

***************added by rajdeep saimons on 04/09/2012************************

DATA: AMT_NEW  TYPE ZSTRUCTURE-AMT,

       AMOUNT_2 TYPE ZSTRUCTURE-AMOUNT,

       AMOUNT2  TYPE ZSTRUCTURE-AMOUNT1,

       """"""""""""""""""""""""""""""""""""""""""""""ADDED BY ANIRBAN ON 11/09/12

      TOTAL_VAT TYPE ZSTRUCTURE-AMT,

      TOTAL_VAT1 TYPE ZSTRUCTURE-AMT,

      TOTAL_ET TYPE ZSTRUCTURE-AMT,

      TOTAL_ET1 TYPE ZSTRUCTURE-AMT,

       TOTAL_CST TYPE ZSTRUCTURE-AMT,

      TOTAL_CST1 TYPE ZSTRUCTURE-AMT.

*****************end of rajdeep*******************************************

SELECTION-SCREEN : BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.

SELECT-OPTIONS   : S_VBELN FOR VBRK-VBELN  NO-EXTENSION NO INTERVALS.

SELECTION-SCREEN : END OF BLOCK B3.

INITIALIZATION.

*  V_REPID = SY-REPID.

*  V_LAYOUT-ZEBRA = C_X.

*

START-OF-SELECTION.

   PERFORM GET_DATA_VBRK.

   PERFORM GET_DATA_VBRP.

   PERFORM GET_DATA_VBKD.

   PERFORM GET_DATA_KNA1.

   PERFORM GET_DATA_T001W.

   PERFORM GET_DATA_KONV.

   PERFORM GET_DATA_LIKP.

   PERFORM PRINTER_SETTINGS.

   PERFORM SMART_FORM.

*----------------------------------------------------------------------

*&      Form  GET_DATA_VBRK

*&---------------------------------------------------------------------*

FORM GET_DATA_VBRK.

*BREAK-POINT.

   SELECT VBELN KNUMV KUNRG FKDAT FROM VBRK INTO CORRESPONDING FIELDS OF TABLE IT_VBRK

     WHERE VBELN IN S_VBELN.

ENDFORM.                    "GET_DATA_VBRK

* *----------------------------------------------------------------------

*&      Form  GET_DATA_VBRP

*&---------------------------------------------------------------------*

FORM GET_DATA_VBRP.

*  break-point.

   SELECT VBELN FKLMG VGBEL AUBEL WERKS ARKTX  MATNR POSNR FROM VBRP INTO CORRESPONDING FIELDS OF TABLE IT_VBRP

     FOR ALL ENTRIES IN IT_VBRK WHERE VBELN = IT_VBRK-VBELN.

loop at it_vbrp into wa_vbrp.

   move-corresponding wa_vbrp to wa_final.

   append wa_Final to it_final.

   endloop.

******************************CHANGED BY RAJDEEP ON 04/09/2012***********************

   IT_FINAL[] = IT_VBRP[].

   LOOP AT IT_FINAL INTO WA_FINAL.

     READ TABLE IT_VBRK INTO WA_VBRK WITH KEY VBELN = WA_FINAL-VBELN.

     IF SY-SUBRC = 0.

       WA_FINAL-KNUMV  = WA_VBRK-KNUMV.

       WA_FINAL-KUNRG  = WA_VBRK-KUNRG.

       WA_FINAL-FKDAT  = WA_VBRK-FKDAT.

       MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING KNUMV KUNRG FKDAT.

     ENDIF.

*    DELETE ADJACENT DUPLICATES FROM IT_FINAL COMPARING ALL FIELDS.              " COMMENTED BY RAJDEEP ON 04/09/2012

     WA_FINAL-FKLMG1 = WA_FINAL-FKLMG.

     MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING FKLMG1.

   ENDLOOP.

***********************END OF RAJDEEP***************************************************

   """"""""""""""""""""""""""added by anirban on 06/10/12"""""""""""""""""""""""""""""""

*  DATA arktx1 TYPE string.

*  LOOP AT it_final INTO wa_final.

*    wa_final-arktx1 = wa_final-arktx.

*    arktx1 = wa_final-arktx1.

*    MODIFY it_final FROM wa_final TRANSPORTING arktx1.

*

*  ENDLOOP.

ENDFORM.                    "GET_DATA_VBRP

* * *------------------------------------------------------------------

*&      Form  GET_DATA_VBkD

*&---------------------------------------------------------------------*

FORM GET_DATA_VBKD.

   SELECT VBELN BSTKD FROM VBKD INTO CORRESPONDING FIELDS OF TABLE IT_VBKD

     FOR ALL ENTRIES IN IT_FINAL WHERE VBELN = IT_FINAL-AUBEL.

   LOOP AT IT_FINAL INTO WA_FINAL.

     READ TABLE IT_VBKD INTO WA_VBKD WITH KEY VBELN = WA_FINAL-AUBEL.

     IF SY-SUBRC = 0.

       WA_FINAL-BSTKD = WA_VBKD-BSTKD.

       MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING BSTKD.

     ENDIF.

   ENDLOOP.

ENDFORM.                    "GET_DATA_VBKD

* * *------------------------------------------------------------------

*&      Form  GET_DATA_KNA1

*&---------------------------------------------------------------------*

FORM GET_DATA_KNA1.

   SELECT KUNNR NAME1 NAME2 name3 ORT01 STCEG FROM KNA1 INTO CORRESPONDING FIELDS OF TABLE IT_KNA1

     FOR ALL ENTRIES IN IT_FINAL WHERE KUNNR = IT_FINAL-KUNRG.

   LOOP AT IT_FINAL INTO WA_FINAL.

     READ TABLE IT_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_FINAL-KUNRG.

     IF SY-SUBRC = 0.

       WA_FINAL-NAME1 = WA_KNA1-NAME1.

       WA_FINAL-NAME2 = WA_KNA1-NAME2.

       WA_FINAL-NAME3 = WA_KNA1-NAME3.

       WA_FINAL-ORT01 = WA_KNA1-ORT01.

       WA_FINAL-STCEG = WA_KNA1-STCEG.

       MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING NAME1 NAME2 name3 ORT01 STCEG.

     ENDIF.

   ENDLOOP.

ENDFORM.                    "GET_DATA_KNA1

* * *------------------------------------------------------------------

*&      Form  GET_DATA_KNA1

*&---------------------------------------------------------------------*

FORM GET_DATA_T001W.

   SELECT WERKS NAME1 FROM T001W INTO CORRESPONDING FIELDS OF TABLE IT_T001W

     FOR ALL ENTRIES IN IT_FINAL WHERE

     WERKS = IT_FINAL-WERKS.

   LOOP AT IT_FINAL INTO WA_FINAL.

     READ TABLE IT_T001W INTO WA_T001W WITH KEY WERKS = WA_FINAL-WERKS.

     IF SY-SUBRC = 0.

       WA_FINAL-PDESC = WA_T001W-NAME1.

       MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING PDESC.

     ENDIF.

   ENDLOOP.

ENDFORM.                    "GET_DATA_T001W

*  * * *------------------------------------------------------------------

*&      Form  GET_DATA_KONV

*&---------------------------------------------------------------------*

FORM GET_DATA_KONV.

   SELECT KNUMV  KPOSN KSCHL KBETR KWERT FROM KONV INTO CORRESPONDING FIELDS OF TABLE IT_KONV

     FOR ALL ENTRIES IN IT_FINAL

     WHERE KNUMV = IT_FINAL-KNUMV

     AND KSCHL IN ('ZR00','ZVAT','ZCET','ZCST').

*******************************************ADDED BY RAJDEEP SAIMONS ON 05/09/2012****************

   SORT IT_KONV BY KSCHL.

   IT_KONV_VAT[] = IT_KONV[].

   IT_KONV_CST[] = IT_KONV[].

   IT_KONV_CET[] = IT_KONV[].

   DELETE IT_KONV     WHERE KSCHL NE 'ZR00'.

   DELETE IT_KONV_VAT WHERE KSCHL NE 'ZVAT'.

   DELETE IT_KONV_CST WHERE KSCHL NE 'ZCST'.

   DELETE IT_KONV_CET WHERE KSCHL NE 'ZCET'.

   LOOP AT IT_FINAL INTO WA_FINAL.

     READ TABLE IT_KONV INTO WA_KONV WITH KEY KNUMV = WA_FINAL-KNUMV.

     IF SY-SUBRC = 0.

       IF WA_KONV-KSCHL = 'ZR00'.

         WA_FINAL-ZR00_KBETR = WA_KONV-KBETR.

         WA_FINAL-ZR00_KWERT = WA_KONV-KWERT.

         MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING  ZR00_KBETR ZR00_KWERT.

       ENDIF.

     ENDIF.

     DELETE IT_KONV INDEX 1.

   ENDLOOP.

   LOOP AT IT_FINAL INTO WA_FINAL.

     READ TABLE IT_KONV_VAT INTO WA_KONV_VAT WITH KEY KNUMV = WA_FINAL-KNUMV.

     IF SY-SUBRC = 0.

       IF WA_KONV_VAT-KSCHL = 'ZVAT'.

         WA_FINAL-ZVAT_RATE = ( WA_KONV_VAT-KBETR /  10 ).

         WA_FINAL-ZVAT_KBETR =  WA_FINAL-ZVAT_RATE   .

         WA_FINAL-ZVAT_KWERT = WA_KONV_VAT-KWERT.

         MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING ZVAT_RATE ZVAT_KBETR ZVAT_KWERT.

         ENDIF.

      """"""""""""""""""""""""""""""""""""""

*     LOOP AT .

*

*     ENDLOOP.

     ENDIF.

     DELETE IT_KONV_VAT INDEX 1.

   ENDLOOP.

"""""""""""""""""""""""""""""""""""""""""""added by Anirban on 11/09/2012..........

   break-point.

LOOP AT IT_FINAL INTO WA_FINAL.

    TOTAL_VAT = WA_FINAL-ZVAT_KWERT .

    TOTAL_VAT1 = TOTAL_VAT1 + TOTAL_VAT.

  ENDLOOP.

  LOOP AT IT_FINAL INTO WA_FINAL.

    WA_FINAL-TOTAL_VAT1 = TOTAL_VAT1 .

   MODIFY it_final FROM wa_final TRANSPORTING TOTAL_VAT1.

  ENDLOOP.

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

   LOOP AT IT_FINAL INTO WA_FINAL.

     READ TABLE IT_KONV_CET INTO WA_KONV_CET WITH KEY KNUMV = WA_FINAL-KNUMV.

     IF SY-SUBRC = 0.

       IF WA_KONV_CET-KSCHL = 'ZCET'.

         WA_FINAL-ZCET_RATE =   ( WA_KONV_CET-KBETR / 10 )  .

         WA_FINAL-ZCET_KBETR = WA_FINAL-ZCET_RATE.

         WA_FINAL-ZCET_KWERT = WA_KONV_CET-KWERT.

         MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING ZCET_RATE ZCET_KBETR ZCET_KWERT.

       ENDIF.

     ENDIF.

     DELETE IT_KONV_CET INDEX 1.

   ENDLOOP.

"""""""""""""""""""""""""""""""""""""""""""""""added by anirban on 11/09/2012""""""""""

   LOOP AT it_final INTO wa_final.

  TOTAL_ET = WA_FINAL-ZCET_KWERT.

  TOTAL_ET1 = TOTAL_ET1 + TOTAL_ET.

   ENDLOOP.

   LOOP AT IT_FINAL INTO WA_FINAL.

     WA_FINAL-TOTAL_ET1 = TOTAL_ET1.

   MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING TOTAL_ET1.

   ENDLOOP.

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

   LOOP AT IT_FINAL INTO WA_FINAL.

     READ TABLE IT_KONV_CST INTO WA_KONV_CST WITH KEY kposn = WA_FINAL-posnr.

     IF SY-SUBRC = 0.

       IF WA_KONV_CST-KSCHL = 'ZCST' ."and wa_konv_cst-Kposn = WA_FINAL-posnr. " added for cst

         WA_FINAL-ZCST_RATE =   ( WA_KONV_CST-KBETR / 10 )  .

         WA_FINAL-ZCST_KBETR = WA_FINAL-ZCST_RATE.

         WA_FINAL-ZCST_KWERT = WA_KONV_CST-KWERT.

         MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING ZCST_RATE ZCST_KBETR ZCST_KWERT.

       ENDIF.

     ENDIF.

     DELETE IT_KONV_CET INDEX 1.

   ENDLOOP.

   """"""""""""""""""""""""""""""""""""""""""""""added by anirban on 10/04/2012""""""""""""""""""""""""""""""""

    LOOP AT IT_FINAL INTO WA_FINAL.

      TOTAL_CST = WA_FINAL-ZCST_KWERT.

      TOTAL_CST1 = TOTAL_CST1 + TOTAL_CST.

    ENDLOOP.

    LOOP AT IT_FINAL INTO WA_FINAL.

      WA_FINAL-TOTAL_CST1 = TOTAL_CST1.

    MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING TOTAL_CST1.

    ENDLOOP.

*   loop at it_final into wa_final.      """"""""""purnand

*     total1 = total + total_vat1 + total_et1 + total_cst1.

*     modify it_final from wa_final transporting total1.

*     endloop.

*****************************************************************************************

**********************************changes by rajdeep saimons on 04/09/2012***************

   LOOP AT IT_FINAL INTO WA_FINAL.

     AMT_NEW  = WA_FINAL-ZR00_KWERT + WA_FINAL-ZVAT_KWERT + WA_FINAL-ZCET_KWERT + WA_FINAL-ZCST_KWERT.

     AMOUNT_2 = AMOUNT_2 + AMT_NEW.

   ENDLOOP.

   CALL FUNCTION 'Z_SPELL_WORDS'

     EXPORTING

       AMOUNT = AMOUNT_2

     IMPORTING

       WORDS  = amount2.

*    EXCEPTIONS

*      INCORRECT_RESULT       = 1

*      OTHERS                 = 2

   .

   IF SY-SUBRC <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

*   ENDIF.

   ENDIF.

******************************************end of rajdeep saimons********************************************

ENDFORM.                    "GET_DATA_KONV

*  * * *------------------------------------------------------------------

*&      Form  GET_DATA_LIKP

*&---------------------------------------------------------------------*

FORM GET_DATA_LIKP.

   SELECT VBELN  WADAT_IST FROM LIKP INTO CORRESPONDING FIELDS OF TABLE IT_LIKP

     FOR ALL ENTRIES IN IT_FINAL WHERE VBELN = IT_FINAL-VGBEL.

   LOOP AT IT_FINAL INTO WA_FINAL.

     READ TABLE IT_LIKP INTO WA_LIKP WITH KEY VBELN = WA_FINAL-VGBEL.

     IF SY-SUBRC = 0.

       WA_FINAL-TIME = WA_LIKP-WADAT_IST.

       MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING TIME.

     ENDIF.

   ENDLOOP.

ENDFORM.                    "GET_DATA_LIKP

*  .....................................CALLING SMARTFORMS................................................

FORM PRINTER_SETTINGS .

   OUTPUT_OPTIONS-XSF        = ' '.      " XSF Output active

   OUTPUT_OPTIONS-XSFCMODE   = 'X'.      " Get XSF params from program

   OUTPUT_OPTIONS-XSFOUTMODE = 'S'.      " Application

   CLEAR OUTPUT_OPTIONS-XSFOUTDEV.

   OUTPUT_OPTIONS-XSFACTION  = 'http://www.sap.com'.

   OUTPUT_OPTIONS-XSFFORMAT  = 'X'.      " Formatting ON

   XSFPARAM_LINE-NAME  = 'GRAPHICS'.

   XSFPARAM_LINE-VALUE = 'EXTRACT'.

   APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.

   XSFPARAM_LINE-NAME  = 'GRAPHICS-DIRECTORY'.

*  xsfparam_line-value = c_gr_dir.

   APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.

   XSFPARAM_LINE-NAME  = 'CONTENT-ID'.

   XSFPARAM_LINE-VALUE = 'ENABLE'.

   APPEND XSFPARAM_LINE TO OUTPUT_OPTIONS-XSFPARS.

   OUTPUT_OPTIONS-TDIMMED = 'X'.

   OUTPUT_OPTIONS-TDNEWID = 'X'.

   OUTPUT_OPTIONS-TDNOPRINT = ' '.

   OUTPUT_OPTIONS-TDDELETE = 'X'.

*    OUTPUT_OPTIONS-TDFINAL = 'X'.

   OUTPUT_OPTIONS-TDDEST = 'LOCL'.

* silent mode ON

   CONTROL-NO_DIALOG = ' '.

   CONTROL-PREVIEW = 'X'.

ENDFORM.                    " PRINTER_SETTINGS

*&---------------------------------------------------------------------*

*&      Form  SMART_FORM

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM SMART_FORM .

   CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

     EXPORTING

       FORMNAME = 'ZINVDISPLAY2_ROUGH'

*      FORMNAME = 'ZINVDISPLAY'

     IMPORTING

       FM_NAME  = FM_NAME.

*  EXCEPTIONS

*    NO_FORM            = 1

*    NO_FUNCTION_MODULE = 2

*    OTHERS             = 3.

   IF SY-SUBRC <> 0.

*    WRITE : / 'ERROR 1'.

   ENDIF.

   CALL FUNCTION FM_NAME

     EXPORTING

       CONTROL_PARAMETERS = CONTROL

       OUTPUT_OPTIONS     = OUTPUT_OPTIONS

       USER_SETTINGS      = SPACE

       AMOUNT_2           = AMOUNT_2                      " added by rajdeep saimons

       amount2            = amount2                 " added by rajdeep saimons

     TABLES

       ITAB               = IT_FINAL[]

     EXCEPTIONS

       FORMATTING_ERROR   = 1

       INTERNAL_ERROR     = 2

       SEND_ERROR         = 3

       USER_CANCELED      = 4

       OTHERS             = 5.

   IF SY-SUBRC <> 0.

     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

   ENDIF.

ENDFORM.                    " SMART_FORM

Read only

0 Likes
2,187

Hi Purna,

can you check the below it will hwlp you.

   loop at it_final into wa_final. 

      clear wa_final- total1.

     wa_final- total1 = wa_final- total_vat1 + wa_final- total_et1 + wa_final- total_cst1.

    modify it_final from wa_final transporting total1.

    endloop.

Regards,

Gurunath

Read only

0 Likes
2,187

I'll check it at home. I'll get back to you

Read only

0 Likes
2,187

Hi Purnand,

go to your sf layout. go to program lines where you have calculated total1 value.

TCS = total1 / 100.  [because 1%] [in export parameter define TCS]

in text node just add

&TCS&.

total sum = amt_2 + TCS. [import parameter define TCS].....

Hope your problem will be solved , if not then let me know......

Thanks

Sabyasachi

Read only

gurunathkumar_dadamu
Active Contributor
0 Likes
2,187

Hi Purna,

my doubt is your displaying itab-total-vat1 and itab-total-et1, but are you the values to total_vat1 and total_et1 for the calculation.

please can you chack and if you share the piece of code which is in within the loop it will helpful

Regards,

Gurunath Kumar