Skip to Content
avatar image
Former Member

function module to find total for delivey for delivery no.

is there any function module to find total price for delivery no.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 22, 2007 at 06:35 AM

    You don't need function

    table LIKP

    NETWR net price

    Add comment
    10|10000 characters needed characters exceeded

    • If you want to add tax, ... conditions, you could try to read conditions (good luck).

      here it's a sample code for sales order (the table are different, but the function the same)

        DATA : is_vbak TYPE vbak ,
               is_vbap TYPE vbap .
      
      
      * Check if the sales order exist.
        SELECT SINGLE *
               INTO is_vbak
               FROM vbak
               WHERE vbeln EQ vbeln.
        IF sy-subrc NE space.
          RAISE sales_order_unknown.
        ENDIF.
      
      * Check if the sales order item exist.
        SELECT SINGLE *
               INTO is_vbap
               FROM vbap
               WHERE vbeln EQ vbeln
               AND   posnr EQ posnr.
        IF sy-subrc NE space.
          RAISE sales_order_item_unknown.
        ENDIF.
      
      
      * Set data.
        MOVE : is_vbak-mandt    TO isg_komk-mandt ,
               is_vbak-kalsm    TO isg_komk-kalsm ,
               is_vbak-fkara    TO isg_komk-fkart ,
               'V'              TO isg_komk-kappl ,
               is_vbak-waerk    TO isg_komk-waerk ,
               is_vbak-knumv    TO isg_komk-knumv ,
               is_vbak-vbtyp    TO isg_komk-vbtyp ,
               is_vbak-bukrs_vf TO isg_komk-bukrs ,
               is_vbak-vbeln    TO isg_komk-belnr ,
               is_vbap-posnr    TO isg_komp-kposn .
        MOVE-CORRESPONDING : is_vbak TO isg_komk ,
                             is_vbap TO isg_komp.
      
      * Get the KOMV table.
        CALL FUNCTION 'RV_PRICE_PRINT_ITEM'
          EXPORTING
            comm_head_i = isg_komk
            comm_item_i = isg_komp
          TABLES
            tkomv       = itg_komv
            tkomvd      = itg_komvd.
      
      * Get the 'Marge'.
        CALL FUNCTION 'PRICING_BUILD_XKOMV'
          EXPORTING
            i_komk           = isg_komk
            i_komp           = isg_komp
            calculation_type = 'E'
          TABLES
            tkomv            = itg_komv
            e_xkomv          = itg_komv2
          EXCEPTIONS
            OTHERS           = 2.