Need fm or code

Hi,
There is a requirement that
in the sales order va02 if some body changed the payment terms then i have to show the error message.
to solve this we have to compare both old value and new vaue of the payment terms.
The problem here is getting the old value i.e if someone change the payment terms and saved it ,the new value is present in that field.Then how to get the old value.
is there any fm module for this to get the oldvalue

I think you can use USEREXIT_SAVE_DOCUMENT_PREPARE which is User exits in the program MV45AFZZ. This user exit can be used to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.
Here in this form, you can get the old value from database table. It will be available in database table as you have not yet saved the new value.You will also get the new value in the internal table and then you can check old as well as new value.
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers

Similar Messages

  • I have just purchased a new iMac and have uninstalled cs6 from my old iMac. Do I just install CS6 as normal or do I need a new code. My licence is for one user

    I have just purchased a new iMac and have uninstalled cs6 from my old iMac. Do I just install CS6 as normal or do I need a new code. My licence is for one user

    Yes, just install as you normally would using the serial number you originally used.
    You did not have to uninstall on the old machine - with your single user license you are allowed to have two activated installations.  So feel free to reinstall it if those are the only two machine you plan to have it on and you'd like to have a backup installation.

  • In bdc if date format of records is different  do we need to hard code

    in bdc if date format of records is different  do we need to hard code or bdc will support automatically,please provide the answer.

    Make sure to format the date before passing to BDC.
    data: datum(10) type c.
    call function 'CONVERT_DATE_TO_EXTERNAL'
      EXPORTING
        DATE_INTERNAL                  = SY-DATUM
      IMPORTING
        DATE_EXTERNAL                  = datum.
    Regards,
    Rich Heilman

  • Need of Process code in ALE Inbound Processing?

    Hi All,
      What is the need of process code in ALE Inbound Processing? Why do we need to reach the function module through process code? we can as well directly point to function module.

    Hi Ravi,
    Please chcek this link perhaps it may help.
    http://help.sap.com/saphelp_erp2005/helpdata/en/dc/6b804043d711d1893e0000e8323c4f/frameset.htm
    Regards,
    Ferry Lianto

  • I need the activation code for nokia 9300I

    i have mobil nokia 9300i and i need the activation code for nokia 9300I to install MobiDict english-arabic
    and that is my serial number
    and thanks a lot
    Moderator Note: IMEI number removed
    Message Edited by kenken on 23-Oct-2008 02:17 PM

    Software activation codes are provided by the software producers, so you need to check with the site you downloaded the app from.

  • Needed example working  code for  FM"LAST_DAY_IN_PERIOD_GET"

    needed example working  code for  FM"LAST_DAY_IN_PERIOD_GET"

    Hi,
    Go through this code
    *& Report  Z_FICO_REP_SHIPMENTS
    REPORT  z_fico_rep_shipments MESSAGE-ID sd.
    TYPE-POOLS : slis.
    TABLES : vbak,
             kna1,
             likp,
             vbfa.
    *>> DEFINE global Types
    TYPES : BEGIN OF gt_vbak,
              vbeln TYPE vbeln,
              kunnr TYPE kunnr ,
              spart TYPE spart,
              audat TYPE audat,
            END OF gt_vbak,
            BEGIN OF gt_kna1,
              kunnr TYPE kunnr,
              name1 TYPE name1,
            END OF gt_kna1,
            BEGIN OF gt_likp,
              vbeln     TYPE vbeln,
              wadat_ist TYPE wadat_ist,
            END OF gt_likp,
            BEGIN OF gt_vbfa,
              vbelv     TYPE vbelv,
              erdat     TYPE erdat,
              rfwrt     TYPE rfwrt,
           END OF gt_vbfa,
            BEGIN OF gt_final,
              kunnr   TYPE kunnr,
              name1   TYPE name1,
              cumon   TYPE monat,
              trcum   TYPE rfwrt,
              trcuy   TYPE rfwrt,
              perce   TYPE rfwrt,
              fiscy   TYPE gjahr,
              ftrcum  TYPE rfwrt,
              ftrcuy  TYPE rfwrt,
              fperce  TYPE rfwrt,
            END OF gt_final.
    DATA : gwa_vbak   TYPE gt_vbak,
           gwa_kna1   TYPE gt_kna1,
           gwa_likp   TYPE gt_likp,
           gwa_vbfa   TYPE gt_vbfa,
           gwa_final  TYPE gt_final,
           gwa_sort   TYPE slis_sortinfo_alv,
           gwa_layout TYPE slis_layout_alv.    "ALV Layout
    DATA : gi_vbak    TYPE STANDARD TABLE OF gt_vbak,
           gi_kna1    TYPE STANDARD TABLE OF gt_kna1,
           gi_likp    TYPE STANDARD TABLE OF gt_likp,
           gi_vbfa    TYPE STANDARD TABLE OF gt_vbfa,
           gi_likp1   TYPE STANDARD TABLE OF gt_likp,
           gi_vbfa1   TYPE STANDARD TABLE OF gt_vbfa,
           gi_final   TYPE STANDARD TABLE OF gt_final WITH HEADER LINE,
           gi_final1  TYPE STANDARD TABLE OF gt_final WITH HEADER LINE.
    *>> DEFINE INTERNAL TABLE
    DATA : gi_fieldcat    TYPE slis_t_fieldcat_alv,   "ALV Fieldcatalog
           gi_events      TYPE slis_t_event,          "ALV EventS
           gi_sort        TYPE slis_t_sortinfo_alv ,
           gi_top_of_page TYPE slis_t_listheader.     "ALV LIST HEADER
    DATA : gv_month(2) TYPE n.
    *>> GLOBAL CONSTANTS
    CONSTANTS: gc_day(2) TYPE n VALUE 01,
               gc_top_of_page  TYPE slis_formname VALUE 'TOP_OF_PAGE',
               gc_x TYPE c VALUE 'X'.
    SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_monat      TYPE     monat OBLIGATORY,
                p_gjahr     TYPE     gjahr OBLIGATORY.
    SELECT-OPTIONS : s_bukrs      FOR      vbak-bukrs_vf OBLIGATORY,
                     s_vkorg     FOR      vbak-vkorg,
                     s_spart     FOR     vbak-spart     OBLIGATORY,
                     s_audat   FOR    vbak-audat NO-DISPLAY.
    SELECTION-SCREEN:END OF BLOCK b1.
    SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
    PARAMETERS: p_det RADIOBUTTON GROUP grp DEFAULT 'X' ,
              p_sum RADIOBUTTON GROUP grp.
    SELECTION-SCREEN:END OF BLOCK b2.
    START-OF-SELECTION.
    *>> Take Period And year and find starting and ending date
      PERFORM fiscal_date.
      PERFORM collect_data.
      PERFORM manipulation_collect_data.
    END-OF-SELECTION.
    *>> Sort
      PERFORM gi_sort_table.
    *>> MEARGE FIELD CATALOG USING INTERNAL TABLE
      PERFORM mearge_field_catalog.
    *>> SET EVENTS
      PERFORM set_event.
    *>> FOR ALV HEADER
      PERFORM n_top_of_page USING gi_top_of_page[].
    *>>For ALV Layout
      PERFORM build_layout.
    *>>For output display
      PERFORM alv_grid_display.
    *&      Form  fiscal_date
    FORM fiscal_date.
      TYPES : BEGIN OF lt_fisc,
                bukrs TYPE bukrs,
                periv TYPE periv,
                bumon TYPE bumon,
                butag TYPE butag,
              END OF lt_fisc,
              BEGIN OF lt_t009b,
                periv TYPE periv,
                bumon TYPE bumon,
                butag TYPE butag,
                poper TYPE poper,
               END OF lt_t009b.
      DATA : lwa_fisc  TYPE lt_fisc,
             lwa_t009b TYPE lt_t009b.
      DATA : li_fisc  TYPE STANDARD TABLE OF lt_fisc,
             li_t009b TYPE STANDARD TABLE OF lt_t009b.
      DATA : lv_date(2) TYPE c,
             lv_mont(2) TYPE c,
             lv_year(4) TYPE c.
      SELECT bukrs periv FROM t001
                         INTO TABLE li_fisc
                         WHERE bukrs IN s_bukrs.
      IF sy-subrc EQ 0.
        SELECT * FROM t009b
                 INTO CORRESPONDING FIELDS OF TABLE li_t009b
                 FOR ALL ENTRIES IN li_fisc
                 WHERE periv EQ li_fisc-periv .
        IF sy-subrc NE 0.
          CLEAR li_t009b.
        ENDIF.
      ELSE.
        CLEAR li_fisc.
      ENDIF.
      SORT li_t009b BY periv poper.
      LOOP AT li_fisc INTO lwa_fisc.
        READ TABLE li_t009b INTO lwa_t009b WITH KEY periv = lwa_fisc-periv
                                                    poper = '001'
                                           BINARY SEARCH.
        IF sy-subrc = 0.
          s_audat-option = 'EQ'.
          s_audat-sign   = 'I'.
          CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
            EXPORTING
              i_gjahr = p_gjahr
              i_periv = lwa_t009b-periv
              i_poper = lwa_t009b-poper
            IMPORTING
              e_date  = s_audat-low.
        ENDIF.
        CLEAR lwa_t009b.
        READ TABLE li_t009b INTO lwa_t009b WITH KEY periv = lwa_fisc-periv
                                                    poper = '012'
                                           BINARY SEARCH.
        IF sy-subrc = 0.
          CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
            EXPORTING
              i_gjahr = p_gjahr
              i_periv = lwa_t009b-periv
              i_poper = lwa_t009b-poper
            IMPORTING
              e_date  = s_audat-high.
        ENDIF.
        CLEAR lwa_t009b.
        READ TABLE li_t009b INTO lwa_t009b WITH KEY periv = lwa_fisc-periv
                                                    poper = p_monat
                                            BINARY SEARCH.
        IF sy-subrc = 0.
          lv_date = s_audat-high+6(2).
          lv_mont = s_audat-high+4(2).
          lv_year = s_audat-high(4).
          lv_mont = lwa_t009b-bumon.
          lv_date = lwa_t009b-butag.
          CONCATENATE lv_year lv_mont lv_date INTO s_audat-high.
          APPEND s_audat.
          CLEAR: lwa_fisc,lwa_t009b,lv_date,lv_mont,lv_year.
        ENDIF.
      ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM s_audat.
    ENDFORM.                    "fiscal_date
    *&      Form  collect_data
    FORM collect_data .
      SELECT vbeln kunnr spart audat
          FROM vbak
          INTO TABLE gi_vbak
          WHERE audat    GE s_audat-low  AND
                audat    LT s_audat-high AND
                vkorg    IN s_vkorg AND
                spart    IN s_spart AND
                bukrs_vf IN s_bukrs.
      IF sy-subrc EQ 0.
        SELECT kunnr name1
        FROM kna1
        INTO TABLE gi_kna1
        FOR ALL ENTRIES IN gi_vbak
        WHERE kunnr EQ gi_vbak-kunnr.
        IF sy-subrc NE 0.
          CLEAR gi_kna1.
        ENDIF.
        SELECT vbeln wadat_ist
        FROM likp
        INTO TABLE gi_likp
        WHERE wadat_ist  GE s_audat-low  AND
              wadat_ist  LT s_audat-high .
        IF sy-subrc EQ 0.
          SELECT vbelv erdat rfwrt
          FROM vbfa
          INTO TABLE gi_vbfa
          FOR ALL ENTRIES IN gi_likp
          WHERE vbeln   = gi_likp-vbeln AND
                 ( vbtyp_n = 'M' OR
                vbtyp_n = 'H' ) .
          IF sy-subrc NE 0.
            CLEAR gi_vbfa.
          ENDIF.
        ELSE.
          CLEAR gi_likp.
        ENDIF.
        PERFORM change_date.
        SELECT vbeln wadat_ist
        FROM likp
        INTO TABLE gi_likp1
        WHERE wadat_ist  GE s_audat-low  AND
              wadat_ist  LT s_audat-high .
        IF sy-subrc EQ 0.
          SELECT vbelv erdat rfwrt
          FROM vbfa
          INTO TABLE gi_vbfa1
          FOR ALL ENTRIES IN gi_likp1
          WHERE vbeln   = gi_likp1-vbeln AND
                 ( vbtyp_n = 'M' OR
                vbtyp_n = 'H' ) .
          IF sy-subrc NE 0.
            CLEAR gi_vbfa.
          ENDIF.
        ELSE.
          CLEAR gi_likp.
        ENDIF.
      ELSE.
        MESSAGE i261.
        LEAVE SCREEN.
      ENDIF.
    ENDFORM.                    "collect_data
    *&      Form  Manipulation_collect_data
    FORM manipulation_collect_data.
      SORT gi_vbak BY vbeln.
      SORT gi_kna1 BY kunnr.
      LOOP AT gi_vbak INTO gwa_vbak.
        MOVE-CORRESPONDING gwa_vbak TO gwa_final.
        READ TABLE gi_kna1 INTO gwa_kna1 WITH KEY kunnr = gwa_vbak-kunnr
                                       BINARY SEARCH.
        IF sy-subrc EQ 0.
          gwa_final-name1 = gwa_kna1-name1.
        ENDIF.
      ENDLOOP.
    *    v_month = gwa_vbak-audat+4(2).
    *    gwa_final-cumon = p_monat.
    *    gwa_final-fiscy = p_gjahr.
    *    IF v_month = p_monat.
    *      CLEAR wa_ckmlhd.
    *      READ TABLE i_ckmlhd INTO wa_ckmlhd WITH KEY matnr = wa_vbap-matnr
    *                                                  bwkey = wa_vbap-werks
    *                                                  BINARY SEARCH.
    *      IF sy-subrc EQ 0.
    *        CLEAR i_nckmlcr.
    *        READ TABLE i_nckmlcr INTO wa_nckmlcr
    *                             WITH KEY kalnr = wa_ckmlhd-kalnr
    *                             BINARY SEARCH.
    *        IF sy-subrc EQ 0.
    *          gwa_final-peinh = wa_nckmlcr-peinh.
    *          gwa_final-kzwi6 = wa_vbap-kzwi6 - wa_vbap-kzwi5.
    *          gwa_final-kzwi5 = wa_vbap-kzwi5.
    *          gwa_final-totre = gwa_final-kzwi6 + gwa_final-kzwi5.
    *          gwa_final-actco = ( wa_nckmlcr-pvprs / wa_nckmlcr-peinh ) *
    *                            wa_vbap-kwmeng.
    *          gwa_final-profit = gwa_final-totre - gwa_final-actco.
    *          gwa_final-prows  = ( gwa_final-profit - gwa_final-kzwi6 ) *
    *100.
    *        ENDIF.
    *      ENDIF.
    *    ELSE.
    *      CLEAR wa_ckmlhd.
    *      READ TABLE i_ckmlhd INTO wa_ckmlhd WITH KEY matnr = wa_vbap-matnr
    *                                                bwkey = wa_vbap-werks
    *                                                BINARY SEARCH.
    *      IF sy-subrc EQ 0.
    *        READ TABLE i_ckmlcr INTO wa_ckmlcr
    *                             WITH KEY kalnr = wa_ckmlhd-kalnr
    *                             BINARY SEARCH.
    *        IF sy-subrc NE 0.
    *          CLEAR wa_ckmlcr.
    *        ENDIF.
    *        CLEAR wa_nckmlcr.
    *        READ TABLE i_nckmlcr INTO wa_nckmlcr
    *                             WITH KEY kalnr = wa_ckmlhd-kalnr
    *                             BINARY SEARCH.
    *        IF sy-subrc EQ 0.
    *          gwa_final-fkzwi6  = wa_vbap-kzwi6 - wa_vbap-kzwi5.
    *          gwa_final-fkzwi5  = wa_vbap-kzwi5.
    *          gwa_final-ftotre  = gwa_final-fkzwi6 + gwa_final-fkzwi5.
    *          gwa_final-factco  = ( ( wa_nckmlcr-pvprs / wa_ckmlcr-peinh )
    *                               * wa_vbap-kwmeng ) / wa_nckmlcr-count.
    *          gwa_final-fprofit = gwa_final-ftotre - gwa_final-factco.
    *         gwa_final-fprows  = ( gwa_final-fprofit - gwa_final-kzwi6 ) *
    *100
    *        ENDIF.
    *      ENDIF.
    *    ENDIF.
    *    APPEND gwa_final TO gi_final.
    *    CLEAR : gwa_final,wa_nckmlcr,wa_ckmlcr,wa_ckmlhd,
    *            gwa_vbak,wa_vbap,gwa_kna1.
    *  ENDLOOP.
    *  gwa_final-matnr = space.gwa_final-vbeln = space.
    *  MODIFY gi_final FROM gwa_final TRANSPORTING vbeln matnr
    *                                WHERE matnr NE space.
    *  SORT gi_final BY kunnr vbeln matnr.
    *  IF p_sum = gc_x.
    *    LOOP AT gi_final INTO gwa_final.
    *      COLLECT gwa_final INTO gi_final1.
    *    ENDLOOP.
    *    CLEAR gwa_final.REFRESH gi_final.
    *    gi_final[] = gi_final1[].
    *  ENDIF.
    ENDFORM.                    "manipulation_collect_data
    *&      Form  change_date
    FORM change_date.
      DATA : lv_date(2) TYPE c,
             lv_mont(2) TYPE c,
             lv_year(4) TYPE n.
      lv_date = s_audat-low+6(2).
      lv_mont = s_audat-low+4(2).
      lv_year = s_audat-low(4).
      lv_year = lv_year - 1.
      CONCATENATE  lv_year lv_mont lv_date INTO s_audat-low.
      CLEAR : lv_date ,lv_mont,lv_year.
      lv_date = s_audat-high+6(2).
      lv_mont = s_audat-high+4(2).
      lv_year = s_audat-high(4).
      lv_year = lv_year - 1.
      CONCATENATE  lv_year lv_mont lv_date INTO s_audat-high.
      CLEAR : lv_date ,lv_mont,lv_year.
    ENDFORM.                    " change_date
    *&      Form  gi_sort_table
    FORM gi_sort_table.
      IF p_det = gc_x.
        gwa_sort-spos = '1'.
        gwa_sort-fieldname = 'KUNNR'.
        gwa_sort-tabname = 'gi_final'.
        gwa_sort-up = gc_x.
        gwa_sort-subtot  = gc_x.
        APPEND gwa_sort TO gi_sort.
        CLEAR gwa_sort.
        gwa_sort-spos = '2'.
        gwa_sort-fieldname = 'NAME1'.
        gwa_sort-tabname = 'gi_final'.
        gwa_sort-up = gc_x.
        APPEND gwa_sort TO gi_sort.
    *  ELSE.
    *    gwa_sort-spos = '1'.
    *    gwa_sort-fieldname = 'KUNNR'.
    *    gwa_sort-tabname = 'gi_final'.
    *    gwa_sort-up = gc_x.
    *    APPEND gwa_sort TO gi_sort.
    *    CLEAR gwa_sort.
    *    gwa_sort-spos = '2'.
    *    gwa_sort-fieldname = 'NAME1'.
    *    gwa_sort-tabname = 'gi_final'.
    *    gwa_sort-up = gc_x.
    *    gwa_sort-group = gc_x.
    *    gwa_sort-subtot  = gc_x.
    *    APPEND gwa_sort TO gi_sort.
      ENDIF.
    ENDFORM.                    "gi_sort_table
    *&      Form  mearge_field_catalog
    FORM mearge_field_catalog .
    *>> LOCAL WORK AREA FOR FIELDCATALOG
      DATA : lwa_fieldcata TYPE slis_fieldcat_alv.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'KUNNR'.
    *  lwa_fieldcata-col_pos      = 1.
      lwa_fieldcata-key          = 'X'.
      lwa_fieldcata-key_sel      = 'X'.
      lwa_fieldcata-ref_tabname  = 'KNA1'.
      lwa_fieldcata-seltext_l    = 'Customer No.'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'NAME1'.
    *  lwa_fieldcata-col_pos      = 2.
      lwa_fieldcata-ref_tabname  = 'KNA1'.
      lwa_fieldcata-seltext_l    = 'Customer Name'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      IF p_det = gc_x.
        CLEAR lwa_fieldcata.
        lwa_fieldcata-fieldname    = 'VBELN'.
    *    lwa_fieldcata-col_pos      = 3.
        lwa_fieldcata-ref_tabname  = 'VBAK'.
        lwa_fieldcata-seltext_l    = 'Sales Order Number'.
        APPEND lwa_fieldcata TO gi_fieldcat.
        CLEAR lwa_fieldcata.
        lwa_fieldcata-fieldname    = 'MATNR'.
    *    lwa_fieldcata-col_pos      = 4.
        lwa_fieldcata-ref_tabname  = 'VBAK'.
        lwa_fieldcata-seltext_l    = 'Material No.'.
        APPEND lwa_fieldcata TO gi_fieldcat.
      ENDIF.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'KWMENG'.
      lwa_fieldcata-col_pos      = 5.
      lwa_fieldcata-ref_tabname  = 'VBAP'.
      lwa_fieldcata-do_sum       = 'X'.
      lwa_fieldcata-seltext_l    = 'Order Quantity'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'PEINH'.
      lwa_fieldcata-col_pos      = 6.
      lwa_fieldcata-ref_tabname  = 'CKMLCR'.
      lwa_fieldcata-text_fieldname = 'PEINH'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'CUMON'.
      lwa_fieldcata-col_pos      = 7.
      lwa_fieldcata-ref_tabname  = 'VBKPF'.
      lwa_fieldcata-seltext_l    = 'Month'.
      lwa_fieldcata-no_sum       = gc_x.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'KZWI6'.
      lwa_fieldcata-col_pos      = 8.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Costed Sales'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'KZWI5'.
      lwa_fieldcata-col_pos      = 9.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Surcharges'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'TOTRE'.
      lwa_fieldcata-col_pos      = 10.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Total Revenues'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'ACTCO'.
      lwa_fieldcata-col_pos      = 11.
      lwa_fieldcata-ref_tabname  = 'VBAP'.
      lwa_fieldcata-seltext_l    = 'Actual Cost for Period'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'PROFIT'.
      lwa_fieldcata-col_pos      = 12.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Profit'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'PROWS'.
      lwa_fieldcata-col_pos      = 13.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Profit % w/surcharge'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FISCY'.
      lwa_fieldcata-col_pos      = 14.
    *  lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Fiscal Year'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FKZWI6'.
      lwa_fieldcata-col_pos      = 15.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Costed Sales'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FKZWI5'.
      lwa_fieldcata-col_pos      = 16.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Surcharges'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FTOTRE'.
      lwa_fieldcata-col_pos      = 17.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Total Revenues'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FACTCO'.
      lwa_fieldcata-col_pos      = 18.
      lwa_fieldcata-ref_tabname  = 'VBAP'.
      lwa_fieldcata-seltext_l    = 'Actual Cost for Period'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FPROFIT'.
      lwa_fieldcata-col_pos      = 19.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Profit'.
      APPEND lwa_fieldcata TO gi_fieldcat.
      CLEAR lwa_fieldcata.
      lwa_fieldcata-fieldname    = 'FPROWS'.
      lwa_fieldcata-col_pos      = 20.
      lwa_fieldcata-ref_tabname  = 'VBAK'.
      lwa_fieldcata-seltext_l    = 'Profit % w/surcharge'.
      APPEND lwa_fieldcata TO gi_fieldcat.
    ENDFORM.                    " mearge_field_catalog
    *&      Form  set_event
    FORM set_event .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 1
        IMPORTING
          et_events   = gi_events.
      SORT gi_events BY name.
    *-- To read Top of Page event
      PERFORM read_events USING slis_ev_top_of_page gc_top_of_page.
    ENDFORM.                    " set_event
    *&      Form  top_of_page
    FORM n_top_of_page USING lp_top_of_page TYPE slis_t_listheader.
      DATA: lwa_listhead TYPE slis_listheader,
            lv_ccode TYPE string,
            lv_sales TYPE string,
            lv_divis TYPE string.
      CONCATENATE 'From : ' s_bukrs-low  ' To: ' s_bukrs-high INTO lv_ccode.
      CONCATENATE 'From: ' s_vkorg-low       ' To: ' s_vkorg-high INTO lv_sales.
      CONCATENATE 'From: ' s_spart-low       ' To: ' s_spart-high INTO lv_divis.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'H'.
      lwa_listhead-info = text-003.
      APPEND lwa_listhead TO lp_top_of_page.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'S'.
      lwa_listhead-key  = 'Month'.
      lwa_listhead-info = p_monat.
      APPEND lwa_listhead TO lp_top_of_page.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'S'.
      lwa_listhead-key  = 'Year'.
      lwa_listhead-info = p_gjahr.
      APPEND lwa_listhead TO lp_top_of_page.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'S'.
      lwa_listhead-key  = 'Company Code'.
      lwa_listhead-info = lv_ccode.
      APPEND lwa_listhead TO lp_top_of_page.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'S'.
      lwa_listhead-key  = 'Sales Org'.
      lwa_listhead-info = lv_sales.
      APPEND lwa_listhead TO lp_top_of_page.
      CLEAR lwa_listhead.
      lwa_listhead-typ  = 'S'.
      lwa_listhead-key  = 'Division'.
      lwa_listhead-info = lv_divis.
      APPEND lwa_listhead TO lp_top_of_page.
      IF p_det = gc_x.
        CLEAR lwa_listhead.
        lwa_listhead-typ  = 'A'.
        lwa_listhead-info = text-004.
        APPEND lwa_listhead TO lp_top_of_page.
      ELSE.
        CLEAR lwa_listhead.
        lwa_listhead-typ  = 'A'.
        lwa_listhead-info = text-005.
        APPEND lwa_listhead TO lp_top_of_page.
      ENDIF.
    ENDFORM.                    "top_of_page
    *&      Form  TOP_OF_PAGE
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          i_logo             = 'ENJOYSAP_LOGO'
          it_list_commentary = gi_top_of_page.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  build_layout
    FORM build_layout .
      gwa_layout-no_input          = gc_x.
      gwa_layout-colwidth_optimize = gc_x.
      gwa_layout-zebra             = gc_x.
    ENDFORM.                    "build_layout
    *&      Form  alv_grid_display
    FORM alv_grid_display .
    * Function module to display ALV report
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          is_layout          = gwa_layout
          it_fieldcat        = gi_fieldcat[]
          it_sort            = gi_sort
          i_save             = 'A'
          it_events          = gi_events[]
        TABLES
          t_outtab           = gi_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.                    " alv_grid_display
    *&      Form  read_events
    FORM read_events  USING  pr_events    TYPE slis_alv_event-name
                             pr_eventname TYPE slis_formname.
      DATA: lwa_event TYPE slis_alv_event.
      CLEAR lwa_event.
      READ TABLE gi_events INTO lwa_event
                          WITH KEY name = pr_events BINARY SEARCH.
      IF sy-subrc = 0.
        MOVE pr_eventname TO lwa_event-form.
        MODIFY gi_events FROM lwa_event
                        TRANSPORTING form
                        WHERE name = pr_events.
      ENDIF.
    ENDFORM.                    " read_events
    Regards
    Sandipan

  • Need pl/sql code to Encrypted data to decryption formate

    Hi All,
    I have Encrypted data 64 bit formate like
    encrypt
    780D0287
    FA57C55510D258C73DE93059E3DC49EC
    need output as a Decryption data..kindly give me output

    This is your duplicate post...
    Re: Need pl/sql code to decryption
    *009*

  • Need discussion forum code in servlets

    hi,
    this is the first time iam posting msg here i need discussion forum code in servlets immediatly, if any one has that plz help me out i need it immediately.
    Regards,
    phani

    Why not try searching for what you want? You may find it gives you more immediate results.

  • Why do we need separate t.codes KB11N and KB41N for reposting costs & rev?

    Hi,
    Why do we need separate t.codes KB11N and KB41N for reposting costs and revenues? I noticed that i can still use one t.code KB11N to post both costs and revenues, hence why do we need a separate t.code KB41N for revenues?

    Hi,
    The BAPI for costs allows more options than the one for revenues. For example, via BAPI_ACC_PRIMARY_COSTS_POST  you can select sender Network, what you cannot do via BAPI_ACC_REVENUES_POST. The same is for 'cost object' as a receiver; you can do it only via BAPI for costs. In other aspects, the BAPI for costs could be used to repost revenues as well.
    Regards,
    Eli

  • Maestro need help also code is 75957252

    maestro need help also code is 75957252 for bios password reset
    This question was solved.
    View Solution.

    Try
    60635894
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • Maestro need help also code is 75957252 for bios password reset

    maestro need help also code is 75957252 for bios password reset
    This question was solved.
    View Solution.

    Check your other post. I replied there.
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • Hello, I bought my iphone in japan. And now I'm in Brazil and I use it here, I need the unlock code for me to use here. please

    Hello, I bought my iphone in japan. And now I'm in Brazil and I use it here, I need the unlock code for me to use here. please

    williamjapa wrote:
    Hello, I bought my iphone in japan. And now I'm in Brazil and I use it here, I need the unlock code for me to use here. please
    Only the carrier to which the phone is locked can authorize an unlock. None of the Japanese carriers will do that. Sell the phone and buy one that works in Brazil.

  • I need to reinstall CS5 on a machine that has had to be reformatted, i need a Support Code after obtaining the Challenge Code. Please help

    I need to reinstall CS5 on a machine that has had to be reformatted, i need a Support Code after obtaining the Challenge Code. My email address is <removed - kglad>
    Please help

    <moved from Adobe Creative Cloud to Downloading, Installing, Setting Up>
    use your serial number to activate.  if you cannot connect to adobe's server's to activate, Sign in, activation, or connection errors | CS5.5 and later

  • I need to re activate CS 4 Creative suite, normally I got a challenge code by telephone, and the software worked. Now it's impossible to speak someone by telephone, how can I activate my software on my new mac? I need a challenge code because it is an upg

    I need to re activate CS 4 Creative suite, normally I got a challenge code by telephone, and the software worked. Now it's impossible to speak someone by telephone, how can I activate my software on my new mac? I need a challenge code because it is an upgrade version.

    Try serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • I need a request code for offline activation. Because i cannot connect with adobe server for online activation. But I receive "The request code is invalid." by generate answer code.

    I need a request code for offline activation. Because i cannot connect with adobe server for online activation. But I receive "The request code is invalid." by generate answer code.

    Dear Anubha,
    I hope these windows illustrate what I am facing.
    The above window shows the prompt that the software requires activation.
    The version is 8.1.0.
    This next window is the point where I select activation by phone.
    This final window shows that the "response code" is not returned.  I get an
    "Activation Number" instead.
    Steven
    On Tue, Jan 27, 2015 at 10:50 PM, Anubha Goel <[email protected]>

  • I need my redemption code. Followed all tips, but did not work. Had to reinstall Windows 8Redemption Code - forgot mine

    I need my redemption code. Followed all tips, but did not work. Had to reinstall Windows 8 due to Windows Explorer crash issue,and had to reinstall all softwares. I am a monthly regular CC customer, and dont recall my 24 digit  code.

    Since this is an open forum, not Adobe support... you need to contact Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"
    -or by telephone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

Maybe you are looking for

  • Problems with quick time and phone

    hi guys im having problems with my quicktime media player where if i want to open or play a movie it says it doesnt support the file but if i open it up on a different media playr such as vlc it does. also this problem arises as ive got a new mobile

  • Port Replicator Series 3 fan?

    Hi all, I am considering buying a port replicator for my t420, but I also want to have an external fan blowing on my thinkpad when I play games, for instance. I'm wondering if the port replicator series 3 has an internal fan built into it, and if not

  • How to view blob/image in uix?

    Version: JDev 9.0.5.2 Goal: To view an image that is coming from a database table. Set Up: In the database: I have a database table with a blob data type. The blob data type contains a pointer to the image in a database directory. In JDev.model: I ha

  • Please please please help me... urgent

    hi i want to redirect my application when am giving the url http://localhost.localdomain:7777/pls/apex/. it goes to the apex login page. where i have to make changes. please please tell me the solution. it is very urgent . i want to upload my applica

  • Find exact string using formula (excel)

    I'm trying to use FIND statement to find multiple strings in the context of a larger formula. The original formula I'm basing it off of is as follows: =IF(ISNUMBER(FIND("INC",A1))," ","Y") Obviously, this yields a Y if it finds whatever text in " ".