Runtime Error in Total ammount calculations in smartforms.

Dear Friends,
                            In my PO smartform i am calculating TOTAL AMOUNT in the CODE .
INPUT PARAMETER          -
OUT PARAMETER
I_EKPO-MENGE                                                             V_BASICAMT(like ekpo-netpr)
I_EKPO-NETPR
in the editor.
v_basicamt = i_ekpo-menge + i_ekpo-netpr.
while executing its goes for a shart dump saying :-
"the result field of  typr p  is too small for the result."
Please advice...
thanks.

Hi,
The type used for v_basicamt is not long enogh to store the result of the calculation v_basicamt = i_ekpo-menge + i_ekpo-netpr.
Use a longer type like data element WERTV13.
Regards,
Ankur Parab

Similar Messages

  • Getting Runtime error while adding Second page in Smartform.

    I added 2 pages in smartform. When I worked with single page. smartform working properly. Now I added one more page(i.e Second page) I am getting runtime error.  ("The current ABAP/4 program encountered an unexpected
    situation".   A RAISE statement in the program "SAPLSTXBC" raised the exception
    condition "ERROR".)   When I debug this standard program Something width problem getting on line number 110. Both width not matched so program raising exception. Can you please tell me to solve this problem what changes will I do in my smartform?

    Please let me know the details of each page.
    Error can occur in these cases.
    1) You copied the first page to second. and later you change the width of second page
    2) You created the second page and there is template in second page. each column width is not matching with the total width of the template.
    3) windows width is greater than the page width
    Please have a look.
    Regards,
    Nikhil
    Edited by: Nikhil V Kumar on Jul 27, 2010 12:16 PM

  • Runtime error in print program of a smartform

    Hi,
    While trying to execute the print program of a smartform I am getting the following runtime error.
    The reason for the exception is:
    The call to the function module "/1BCDWB/SF00000288" is incorrect:
    In the function module interface, you can specify only
    fields of a specific type and length under "IT_BOOKINGS".
    Although the currently specified field
    "IT_BOOKINGS" is the correct type, its length is incorrect.
    In the form interface of the smartform under tables parameters I have declared like this.
    IT_BOOKINGS      LIKE      SBOOK
    IT_SCHEDULE      LIKE      SPFLI
    Can anyone tell me why do we get this error?
    Regards,
    Hema

    Hello,
    program to call smartform is really simple :
    -> function SSF_FUNCTION_MODULE_NAME give you the name of the function link to your sapscript.
    -> function WFMC_PREPARE_SMART_FORM help your to prepare your options to your smartform.
    -> function xxx  to call your smartform (find with the first function).
    Sometimes you have to play with values of NAST (for ex) to find the language (set in control_parameters) or for example if you want to print without display (when it ask you for print / print preview  and the name of the print device) .....
    Frédéric

  • Runtime Error when trying to trigger smartform from VL03N

    Hi all,
    i am having a runtime error while trying to triger my smartforms from transaction VL03N.
    The error is 'The current ABAP program "SAPLV60U" had to be terminated because it has come across a statement that unfortunately cannot be executed.'
    The it's in the include: "LV60UF0K"
                                                                                    |   21|  LOOP AT XKOMV.                                                                           
    |   22|    KONV       = XKOMV.                                                                    
    |   23|    BELEG = XKOMV-KNUMV.                                                                   
    |   24|    IF BELEG-ID = '$'.                                                                     
    |   25|      PERFORM VBRK_BELEGNUMMER_ERMITTELN.                                                 
    |   26|      XKOMV-KNUMV = XVBRK-KNUMV.                                                           
    |   27|    ENDIF.                                                                               
    |   28|    MODIFY XKOMV.                                                                          
    |   29|  ENDLOOP.                                                                               
    |>>>>>|  INSERT KONV FROM TABLE XKOMV.                                                            
    |   31|  IF SY-SUBRC NE 0.                                                                        
    |   32|    MESSAGE A100 WITH 'KONV' SY-SUBRC XKOMV-knumv.                                         
    |   33|  ENDIF. 
    can anyone help me on this please..
    Thanks in advance
    Regards
    Nitin

    This looks like standard SAP code, your best bet is to log this as a problem on service.sap.com
    Regards,
    Nick

  • Runtime error in executing smartform

    Hi,
    I am working on smartform and its abap code in which i am getting runtime error :-
    In the function "/1BCDWB/SF00000004", the STRUCTURE parameter "ITEM" is typed
    in such a way
    that only actual parameters are allowed, which are compatible in Unicode
    with respect to the fragment view. However, the specified actual
    parameter "ITEM_FINAL1" has an incompatible fragment view.
    Here,item and item_final1(with header line) are the internal tables. plzz provide me guidelines for solvig this problem.
    Edited by: ricx .s on Jan 16, 2009 6:24 AM

    hi,
    i had declared the ITEM and ITEM_FINAL1 AS :-
    DATA : BEGIN OF item OCCURS 0,
           ebelp  LIKE ekpo-ebelp,
           txz01  LIKE ekpo-txz01,
           cc     LIKE cacns_general-reserve3,
           eindt LIKE eket-eindt,
           menge  LIKE ekpo-menge,
           rate   LIKE konv-kbetr,
           rate1  LIKE konv-kbetr, " NEW ZING
           rate2  LIKE konv-kbetr, " NEW ZGRD
           rate3  LIKE konv-kbetr, " NEW ZBDL
           disc   LIKE konv-kbetr,
           ed     LIKE konp-kbetr,
           ed1    LIKE konp-kbetr,"NEW
           ed2    LIKE konp-kbetr,"NEW
           tax    LIKE konp-kbetr,
           cutc   LIKE konv-kbetr,
           pf     LIKE konv-kbetr,
           insurance LIKE konv-kbetr,
           frt LIKE konv-kbetr,
           inst LIKE konv-kbetr,
           octroi LIKE konv-kbetr,
           knumh LIKE konh-knumh,"NEW
           matnr LIKE ekpo-matnr,"NEW
           vakey   LIKE konh-vakey,"NEW
           total LIKE konv-kbetr,
           mtart LIKE ekpo-mtart,
           bwtar LIKE ekpo-bwtar,
           knttp LIKE ekpo-knttp,
           meins LIKE ekpo-meins,
           END OF item.
    DATA : item_final1 LIKE item OCCURS 0 WITH HEADER LINE.
    here's d code of the form :-
    CALL FUNCTION form_name
        EXPORTING
          control_parameters = t_control_parameters
          output_options     = t_output_options
          user_settings      = 'X'
          vknumv             = vknumv
          vtex               = vtex
          vebeln             = vebeln
          vkwert             = vkwert
        TABLES
          header             = header
          item               = item_final1
        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.
    IN the smartform i had declared it as it was in the declaration of the internal table(ITEM).
    I

  • Smartform runtime error

    hi,
        when i am executing the smartform a runtime error is raised in function module
    SSFCOMP_GENERATE_SMART_FORM and the error is err_comp ssf_err_main_width_changed 'A' 080 can anyone tell what is the error its throwing ?

    Hi harri kishan,
                 As shivkumar said. All the main windows of pages should have the same width. If width varies, then form will got dump. So make sure all the main windows should have the same measurements.
          Award points if its useful to you. Feel free to contact me.
    Regards
    Sreenivasa sharma k.

  • Runtime error when executing smartform in se38

    hi,
    i designed a smartform but when iam executing that using se38 am gettin runtime error.can anybody plz help me.
    *& Report  ZDEMOPRG
    REPORT  ZDEMOPRG.
    DATA FNAME(30) TYPE C.
    TABLES: LFA1.
    DATA: BEGIN OF ITAB OCCURS 0.
            INCLUDE STRUCTURE LFA1.
    DATA: END OF ITAB.
    SELECT-OPTIONS S_KUNNR FOR LFA1-KUNNR MEMORY ID 001.
    SELECT * FROM LFA1 WHERE KUNNR IN S_KUNNR.
       MOVE-CORRESPONDING LFA1 TO ITAB..
       APPEND ITAB.
    ENDSELECT.
    CALL FUNCTION '/1BCDWB/SF00000006'
    EXPORTING
        FORMNAME = 'ZEXM_SMART'
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        ITAB                       = ITAB.
    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.
    plz help me
    thanks
    sudheer

    Hi,
    Try this and reward points by clicking the star on the left of reply,if it helps.
    data: form_name type tdsfname value 'ZEXM_SMART'.
    data: fm_name type  rs38l_fnam.
    TABLES: LFA1.
    DATA: BEGIN OF ITAB OCCURS 0.
    INCLUDE STRUCTURE LFA1.
    DATA: END OF ITAB.
    SELECT-OPTIONS S_KUNNR FOR LFA1-KUNNR MEMORY ID 001.
    SELECT * FROM LFA1 WHERE KUNNR IN S_KUNNR.
    MOVE-CORRESPONDING LFA1 TO ITAB..
    APPEND ITAB.
    ENDSELECT.
    call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
        formname                 = form_name
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
    importing
       fm_name                  = fm_name
    exceptions
       no_form                  = 1
       no_function_module       = 2
       others                   = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    CALL FUNCTION fm_name
      TABLES
    ITAB = ITAB
    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.
    endloop.

  • Runtime Error for the Picking List Smartform

    Hi All,
    I am working on the smartform, used for GI Scrapping for 551 Movement type. The requirement is they need DEA number for the Plant. I have written code for getting the DEA number. Iacivated the form and I want to print it using the TCODE MB02.
    I get the runtime error saying UPDATE TERMINATED.I saw Dump Analysis it says CALL_FUNCTION_PARM_MISSING. It says IS_ADRC is the parameter. The ABAP program is the include program /SMB40/M07DRSON. This show the function module lf_fname with out passing the parameter IS_ADRC. How can I change the program. This is Standard program.
    Thanks,

    Then the smart form interface in the transaction SMARTFORMS you have to remove the parameter IS_ADRC. As the calling program will not automatically add the parameters if you add it in the smartforms...
    If you want the values from the table ADRC..you can write subroutines in the INITIALIZATION to get the values...
    Thanks,
    Naren

  • Runtime error smartform

    HI experts ,
                      I have smartforms for Stock Report. and respective selection screen in se38. while executing its shows Below runtime error.
    Runtime Errors         CALL_FUNCTION_CONFLICT_LENG
    Exceptn                CX_SY_DYN_CALL_ILLEGAL_TYPE
    Date and Time          07.07.2007 16:15:34
    ShrtText
        Type conflict when calling a function module (field length).
    What happened?
        Error in ABAP application program.
        The current ABAP program "ZSTOCK_TR" had to be terminated because one of the
        statements could not be executed.
        This is probably due to an error in the ABAP program.
        A function module was called incorrectly.
    Error analysis
        An exception occurred. This exception will be dealt with in more detail
        below. The exception, assigned to the class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
         not caught, which
         led to a runtime error. The reason for this exception is:
        The call to the function module "/1BCDWB/SF00000017" is incorrect:
        In the function module interface, you can specify only
        fields of a specific type and length under "GT_STRUCT".
        Although the currently specified field
        "GT_STRUCT2" is the correct type, its length is incorrect.
    Source Code Extract
    Line  SourceCde
      304
      305 SELECT stceg into ITAB0-stceg  FROM kna1 WHERE KUNNR = VKUNNR.
      306 APPEND ITAB0.
      307 ENDSELECT.
      308
      309 select vgbel from lips into itab0-ponum where vbeln in vbeln.
      310 append itab0.
      311 endselect.
      312 DATA : LINES TYPE STANDARD TABLE OF TLINE WITH HEADER LINE.
      313
      314 ***************************************************************
      315
      316  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      317    EXPORTING
      318      FORMNAME                 = 'Z_STOCK_TR'
      319 *    VARIANT                  = ' '
      320 *    DIRECT_CALL              = ' '
      321   IMPORTING
      322     FM_NAME                  =  gv_fname
      323 *  EXCEPTIONS
      324 *    NO_FORM                  = 1
      325 *    NO_FUNCTION_MODULE       = 2
      326 *    OTHERS                   = 3
      327            .
      328  IF SY-SUBRC <> 0.
      329 * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      330 *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      331  ENDIF.
      332
      333
    >334         CALL FUNCTION gv_fname
      335       exporting
      336 *           ARCHIVE_INDEX              =
      337 *           ARCHIVE_INDEX_TAB          =
      338 *           ARCHIVE_PARAMETERS         =
      339 *           CONTROL_PARAMETERS         =
      340 *           MAIL_APPL_OBJ              =
      341 *           MAIL_RECIPIENT             =
      342 *           MAIL_SENDER                =
      343 *           OUTPUT_OPTIONS             =
      344 *           USER_SETTINGS              = 'X'
      345                                  plant = plant
      346 *              vbeln                    =    exc_inv
      347 *              srdoc                    =    srdoc-low
      348 *              vexdat                   =    vexdat
      349 *              vrdoc                    =    vrdoc
      350 *              ptotal                   =    ptotal
      351 *              line1                    =    line1
      352 *              fkwert                   =    fkwert
      353 *              ikwert                   =    ikwert
    Plz help. Thanks alot.
    Khan.

    Hi
    I think u have not called Function module properly
    check this sample code
    Tables : sflight.
    Data : fm_name TYPE rs38l_fnam.
    *data : Begin of it_flttab occurs 0,
    *        carrid type sflight-carrid,
    *        connid type sflight-connid,
    *        fldate type sflight-fldate,
    *        seatsmax type sflight-seatsmax,
    *        seatsocc type sflight-seatsocc,
    *        End of it_flttab.
    data : it_flttab like table  of sflight.
    Data : g_salary type i .
    *       it_flttab type standard table of ty_flt.
    g_salary = 1000.
    select carrid connid fldate seatsmax seatsocc from sflight into
    corresponding fields of table it_flttab.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname                 = 'ZTACA_SMFORM2'
    *   VARIANT                  = ' '
    *   DIRECT_CALL              = ' '
    IMPORTING
       FM_NAME                  = fm_name
    EXCEPTIONS
       NO_FORM                  = 1
       NO_FUNCTION_MODULE       = 2
       OTHERS                   = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    call function fm_name
      Exporting
         salary = g_salary
      TABLES
         it_flttab = it_flttab
      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.
    <b>2nd code</b>
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
            INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
       MOVE-CORRESPONDING MKPF TO INT_MKPF.
       APPEND INT_MKPF.
    ENDSELECT.
    * At the end of your program.
    * Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
        formname                 = 'ZSMARTFORM'
    *   VARIANT                  = ' '
    *   DIRECT_CALL              = ' '
      IMPORTING
        FM_NAME                  = FM_NAME
      EXCEPTIONS
        NO_FORM                  = 1
        NO_FUNCTION_MODULE       = 2
        OTHERS                   = 3.
    if sy-subrc <> 0.
       WRITE: / 'ERROR 1'.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    * EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
    *   CONTROL_PARAMETERS         =
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
    *   OUTPUT_OPTIONS             =
    *   USER_SETTINGS              = 'X'
    * IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
    *   JOB_OUTPUT_INFO            =
    *   JOB_OUTPUT_OPTIONS         =
      TABLES
        GS_MKPF                    = INT_MKPF
      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.
    Reward all helpfull answers
    Regards
    Pavan

  • Runtime error when executing driver program

    when im executing my report after passing smartform to it , by giving invoice number in selectionscreen,it's generating runtime error as
    the call to the function module     '/1BCDWB/SF00000032'   is incorrect:
    in the function module interface, u can only specify fields of a specific  type and
    length under "s_final".although the currently specified field "    " is the correct type,
    it's length is incorrect.
    i declared s_final in forminterface->tables as s_final like zform1.
    i defined zform1 with fields which are in t_final.
    please suggest where im going wrong.
    TYPES : BEGIN OF TY_FINAL,
           VBELN TYPE VBRP-VBELN,"INVOICE NO
            ADRNR TYPE KNA1-ADRNR, "ADDRESS FOR CONSIGNEE
            BSTKD  TYPE VBKD-BSTKD,   "PO NUMBER
            BSTDK  TYPE VBKD-BSTDK,  "PO DATE
             ARKTX TYPE VBRP-ARKTX, "DESCRITION
            PACK TYPE I,           "NO OF PACKAGES
            UMREZ TYPE SMEINH-UMREZ, "AVG. CONTENTS PER PACKAGE IN KGS
             FKIMG TYPE VBRP-FKIMG,  "TOTAL QTY IN KGS
             KNUMV  TYPE KONV-KNUMV,
             KBETR TYPE KONV-KBETR,  "SELLING RATE/KG
            KBETR1 TYPE KONV-KBETR,
             KWERT TYPE KONV-KWERT,
             TARIFF TYPE ZFORM1-TARIFF,
             DUTY TYPE ZFORM1-DUTY,
             AMOUNT TYPE ZFORM1-AMOUNT,
             END OF TY_FINAL.
        TYPES : BEGIN OF TY_ITEM,
                VBELN TYPE VBRP-VBELN,"INVOICE NO
                POSNR TYPE VBRP-POSNR,
                ARKTX TYPE VBRP-ARKTX, "DESCRITION
                FKIMG TYPE VBRP-FKIMG,  "TOTAL QTY IN KGS
                 BSTKD  TYPE VBKD-BSTKD,   "PO NUMBER
                 BSTDK  TYPE VBKD-BSTDK,  "PO DATE
                 AUBEL TYPE VBRP-AUBEL,
                 AUPOS TYPE VBRP-AUPOS,
                END OF TY_ITEM.
    DATA : FM_NAM TYPE RS38L_FNAM  VALUE '/1BCDWB/SF00000032'.
    DATA :IT_ITEM TYPE TABLE OF TY_ITEM,
          W_ITEM TYPE TY_ITEM,
          W_FINAL  TYPE TY_FINAL,
          T_FINAL TYPE TABLE OF TY_FINAL,
         P TYPE I VALUE 250, "total quantity.
          TOTALDUTY TYPE I  VALUE 0,
           CESS TYPE I,
           EDCESS TYPE I,
             VAT TYPE I,
             FREIGHT TYPE I,
             GROSSTOTAL TYPE I,
           TOTAL TYPE I,
           PONUMBER  TYPE VBKD-BSTKD,   "PO NUMBER
           PODATE  TYPE VBKD-BSTDK,  "PO DATE
            ZTERM TYPE VBKD-ZTERM, "PAYMENT TERMS
           INVOICENO TYPE VBRP-VBELN.
    PARAMETERS : XVBELN TYPE VBELN.
    SELECT VBELN
           POSNR
           ARKTX
           FKIMG
           AUBEL
           AUPOS
           FROM VBRP
           INTO CORRESPONDING FIELDS OF TABLE IT_ITEM
           WHERE VBELN =  XVBELN AND UEPOS  = '000000'.
    LOOP AT IT_ITEM INTO W_ITEM.
    *INVOICE NO
    MOVE  W_ITEM-VBELN TO INVOICENO.
    *DESCRIPTION
    MOVE  W_ITEM-ARKTX TO W_FINAL-ARKTX.
    **TOTAL QUANTITY IN KGS
    MOVE W_ITEM-FKIMG TO W_FINAL-FKIMG.
    *PO NUMBER
    SELECT SINGLE BSTKD FROM VBKD
    INTO W_ITEM-BSTKD
    WHERE VBELN EQ W_ITEM-AUBEL.
    MOVE W_ITEM-BSTKD TO PONUMBER.
    *PO DATE
    SELECT SINGLE BSTDK FROM VBKD
    INTO W_ITEM-BSTDK
    WHERE VBELN EQ W_ITEM-AUBEL.
    MOVE W_ITEM-BSTDK TO PODATE.
    SELECT SINGLE KNUMV FROM VBRK INTO W_FINAL-KNUMV WHERE VBELN = W_ITEM-VBELN.
    **SELLING RATE/KG
    SELECT SINGLE KBETR FROM KONV INTO W_FINAL-KBETR WHERE KNUMV = W_FINAL-KNUMV
               AND KPOSN = W_ITEM-POSNR AND KSCHL = 'PR00'.
    **TOTAL TARIFF VALUE
                W_FINAL-TARIFF  =   W_FINAL-KBETR  *  W_ITEM-FKIMG.
    SELECT SINGLE KBETR FROM KONV INTO  W_FINAL-KWERT WHERE KNUMV =   W_FINAL-KNUMV
               AND KPOSN = W_ITEM-POSNR AND KSCHL = 'JEXT'.
    *TOTAL DUTY PAYABLE
               W_FINAL-DUTY  =  W_FINAL-KWERT / 10.
    **AMOUNT
               W_FINAL-AMOUNT =   W_FINAL-TARIFF  +     W_FINAL-DUTY.
    *TOTAL DUTY FOR CESS&EDCESS
                TOTALDUTY  = TOTALDUTY + W_FINAL-DUTY.
                APPEND W_FINAL TO T_FINAL..
                CLEAR  W_FINAL.
    *WRITE : /10   W_ITEM-ARKTX,
            30  W_ITEM-FKIMG,
            60  W_FINAL-KBETR,
            90     TARIFF,
            120  DUTY,
            160 AMOUNT.
    ENDLOOP.
    *SELECT SINGLE KBETR FROM KONV INTO  W_FINAL-KWERT WHERE KNUMV =   W_FINAL-KNUMV
              AND KPOSN = W_ITEM-POSNR AND KSCHL = 'ZECS'.
    *MOVE   W_FINAL-KWERT TO CESS.
    *SELECT SINGLE KBETR FROM KONV INTO  W_FINAL-KWERT WHERE KNUMV =   W_FINAL-KNUMV
              AND KPOSN = W_ITEM-POSNR AND KSCHL = 'ZECX'.
    *MOVE W_FINAL-KWERT  TO EDCESS.
    *CESS
    CESS  =  TOTALDUTY  *  2 / 100.
    *EDCESS
    EDCESS  =  TOTALDUTY  *  1 / 100..
    *TOTAL VALUE AT FOOTER
    TOTAL  = W_FINAL-AMOUNT + CESS + EDCESS.
    *VAT
    VAT  =  TOTAL *  4 / 100.
    *FREIGHT
    *GROSS TOTAL
    GROSSTOTAL   =  TOTAL + VAT.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME                 =  'ZSF_SD_INVOICE1'
       VARIANT                  = ' '
       DIRECT_CALL              = ' '
      IMPORTING
       FM_NAME                  =   FM_NAM
    EXCEPTIONS
       NO_FORM                  = 1
       NO_FUNCTION_MODULE       = 2
       OTHERS                   = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION FM_NAM
      EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
        TOTALDUTY                  =  TOTALDUTY
        CESS                       =   CESS
        EDCESS                     =   EDCESS
        TOTAL                      =   TOTAL
        PONUMBER                   =  PONUMBER
        PODATE                     =   PODATE
        GROSSTOTAL                 =  GROSSTOTAL
        VAT                        =  VAT
        INVOICENO                  =  INVOICENO
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        S_FINAL                    =  T_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.

    Hi,
    U need to fill the ref_fieldname and ref_tabname or the cfieldname, ctabname for currency fields and qtabname and qfieldname for quantity fields in fieldcatalog.
    santhosh
    Message was edited by:
            Kaluvala Santhosh

  • Report giving runtime error

    hi,
    i HAD MADE A REPORET IN which i havce to display the bolck stock ,it is giving runtime error as i had added 1 more table,plzz help me out as it is really urgent to me. here is d code:-
    *& Report  ZDEMO_SMARTFORM_COPY
    REPORT  ZDEMO_SMARTFORM_COPY.
    TABLES: MCHB,MARA,T001W.
    DATA: BEGIN OF ITAB OCCURS 0,
          ITEMID LIKE MARD-MATNR,
          SPEME LIKE MARD-SPEME,
          WERKS LIKE MARD-SPEME,
          LGORT LIKE MARD-LGORT,
          NTGEW LIKE MARA-NTGEW,
          MEINS LIKE MARA-MEINS,
          GEWEI LIKE MARA-GEWEI,
          CHARG LIKE MCHB-CHARG,
          WTKG LIKE MARA-NTGEW,
          STOCK TYPE P LENGTH 10 DECIMALS 3,
          DESC LIKE MAKT-MAKTX,
          TOTWT LIKE MARD-SPEME,
          WT TYPE P LENGTH 12 DECIMALS 3,
          END OF ITAB.
         ITEMID LIKE MCHB-MATNR,
         CSPEM LIKE MCHB-CSPEM,
         CHARG LIKE MCHB-CHARG,
         WERKS LIKE MCHB-WERKS,
    *PARAMETERS : PLANT LIKE MCHB-WERKS OBLIGATORY.
    PARAMETERS : PLANT LIKE MARD-WERKS OBLIGATORY.
    DATA : DESC LIKE MAKT-MAKTX.
      SELECT AMATNR ASPEME AWERKS ALGORT BNTGEW BMEINS BGEWEI CCHARG FROM MARD AS A
        INNER JOIN MARA AS B ON BMATNR = AMATNR
          INNER JOIN MCHB AS C ON CMATNR = AMATNR
            INTO TABLE ITAB WHERE AWERKS = PLANT AND ASPEME > 0.
    SELECT AMATNR ACSPEM ACHARG AWERKS  BNTGEW BMEINS B~GEWEI FROM MCHB AS A
       INNER JOIN MARA AS B ON BMATNR = AMATNR
         INTO TABLE ITAB WHERE AWERKS = PLANT AND ACSPEM > 0.
    WRITE: / 'ITEMID           DESCRIPTION                              STOCK.QTY  BATCH NO.           NETWT          TOTAL.WEIGHT '.
    ULINE.
    LOOP AT ITAB.
          IF ITAB-NTGEW <> 0 .
            CALL FUNCTION 'ZGET_ITEM_WEIGHT'
             EXPORTING
               P_BUID         = ITAB-WERKS
               P_ITEMID       = ITAB-ITEMID
               P_QTY          = ITAB-NTGEW
               P_UOM          = ITAB-GEWEI
               P_UOM1         = 'KG'
             IMPORTING
               P_RETVAL       = ITAB-WTKG.
          ENDIF.
       CONVERTING ITEM QTY IN KG
          ITAB-WT = ITAB-STOCK.
          IF ITAB-MEINS = 'G'.
            ITAB-WT = ITAB-STOCK / 1000000.
          ELSEIF ITAB-MEINS = 'KG'.
            ITAB-WT = ITAB-STOCK / 1000.
          ELSEIF ITAB-MEINS = 'TO'.
            ITAB-WT = ITAB-STOCK * ITAB-WTKG / 1000.
         ENDIF.
       ITAB-TOTWT = ITAB-WTKG * ITAB-CSPEM.
       ITAB-TOTWT = ITAB-WTKG * ITAB-SPEME.
       SELECT SINGLE MAKTX FROM MAKT INTO DESC WHERE MATNR = ITAB-ITEMID.
         WRITE:/ ITAB-ITEMID,15 DESC,50 ITAB-SPEME,ITAB-CHARG,ITAB-WTKG,ITAB-TOTWT.
       MODIFY ITAB.
       ENDLOOP.

    HI,
    i had tried to ftech data from mard and it isgiving runtime error. dis is the code:-
    TABLES: MCHB,MARA,MARD.
    DATA: BEGIN OF ITAB OCCURS 0,
          MATNR LIKE MARD-MATNR,
          SPEME LIKE MARD-SPEME,
          WERKS LIKE MARD-SPEME,
          LGORT LIKE MARD-LGORT,
          END OF ITAB.
          SELECT MATNR SPEME WERKS LGORT FROM MARD INTO CORRESPONDING FIELDS OF TABLE ITAB.
          LOOP AT ITAB.
          WRITE:/ ITAB-MATNR,ITAB-SPEME,ITAB-WERKS,ITAB-LGORT.
          ENDLOOP.

  • Regarding Runtime error in ALV List Display.

    am using following to display data in ALV List.
    but after executing of program am getting runtime error called 'Field Symbol has Not been assigned' .
    please tell me how to correct the error.
    Very urgent
    Suitable answers rewarded with Maximum Ponits...
    REPORT  zmatrix.
    TYPE-POOLS: slis.
    TABLES: agr_define, sza5_d0700.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-006.
    SELECT-OPTIONS: s_role FOR agr_define-agr_name OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
                           D A T A                                       *
    TYPES: BEGIN OF ty_agr_1251_inf,
           agr_name TYPE agr_1251-agr_name,
           object   TYPE agr_1251-object,
           field    TYPE agr_1251-field,
           low(20)  TYPE c,
           high     TYPE agr_1251-high,
           infty    TYPE t582s-infty,
           itext    TYPE t582s-itext,
           END OF ty_agr_1251_inf.
    TYPES: BEGIN OF ty_agr_1251_tcode,
           agr_name TYPE agr_1251-agr_name,
           object   TYPE agr_1251-object,
           field    TYPE agr_1251-field,
           low(20)  TYPE c,
           high     TYPE agr_1251-high,
           tcode    TYPE tstct-tcode,
           ttext    TYPE tstct-ttext,
           END OF ty_agr_1251_tcode.
    TYPES: BEGIN OF ty_t582s,
           infty TYPE agval,
           itext TYPE t582s-itext,
           END OF ty_t582s.
    TYPES: BEGIN OF ty_code,
           tcode TYPE tstct-tcode,
           ttext TYPE ttext_stct,
    END OF ty_code.
    TYPES: BEGIN OF ty_inf,
           infty TYPE t582s-infty,
           itext TYPE t582s-itext,
           END OF ty_inf.
    TYPES: BEGIN OF ty_role,
           agr_name TYPE agr_1251-agr_name,
           END OF ty_role.
    TYPES: BEGIN OF tys_role_dtls,
             agr_name  TYPE agr_name,
             value     TYPE c,
             property  TYPE c,
           END  OF tys_role_dtls.
    TYPES: BEGIN OF tys_infotype_final,
           text(60),
           text1(60),
           value(4),
           END OF tys_infotype_final.
                        I N T E R N A L   T A B L E S                    *
    DATA: wa_infotyp_final TYPE tys_infotype_final.
    DATA: t_infotyp_final TYPE TABLE OF tys_infotype_final.
    DATA: BEGIN OF wa_infotyp_dtls,
             infty     TYPE infty,
             itext     TYPE intxt,
             role_dtls TYPE TABLE OF tys_role_dtls,
          END OF wa_infotyp_dtls.
    DATA: BEGIN OF wa_tcode_dtls,
             tcode     TYPE tcode,
             ttext     TYPE ttext_stct,
             role_dtls TYPE TABLE OF tys_role_dtls,
           END OF wa_tcode_dtls.
    DATA: t_infotyp_dtls      LIKE   TABLE OF wa_infotyp_dtls,
          t_tcode_dtls        LIKE   TABLE OF wa_tcode_dtls,
          t_role_dtls         TYPE   TABLE OF tys_role_dtls,
          wa_role_dtls        TYPE   tys_role_dtls.
    DATA: wa_inf              TYPE   ty_inf,
          t_inf               TYPE   STANDARD TABLE OF ty_inf.
    DATA: wa_role             TYPE   ty_role,
          t_role              TYPE   STANDARD TABLE OF ty_role.
    DATA: wa_tcode            TYPE   ty_code,
          t_tcode             TYPE   TABLE OF ty_code.
    DATA: wa_agr_1251_inf     TYPE   ty_agr_1251_inf.
    DATA: wa_agr_1251_tcode   TYPE   ty_agr_1251_tcode.
    DATA: t_agr_1251_inf      TYPE STANDARD TABLE OF ty_agr_1251_inf.
    DATA: t_agr_1251_tc       TYPE STANDARD TABLE OF ty_agr_1251_tcode.
    DATA: wa_582s             TYPE   ty_t582s.
    DATA: t_582s              TYPE STANDARD TABLE OF ty_t582s.
    DATA: t_range_tcode       TYPE RANGE OF tcode.
    DATA: t_range_inf         TYPE RANGE OF infotyp.
    DATA: wa_range_inf        LIKE LINE OF t_range_inf.
    DATA: wa_range_tcode      LIKE LINE OF t_range_tcode.
    DATA: wa_field TYPE slis_fieldcat_alv.
    DATA: t_field TYPE slis_t_fieldcat_alv.
                      VARIABLES FOR OLE                                  *
    DATA: text(20),
          count(20).
    DATA: text1(30).
    DATA: agr_name       TYPE   agr_1251-agr_name.
    DATA: flag           TYPE   i VALUE '0'.
    DATA: string1        TYPE   string.
    DATA: str            TYPE   string VALUE 'SAP%'.
    DATA: count1         TYPE   i VALUE '0'.
    *&   Event START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM f100_get_inf_data.
      PERFORM f200_process_inf_data.
      count1 = 1.
      PERFORM f300_prepare_field_catalog.
      PERFORM f110_main_data.
      PERFORM f400_display_data.
      PERFORM  f100_get_trans_data.
    *&      Form  f110_main_data
          text
    FORM f110_main_data.
      wa_infotyp_final-text = 'Access to Infotypes'.
      APPEND wa_infotyp_final TO t_infotyp_final.
      wa_infotyp_final-text = 'Infotype'.
      wa_infotyp_final-text1 = 'Description'.
      APPEND wa_infotyp_final TO t_infotyp_final.
      wa_infotyp_final-text = '*'.
      wa_infotyp_final-text1 = 'Acess to all Infotypes'.
    LOOP AT t_role INTO wa_role WHERE agr_name <> ' '.
       READ TABLE t_agr_1251_inf INTO wa_agr_1251_inf
       WITH KEY agr_name = wa_role-agr_name field = 'INFTY' low = '*'.
       IF syst-subrc = 0.
         wa_infotyp_final-value = 'X'.
       ENDIF.
    ENDLOOP.
      APPEND wa_infotyp_final TO t_infotyp_final.
      LOOP AT t_inf INTO wa_inf WHERE infty <> ' '.
        wa_infotyp_final-text = wa_inf-infty.
        wa_infotyp_final-text1 = wa_inf-itext.
        LOOP AT t_role INTO wa_role WHERE agr_name <> ' '.
       Role Name
          CLEAR wa_role_dtls.
          flag = 1.
          wa_role_dtls-agr_name =  wa_role-agr_name.
        For Value D & F
          READ TABLE t_agr_1251_inf INTO wa_agr_1251_inf
          WITH KEY agr_name = wa_role-agr_name field = 'AUTHC'..
          IF syst-subrc EQ 0.
            IF wa_agr_1251_inf-low = 'R'.
              wa_infotyp_final-value = 'D'.
            ELSE.
              wa_infotyp_final-value = 'F'.
            ENDIF.
          ENDIF.
          APPEND wa_role_dtls TO t_role_dtls.
          APPEND wa_infotyp_final TO t_infotyp_final.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    "f110_main_data
    *&      Form  f100_get_inf_data
          text
    FORM f100_get_inf_data.
                          Logic for Infotypes                            *
      SELECT aagr_name aobject
             afield alow a~high
             INTO TABLE t_agr_1251_inf
             FROM agr_1251 AS a INNER JOIN agr_define AS b
             ON aagr_name EQ bagr_name
      WHERE ( ( aobject EQ 'P_ORGIN' OR aobject EQ 'P_PERNR' )
      AND   ( aagr_name IN s_role ) AND ( bagr_name NOT LIKE str ) ).
    ENDFORM.                    "f100_get_inf_data
    *&      Form  f200_get_inf_process_data
          text
    FORM f200_process_inf_data.
      LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
        IF wa_agr_1251_inf-high IS INITIAL.
          CLEAR wa_range_inf.
          wa_range_inf-sign = 'I'.
          wa_range_inf-option = 'EQ'.
          wa_range_inf-low = wa_agr_1251_inf-low.
          APPEND wa_range_inf TO t_range_inf.
        ELSE.
          CLEAR wa_range_inf.
          wa_range_inf-sign = 'I'.
          wa_range_inf-option = 'BT'.
          wa_range_inf-low = wa_agr_1251_inf-low.
          wa_range_inf-high = wa_agr_1251_inf-high.
          APPEND wa_range_inf TO t_range_inf.
        ENDIF.
      ENDLOOP.
      SORT t_range_inf.
      DELETE ADJACENT DUPLICATES FROM t_range_inf.
      IF t_range_inf IS NOT INITIAL.
        SELECT infty itext FROM t582s
        INTO TABLE t_582s
        WHERE sprsl = 'EN' AND infty IN t_range_inf.
        IF syst-subrc EQ 0.
        ENDIF.
      ENDIF.
      LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
        IF wa_agr_1251_inf-high IS INITIAL.
          READ TABLE t_582s INTO wa_582s
            WITH KEY infty = wa_agr_1251_inf-low.
          IF syst-subrc EQ 0.
            wa_agr_1251_inf-infty = wa_582s-infty.
            wa_agr_1251_inf-itext = wa_582s-itext.
            MODIFY t_agr_1251_inf FROM wa_agr_1251_inf
                         TRANSPORTING infty itext.
            IF syst-subrc EQ 0.
            ENDIF.
          ENDIF.
        ELSE.
          CLEAR count.
          LOOP AT t_582s INTO wa_582s
                  WHERE infty GE wa_agr_1251_inf-low
                    AND infty LE wa_agr_1251_inf-high.
            IF count LE 1.
              wa_agr_1251_inf-high = space.
              wa_agr_1251_inf-infty = wa_582s-infty.
              wa_agr_1251_inf-itext = wa_582s-itext.
              MODIFY t_agr_1251_inf FROM wa_agr_1251_inf
                           TRANSPORTING infty itext.
              IF syst-subrc EQ 0.
                CLEAR wa_582s.
              ENDIF.
            ELSE.
              wa_agr_1251_inf-high = space.
              wa_agr_1251_inf-infty = wa_582s-infty.
              wa_agr_1251_inf-itext = wa_582s-itext.
              APPEND wa_agr_1251_inf TO t_agr_1251_inf.
            ENDIF.
            CLEAR wa_agr_1251_inf.
            count = count + 1.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
      wa_role-agr_name = ' '.
      APPEND wa_role TO t_role.
      wa_role-agr_name = ' '.
      APPEND wa_role TO t_role.
      LOOP AT t_agr_1251_inf INTO wa_agr_1251_inf.
        IF wa_agr_1251_inf IS NOT INITIAL.
          wa_role-agr_name = wa_agr_1251_inf-agr_name.
          wa_inf-infty = wa_agr_1251_inf-infty.
          wa_inf-itext = wa_agr_1251_inf-itext.
          APPEND wa_role TO t_role.
          APPEND wa_inf TO t_inf.
        ENDIF.
      ENDLOOP.
      SORT t_role BY agr_name.
      DELETE ADJACENT DUPLICATES FROM t_role.
      SORT t_inf BY infty.
      DELETE ADJACENT DUPLICATES FROM t_inf.
    ENDFORM.                    "f200_get_process_inf_data
    *&      Form  f100_get_trans_data
          text
    FORM  f100_get_trans_data.
                  Logic for Transaction Codes                            *
      SELECT aagr_name aobject
               afield alow a~high
        INTO CORRESPONDING FIELDS OF TABLE t_agr_1251_tc
        FROM agr_1251 AS a
        INNER JOIN agr_define AS b ON aagr_name EQ bagr_name
        WHERE a~agr_name IN s_role
          AND a~object EQ 'S_TCODE'.
    ENDFORM.                    "f100_get_trans_data
    *&      Form  f200_process_trans_data
          text
    FORM f200_process_trans_data.
      LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
        IF wa_agr_1251_tcode-high IS INITIAL.
          CLEAR wa_range_tcode.
          wa_range_tcode-sign = 'I'.
          wa_range_tcode-option = 'EQ'.
          wa_range_tcode-low = wa_agr_1251_tcode-low.
          APPEND wa_range_tcode TO t_range_tcode.
        ELSE.
          CLEAR wa_range_tcode.
          wa_range_tcode-sign = 'I'.
          wa_range_tcode-option = 'BT'.
          wa_range_tcode-low = wa_agr_1251_tcode-low.
          wa_range_tcode-high = wa_agr_1251_tcode-high.
          APPEND wa_range_tcode TO t_range_tcode.
        ENDIF.
      ENDLOOP.
      SORT t_range_tcode.
      DELETE ADJACENT DUPLICATES FROM t_range_tcode.
      IF t_range_tcode IS NOT INITIAL.
        SELECT tcode
               ttext
          FROM tstct
          INTO TABLE t_tcode
          WHERE sprsl EQ 'E'
            AND tcode IN t_range_tcode.
        IF sy-subrc EQ 0.
        ENDIF.
      ENDIF.
      SORT t_agr_1251_tc BY agr_name.
      LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
        IF wa_agr_1251_tcode-high IS INITIAL.
          READ TABLE t_tcode INTO wa_tcode
            WITH KEY tcode = wa_agr_1251_tcode-low.
          IF syst-subrc EQ 0.
            wa_agr_1251_tcode-tcode = wa_tcode-tcode.
            wa_agr_1251_tcode-ttext = wa_tcode-ttext.
            MODIFY t_agr_1251_tc FROM wa_agr_1251_tcode
                         TRANSPORTING tcode ttext.
            IF syst-subrc EQ 0.
            ENDIF.
          ENDIF.
        ELSE.
          CLEAR count.
          LOOP AT t_tcode INTO wa_tcode
                  WHERE tcode GE wa_agr_1251_tcode-low
                    AND tcode LE wa_agr_1251_tcode-high.
            IF count LE 1.
              agr_name  = wa_agr_1251_tcode-agr_name.
              wa_agr_1251_tcode-high = space.
              wa_agr_1251_tcode-tcode = wa_tcode-tcode.
              wa_agr_1251_tcode-ttext = wa_tcode-ttext.
              MODIFY t_agr_1251_tc FROM wa_agr_1251_tcode
                           TRANSPORTING tcode ttext high.
              IF syst-subrc EQ 0.
                CLEAR wa_tcode.
              ENDIF.
              count = 1.
            ELSE.
              wa_agr_1251_tcode-high = space.
              wa_agr_1251_tcode-agr_name = agr_name.
              wa_agr_1251_tcode-low =  wa_tcode-tcode.
              wa_agr_1251_tcode-tcode = wa_tcode-tcode.
              wa_agr_1251_tcode-ttext = wa_tcode-ttext.
              APPEND wa_agr_1251_tcode TO t_agr_1251_tc.
            ENDIF.
            CLEAR wa_agr_1251_tcode.
            count = count + 1.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
      LOOP AT t_agr_1251_tc INTO wa_agr_1251_tcode.
        wa_role-agr_name = wa_agr_1251_tcode-agr_name.
        APPEND wa_role TO t_role.
      ENDLOOP.
      SORT t_role BY agr_name.
      DELETE ADJACENT DUPLICATES FROM t_role.
      SORT t_tcode BY tcode.
      DELETE ADJACENT DUPLICATES FROM t_tcode.
    ENDFORM.                    "f200_process_trans_data
    *&      Form  f100_prepare_field_catalog
          text
    FORM f300_prepare_field_catalog.
      LOOP AT t_role INTO wa_role.
        wa_field-col_pos = count1.
        wa_field-fieldname = wa_role-agr_name.
        APPEND wa_field TO t_field.
        count1 = count1 + 1.
      ENDLOOP.
    ENDFORM.                    "f100_prepare_field_catalog
    *&      Form  f100_display_data
          text
    FORM f400_display_data.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
                EXPORTING
                I_INTERFACE_CHECK              = ' '
                I_BYPASSING_BUFFER             =
                I_BUFFER_ACTIVE                = ' '
                  i_callback_program             = sy-cprog
                I_CALLBACK_PF_STATUS_SET       = ' '
                I_CALLBACK_USER_COMMAND        = ' '
                I_STRUCTURE_NAME               =
                IS_LAYOUT                      =
                  it_fieldcat                    = t_field[]
                IT_EXCLUDING                   =
                IT_SPECIAL_GROUPS              =
                IT_SORT                        =
                IT_FILTER                      =
                IS_SEL_HIDE                    =
                I_DEFAULT                      = 'X'
                I_SAVE                         = ' '
                IS_VARIANT                     =
                IT_EVENTS                      =
                IT_EVENT_EXIT                  =
                IS_PRINT                       =
                IS_REPREP_ID                   =
                I_SCREEN_START_COLUMN          = 0
                I_SCREEN_START_LINE            = 0
                I_SCREEN_END_COLUMN            = 0
                I_SCREEN_END_LINE              = 0
                IR_SALV_LIST_ADAPTER           =
                IT_EXCEPT_QINFO                =
                I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
              IMPORTING
                E_EXIT_CAUSED_BY_CALLER        =
                ES_EXIT_CAUSED_BY_USER         =
                  TABLES
                    t_outtab                       = t_infotyp_final[]
                 EXCEPTIONS
                   program_error                  = 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.
    ENDFORM.                    "f100_display_data

    this are the wasy u can build a field catalog...
    1.----
    FORM fill_fieldcat .
    DATA: fld(30),
    idx(2) TYPE n.
    DEFINE no_output.
    fieldcatalog-fieldname = &1.
    fieldcatalog-no_out = 'X'.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    END-OF-DEFINITION.
    DEFINE catalog.
    fieldcatalog-fieldname = &1.
    fieldcatalog-seltext_s = &2.
    if not &3 is initial.
    fieldcatalog-seltext_m = &3.
    else.
    fieldcatalog-seltext_m = fieldcatalog-seltext_s.
    endif.
    if not &4 is initial.
    fieldcatalog-seltext_l = &4.
    else.
    fieldcatalog-seltext_l = fieldcatalog-seltext_m.
    endif.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    END-OF-DEFINITION.
    catalog 'AVAIL_BASE'
    'Base Qty.'
    'Base Qty. Available'
    'Base Quantity Available'.
    catalog 'AVAIL_SALES'
    'Sales Qty.'
    'Sales Qty. Available'
    'Sales Quantity Available'.
    LOOP AT t_char_data.
    idx = sy-tabix.
    CONCATENATE 'CHR' idx INTO fld.
    catalog fld
    t_char_data-atbez
    t_char_data-atbez
    t_char_data-atbez.
    ENDLOOP.
    ADD 1 TO idx.
    WHILE idx LE 15.
    CONCATENATE 'CHR' idx INTO fld.
    no_output fld.
    ADD 1 TO idx.
    ENDWHILE..
    fieldcatalog-fieldname = 'EXACT'.
    fieldcatalog-checkbox = 'X'.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR fieldcatalog.
    2.----
    FORM fieldcatalog.
    REFRESH fc. CLEAR fc.
    fc-tabname = 'HEADER'.
    fc-fieldname = 'KUNNR'.
    fc-ref_tabname = 'MSKU'.
    APPEND fc. CLEAR fc.
    fc-tabname = 'HEADER'.
    fc-fieldname = 'NAME1_K'.
    fc-ref_tabname = 'KNA1'.
    fc-ref_fieldname = 'NAME1'.
    APPEND fc. CLEAR fc.
    fc-tabname = 'HEADER'.
    fc-fieldname = 'TOTAL'.
    fc-ref_tabname = 'MBEW'.
    fc-ref_fieldname = 'SALK3'.
    APPEND fc. CLEAR fc.
    fc-tabname = 'LIST'.
    fc-fieldname = 'MATNR'.
    fc-ref_tabname = 'MSKU'.
    APPEND fc. CLEAR fc.
    fc-tabname = 'LIST'.
    fc-fieldname = 'MAKTX'.
    fc-ref_tabname = 'MAKT'.
    fc-no_out = 'X'.
    APPEND fc. CLEAR fc.
    fc-tabname = 'LIST'.
    fc-fieldname = 'CHARG'.
    fc-ref_tabname = 'MSKU'.
    APPEND fc. CLEAR fc.
    fc-tabname = 'LIST'.
    fc-fieldname = 'WERKS'.
    fc-ref_tabname = 'MSKU'.
    fc-no_out = 'X'.
    APPEND fc. CLEAR fc.
    fc-tabname = 'LIST'.
    fc-fieldname = 'NAME1_W'.
    fc-ref_tabname = 'T001W'.
    fc-ref_fieldname = 'NAME1'.
    fc-no_out = 'X'.
    APPEND fc. CLEAR fc.

  • Runtime Error while summing a column in ALV output

    Dear All,
    I have developed an ALV Report and the report is giving output without any flaws.
    I have defined proper field catalog and displaying the results using REUSE_ALV_GRID function module.
    Now the report is generating Runtime Error while the user selects a column and click the SUM icon.
    The fields like Qty, or amounts are also theowing runtime error while summing up their column in the ALV output.
    What might be the reason and how to resolve this issu?
    Regards
    Pavan

    Hi ,
    I don't know how you have write  down the code but follow the below coding example:
    FOR TOTAL:
    there is a property of fieldcatalog, that is do_sum.
    USE COED LIKE:
    PERFORM fieldcat USING:
    '1' 'MATNR' 'I_MARD' 'MATERIAL NO' 'MARD' 'MATNR ' ' ',
    '2' 'NETWR' 'I_MARD' 'PLANT' 'MARD' 'WERKS' ' ',
    FORM fieldcat USING value(p_0029)
    value(p_0030)
    value(p_0031)
    value(p_0032)
    wa_fieldcat-col_pos = p_0029.
    wa_fieldcat-fieldname = p_0030.
    wa_fieldcat-tabname = p_0031.
    wa_fieldcat-reptext = p_0032.
    wa_fieldcat-do_sum = 'X'.
    APPEND wa_fieldcat TO i_fieldcat.
    ENDFORM. " FIELDCAT
    in final output you will get the total of currency field.
    FOR SUB TOTAL:
    decleare: i_sort type standard table of slis_sortinfo_alv,
              wa_sort type slis_t_sortinfo_alv.
    wa_sort-spos = '1'.
    wa_sort-fieldname = 'field1'.
    wa_sort-subtot = 'X'.
    append wa_tab to i_sort.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    it_fieldcat = it_fieldcat
    it_sort = i_sort
    Hope this can solve your pbs.
    If you need more inputs let me know.
    Regards,
    Tutun

  • Runtime error while executing rule - see long text RSTRAN 301

    Hi BW Gurus,
    When I executing the DTP, the following error occured.
    Runtime error while executing rule -> see long text     RSTRAN     301
    Diagnosis
        An error occurred while executing a transformation rule:
        The exact error message is:
        The argument 'GBP' cannot be interpreted as a number
        The error was triggered at the following point in the program:
        GP46DQFOYRZTUS0QITMO07IFTS0 1137
    Appreciate any useful suggestions.
    Thanks in advance.
    Maruthi

    Guess you are doing some calculation in your routines ..based on Currency Key i.e USD or INR , GBP..etc ..it should be currency value..rather than currency key. Check your field caluclation

  • ABAP runtime error while executing T.code : PC00_M40_CALC

    Hi,
    I have applied SAP note 1568264 - Budget Changes 2011 as released by
    SAP and i also applied the pre-requiste SAP notes mentioned in the
    above SAP note
    1) SAP Note 1558475- Amendments to IT calculation notified under
    circular:08/2010.
    2) SAP Note 1572614- Tax calculations inconsistent for emp. without a
    vaild PAN.
    3) SAP Note 1575366- HINCALC0:Tax calculation inconsistent in case of
    invalid PAN.
    After applying the SAP notes, when i am trying to execute the T.Code :
    PC00_M40_CALC, i am getting an "Abap runtime error"
    "  Error in the ABAP Application Program
    The current ABAP program "????????????????????????????????????????" had to be
      terminated because it has
    come across a statement that unfortunately cannot be executed.
    The following syntax error occurred in program "HINCALC0 " in include "PCTAXIN0
      " in
    line 905:
    ""ENDUZ-" expected, not "EDU_""
    The include has been created and last changed by:
    Created by: "SAP "
    Last changed by: "S2K_BASIS "
    Error in the ABAP Application Program
    The current ABAP program "????????????????????????????????????????" had to be
      terminated because it has
    come across a statement that unfortunately cannot be executed.   "
    Kindly suggest me what has to be done on priority basis.
    Regards
    Vish

    The dump error is generally encountered if your system is at a lower Support Pack level. For implementing Note 1568264 (Budget Changes 2011), you need to be at the below mentioned pre-requisite level corresponding to your Release:
    Prerequisites:
       Release     Support Package
         604         HRSP29
         600         HRSP63
         500         HRSP80
         470         HRSPB4
         46C         HRSPG9
    The correct sequence to implement the Notes is:
    SAP Note 1558475- Amendments to IT calculation notified under
    circular:08/2010.
    SAP Note 1572614- Tax calculations inconsistent for emp. without a
    vaild PAN.
    SAP Note 1575366- HINCALC0:Tax calculation inconsistent in case of
    invalid PAN.
    SAP Note 1568264- Budget Changes 2011
    This should solve the issue unless there is some problem while implementing the Notes.
    Regards,
    Nishtha

Maybe you are looking for