Function Module to evaluate Dependency Procedure

I am in need of a Function Module which can parse and/or evaluate the psuedo-code of a Dependency Procedure (see Function Module CUKD_GET_KNOWLEDGE).
This is needed to create a report which will predict changes to Material Configurations and display changes caused by Dependencies.   Any information is greatly appreciated.
Thank you.

You can use FM - RV_INVOICE_DOCUMENT_READ
pass KONV_READ = 'X'
and VBRK_I-VBELN = Invoice # u wanna read.
the structure XKOMV will give u the pricing data.
Or if u want to select from DB, then go to VBRK pass the Invoice number there( at VBRK-VBELN) and get the VBRK-KNUMV ( Condition rec no) . With this no go to table KONV and u will get all the pricing data.
Hope it helps.

Similar Messages

  • Function module "Z_XSI_ACTIVE" not found

    Dear all,
    I m getting an error
    Runtime Errors CALL_FUNCTION_NOT_FOUND
    Except. CX_SY_DYN_CALL_ILLEGAL_FUNC
    Date and Time 18.07.2008 16:02:20
    Short dump has not been completely stored (too big)
    Short text
    Function module "Z_XSI_ACTIVE" not found.
    Pls see details
    Error analysis
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_FUNC', was
    not caught in
    procedure "XSI_ACTIVE_DELV" "(FUNCTION)", nor was it propagated by a RAISING
    clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    The program "SAPLVVTR" contains the CALL FUNCTION statement.
    The name of the function module to be called is "Z_XSI_ACTIVE".
    No function module exists with the name "Z_XSI_ACTIVE".
    All function modules are listed in the Function Library (SE37).
    Possible reasons:
    a) Wrong name specified. Pay particular attention to
    upper/lower case and underscores ("_").
    or
    b) Transport error
    c) In the case of an enqueue/dequeue module,
    the lock object may not have been activated
    (ABAP/4 Dictionary).
    Pls view Function Module "XSI_ACTIVE_DELV" and tell me about function "Z_XSI_ACTIVE".
    I think it has problem with user exit.

    In the IMG (tx SPRO) you have Logistics Execution->Shipping->Basic Shipping Functions->Configure Global Shipping Data.  If you execute that, you have the choice for field ExpDlvCo to have
    Inactive
    Active
    Active depending on function module XSI_ACTIVE
    Active depending on function module XSI_ACTIVE with changes
    Help on this field says:
    Express Delivery Company Active
        This indicator dictates whether the express-delivery-company interface
        is active and may contain the following values:
           "X": clients active
           " " (blank): clients inactive
        Special processing:
        The values of "S" and "U" call up the "XSI_ACTIVE" customer function
        module. "S" indicates that the data is read-only, whereas "U" means that
        data can be changed. The interface for this function module must be
        identical to the one in the function module "XSI_ACTIVE_SAMPLE".
    I.e., if you set the ExpDlvCo field to be  "Active depending on function module XSI_ACTIVE" or "Active depending on function module XSI_ACTIVE with changes", then you have to create a function module Z_XSI_ACTIVE, with the same interface as XSI_ACTIVE_SAMPLE.
    matt

  • Use of g_posting_glpct function module

    can anyone explain the use of the following function module.
    1. g_posting_glpct
    2. message_prepare
    3. k_costs_plan_interface_period

    Hi
    <b>g_posting_glpct</b> - used to Posting values into GLPCT table
    <b>message_prepare</b> - this Fun module is similar to FORMAT_MESSAGE which is used to format the messages into a string and to display.
    <b> k_costs_plan_interface_period</b> - used to Transfer Cost Planning with Period Values
    Functionality
    The function module transfers activity-dependent primary cost planning for cost centers to orders and projects, and revenue planning to cost centers. You can process only one object type per call up -- for example, you must define transfers to cost centers and to orders in two separate operations. The transfer of individual plan records uses table IRKU01JA with structure RKU01JA. The module treats periodically occurring plan values.
    The module import parameters (fiscal year, version, and so on) are valid for all plan records in the table and appear automatically in the table entries. Identically-named fields in table IRKU01JA need not be filled. Because the structure applies to other planning transactions and different planning objects, you must supply the relevant information for the relevant fields only (see table IRKU01JA).
    If the transferred plan values do not appear otherwise (see parameter DELTA below), they appear as new plan totals values. If line item update is active for the version in question, the system creates line items for new plan records and corresponding difference line items for previously-created plan records.
    Transfers take place after tests for valid plan records. The module can issue an error message for invalid records at the end of processing, if so desired.
    Reward points if useful
    Regards
    Anji

  • Transport Request for Function Module

    Hi Gurus,
    I have created custom function module, which has function group, fields, and include. While developing only Function group is collected . But couldn't know how to collect function module and other dependent objects.
    Please assiss me how to collect function module and other dependent objects.
    Thanks
    Ganesh Reddy.

    Hi Ganesh,
    goto SE37, give the functional module and diplay the code
    in the environment on menu bar, you will find option transport request
    Regards,
    Venkatesh

  • Function module to pricing procedure calculation

    hi,
    I want to know whether any function modules available to get as I see in  Invoice ->
    select item level conditions.
    Where i can see the basic price ,discount, etc as defined in the corresponding pricing procedure.
    i have tried with
    RV_INVOICE_PRICE_PBO
    PRICING_SUBSCREEN_SET_DATA
    here i get only the records which have condition type,
    similarly for P.O. we have
    ME_SWP_SIC_GET_PRICING_INFO
    regards,
    Prabhu
    Points assured.

    REPORT  zmm_pvr.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     TYPE-POOLS                                          *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    TYPE-POOLS slis.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                       TABLES                                            *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    TABLES: mara,                         " General Material Data
            marc,                         " Plant Data for Material
            ekko,                         " Purchasing Document Header
            ekpo,                         " Purchasing Document Item
            lfa1,                         " Vendor Master (General Section)
            konv,                         " Conditions (Transaction Data)
            mbew,                         " Material Valuation
            makt.                         " Material Descriptions
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    DATA DECLARATION                                     *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    DATA: BEGIN OF i_mat OCCURS 1,
            matnr LIKE mara-matnr,
            mtart LIKE mara-mtart,
            werks LIKE marc-werks,
            abcin LIKE marc-abcin,
          END OF i_mat.
    DATA: BEGIN OF itab OCCURS 1,
            ebeln LIKE ekko-ebeln,
            bedat LIKE ekko-bedat,
            lifnr LIKE ekko-lifnr,
            waers LIKE ekko-waers,
            bukrs LIKE ekko-bukrs,
            ekorg LIKE ekko-ekorg,
            name1 LIKE lfa1-name1,
            werks LIKE ekpo-werks,
            menge LIKE ekpo-menge,
            meins LIKE ekpo-meins,
            netpr LIKE ekpo-netpr,
            netwr LIKE ekpo-netwr,
            menge1(16),
            netpr1(16),
            menge2  TYPE string,
            netpr2 TYPE string,
            lrate TYPE p DECIMALS 2,
            stax LIKE ekpo-netwr,
            exbed LIKE ekpo-netwr,
            dcost LIKE konv-kwert,
            nomvl LIKE ekpo-netwr,
            nomrt LIKE ekpo-netwr,
            zplp1 LIKE mbew-zplp1,
            verpr LIKE mbew-verpr,
            bgval LIKE ekpo-netwr,
            varnc LIKE ekpo-netwr,
            maktx LIKE makt-maktx,
            knumv LIKE ekko-knumv,
            ebelp LIKE ekpo-ebelp,
            matnr LIKE ekpo-matnr,
            matkl LIKE ekpo-matkl,
            mtart LIKE ekpo-mtart,
            bprme LIKE ekpo-bprme,
            txz01 LIKE ekpo-txz01,
            mwskz LIKE ekpo-mwskz,
            prdat LIKE ekpo-prdat,
          END OF itab.
    DATA: wtab LIKE itab.
    DATA: v_steuc TYPE marc-steuc.
    DATA: v_brsch TYPE lfa1-brsch.
    DATA: wa_komk TYPE komk.
    DATA: wa_komp TYPE komp.
    DATA: it_komv TYPE TABLE OF komv.
    DATA: wa_komv TYPE komv.
    DATA : wa_fieldcat TYPE  slis_fieldcat_alv,
           gt_fieldcat TYPE  slis_t_fieldcat_alv,
           wa_layout   TYPE  slis_layout_alv,
           lt_sort     TYPE  slis_t_sortinfo_alv,
           i LIKE sy-tabix.
    DATA: gt_events     TYPE slis_t_event.
    DATA: gd_prntparams TYPE slis_print_alv.
    DATA: it_color TYPE   slis_t_specialcol_alv.
    DATA: wa_color TYPE   slis_specialcol_alv.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          Begin Of Selection Screen                      *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    SELECTION-SCREEN BEGIN OF BLOCK pas WITH FRAME TITLE text-001.
    SELECT-OPTIONS s_matnr FOR  ekpo-matnr.
    SELECT-OPTIONS s_werks FOR  ekpo-werks.
    SELECT-OPTIONS s_bedat FOR  ekko-bedat.
    PARAMETERS     p_abcin LIKE marc-abcin OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK pas.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                           INITIALIZATION                                *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    INITIALIZATION.
      IF sy-datum+4(2) GE 4.
        s_bedat-low+6(2) = 01.
        s_bedat-low+4(2) = 04.
        s_bedat-low(4) = sy-datum(4).
      ENDIF.
      IF sy-datum+4(2) LT 4.
        s_bedat-low+6(2) = 01.
        s_bedat-low+4(2) = 04.
        s_bedat-low(4) = sy-datum(4) - 1.
      ENDIF.
      s_bedat-high   = sy-datum.
      APPEND s_bedat.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        AT Selection Screen Output                       *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    AT SELECTION-SCREEN.
    Check for Material Type
      SELECT amatnr amtart bwerks babcin INTO CORRESPONDING FIELDS OF TABLE i_mat
      FROM mara AS a INNER JOIN marc AS b
           ON amatnr = bmatnr
      WHERE a~matnr IN s_matnr
        AND ( amtart = 'IRAM' OR amtart = 'IPAM' OR amtart = 'PRAM' OR amtart = 'PPAM' )
        AND b~werks IN s_werks
        AND b~abcin = p_abcin.
      SORT i_mat BY matnr werks.
      CHECK NOT i_mat[] IS INITIAL.
      READ TABLE i_mat INDEX 1.
      IF sy-subrc <> 0.
        MESSAGE e006(zmm).
        LEAVE LIST-PROCESSING.
      ENDIF.
    Check for Date
      IF ( s_bedat-low IS INITIAL AND s_bedat-high IS INITIAL ).
        s_bedat-sign   = 'I'.
        s_bedat-option = 'BT'.
        IF sy-datum+4(2) GE 4.
          s_bedat-low+6(2) = 01.
          s_bedat-low+4(2) = 04.
          s_bedat-low(4) = sy-datum(4).
        ENDIF.
        IF sy-datum+4(2) LT 4.
          s_bedat-low+6(2) = 01.
          s_bedat-low+4(2) = 04.
          s_bedat-low(4) = sy-datum(4) - 1.
        ENDIF.
        s_bedat-high   = sy-datum.
      ELSEIF ( s_bedat-low IS NOT INITIAL AND s_bedat-high IS INITIAL ).
        s_bedat-low6(2) = s_bedat-low6(2).
        s_bedat-low4(2) = s_bedat-low4(2).
        s_bedat-low(4)   = s_bedat-low(4).
      ELSEIF ( s_bedat-low IS NOT INITIAL AND s_bedat-high IS NOT INITIAL ).
        s_bedat-sign   = 'I'.
        s_bedat-option = 'BT'.
        s_bedat-low6(2) = s_bedat-low6(2).
        s_bedat-low4(2) = s_bedat-low4(2).
        s_bedat-low(4)   = s_bedat-low(4).
        s_bedat-high6(2) = s_bedat-high6(2).
        s_bedat-high4(2) = s_bedat-high4(2).
        s_bedat-high(4)   = s_bedat-high(4).
      ENDIF.
      APPEND s_bedat.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            START OF SELECTION                           *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    START-OF-SELECTION.
    *----- Get all PO for given selection criteria.
    LOOP AT i_mat.
      SELECT
        aebeln abedat alifnr aknumv awaers abukrs a~ekorg
        bebelp bmatnr bmatkl bnetpr bbprme btxz01 bwerks bmenge bmeins bnetwr bmtart bmwskz b~prdat
      FROM ( ekko AS a INNER JOIN ekpo AS b ON  amandt = bmandt AND aebeln = bebeln )
      INTO CORRESPONDING FIELDS OF TABLE itab
      FOR ALL ENTRIES IN i_mat
      WHERE a~bedat IN s_bedat
       AND  a~loekz = ''
       AND  b~matnr = i_mat-matnr
       AND  b~werks = i_mat-werks
       AND  b~loekz = ''
       AND  b~pstyp = '0'
       AND  b~bstyp = 'F'
       AND  b~knttp = ''.
    ENDLOOP.            " END OF i_mat
      CHECK NOT itab[] IS INITIAL.
      SORT itab BY ebeln ebelp.
    *----- Calculating The DCOST -- Delivery Cost
      DATA: BEGIN OF i_konv OCCURS 0,
             knumv LIKE konv-knumv,
             kposn LIKE konv-kposn,
             stunr LIKE konv-stunr,
             zaehk LIKE konv-zaehk,
             kschl LIKE konv-kschl,
             kbetr LIKE konv-kbetr,
             kwert LIKE konv-kwert,
           END OF i_konv.
      SELECT knumv kposn stunr zaehk kschl kbetr kwert
      FROM konv
      INTO CORRESPONDING FIELDS OF TABLE i_konv
      FOR ALL ENTRIES IN itab
      WHERE knumv = itab-knumv
       AND kposn = itab-ebelp
        AND ( kschl   = 'ZFC3' OR kschl   = 'ZQIQ'
           OR kschl   = 'ZQIV' OR kschl   = 'ZFA3'
           OR kschl   = 'ZFB3' OR kschl   = 'ZPF2'
           OR kschl   = 'ZPQ2' OR kschl   = 'ZPV2'
           OR kschl   = 'ZOCP' OR kschl   = 'ZOCQ'
           OR kschl   = 'ZOCV' OR kschl   = 'ZMT1'
           OR kschl   = 'ZIN2' OR kschl   = 'ZIQ2'
           OR kschl   = 'ZIV2' OR kschl   = 'ZBK1'
           OR kschl   = 'ZBKQ' OR kschl   = 'ZBKV' ).
      SORT i_konv BY knumv kposn stunr zaehk kschl .
      DELETE ADJACENT DUPLICATES FROM i_konv.
      DELETE i_konv WHERE kbetr = 0.
      DATA: BEGIN OF i_knumv OCCURS 0,
              knumv LIKE konv-knumv,
              kwert LIKE konv-kwert,
            END OF i_knumv.
      LOOP AT i_konv.
        MOVE i_konv-knumv TO i_knumv-knumv.
        MOVE i_konv-kwert TO i_knumv-kwert.
        COLLECT i_knumv.
      ENDLOOP.
      CLEAR i_konv.
      CLEAR i_knumv.
      LOOP AT itab INTO wtab.
        READ TABLE i_knumv WITH KEY knumv = wtab-knumv.
        IF sy-subrc = 0.
          wtab-dcost = i_knumv-kwert.
          MODIFY itab FROM wtab.
        ENDIF.
      ENDLOOP.
      CLEAR i_knumv.
      CLEAR itab.
    *----- Get the vendor name.
      LOOP AT itab.
        SELECT SINGLE name1 FROM lfa1 INTO itab-name1
                                        WHERE lifnr = itab-lifnr.
        MODIFY itab INDEX sy-tabix TRANSPORTING name1.
      ENDLOOP.
    *----- Calculate Excise Duty, Educat. cess, Sec edu. cess, sales tax
      CLEAR: wa_komk, wa_komp.
    Selecting The Value Of STEUC (Controlling Code)
      CLEAR itab.
      LOOP AT itab.
        SELECT SINGLE steuc
          FROM marc
          INTO v_steuc
         WHERE matnr = itab-matnr
           AND werks = itab-werks.
    Selecting The Value Of BRSCH (Industry key)
        SELECT SINGLE brsch
          FROM lfa1
          INTO v_brsch
         WHERE lifnr = itab-lifnr.
    Filling KOMK (Header Structure)
        wa_komk-kappl     = 'TX'.
        wa_komk-kalsm     = 'TAXINN'.
        wa_komk-lifnr     = itab-lifnr.
        wa_komk-waerk     = itab-waers.
        wa_komk-aland     = 'IN'.
        wa_komk-hwaer     = 'INR'.
        wa_komk-bukrs     = itab-bukrs.
        wa_komk-brsch     = v_brsch.
        wa_komk-prsdt     = itab-bedat.
        wa_komk-ekorg     = itab-ekorg.
        wa_komk-mwskz     = itab-mwskz.
    Filling KOMP (Details Structure)
        wa_komp-kposn     = itab-ebelp.
        wa_komp-matnr     = itab-matnr.
        wa_komp-werks     = itab-werks.
        wa_komp-matkl     = itab-matkl.
        wa_komp-meins     = itab-meins.
        wa_komp-vrkme     = itab-bprme.
        wa_komp-netwr     = itab-netwr.
        wa_komp-wrbtr     = itab-netwr.
        wa_komp-mwskz     = itab-mwskz.
        wa_komp-netpr     = itab-netpr.
        wa_komp-mtart     = itab-mtart.
        wa_komp-kursk_dat = itab-prdat.
        wa_komp-steuc     = v_steuc.
        wa_komp-mgame     = itab-menge.
        wa_komp-mglme     = itab-menge.
        FREE it_komv.
    Calling The Pricing Function To Get GR EXCISE, GR ECES, GR VAT/CST
        CALL FUNCTION 'PRICING'
          EXPORTING
            calculation_type = 'B'
            comm_head_i      = wa_komk
            comm_item_i      = wa_komp
          TABLES
            tkomv            = it_komv.
    Calculating The Excise --excise duty
        DATA: l_kbetr        TYPE komv-kbetr.
        DATA: l_gr_excise    TYPE ekpo-brtwr.
        DATA: l_basic_gr_val TYPE ekpo-netpr.
        l_basic_gr_val = itab-netwr.
        CLEAR: l_kbetr, l_gr_excise.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JMOP'
                                        OR kschl = 'JAOP'
                                        OR kschl = 'JMIP'
                                        OR kschl = 'JAOQ'.
          l_kbetr     = ( wa_komv-kbetr / 10 ).
          l_gr_excise = ( l_kbetr * l_basic_gr_val ) / 100.
        ENDLOOP.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JAIP'
                                        OR kschl = 'JAIQ'
                                        OR kschl = 'JMIQ'
                                        OR kschl = 'JMOQ'.
          l_gr_excise = ( wa_komv-kbetr * l_basic_gr_val ).
        ENDLOOP.
    Calculating The ECES -- Educational Cess
        DATA l_gr_eces      TYPE ekpo-netpr.
        CLEAR: l_kbetr, l_gr_eces.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'ZECE'
                                        OR kschl = 'ZECN'.
          l_kbetr     = ( wa_komv-kbetr / 10 ).
          l_gr_eces   = ( l_kbetr * l_gr_excise ) / 100.
        ENDLOOP.
    Calculating The SECES -- Sec. Educational Cess
        DATA l_gr_secs      TYPE ekpo-netpr.
        CLEAR: l_kbetr, l_gr_secs.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JSEP'
                                        OR kschl = 'JSEI'.
          l_kbetr     = ( wa_komv-kbetr / 10 ).
          l_gr_secs   = ( l_kbetr * l_gr_excise ) / 100.
        ENDLOOP.
    Calculating The VAT/CST --Sales Tax
        DATA l_gr_vatcst    TYPE ekpo-netpr.
        CLEAR: l_kbetr, l_gr_vatcst.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JVRN'
                                        OR kschl = 'JVRD'
                                        OR kschl = 'JVCS'
                                        OR kschl = 'JVCD'
                                        OR kschl = 'JVCN'
                                        OR kschl = 'JIPS'
                                        OR kschl = 'JIPC'
                                        OR kschl = 'JIPL'.
          l_kbetr     = ( wa_komv-kbetr / 10 ).
          l_gr_vatcst = ( ( l_basic_gr_val + l_gr_excise + l_gr_eces + l_gr_secs ) * l_kbetr ) / 100.
        ENDLOOP.
    Calculating The NOMVL & NOMVR -- NOM Value (Setoff / Inventory ) & NOM Rate
        DATA: l_netpr TYPE ekpo-netpr,
              l_menge TYPE ekpo-menge,
              l_dcost TYPE ekpo-netwr,
              l_nomvl TYPE ekpo-netwr,
              l_nomrt TYPE ekpo-netwr.
        l_netpr = itab-netpr.
        l_menge = itab-menge.
        l_dcost = itab-dcost.
        CLEAR: l_nomvl, l_nomrt.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JMOP'                        "------setoff
                                        OR kschl = 'ZECE'
                                        OR kschl = 'JSEP'.
          l_nomvl = ( l_netpr * l_menge ) + l_gr_vatcst + l_dcost - ( l_gr_excise + l_gr_eces + l_gr_secs ).
          l_nomrt =  l_nomvl / l_menge.
        ENDLOOP.
        LOOP AT it_komv INTO wa_komv WHERE kschl = 'JMIP'                        "-------inventory
                                        OR kschl = 'ZECN'
                                        OR kschl = 'JSEI'.
          l_nomvl = ( l_netpr * l_menge ) + l_gr_vatcst + l_dcost.
          l_nomrt =  l_nomvl / l_menge.
        ENDLOOP.
        itab-exbed = l_gr_excise + l_gr_eces + l_gr_secs.
        itab-stax  = l_gr_vatcst.
        itab-nomvl = l_nomvl.
        itab-nomrt = l_nomrt.
        MODIFY itab .
        CLEAR itab.
      ENDLOOP.           " end of itab
      LOOP AT itab WHERE exbed = 0.
        itab-nomvl = ( itab-netpr * itab-menge ) + itab-stax + itab-dcost.
        itab-nomrt = itab-nomvl / itab-menge.
        MODIFY itab INDEX sy-tabix TRANSPORTING nomvl nomrt.
      ENDLOOP.
    *----- Calculating The Budget Rate, Moving Average Price, Landed Rate & Material Description
      DATA: verp(15).
      DATA: matdes(40).
      LOOP AT itab.
        SELECT SINGLE zplp1 FROM mbew INTO itab-zplp1
                                        WHERE matnr = itab-matnr AND bwkey = itab-werks.
        SELECT SINGLE verpr FROM mbew INTO itab-verpr
                                        WHERE matnr = itab-matnr AND bwkey = itab-werks.
        itab-lrate = itab-netwr / itab-menge.
        SELECT SINGLE maktx FROM makt INTO itab-maktx
                                        WHERE matnr = itab-matnr AND spras = 'EN'.
        MODIFY itab INDEX sy-tabix TRANSPORTING zplp1 verpr lrate maktx.
        verp = itab-verpr.
        matdes = itab-maktx.
      ENDLOOP.
    *----- Calculating The Budget Value & Variance
      LOOP AT itab.
        itab-bgval = itab-zplp1 * itab-menge.
        itab-varnc = itab-bgval - itab-nomvl.
        MODIFY itab INDEX sy-tabix TRANSPORTING bgval varnc.
      ENDLOOP.
    *------ Calculating Total of Quantity
      DATA: BEGIN OF i_quan OCCURS 1,
               quant LIKE ekpo-menge,
               unit LIKE ekpo-meins,
               nomvl LIKE ekpo-netwr,
               curr LIKE ekko-waers,
               varnc LIKE ekpo-netwr,
               bgval LIKE ekpo-netwr,
             END OF i_quan.
      LOOP AT itab.
        MOVE itab-menge TO i_quan-quant.
        MOVE itab-meins TO i_quan-unit.
        MOVE itab-nomvl TO i_quan-nomvl.
        MOVE itab-waers TO i_quan-curr.
        MOVE itab-varnc TO i_quan-varnc.
        MOVE itab-bgval TO i_quan-bgval.
        COLLECT i_quan.
      ENDLOOP.
      CLEAR itab.
      CLEAR i_quan.
      DATA: qty(15).
      DATA: unt(3).
      DATA: wtd TYPE p DECIMALS 2.
      DATA: wtd2(15).
      DATA: cur(3).
      DATA: var(15).
      DATA: nomvl(15).
      DATA: bgval(15).
      DATA: bgv TYPE p DECIMALS 2.
      DATA: bgv2(15).
      LOOP AT i_quan.
        qty = i_quan-quant.
        unt = i_quan-unit.
        cur = i_quan-curr.
        var = i_quan-varnc.
        bgval = i_quan-bgval.
        nomvl = i_quan-nomvl.
        wtd = nomvl / qty.
        bgv = bgval / qty.
      ENDLOOP.
      CLEAR i_quan.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          DATA DISPLAY                                   *
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      wa_fieldcat-fieldname  = 'EBELN'.
      wa_fieldcat-seltext_l  = 'Purchase Order'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 1.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'BEDAT'.
      wa_fieldcat-seltext_l  = 'PO Date'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 2.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'NAME1'.
      wa_fieldcat-seltext_l  = 'Vendor Name'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 3.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'WERKS'.
      wa_fieldcat-seltext_l  = 'Plant'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 4.
      APPEND wa_fieldcat TO gt_fieldcat.
    wa_fieldcat-fieldname  = 'MENGE2'.
      wa_fieldcat-fieldname  = 'MENGE'.
      wa_fieldcat-seltext_l  = 'Quantity'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 5.
      wa_fieldcat-do_sum     = 'X'.
      APPEND wa_fieldcat TO gt_fieldcat.
    wa_fieldcat-fieldname  = 'NETPR2'.
      wa_fieldcat-fieldname  = 'NETPR'.
      wa_fieldcat-seltext_l  = 'Basic Rate'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 6.
      wa_fieldcat-do_sum     = ' '.
      APPEND wa_fieldcat TO gt_fieldcat.
    wa_fieldcat-fieldname  = 'EXBED'.
    wa_fieldcat-seltext_l  = 'Excise'.
    wa_fieldcat-tabname    = 'ITAB'.
    wa_fieldcat-row_pos    = 1.
    wa_fieldcat-col_pos    = 7.
    APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'STAX'.
      wa_fieldcat-seltext_l  = 'Sale Tax'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 7.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'DCOST'.
      wa_fieldcat-seltext_l  = 'Delivery Cost'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 8.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'NETWR'.
      wa_fieldcat-seltext_l  = 'Landed Value'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 9.
      wa_fieldcat-do_sum     = 'X'.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'LRATE'.
      wa_fieldcat-seltext_l  = 'Landed Rate'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 10.
      wa_fieldcat-do_sum     = ' '.
      APPEND wa_fieldcat TO gt_fieldcat.
    wa_fieldcat-fieldname  = 'NOMVL'.
    wa_fieldcat-seltext_l  = 'NOM Value'.
    wa_fieldcat-tabname    = 'ITAB'.
    wa_fieldcat-row_pos    = 1.
    wa_fieldcat-col_pos    = 12.
    wa_fieldcat-do_sum     = 'X'.
    APPEND wa_fieldcat TO gt_fieldcat.
    wa_fieldcat-fieldname  = 'NOMRT'.
    wa_fieldcat-seltext_l  = 'NOM Rate'.
    wa_fieldcat-tabname    = 'ITAB'.
    wa_fieldcat-row_pos    = 1.
    wa_fieldcat-col_pos    = 13.
    wa_fieldcat-do_sum     = ' '.
    APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'BGVAL'.
      wa_fieldcat-seltext_l  = 'Budget Value'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 11.
      wa_fieldcat-do_sum     = 'X'.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'ZPLP1'.
      wa_fieldcat-seltext_l  = 'Budget Rate'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 12.
      wa_fieldcat-do_sum     = ' '.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_fieldcat-fieldname  = 'VARNC'.
      wa_fieldcat-seltext_l  = 'Variance'.
      wa_fieldcat-tabname    = 'ITAB'.
      wa_fieldcat-row_pos    = 1.
      wa_fieldcat-col_pos    = 13.
      wa_fieldcat-do_sum     = 'X'.
      APPEND wa_fieldcat TO gt_fieldcat.
      wa_layout-colwidth_optimize = 'X'.
      wa_layout-zebra = ' '.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = gt_events[].
      READ TABLE gt_events WITH KEY name =  slis_ev_end_of_page
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE 'END_OF_PAGE' TO ls_event-form.
        APPEND ls_event TO gt_events.
      ENDIF.
      READ TABLE gt_events WITH KEY name =  slis_ev_end_of_list
                             INTO ls_event.
      IF sy-subrc = 0.
        MOVE 'END_OF_LIST' TO ls_event-form.
        APPEND ls_event TO gt_events.
      ENDIF.
      gd_prntparams-reserve_lines = '7'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
                i_callback_program        = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
           i_callback_top_of_page            = 'TOP-OF-PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      i_callback_html_end_of_list           = 'END_OF_LIST_HTML'
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
                is_layout                 = wa_layout
                it_fieldcat               = gt_fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
             i_default                    = 'X'
             i_save                       = 'X'
      IS_VARIANT                        =
       it_events                         = gt_events
      IT_EVENT_EXIT                     =
      is_print                          = gd_prntparams
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = itab
       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.
    *&      Form  top-of-page
          text
    -->  p1        text
    <--  p2        text
    FORM top-of-page .
    ALV Header Declarations
      DATA: t_header TYPE slis_t_listheader,
            wa_header  TYPE slis_listheader,
           wa_header1 TYPE slis_listheader,
           wa_header2 TYPE slis_listheader,
           wa_header3 TYPE slis_listheader,
            wa_header4 TYPE slis_listheader.
    Title
      wa_header-typ = 'H'.
      wa_header-info = 'Purchase Variance Report'.
      APPEND wa_header TO t_header.
      CLEAR wa_header.
    Material
    SHIFT p_matnr LEFT DELETING LEADING '0'.
    wa_header1-typ = 'S'.
    wa_header1-info = ' '.
    CONCATENATE 'Material : ' p_matnr matdes INTO wa_header1-info SEPARATED BY space.
    APPEND wa_header1 TO t_header.
    CLEAR wa_header1.
    Plant
    IF ( s_werks-low IS NOT INITIAL AND s_werks-high IS NOT INITIAL ).
       wa_header2-typ = 'S'.
       wa_header2-info = ' '.
       CONCATENATE 'Plant : ' s_werks-low 'to' s_werks-high INTO wa_header2-info SEPARATED BY space.
       APPEND wa_header2 TO t_header.
       CLEAR wa_header2.
    ELSEIF ( s_werks-low IS NOT INITIAL AND s_werks-high IS INITIAL ).
       wa_header2-typ = 'S'.
       wa_header2-info = ' '.
       CONCATENATE 'Plant : ' s_werks-low INTO wa_header2-info SEPARATED BY space.
       APPEND wa_header2 TO t_header.
       CLEAR wa_header2.
    ELSEIF ( s_werks-low IS INITIAL AND s_werks-high IS INITIAL ).
       EXIT.
    ENDIF.
    Period
      IF ( s_bedat-low IS NOT INITIAL AND s_bedat-high IS INITIAL ).
        wa_header4-typ = 'S'.
        wa_header4-info = ' '.
        CONCATENATE 'Period : '
                    s_bedat-low+6(2) '.'
                    s_bedat-low+4(2) '.'
                    s_bedat-low(4) INTO wa_header4-info SEPARATED BY space.
        APPEND wa_header4 TO t_header.
        CLEAR wa_header4.
      ELSE.
    IF ( s_bedat-low IS INITIAL AND s_bedat-high IS INITIAL ).
        wa_header4-typ = 'S'.
        wa_header4-info = ' '.
        CONCATENATE 'Period : '
                    s_bedat-low+6(2) '.'
                    s_bedat-low+4(2) '.'
                    s_bedat-low(4)
                    'to'
                    s_bedat-high+6(2) '.'
                    s_bedat-high+4(2) '.'
                    s_bedat-high(4) INTO wa_header4-info SEPARATED BY space.
        APPEND wa_header4 TO t_header.
        CLEAR wa_header4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_header.
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                    " top-of-page
    *&      Form  end_of_list_html
          output at the end of the list - not in printed output       *
    FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
      DATA: ls_text TYPE sdydo_text_element,
            l_grid     TYPE REF TO cl_gui_alv_grid,
            f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.
      DATA: qty1 TYPE sdydo_text_element.
      DATA: unt1 TYPE sdydo_text_element.
      DATA: wtd1 TYPE sdydo_text_element.
      DATA: cur1 TYPE sdydo_text_element.
      DATA: var1 TYPE sdydo_text_element.
      DATA: verp1 TYPE sdydo_text_element.
      DATA: bgv1 TYPE sdydo_text_element.
      qty1 = qty.
      unt1 = unt.
      wtd1 = wtd.
      cur1 = cur.
      var1 = var.
      verp1 = verp.
      bgv1 = bgv.
      ls_text = 'SUMMARY'.
      CALL METHOD end->add_text
        EXPORTING
          text         = ls_text
          sap_emphasis = 'strong'.
    Total Qty Bought (start new line)
      CALL METHOD end->new_line.
      CALL METHOD end->add_text
        EXPORTING
          text = 'Total Qty Bought : '.
      CALL METHOD end->add_text
        EXPORTING
          text = qty1.
      CALL METHOD end->add_text
        EXPORTING
          text = unt1.
    Wtd. Avg. Purchase Rate
      CALL METHOD end->new_line.
      CALL METHOD end->add_text
        EXPORTING
          text = 'Wtd. Avg. Purchase Rate : '.
      CALL METHOD end->add_text
        EXPORTING
          text = cur1.
      CALL METHOD end->add_text
        EXPORTING
          text = wtd1.
    Wtd. Avg. Budget Rate
      CALL METHOD end->new_line.
      CALL METHOD end->add_text
        EXPORTING
          text = 'Wtd. Avg. Budget Rate : '.
      CALL METHOD end->add_text
        EXPORTING
          text = cur1.
      CALL METHOD end->add_text
        EXPORTING
          text = bgv1.
    Gain / Loss
      CALL METHOD end->new_line.
      CALL METHOD end->add_text
        EXPORTING
          text = 'Gain / Loss : '.
      CALL METHOD end->add_text
        EXPORTING
          text = cur1.
      CALL METHOD end->add_text
        EXPORTING
          text = var1.
    MAP ( Moving Average Price )
      CALL METHOD end->new_line.
      CALL METHOD end->add_text
        EXPORTING
          text = 'Mov Avg Price : '.
      CALL METHOD end->add_text
        EXPORTING
          text = cur1.
      CALL METHOD end->add_text
        EXPORTING
          text = verp1.
    ENDFORM. "end_of_list_html.
    *&      Form  END_OF_PAGE
    FORM end_of_page.
      DATA: listwidth TYPE i,
            ld_pagepos(10) TYPE c,
            ld_page(10)    TYPE c.
      wtd2 = wtd.
      bgv2 = bgv.
      CONDENSE qty.
      CONDENSE unt.
      CONDENSE wtd2.
      CONDENSE bgv2.
      CONDENSE var.
      CONDENSE verp.
      SKIP.
      WRITE:/ 'SUMMARY:'.
    write:/ sy-uline(7).
      WRITE:/ 'Total Qty Bought        : ', qty, unt.
      WRITE:/ 'Wtd. Avg. Purchase Rate : ', wtd2, cur.
      WRITE:/ 'Wtd. Avg. Budget Rate   : ', bgv2, cur.
      WRITE:/ 'Gain / Loss             : ', var, cur.
      WRITE:/ 'Mov Avg Price           : ', verp, cur.
    ENDFORM.                    "END_OF_PAGE
    *&      Form  END_OF_LIST
    FORM end_of_list.
      DATA: listwidth TYPE i,
            ld_pagepos(10) TYPE c,
            ld_page(10)    TYPE c.
      wtd2 = wtd.
      bgv2 = bgv.
      CONDENSE qty.
      CONDENSE unt.
      CONDENSE wtd2.
      CONDENSE bgv2.
      CONDENSE var.
      CONDENSE verp.
      SKIP.
      WRITE:/ 'SUMMARY:'.
    write:/ sy-uline(7).
      WRITE:/ 'Total Qty Bought        : ', qty, unt.
      WRITE:/ 'Wtd. Avg. Purchase Rate : ', wtd2, cur.
      WRITE:/ 'Wtd. Avg. Budget Rate   : ', bgv2, cur.
      WRITE:/ 'Gain / Loss             : ', var, cur.
      WRITE:/ 'Mov Avg Price           : ', verp, cur.

  • Function module to find out dependent requirements

    Hello Experts,
    Any function module to determine the dependent requirements for process order...
    Pls let me know.
    Regards.

    use the following FM
    MD_STOCK_REQUIREMENTS_LIST_API
    give material no and  plant and following\
    DISPLAY_LIST_MDPSX = X
    DISPLAY_LIST_MDEZX =  X
    DISPLAY_LIST_MDSUX =  x
    o/p
    MDPSX filter for the values of here DELKZ(MRP element indicator) = AR
    you will get all depnedent reservation from process order.

  • Can a SQL Server stored procedure call an SAP function module?

    Can a SQL Server stored procedure call an SAP function module.? The stored procedure will be called via a trigger when data records are added to a Z table.

    You have two options:
    - the other software can use the RFC SDK and call directly in the system
    - the other software can use a database connect
    Markus

  • RFC function module - to have it as time dependent

    Hi,
    I have a RFC call to CRM system from R/3 side.  This call is made to get email address of users in CRM system - during the triggering of order confirmation output. 
    Some times the RFC queue is full and these calls also get in to the queue blocking the queue.  This call for me it is an optional and it should not get struck in the queue meaning the order output process should not wait for longer time. 
    Is there a way that I can say if the call is taking longer time say over 60 seconds no need to wait for the CRM data.  Is there any option in the function module to do so (something similar to "starting new task", "performing <a routine> on end of task").
    Thanks in advance...
    Krish

    Thanks for your responses.
    May I know where I can set the timeout in SM59?  If it is a common setting for all RFC connections, then I cannot touch since the regular calls to CRM/ other systems shouldn't get affected.  If it is specific to the RFC connection then I can create a new one and use it over here with time out setting.
    Asynchronous RFC I can try but this call to CRM system is made from the output routine - so I am not sure how we can use it over here.  The output routine checks if any valid email address found in CRM system for the customer.  If so then it sets sy-subrc = 0.  Since this routine is called during the order creation the wait causes delay in order getting saved.  This happens occasionally when the CRM queue is fully occupied.
    Thanks,
    Krishnan V

  • Diff b/w BAPI and Function Module.

    What is the difference between BAPI and Function Module....
    By Interface programming do we mean posting data thru  BAPI,BDC....

    Hi Alex,
    BAPI: Standard Interface in the R/3 system that allows the system to communicate with components of other business suites.
    FM: These are the procedures that are defined in the Function Groups and can be called from any ABAP Program. FM allow you to encapsulate and reuse global functions int he R/3 system.
    The main basic difference between BAPI and FM are
    1) All BAPIs are FM but not all FMs are BAPIs
    2) BAPIs are remote enabled
    3) BAPIs interface will not have a changing and exceptions. They can not be used to have use dialog.
    Interface programs can post data to SAP either through a BDC, BAPI, IDOC etc. It depends on the type of requirement.
    Hope this solves your question.
    Enjoy SAP
    Rajasekhar

  • Error occurred while loading Generic extraction using Function module

    Hi all
    I'm trying to do INIT for Generic Extractor using Function module, but i'm getting error as "Error occurred in the source system"
    Error message from the source system
    Diagnosis
    An error occurred in the source system.
    System Response
    Caller 09 contains an error message.
    Further analysis:
    The error occurred in Extractor .
    Refer to the error message.
    Procedure
    How you remove the error depends on the error message.
    Note
    If the source system is a Client Workstation, then it is possible that the file that you wanted to load was being edited at the time of the data request. Make sure that the file is in the specified directory, that it is not being processed at the moment, and restart the request.
    Job terminated in source system --> Request set to red
    Message no. RSM078
    Can u help plz....

    Hi Vishnu
    This are the Job log details i found in source system...Can u tell what whould be the problem?
    Message
    Job started
    Step 001 started (program SBIE0001, variant &0000000002861, user ID
    Asynchronous transmission of info IDoc 2 in task 0001 (0 parallel tasks)
    DATASOURCE = ZYFI102
    RLOGSYS    =
    REQUNR     = REQU_D9Y4CZDQULRIHRRVU33KOLQZO
    UPDMODE    = D
    LANGUAGES  = *
             Current Values for Selected Profile Parameters               *
    abap/heap_area_nondia......... 0                                       *
    abap/heap_area_total.......... 10737418240                             *
    abap/heaplimit................ 40000000                                *
    zcsa/installed_languages...... DE                                      *
    zcsa/system_language.......... E                                       *
    ztta/max_memreq_MB............ 2047                                    *
    ztta/roll_area................ 3000000                                 *
    ztta/roll_extension........... 2000000000                              *
    No authorization for Acct type D
    Job cancelled after system exception ERROR_MESSAGE
    Thanks in advance
    Edited by: MohanDP on Feb 25, 2011 11:58 AM
    Edited by: MohanDP on Feb 25, 2011 12:01 PM

  • How to display error message in case of function module ?

    In the report i was using  " message-id "   to display error message....
    how to use in function module ?

    Hi,
    Messages in Function Modules and Methods
    Messages have two different functions in function modules and methods:
    Normal Messages
    If you use messages in function modules and methods without the RAISING addition in the MESSAGE statement, and the caller does not catch the message, the message is handled
    normally according to the context in which it is called within the function module or method.
    Triggering Exceptions with Messages
    If you use messages in function modules and methods with the addition
    ... RAISING <exc>
    the way in which the message is handled depends on whether the calling program handles the exception <exc> or not.
      If the calling program does not handle the exception, the message is displayed and handled according to the context in which it occurs in the function module or method from which it
    was called.
      If the calling program handles the exception, the message is not displayed. Instead, the procedure is interrupted in accordance with the message type, and processing returns to the calling program. The contents of the message are placed in the system fields SY-MSGID, SY-MSGTY, SY-MSGNO, and SY-MSGV1 to SY-MSGV4.
    Catching Message in the Calling Program
    You can catch messages from function modules that are not sent using the RAISING addition in the MESSAGE statement by including the implicit exception ERROR_MESSAGE in the
    EXCEPTIONS list of the CALL FUNCTION statement. The following conditions apply:
      Type S, I, and W messages are ignored (but logged during background processing)
      Type E and A messages trigger the exception ERROR_MESSAGE
      Type X messages trigger the usual runtime error and short dump.
    Catching messages is not currently supported for methods.
    Regards,
    Bhaskar

  • How to use BAPI_MATERIAL_AVAILABILITY Function Module....

    Hi Experts,
    I want to know actual free available quantity (ATP Qty.) for mass materials,
    How to use BAPI_MATERIAL_AVAILABILITY function module ?
    I have select all material from MARA and inserted in itab.
    LOOP AT ITAB.
    CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
      EXPORTING
        PLANT                    =
        MATERIAL                 =
        UNIT                     =
      CHECK_RULE               =
      STGE_LOC                 =
      BATCH                    =
      CUSTOMER                 =
      DOC_NUMBER               =
      ITM_NUMBER               =
      WBS_ELEM                 =
      STOCK_IND                =
      DEC_FOR_ROUNDING         =
      DEC_FOR_ROUNDING_X       =
      READ_ATP_LOCK            =
      READ_ATP_LOCK_X          =
    IMPORTING
      ENDLEADTME               =
      AV_QTY_PLT               =
      DIALOGFLAG               =
      RETURN                   =
      TABLES
        WMDVSX                   =
        WMDVEX                   =
    I dont know how to use it.
    pl. guide us.
    Yusuf

    Hi,
           data:  iwmdvsx type table of bapiwmdvs with header line,
           iwmdvex type table of bapiwmdve with header line.
    parameters: p_matnr type mara-matnr,
                p_werks type marc-werks,
                p_meins type mara-meins.
    call function 'BAPI_MATERIAL_AVAILABILITY'
      exporting
        plant            = p_werks
        material         = p_matnr
        unit             = p_meins
      CHECK_RULE       =
      STGE_LOC         =
      BATCH            =
      CUSTOMER         =
      DOC_NUMBER       =
      ITM_NUMBER       =
      WBS_ELEM         =
      STOCK_IND        =
    IMPORTING
      ENDLEADTME       =
      AV_QTY_PLT       =
      DIALOGFLAG       =
      RETURN           =
      tables
        wmdvsx           = iwmdvsx
        wmdvex           = iwmdvex.
    check sy-subrc = 0.
    Text
    ATP information
    Functionality
    Using this function module, you can determine the receipt quantity still available for a particular material in a certain plant according to ATP logic (MRPII).
    The availability check is carried out on transferring the material number, the plant and the input table (WMDVSX). The scope of the check, that is, which stocks, receipts and issues are to be included in the check is defined by the combination of checking group (material master) and cheking rule. In the function module, the system uses the checking rule defined in Sales & Distribution (A). You can overrule this checking rule by using an interface or a user-exit (exit_saplw61v_001). A similar procedure is also valid for the plant parameters. The customer number in the user-exit means that the plant selection can be controlled via the customer. If no plant parameters are given via the interface, the system uses the parameter 'WRK' saved in the user's fixed values.
    The results of the availability check are recorded in the output table (WMDVEX). This table contains dates and available receipt quantities (ATP quantities). The results of the check depends on the following entries:
    If no date and no quantity is transferred, the system displays the ATP situation from today's date into the future as the result.
    If only a date and no quantity is transferred, the system displays the ATP situation from the corresponding date as the result.
    If both a date and a quantity are transferred, the system calculates the availability situation for the quantity specified.
    In the last two cases, the parameter 'DIALOGFLAG' is supplied. This can result in the following:
    ' ' (blank)   <=> quantity completely available
    'X'           <=> only partial quantity available or not available at
                      all
    'N'           <=> Material not included in the availability check
                      (Material not relevant to the availability check)
    The system also displays the end of the replenishment lead time (ENDLEADTME).
    regards

  • How to call a function module in VC

    Hi,
    I want to call a function module for an addition formula which shall calculate and infer the value.
    eg. quantities of 5 different characteristics (of numeric data) is to be summed up and inferred against the 6th characteristic.
    I want to know the detailed process to create a Variant Function and use it in a dependency.
    Request to please advise the steps, type of dependency and its code.
    Regards,
    Rajesh Mohapatra

    Dear Rajesh,
    I also wanted to learn how to do that, your post motivated me to use a bit of freetime and investigate on the subject. I finally made my function work, so here are the tips.
    The example is very simple, just a variant function with two inputs and which multiplies inside the input values and transfer that result to the output ( 3 x 4 => 12 ).
    Deducting how to add five values or any other logic would be easier starting from there.
    STEP 1: Create Variant Class for the product. I imagine you already have that. In my case its name is ZVC_CLASS, you have already a material assigned to the class, a configuration profile, etc....
    STEP 2: Create Three Characteristics Z_NUM_CH_1,Z_NUM_CH_2,Z_NUM_CH_3 the three of numeric type
    STEP 3: Assign characteristics from step 2 into class ZVC_CLASS
    STEP 4: Create the function module with the code given below. I put the name ZVC_FUN_TEST
    FUNCTION ZVC_FUN_TEST.
    ""Interfase local
    *"  IMPORTING
    *"     REFERENCE(GLOBALS) TYPE  CUOV_00
    *"  TABLES
    *"      QUERY STRUCTURE  CUOV_01
    *"      MATCH STRUCTURE  CUOV_01
    *"  EXCEPTIONS
    *"      FAIL
    *"      INTERNAL_ERROR
    *- Inicializar los valores.
      DATA:
      GV_VALOR_FINAL        TYPE CUOV_01-ATFLV,
      GV_VALOR_NUM1         TYPE CUOV_01-ATFLV,
      GV_VALOR_NUM2         TYPE CUOV_01-ATFLV.
      CLEAR:
        gv_valor_final,
        gv_valor_num1,
        gv_valor_num2.
    CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'
        EXPORTING
          ARGUMENT            =  'Z_NUM_CH_1'
        IMPORTING
         VTYPE               =  P_VTYPE1
         SYM_VAL             =  P_VALOR_SYM1
          NUM_VAL             =  gv_valor_num1
      IO_FLAG             =
        TABLES
          QUERY               =  QUERY
        EXCEPTIONS
          ARG_NOT_FOUND       = 01.
      IF SY-SUBRC <> 0.
        RAISE INTERNAL_ERROR.
      ENDIF.
    CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'
        EXPORTING
          ARGUMENT            =  'Z_NUM_CH_2'
        IMPORTING
         VTYPE               =  P_VTYPE1
         SYM_VAL             =  P_VALOR_SYM1
          NUM_VAL             =  gv_valor_num2
      IO_FLAG             =
        TABLES
          QUERY               =  QUERY
        EXCEPTIONS
          ARG_NOT_FOUND       = 01.
      IF SY-SUBRC <> 0.
        RAISE INTERNAL_ERROR.
      ENDIF.
    *- Calculate final value
      gv_valor_final = gv_valor_num1 * gv_valor_num2.          "Especifico de c/u.
    DATA: VTYPE TYPE CUOV_01-ATFOR.
    VTYPE = 'NUM'.
    CALL FUNCTION 'CUOV_SET_FUNCTION_ARGUMENT'
        EXPORTING
          ARGUMENT                = 'Z_NUM_CH_3'
          VTYPE                   = VTYPE
          NUM_VAL                 =  gv_valor_final
        TABLES
          MATCH                   = MATCH
        EXCEPTIONS
          EXISTING_VALUE_REPLACED = 01.
      IF SY-SUBRC <> 0.
        RAISE INTERNAL_ERROR.
      ENDIF.
    ENDFUNCTION.
    STEP 5: Activate the function module for Variant Configuration in transaction CU65, put there your function module, release int and in button characteristics write  Z_NUM_CH_1,Z_NUM_CH_2,Z_NUM_CH_3. Flag the first two lines as they are inputs.
    STEP 6: Create a Dependency ZVC_PROC_TEST of type Procedure to call the function with this code:
    000010 Function ZVC_FUN_TEST           
    000020 (Z_NUM_CH_1 = $root.Z_NUM_CH_1, 
    000030 Z_NUM_CH_2 = $root.Z_NUM_CH_2,  
    000040 Z_NUM_CH_3 = $self.Z_NUM_CH_3)  
    STEP 7: Lets say I want to calculate the multiplication only upon the selection of another characteristic "Calculate" YES/NO. For this I create a characteristic in CT04 Z_CALCULATE type CHAR 1 with possible values Y or N. For the value Y y add the procedure ZVC_PROC_TEST so that formula only activates on Y.
    STEP 8: Add characteristic Z_CALCULATE to class  ZVC_CLASS
    STEP 9: VA01, it should work

  • Creation of Database table using function module DB_CREATE_TABLE

    I used the function module DB_CREATE_TABLE to create a database table from a report program.
    The SY-SUBRC value being returned is 0 but I am not able to access the table using SE11(that is if it gets created). Kindly let me know if you know how to resolve this problem.
    Is there any other function module to create a database table from a report program?
    Thanks & Regards,
    Pranjali

    Hello,
    Check this programs how they are using the this FM.
    LSDB3U14
    LSDB6U04                               DD: Creation of temporary tables (only keys or complete)
    LSMC2F00                               Procedures for Creating and Deleting Dependent Matchcode ID Objects
    LSUGXU08
    LSUGXU18                             Rückgabe aller DB-spezifischen Parameter der Freiplatzprüfung im Upgra
    RCNV0002                               DD: Convert CDHDR and CDPOS
    RDDMV4TB                               Generate Exchange TADIR
    RDDMVCUA                               Generate Exchange TADIR
    RDDMVFTX                               Repository Switch: Generate New Empty Clone Table DDFTX
    RDDMVNTB                               Filling the Exchange Nametabs (DDYTT, DDYTF)
    RDDMVTRE                               Generate Exchange TADIR
    RSINFINI                               INFORMIX Performance Monitor: Additional DB Definitions for SAP R/3
    RTXWCF1F                               Include LTXW4F01

  • How to use function module to update data

    Hello ,
    Can any body have idea how we can use function module SAVE_TEXT to update the master recipe header and operation long text.
    I want to use this functional module to update the master recipe long text
    step by step procedure is highly appreciated
    thanks & regards
    siddhasrth

    Hi
    SAVE_TEXT
    SAVE_TEXT writes a text module back to the text file or the text memory, depending on the storage mode of the corresponding text object.
    You can use this module either to change existing texts or to create new texts. If you know for sure that the text is new, use the parameter INSERT to indicate this. The system then does not have to read the text first, which improves the performance of the function module.
    If the lines table passed with the function module is empty, the system deletes the text from the text file.
    Function call:
    CALL FUNCTION 'SAVE_TEXT'
    EXPORTING CLIENT = SY-MANDT
    HEADER = ?...
    INSERT = SPACE
    SAVEMODE_DIRECT = SPACE
    OWNER_SPECIFIED = SPACE
    IMPORTING FUNCTION =
    NEWHEADER =
    TABLES LINES = ?...
    EXCEPTIONS ID =
    LANGUAGE =
    NAME =
    check thi sample code
    CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
    CLIENT = SY-MANDT
    HEADER = t_header
    SAVEMODE_DIRECT = 'X'
    * OWNER_SPECIFIED = ' '
    * LOCAL_CAT = ' '
    * IMPORTING
    * FUNCTION =
    * NEWHEADER =
    TABLES
    LINES = t_long
    EXCEPTIONS
    ID = 1
    LANGUAGE = 2
    NAME = 3
    OBJECT = 4
    OTHERS = 5
    Reward all helpfull answers
    Regards
    Pavan

Maybe you are looking for

  • Refresh data in popup by external event

    Hi folks, I have got a popup with an alv grid displaying data from a database table. I want to reload the alv grid in case new entries were created outside of this popup. I thought it would be possible to fire an ABAP OO event after writing new data

  • I upgraded my Macbook from 4.8 to Snow Leopard 6.3 now it keeps crashing and grey screen of death

    Hi everyone i have a Mac Book   2.16GHz   Core 2 Duo, 4GB 667 MHz DDR2 SDRAM.  Prior to upgrading my macbook worked like a dream.  I upgraded to 6.3 then straight up to 6.8, had lots of problems with the computer screen going blue, the Mac refrshing

  • How to create a "Explorer" like in java

    i'm just wonderin if there's a way on how to create "Windows Explorer" like in Java wherein you can view all your directories with yellow folder icon and also you can view all your files and drives.... And when you double click the yellow folder icon

  • Uploaded text file has a new line added at the top using BSP MVC applicatio

    I have a BSP MVC application that uploads data on to the application server. When I open the uploaded text file, the very first line on the file looks like the line below. -> htmlb:button:click:nullhtmlb_form_1UploadUpload0htmlbdfsdf But the rest of

  • Any idea how this is done?

    Hello, I'm wondering if anyone might have insight on how this effect was created: http://www.youtube.com/watch?v=U0d0GpzSSc8 Any insights would be appreciated! Thanks, Tawny