Quantity Variable No. On BackOrder Report

Hi Experts,
              I want to show the quantity on Sales Back Order Report PLD(Sales A/R ->Sales Report -> BackOrder). Please suggest how can i do this ? Which variable no cintain the info about quantity .
Thanks & Regards

Hi Om...........
            if you refer the system defaul PLD then you can get the variable no. But its already there in ordered and delivered column.
Regards,

Similar Messages

  • Needs Help in Backorder Report!

    Good day to everyone.
    I would like to ask for help in checking the Backorder Report below. The user requirement is to include the plant field in the Report. Though I already included the plant field, the program encounters ABAP runtime upon execution. Please help me correct the errors that is being encountered.
    Thank you very much.
    Raffee
    REPORT zsdr_out_of_stock  LINE-SIZE  380
              LINE-COUNT 65 NO STANDARD PAGE HEADING.
    TABLES:  mara,
             zcust,
             vbrk,
             vbak,
             vbap.
    Start of Internal tables for Out of Stock
    DATA: BEGIN OF it_total_out_stock1 OCCURS 0,
            fkdat  LIKE vbrk-fkdat,         "Billing Date
            bukrs  LIKE vbrk-bukrs,         "Company
            knumv  LIKE vbrk-knumv,         "No of the document condition
            vbeln  LIKE vbrp-vbeln,         "Billing Doc
            posnr  LIKE vbrp-posnr,         "Item
            aubel  LIKE vbrp-aubel,         "Sales Order
            aupos  LIKE vbrp-aupos,         "Sales Item
            matnr  LIKE vbrp-matnr,         "Material No.
            fkimg  TYPE p DECIMALS 2,       "Billed Quantity
            auart  LIKE vbak-auart,
            kunnr  LIKE vbak-kunnr,
            vkbur  LIKE vbak-vkbur,           "Sales office
            vkorg  LIKE vbak-vkorg,           "Sales organization
            vkgrp  LIKE vbak-vkgrp,           "Sales group
            zcusno LIKE zcust-zcusno,
            zregion LIKE zcust-zregion,
          END OF it_total_out_stock1.
    DATA: BEGIN OF it_total_out_stock2 OCCURS 0,
            vbeln   LIKE vbak-vbeln,
            auart   LIKE vbak-auart,
            kunnr   LIKE vbak-kunnr,
            vkbur   LIKE vbak-vkbur,           "Sales office
            vkorg   LIKE vbak-vkorg,           "Sales organization
            vkgrp   LIKE vbak-vkgrp,           "Sales group
            zcusno  LIKE zcust-zcusno,
            zregion LIKE zcust-zregion,
          END OF it_total_out_stock2.
    DATA: BEGIN OF it_vbap OCCURS 0,
              vbeln  LIKE vbap-vbeln,
              posnr  LIKE vbap-posnr,
              werks  LIKE vbap-werks,
              matnr  LIKE vbap-matnr,
              netwr  LIKE vbap-netwr,
              kwmeng LIKE vbap-kwmeng,
              bukrs_vf LIKE vbak-bukrs_vf,
              knumv  LIKE vbak-knumv,
              kunnr  LIKE vbak-kunnr,
              vkbur   LIKE vbak-vkbur,           "Sales office
              vkorg   LIKE vbak-vkorg,           "Sales organization
              vkgrp   LIKE vbak-vkgrp,           "Sales group
          END OF it_vbap.
    DATA: BEGIN OF it_vbap_stock OCCURS 0,
              vbeln  LIKE vbap-vbeln,
              posnr  LIKE vbap-posnr,
              werks  LIKE vbap-werks,
              matnr  LIKE vbap-matnr,
              netwr  LIKE vbap-netwr,
              kwmeng TYPE p DECIMALS 2,
              bukrs_vf LIKE vbak-bukrs_vf,
              knumv   LIKE vbak-knumv,
              kunnr   LIKE vbak-kunnr,
              vkbur   LIKE vbak-vkbur,           "Sales office
              vkorg   LIKE vbak-vkorg,           "Sales organization
              vkgrp   LIKE vbak-vkgrp,           "Sales group
          END OF it_vbap_stock.
    DATA: BEGIN OF it_out_stock OCCURS 0,
              vbeln LIKE vbap-vbeln,
              posnr LIKE vbap-posnr,
              werks LIKE vbap-werks,
              matnr LIKE vbap-matnr,
              netwr LIKE vbap-netwr,
              knumv LIKE vbak-knumv,
              bukrs_vf LIKE vbak-bukrs_vf,
              kunnr   LIKE vbak-kunnr,
              vkbur   LIKE vbak-vkbur,           "Sales office
              vkorg   LIKE vbak-vkorg,           "Sales organization
              vkgrp   LIKE vbak-vkgrp,           "Sales group
              fkimg   TYPE p DECIMALS 2,         "Billed Quantity
              kwmeng LIKE vbap-kwmeng,
              counter TYPE i,
          END OF it_out_stock.
    DATA: BEGIN OF it_mara_totals_stock OCCURS 0,
            matnr LIKE mara-matnr,
            matkl LIKE mara-matkl,
            spart LIKE mara-spart,
          END OF it_mara_totals_stock.
    DATA: BEGIN OF it_tspat_totals_stock OCCURS 0,
            spart LIKE tspat-spart,
            vtext LIKE tspat-vtext,
          END OF it_tspat_totals_stock.
    DATA: BEGIN OF it_t023t_totals_stock OCCURS 0,
            matkl  LIKE t023t-matkl,
            wgbez  LIKE t023t-wgbez,
          END OF it_t023t_totals_stock.
    DATA: BEGIN OF it_konv_totals_stock OCCURS 0,
            knumv LIKE konv-knumv,
            kposn LIKE konv-kposn,
            kschl LIKE konv-kschl,
            kawrt LIKE konv-kawrt,
            kwert LIKE konv-kwert,
            kbetr LIKE konv-kbetr,
          END OF it_konv_totals_stock.
    DATA: BEGIN OF it_total_stock_final OCCURS 0,
            cnt1   TYPE i,
            cnt2   TYPE i,                  "DPM Category
            werks  LIKE vbap-werks,         "Plant
            spart  LIKE mara-spart,         "Division Description
            matkl  LIKE mara-matkl,         "Material Type
            vbeln  LIKE vbrk-vbeln,         "Billing Doc
            aubel  LIKE vbrp-aubel,         "Sales document
            aupos  LIKE vbrp-aupos,         "Sales document item
            vkbur  LIKE vbak-vkbur,         "Sales office
            vkorg  LIKE vbak-vkorg,         "Sales organization
            vkgrp  LIKE vbak-vkgrp,         "Sales group
            kunnr  LIKE vbak-kunnr,         "Customer
            matnr  LIKE vbrp-matnr,         "Material
            vtext  LIKE tspat-vtext,        "Material Group Desc
            kbetr1 LIKE konv-kbetr,
            kbetr2 LIKE konv-kbetr,
            kawrt  LIKE konv-kawrt,         "Condition Rate
            kwert1 LIKE konv-kwert,         "Volume Discount
            kwert2 LIKE konv-kwert,         "Promo Discount
            fkimg  TYPE p DECIMALS 2,       "Billed Quantity
            kwmeng LIKE vbap-kwmeng,
            counter TYPE i,
         END OF it_total_stock_final.
    Start of Internal tables for Held
    DATA: BEGIN OF it_total_held1 OCCURS 0,
            erdat     LIKE vbak-erdat,
            bukrs_vf  LIKE vbak-bukrs_vf,
            knumv     LIKE vbak-knumv,
            kunnr     LIKE vbak-kunnr,
            werks     LIKE vbap-werks,           "Plant
            vkbur     LIKE vbak-vkbur,           "Sales office
            vkorg     LIKE vbak-vkorg,           "Sales organization
            vkgrp     LIKE vbak-vkgrp,           "Sales group
            vbeln     LIKE vbap-vbeln,
            posnr     LIKE vbap-posnr,
            matnr     LIKE vbap-matnr,
            kwmeng    LIKE vbap-kwmeng,         "Order Quantity
            cmgst     LIKE vbuk-cmgst,
          END OF it_total_held1.
    DATA: BEGIN OF it_total_held2 OCCURS 0,
            zcusno    LIKE zcust-zcusno,
            zregion   LIKE zcust-zregion,
          END OF it_total_held2.
    DATA: BEGIN OF it_mara_totals_held OCCURS 0,
            matnr LIKE mara-matnr,
            matkl LIKE mara-matkl,
            spart LIKE mara-spart,
          END OF it_mara_totals_held.
    DATA: BEGIN OF it_tspat_totals_held OCCURS 0,
            spart LIKE tspat-spart,
            vtext LIKE tspat-vtext,
          END OF it_tspat_totals_held.
    DATA: BEGIN OF it_t023t_totals_held OCCURS 0,
            matkl  LIKE t023t-matkl,
            wgbez  LIKE t023t-wgbez,
          END OF it_t023t_totals_held.
    DATA: BEGIN OF it_konv_totals_held OCCURS 0,
            knumv LIKE konv-knumv,
            kposn LIKE konv-kposn,
            kschl LIKE konv-kschl,
            kawrt LIKE konv-kawrt,
            kwert LIKE konv-kwert,
          END OF it_konv_totals_held.
    DATA: BEGIN OF it_total_held_final OCCURS 0,
            cnt1   TYPE i,
            cnt2   TYPE i,                  "DPM Category
            werks  LIKE vbap-werks,         "Plant
            spart  LIKE mara-spart,         "Division Description
            matkl  LIKE mara-matkl,         "Material Type
            vbeln  LIKE vbrk-vbeln,         "Billing Doc
            aubel  LIKE vbrp-aubel,         "Sales document
            aupos  LIKE vbrp-aupos,         "Sales document item
            erdat  LIKE vbak-erdat,
            vkbur  LIKE vbak-vkbur,         "Sales office
            vkorg  LIKE vbak-vkorg,         "Sales organization
            vkgrp  LIKE vbak-vkgrp,         "Sales group
            kunnr  LIKE vbak-kunnr,         "Customer
            matnr  LIKE vbrp-matnr,         "Material
            vtext  LIKE tspat-vtext,        "Material Group Desc
            kwmeng LIKE vbap-kwmeng,        "Order Quantity
            kawrt  LIKE konv-kawrt,         "Condition Rate
            kwert1 LIKE konv-kwert,         "Volume Discount
            kwert2 LIKE konv-kwert,         "Promo Discount
         END OF it_total_held_final.
    End of Internal tables for Held
    DATA: l_quantity LIKE vbap-kwmeng.
    DATA: g_div(20),      "Division
          g_mat(20),      "Material Group
          g_maktx(40),
          g_name1(40),
          v_net_value TYPE p DECIMALS 2.
            CONSTANTS DECLARATION
    Constants are named data objects that you create statically using
    a declarative statement. They allow you to store data under a
    particular name within the memory area of a program.
    The value of a constant cannot be changed during the execution of
    the program.
    CONSTANTS: header01(10)    TYPE c VALUE 'Invoice #',
               header02(06)    TYPE c VALUE 'Item',
               header03(10)    TYPE c VALUE 'Sales Doc.',
               header04(03)    TYPE c VALUE 'Div',
               header05(20)    TYPE c VALUE 'Division Desc',
               header06(10)    TYPE c VALUE 'Customer #',
               header07(35)    TYPE c VALUE 'Customer Name',
               header08(18)    TYPE c VALUE 'Material No.',
               header09(40)    TYPE c VALUE 'Material Text',
               header10(09)    TYPE c VALUE 'MType',
               header11(20)    TYPE c VALUE 'Material Grp Desc',
               header12(20)    TYPE c VALUE 'Condition Rate',
               header13(20)    TYPE c VALUE 'Vol Discount',
               header14(20)    TYPE c VALUE 'Promo Discount',
               header15(12)    TYPE c VALUE 'Date Created',
               header16(12)    TYPE c VALUE 'Invoice Date',
               header17(20)    TYPE c VALUE 'Net Value',
               header18(12)    TYPE c VALUE 'Sales office',
               header19(10)    TYPE c VALUE 'Sales Org',
               header20(10)    TYPE c VALUE 'Sales Grp',
               header21(20)    TYPE c VALUE 'Quantity',
               header22(04)    TYPE c VALUE 'Plnt'.
    End of Internal tables for Out of Stock
    Start of selection screen criteria
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_zreg  FOR zcust-zregion,               "Region
                    s_matkl FOR mara-matkl,                  "Material Group
                    s_spart FOR mara-spart,                  "Division
                    s_vkorg FOR vbak-vkorg,                  "Sales Org
                    s_vkbur FOR vbak-vkbur,                  "Sales Office
                    s_class FOR zcust-zaclass.               "Account Class
    SELECT-OPTIONS: s_curr  FOR vbrk-fkdat OBLIGATORY.       "Date
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS p0 RADIOBUTTON GROUP radi.
    PARAMETERS p1 RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    Start of Selection
    START-OF-SELECTION.
      IF p0 = 'X'.
    ****Get the Out of Stock
        PERFORM out_stock.
        PERFORM write_report.
      ELSEIF p1 = 'X'.
        PERFORM held_order.
        PERFORM write_report1.
      ENDIF.
    *&      Form  out_stock
          text
    -->  p1        text
    <--  p2        text
    FORM out_stock.
      DATA: l_cnt1 TYPE i,
            l_cnt2 TYPE i,
            l_spart LIKE mara-spart,
            l_matkl LIKE mara-matkl,
            l_text  LIKE tspat-vtext,
            l_amount TYPE p DECIMALS 2,
            l_aupos LIKE vbrp-aupos,
            l_aubel LIKE vbrp-aubel.
      SELECT vbrk~fkdat
             vbrk~bukrs
             vbrk~knumv
             vbrp~vbeln
             vbrp~posnr
             vbrp~aubel
             vbrp~aupos
             vbrp~matnr
             vbrp~fkimg
           vbap~werks
             vbak~auart
             vbak~kunnr
             vbak~vkbur           "Sales office
             vbak~vkorg           "Sales organization
             vbak~vkgrp           "Sales group
             zcust~zcusno
             zcust~zregion
             INTO TABLE it_total_out_stock1
             FROM vbrk
             INNER JOIN vbrp
             ON vbrkvbeln = vbrpvbeln
             INNER JOIN vbak
             ON vbrpaubel = vbakvbeln
             INNER JOIN zcust
             ON vbakkunnr = zcustzcusno
             WHERE vbrk~fkdat IN s_curr
               AND vbrp~matkl IN s_matkl
               AND vbrp~spart IN s_spart
               AND vbak~auart IN ('ZDOA', 'ZDTO', 'ZQOA', 'ZDTA', 'ZQTO')
               AND zcust~zregion IN s_zreg
               AND zcust~zaclass IN s_class
               AND vbak~vkorg IN s_vkorg
               AND vbak~vkbur IN s_vkbur
               AND vbak~bukrs_vf IN ('5116', '5106')
               AND vbak~vkbur <> '5100'.
      IF sy-subrc = 0.
        IF NOT it_total_out_stock1[] IS INITIAL.
    ***Check if the Order is Out of Stock compare to billing invoice
          SELECT vbap~vbeln
                 vbap~posnr
                 vbap~matnr
                 vbap~netwr
                 vbap~kwmeng
                 vbak~bukrs_vf
                 vbak~knumv
                 vbak~kunnr
                 vbap~werks
                 vbak~vkbur           "Sales office
                 vbak~vkorg           "Sales organization
                 vbak~vkgrp           "Sales group
                 INTO TABLE it_vbap
                 FROM vbap
                 INNER JOIN vbak
                 ON vbapvbeln = vbakvbeln
                 FOR ALL entries IN it_total_out_stock1
                 WHERE vbap~vbeln = it_total_out_stock1-aubel
                   AND vbap~posnr <> it_total_out_stock1-aupos
                   AND vbak~auart IN ('ZDOA', 'ZDTO', 'ZQOA',
                                  'ZDTA', 'ZQTO')
                   AND vbak~vkorg IN s_vkorg
                   AND vbak~vkbur IN s_vkbur
                   AND vbap~matkl IN s_matkl
                   AND vbap~spart IN s_spart.
    ***Check if the Order is Out of Stock by Quantity
          SELECT vbap~vbeln
                 vbap~posnr
                 vbap~matnr
                 vbap~netwr
                 vbap~kwmeng
                 vbak~bukrs_vf
                 vbak~knumv
                 vbak~kunnr
                 vbap~werks
                 vbak~vkbur           "Sales office
                 vbak~vkorg           "Sales organization
                 vbak~vkgrp           "Sales group
                 INTO TABLE it_vbap_stock
                 FROM vbap
                 INNER JOIN vbak
                 ON vbapvbeln = vbakvbeln
                  FOR ALL entries IN it_total_out_stock1
                   WHERE vbap~posnr = it_total_out_stock1-aupos
                     AND vbap~vbeln = it_total_out_stock1-aubel
                     AND vbap~kwmeng NE it_total_out_stock1-fkimg
                     AND vbak~auart IN ('ZDOA', 'ZDTO', 'ZQOA',
                                        'ZDTA', 'ZQTO')
                     AND vbak~vkorg IN s_vkorg
                     AND vbak~vkbur IN s_vkbur
                     AND vbap~matkl IN s_matkl
                     AND vbap~spart IN s_spart.
        ENDIF.
        IF NOT it_vbap[] IS INITIAL.
          SORT it_vbap BY vbeln posnr.
          SORT it_total_out_stock1 BY aubel aupos.
          LOOP AT it_vbap.
            READ TABLE it_total_out_stock1
              WITH KEY aubel = it_vbap-vbeln
                       aupos = it_vbap-posnr.
            IF sy-subrc NE 0.
              it_out_stock-vbeln    = it_vbap-vbeln.
              it_out_stock-posnr    = it_vbap-posnr.
              it_out_stock-matnr    = it_vbap-matnr.
              it_out_stock-netwr    = it_vbap-netwr.
              it_out_stock-knumv    = it_vbap-knumv.
              it_out_stock-bukrs_vf = it_vbap-bukrs_vf.
              it_out_stock-kunnr    = it_vbap-kunnr.
              it_out_stock-werks    = it_vbap-werks.
              it_out_stock-vkbur    = it_vbap-vkbur.  "Sales office
              it_out_stock-vkorg    = it_vbap-vkorg.  "Sales organization
              it_out_stock-vkgrp    = it_vbap-vkgrp.  "Sales group
              it_out_stock-kwmeng   = it_vbap-kwmeng.
              APPEND it_out_stock.
            ENDIF.
          ENDLOOP.
        ENDIF.
        IF NOT it_vbap_stock[] IS INITIAL.
          SORT it_vbap_stock BY vbeln posnr.
          SORT it_total_out_stock1 BY aubel aupos.
          LOOP AT it_vbap_stock.
            LOOP AT it_total_out_stock1 WHERE aubel = it_vbap_stock-vbeln
                                         AND  aupos = it_vbap_stock-posnr
                                         AND  fkimg NE it_vbap_stock-kwmeng.
              it_out_stock-vbeln    = it_vbap_stock-vbeln.
              it_out_stock-posnr    = it_vbap_stock-posnr.
              it_out_stock-matnr    = it_vbap_stock-matnr.
              it_out_stock-netwr    = it_vbap_stock-netwr.
              it_out_stock-knumv    = it_vbap_stock-knumv.
              it_out_stock-bukrs_vf = it_vbap_stock-bukrs_vf.
              it_out_stock-kunnr    = it_vbap_stock-kunnr.
              it_out_stock-werks    = it_vbap_stock-werks.
              it_out_stock-vkbur    = it_vbap_stock-vkbur.  "Sales office
              it_out_stock-vkorg    = it_vbap_stock-vkorg.  "Sales org
              it_out_stock-vkgrp    = it_vbap_stock-vkgrp.  "Sales group
    ****Begin Insert by Ron
              it_out_stock-kwmeng   = it_vbap_stock-kwmeng.
              it_out_stock-fkimg    = it_total_out_stock1-fkimg.
              it_out_stock-counter  = 1.
    ****End Insert
              APPEND it_out_stock.
            ENDLOOP.
          ENDLOOP.
        ENDIF.
      ENDIF.      "it_total_out_stock1
      IF NOT it_out_stock[] IS INITIAL.
    ***get the value of material and material group
        SELECT matnr
               matkl
               spart
               INTO TABLE it_mara_totals_stock
               FROM mara
               FOR ALL ENTRIES IN it_out_stock
               WHERE matnr = it_out_stock-matnr.
      ENDIF.
    ***Get the Value of Division Description
      IF NOT it_mara_totals_stock[] IS INITIAL.
        SELECT spart
               vtext
               INTO TABLE it_tspat_totals_stock
               FROM tspat
               FOR ALL ENTRIES IN it_mara_totals_stock
               WHERE spart = it_mara_totals_stock-spart AND
                     spras = sy-langu.
      ENDIF.
    ***Get the Material Group Description
      IF NOT it_mara_totals_stock[] IS INITIAL.
        SELECT matkl
               wgbez
               INTO TABLE it_t023t_totals_stock
               FROM t023t
               FOR ALL ENTRIES IN it_mara_totals_stock
                WHERE matkl = it_mara_totals_stock-matkl AND
                      spras = sy-langu.
      ENDIF.
    ***Get the Value of Condition Type
      IF NOT it_out_stock[] IS INITIAL.
        SELECT knumv
               kposn
               kschl
               kawrt
               kwert
               kbetr
               INTO TABLE it_konv_totals_stock
               FROM konv
               FOR ALL ENTRIES IN it_out_stock
                WHERE knumv = it_out_stock-knumv
                  AND kposn = it_out_stock-posnr
                  AND kschl IN ('ZQPR', 'ZQD3', 'ZQP3',
                                'ZDPR', 'ZDD3', 'ZDP3').
      ENDIF.
      SORT it_out_stock          BY vbeln posnr.
      SORT it_mara_totals_stock  BY matnr.
      SORT it_tspat_totals_stock BY spart.
      SORT it_t023t_totals_stock BY matkl.
      SORT it_konv_totals_stock  BY knumv kposn.
      LOOP AT it_out_stock.
        CLEAR: it_total_stock_final-kawrt,  it_total_stock_final-kwert1,
               it_total_stock_final-kwert2, it_total_stock_final-vtext,
               it_total_stock_final-matkl,  it_total_stock_final-spart,
               it_total_stock_final-aubel,  it_total_stock_final-aupos,
               it_total_stock_final-cnt1,   it_total_stock_final-cnt2.
    ***Begin Insert by RONCR
        CLEAR: it_total_stock_final-kwmeng, it_total_stock_final-fkimg,
               it_total_stock_final-counter.
    ***End Insert by RONCR
        CLEAR: it_mara_totals_stock, it_tspat_totals_stock,
               it_t023t_totals_stock, it_konv_totals_stock,
               l_cnt1, l_cnt2.
    **Counter for Total Orders Column
        l_cnt1 = 4.
        READ TABLE it_mara_totals_stock
            WITH KEY matnr = it_out_stock-matnr.
        IF sy-subrc EQ 0.
          it_total_stock_final-matnr = it_mara_totals_stock-matnr.
          it_total_stock_final-matkl = it_mara_totals_stock-matkl.
          it_total_stock_final-spart = it_mara_totals_stock-spart.
    ***DPM
          IF it_total_stock_final-matkl EQ 'DPM' OR
             it_total_stock_final-matkl EQ 'SSN'.
            READ TABLE it_tspat_totals_stock
             WITH KEY spart = it_mara_totals_stock-spart.
            IF sy-subrc EQ 0.
              it_total_stock_final-vtext  = it_tspat_totals_stock-vtext.
            ENDIF.
    ***Non Dole
          ELSE.
            READ TABLE it_t023t_totals_stock
             WITH KEY matkl = it_mara_totals_stock-matkl.
            IF sy-subrc EQ 0.
              it_total_stock_final-vtext  = it_t023t_totals_stock-wgbez.
            ENDIF.
          ENDIF.
        ENDIF.
        IF it_total_stock_final-matkl = 'DPM' OR
           it_total_stock_final-matkl = 'SSN'.
          l_cnt2 = 1.
        ELSE.
          l_cnt2 = 2.
        ENDIF.
    ***Condition Value for Comapny Code 5116
        IF it_out_stock-bukrs_vf EQ '5116'.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZQPR'.
          IF sy-subrc EQ 0.
            it_total_stock_final-kawrt = it_konv_totals_stock-kawrt.
          ENDIF.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZQD3'.
          IF sy-subrc EQ 0.
            it_konv_totals_stock-kwert = it_konv_totals_stock-kwert * -1.
            it_total_stock_final-kwert1 = it_konv_totals_stock-kwert.
            it_total_stock_final-kbetr1 = it_konv_totals_stock-kbetr.
            it_total_stock_final-kbetr1 = it_total_stock_final-kbetr1 * -1.
          ENDIF.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZQP3'.
          IF sy-subrc EQ 0.
            it_konv_totals_stock-kwert = it_konv_totals_stock-kwert * -1.
            it_total_stock_final-kwert2 = it_konv_totals_stock-kwert.
            it_total_stock_final-kbetr2 = it_konv_totals_stock-kbetr.
            it_total_stock_final-kbetr2 = it_total_stock_final-kbetr2 * -1.
          ENDIF.
        ENDIF.
    ***Condition Value for Company Code 5106
        IF it_out_stock-bukrs_vf EQ '5106'.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZDPR'.      "Base price
          IF sy-subrc EQ 0.
            it_total_stock_final-kawrt = it_konv_totals_stock-kawrt.
          ENDIF.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZDD3'.      "Volume Discount
          IF sy-subrc EQ 0.
            it_konv_totals_stock-kwert = it_konv_totals_stock-kwert * -1.
            it_total_stock_final-kwert1 = it_konv_totals_stock-kwert.
            it_total_stock_final-kbetr1 = it_konv_totals_stock-kbetr.
            it_total_stock_final-kbetr2 = it_total_stock_final-kbetr2 * -1.
          ENDIF.
          READ TABLE it_konv_totals_stock
            WITH KEY knumv = it_out_stock-knumv
                     kposn = it_out_stock-posnr
                     kschl = 'ZDP3'.      "Promo Discount
          IF sy-subrc EQ 0.
            it_konv_totals_stock-kwert = it_konv_totals_stock-kwert * -1.
            it_total_stock_final-kwert2 = it_konv_totals_stock-kwert.
            it_total_stock_final-kbetr2 = it_konv_totals_stock-kbetr.
            it_total_stock_final-kbetr2 = it_total_stock_final-kbetr2 * -1.
          ENDIF.
        ENDIF.
        it_total_stock_final-cnt1  = l_cnt1.
        it_total_stock_final-cnt2  = l_cnt2.
        it_total_stock_final-aubel = it_out_stock-vbeln.
        it_total_stock_final-aupos = it_out_stock-posnr.
        it_total_stock_final-kunnr = it_out_stock-kunnr.
        it_total_stock_final-werks = it_out_stock-werks.
        it_total_stock_final-vkbur = it_out_stock-vkbur.  "Sales office
        it_total_stock_final-vkorg = it_out_stock-vkorg.  "Sales org
        it_total_stock_final-vkgrp = it_out_stock-vkgrp.  "Sales group
    ***Begin Insert by RONCR
        it_total_stock_final-kwmeng = it_out_stock-kwmeng.
        it_total_stock_final-fkimg = it_out_stock-fkimg.
        it_total_stock_final-counter = it_out_stock-counter.
    **End of Insert by RONCR
        APPEND it_total_stock_final.
      ENDLOOP.
    ENDFORM.                    " out_stock
    *&      Form  write_report
          text
    -->  p1        text
    <--  p2        text
    FORM write_report.
      ULINE (360).
      FORMAT COLOR 1.
      WRITE: / sy-vline, header01,
            12 sy-vline, header02,
            19 sy-vline, header03,
            30 sy-vline, header04,
            35 sy-vline, header05,
            55 sy-vline, header18,
            75 sy-vline, header19,
            87 sy-vline, header20,
           100 sy-vline, header06,
           112 sy-vline, header07,
           150 sy-vline, header08,
           170 sy-vline, header09,
           215 sy-vline, header10,
           225 sy-vline, header11,
           247 sy-vline, header21,
           271 sy-vline, header12,
           293 sy-vline, header13,
           315 sy-vline, header14,
           337 sy-vline, header17,
           360 sy-vline, header22,
           363 sy-vline.
      ULINE (360).
      FORMAT COLOR 2.
      SORT it_total_stock_final BY cnt2 cnt1 spart aubel aupos.
      LOOP AT  it_total_stock_final.
        CLEAR: g_div, g_mat, g_maktx, g_name1, v_net_value.
        SELECT SINGLE vtext INTO g_div
           FROM tspat
           WHERE spart = it_total_stock_final-spart
             AND spras = sy-langu.
        SELECT SINGLE wgbez INTO g_mat
           FROM t023t
           WHERE matkl = it_total_stock_final-matkl
             AND spras = sy-langu.
        SELECT SINGLE maktx INTO g_maktx
           FROM makt
             WHERE matnr = it_total_stock_final-matnr
               AND spras = sy-langu.
        SELECT SINGLE name1  INTO g_name1
           FROM kna1
              WHERE kunnr = it_total_stock_final-kunnr.
        IF it_total_stock_final-counter = 1.
          CLEAR: l_quantity.
          l_quantity = it_total_stock_final-kwmeng -
                       it_total_stock_final-fkimg.
          it_total_stock_final-kawrt = it_total_stock_final-kawrt /
                      it_total_stock_final-kwmeng.
          it_total_stock_final-kawrt = it_total_stock_final-kawrt *
                       l_quantity.
          it_total_stock_final-kbetr1 = it_total_stock_final-kbetr1 /
                                         1000.
          it_total_stock_final-kbetr2 = it_total_stock_final-kbetr2 /
                                         1000.
          it_total_stock_final-kwert1 = it_total_stock_final-kawrt *
                                        it_total_stock_final-kbetr1.
          it_total_stock_final-kwert2 = it_total_stock_final-kawrt *
                                        it_total_stock_final-kbetr2.
              clear:  it_total_stock_final-kawrt,
                      it_total_stock_final-kbetr1,
                      it_total_stock_final-kbetr2,
                      it_total_stock_final-kwert1,
                      it_total_stock_final-kwert2.
        ENDIF.
        v_net_value = it_total_stock_final-kawrt -
                      it_total_stock_final-kwert1 -
                      it_total_stock_final-kwert2.
        WRITE: / sy-vline, it_total_stock_final-vbeln,
              12 sy-vline, it_total_stock_final-aupos,
              19 sy-vline, it_total_stock_final-aubel,
              30 sy-vline, it_total_stock_final-spart,
              35 sy-vline, g_div,
              55 sy-vline, it_total_stock_final-vkbur,
              75 sy-vline, it_total_stock_final-vkorg,
              87 sy-vline, it_total_stock_final-vkgrp,
             100 sy-vline, it_total_stock_final-kunnr,
             112 sy-vline, g_name1,
             150 sy-vline, it_total_stock_final-matnr,
             170 sy-vline, g_maktx,
             215 sy-vline, it_total_stock_final-matkl,
             225 sy-vline, it_total_stock_final-vtext.
        IF it_total_stock_final-counter = 1.
          WRITE:  247 sy-vline, l_quantity,
                  271 sy-vline, it_total_stock_final-kawrt,
                  293 sy-vline, it_total_stock_final-kwert1,
                  315 sy-vline, it_total_stock_final-kwert2,
                  337 sy-vline, v_net_value,
                  360 sy-vline, it_total_stock_final-werks,
                  363 sy-vline.
        ELSE.
          WRITE:  247 sy-vline, it_total_stock_final-kwmeng,
                  271 sy-vline, it_total_stock_final-kawrt,
                  293 sy-vline, it_total_stock_final-kwert1,
                  315 sy-vline, it_total_stock_final-kwert2,
                  337 sy-vline, v_net_value,
                  360 sy-vline, it_total_stock_final-werks,
                  363 sy-vline.
        ENDIF.
      ENDLOOP.
      ULINE (360).
    ENDFORM.                    " write_report
    *&      Form  held_order
          text
    -->  p1        text
    <--  p2        text
    FORM held_order.
      DATA: l_cnt1 TYPE i,
            l_cnt2 TYPE i,
            l_spart LIKE mara-spart,
            l_matkl LIKE mara-matkl,
            l_text  LIKE tspat-vtext,
            l_amount TYPE p DECIMALS 2,
            l_aupos LIKE vbrp-aupos,
            l_aubel LIKE vbrp-aubel.
      SELECT vbak~erdat
             vbak~bukrs_vf
             vbak~knumv
             vbak~kunnr
             vbap~werks
             vbak~vkbur                          "Sales office
             vbak~vkorg                          "Sales organization
             vbak~vkgrp                          "Sales group
             vbap~vbeln
             vbap~posnr
             vbap~matnr
             vbap~kwmeng                         "Order Quantity
             vbuk~cmgst
             INTO TABLE it_total_held1
             FROM vbak
             INNER JOIN vbap
             ON vbakvbeln = vbapvbeln
             INNER JOIN vbuk
             ON vbapvbeln = vbukvbeln
             WHERE vbak~erdat IN s_curr
               AND vbak~vkorg IN s_vkorg
               AND vbak~vkbur IN s_vkbur
               AND vbap~matkl IN s_matkl
               AND vbak~bukrs_vf IN ('5116', '5106')
               AND vbak~vkbur NE '5100'
               AND vbak~auart IN ('ZDOA', 'ZDTO', 'ZQOA', 'ZDTA', 'ZQTO')
               AND vbak~kkber = '5116'
               AND vbuk~cmgst = 'B'
               AND vbap~spart IN s_spart.
      IF sy-subrc = 0.
        SELECT zcusno
               zregion
               INTO TABLE it_total_held2
               FROM zcust
               FOR ALL ENTRIES IN it_total_held1
                WHERE zcusno = it_total_held1-kunnr
                  AND zcust~zregion IN s_zreg
                  AND zcust~zaclass IN s_class.
        IF sy-subrc EQ 0.
    ***get the value of material and material group
          SELECT matnr
                 matkl
                 spart
                 INTO TABLE it_mara_totals_held
                 FROM mara
                 FOR ALL ENTRIES IN it_total_held1
                 WHERE matnr = it_total_held1-matnr.
    ***Get the Value of Division Description
          IF NOT it_mara_totals_held[] IS INITIAL.
            SELECT spart
                   vtext
                   INTO TABLE it_tspat_totals_held
                   FROM tspat
                   FOR ALL ENTRIES IN it_mara_totals_held
                   WHERE spart = it_mara_totals_held-spart AND
                         spras = sy-langu.
          ENDIF.
    ***Get the Material Group Description
          IF NOT it_mara_totals_held[] IS INITIAL.
            SELECT matkl
                   wgbez
                   INTO TABLE it_t023t_totals_held
                   FROM t023t
                   FOR ALL ENTRIES IN it_mara_totals_held
                    WHERE matkl = it_mara_totals_held-matkl AND
                          spras = sy-langu.
          ENDIF.
    ***Get the Value of Condition Type
          IF NOT it_total_held1[] IS INITIAL.
            SELECT knumv
                   kposn
                   kschl
                   kawrt
                   kwert
                   INTO TABLE it_konv_totals_held
                   FROM konv
                   FOR ALL ENTRIES IN it_total_held1
                    WHERE knumv = it_total_held1-knumv
                      AND kposn = it_total_held1-posnr
                      AND kschl IN ('ZQPR', 'ZQD3', 'ZQP3',
                                    'ZDPR', 'ZDD3', 'ZDP3').
          ENDIF.
        ENDIF.
      ENDIF.
      SORT it_total_held1       BY vbeln posnr.
      SORT it_total_held2       BY zcusno zregion.
      SORT it_mara_totals_held  BY matnr.
      SORT it_tspat_totals_held BY spart.
      SORT it_t023t_totals_held BY matkl.
      SORT it_konv_totals_held  BY knumv kposn.
      LOOP AT it_total_held1.
        CLEAR: it_total_held_final-kawrt,  it_total_held_final-kwert1,
               it_total_held_final-kwert2, it_total_held_final-vtext,
               it_total_held_final-matkl,  it_total_held_final-spart,
               it_total_held_final-aubel,  it_total_held_final-aupos,
               it_total_held_final-cnt1,   it_total_held_final-cnt2.
        CLEAR: it_mara_totals_held, it_tspat_totals_held,
               it_t023t_totals_held, it_konv_totals_held,
               l_cnt1, l_cnt2.
        READ TABLE it_total_held2
            WITH KEY zcusno = it_total_held1-kunnr.
        IF sy-subrc = 0.
    **Counter for Total Orders Column
          l_cnt1 = 3.
          READ TABLE it_mara_totals_held
              WITH KEY matnr = it_total_held1-matnr.
          IF sy-subrc EQ 0.
            it_total_held_final-matnr = it_mara_totals_held-matnr.
            it_total_held_final-matkl = it_mara_totals_held-matkl.
            it_total_held_final-spart = it_mara_totals_held-spart.
    ***Dole
            IF it_total_held_final-matkl EQ 'DPM' OR
               it_total_held_final-matkl EQ 'SSN'.
              READ TABLE it_tspat_totals_held
               WITH KEY spart = it_mara_totals_held-spart.
              IF sy-subrc EQ 0.
                it_total_held_final-vtext  = it_tspat_totals_held-vtext.
              ENDIF.
    ***Non Dole
            ELSE.
              READ TABLE it_t023t_totals_held
               WITH KEY matkl = it_mara_totals_held-matkl.
              IF sy-subrc EQ 0.
                it_total_held_final-vtext  = it_t023t_totals_held-wgbez.
              ENDIF.
            ENDIF.
          ENDIF.
          IF it_total_held_final-matkl = 'DPM' OR
             it_total_held_final-matkl = 'SSN'.
            l_cnt2 = 1.
          ELSE.
            l_cnt2 = 2.
          ENDIF.
    ***Condition Value for Comapny Code 5116
          IF it_total_held1-bukrs_vf EQ '5116'.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZQPR'.
            IF sy-subrc EQ 0.
              it_total_held_final-kawrt = it_konv_totals_held-kawrt.
            ENDIF.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZQD3'.
            IF sy-subrc EQ 0.
              it_konv_totals_held-kwert = it_konv_totals_held-kwert * -1.
              it_total_held_final-kwert1 = it_konv_totals_held-kwert.
            ENDIF.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZQP3'.
            IF sy-subrc EQ 0.
              it_konv_totals_held-kwert = it_konv_totals_held-kwert * -1.
              it_total_held_final-kwert2 = it_konv_totals_held-kwert.
            ENDIF.
          ENDIF.
    ***Condition Value for Comapny Code 5106
          IF it_total_held1-bukrs_vf EQ '5106'.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZDPR'.      "Base price
            IF sy-subrc EQ 0.
              it_total_held_final-kawrt = it_konv_totals_held-kawrt.
            ENDIF.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZDD3'.      "Volume Discount
            IF sy-subrc EQ 0.
              it_konv_totals_held-kwert = it_konv_totals_held-kwert * -1.
              it_total_held_final-kwert1 = it_konv_totals_held-kwert.
            ENDIF.
            READ TABLE it_konv_totals_held
              WITH KEY knumv = it_total_held1-knumv
                       kposn = it_total_held1-posnr
                       kschl = 'ZDP3'.      "Promo Discount
            IF sy-subrc EQ 0.
              it_konv_totals_held-kwert = it_konv_totals_held-kwert * -1.
              it_total_held_final-kwert2 = it_konv_totals_held-kwert.
            ENDIF.
          ENDIF.
          it_total_held_final-cnt1   = l_cnt1.
          it_total_held_final-cnt2   = l_cnt2.
          it_total_held_final-aubel  = it_total_held1-vbeln.
          it_total_held_final-aupos  = it_total_held1-posnr.
          it_total_held_final-kunnr  = it_total_held1-kunnr.
          it_total_held_final-erdat  = it_total_held1-erdat.
          it_total_held_final-werks  = it_total_held1-werks.
          it_total_held_final-vkbur  = it_total_held1-vkbur.  "Sales office
          it_total_held_final-vkorg  = it_total_held1-vkorg.  "Sales Org
          it_total_held_final-vkgrp  = it_total_held1-vkgrp.  "Sales group
          it_total_held_final-kwmeng = it_total_held1-kwmeng. "Order qty
          APPEND it_total_held_final.
        ENDIF.     "it_total_held2
      ENDLOOP.
    ENDFORM.                    " held_order
    *&      Form  write_report1
          text
    -->  p1        text
    <--  p2        text
    FORM write_report1.
      ULINE (360).
      FORMAT COLOR 1.
      WRITE: / sy-vline, header01,
               12 sy-vline, header02,
               19 sy-vline, header03,
               30 sy-vline, header15,
               45 sy-vline, header04,
               50 sy-vline, header05,
               75 sy-vline, header18,
               90 sy-vline, header19,
              103 sy-vline, header20,
              115 sy-vline, header06,
              127 sy-vline, header07,
              167 sy-vline, header08,
              184 sy-vline, header09,
              227 sy-vline, header10,
              237 sy-vline, header11,
              260 sy-vline, header21,
              282 sy-vline, header12,
              306 sy-vline, header13,
              330 sy-vline, header14,
              354 sy-vline, header17,
              376 sy-vline, header22,
              380 sy-vline.
          ULINE (376).
          FORMAT COLOR 2.
          SORT it_total_held_final BY cnt2 cnt1 spart aubel aupos.
          LOOP AT  it_total_held_final.
            CLEAR: g_div, g_mat, g_maktx, g_name1, v_net_value.
            SELECT SINGLE vtext INTO g_div
               FROM tspat
               WHERE spart = it_total_held_final-spart
                 AND spras = s

    Hi,
    790072 wrote:
    Hi Gurus,
    Need your help in writing an sql to search records which has length of 4000 bytes from an varchar2(4000) column and inserting the same records to another table by truncating the record to 3500 bytes .Something like this:
    INSERT INTO new_table (txt_column)
    SELECT  SUBSTRB (txt_column, 1, 3500)
    FROM    old_table;SUBSTR returns a string with a specified number of characters , SUBSTR<b>B</b> has a specified number of bytes .

  • Backorder report, not possible to print Cardname

    Hello,
    in the PLD template for the backorder report it is not possible to inlcude the Cardname, there is no system variable available.
    Does anyone have a workaround for this?
    Thank you in advance.
    Best regards,
    Anton Wieser.

    Hi,
    Were you able to figure out solution for this.
    I tried this out by processing a backorder goods delivery. The system is still taking the delivery PLD. So, I am getting the Cardname (Customer Name).
    Try out using Advanced print layout. Probably that will help in finding out a solution.
    Assign points if useful.
    Thanks,
    Srikanth

  • There is double quantity in the sales item report?

    Hi all,
    I have created an infoset with sales order item and delivery
    The issue is
    there is one sales order item with qty 10 but because it was delivered on different dates with different quantity like 5,5
    the report show likes
    sales order item                            quantity                  delivered quantiy   act gds issue date
    10                                                 10                             5                        20/09/2010
    10                                                  10                            5                        21/09/2010
    result                                              20                           10
    but the actual quanity should only be 10 but the result it is sumarizing as 20 because there are 2 line items for the same
    how to rectify and summarise it
    thanks

    Hi,
    Check this blog on your topic. It explaines exception aggregation in detail.
    Infoset Keyfigure multiplicity Part 3
    Infoset Keyfigure multiplicity Part 1
    Infoset Keyfigure multiplicity Part 2

  • Issue with Variable Personalisation in Bex Report

    Hi Gurus,
    I'm facing a typical problem with Variable presonalisation in the Report.
    I've executed a BEX Report and filtered data on some characteristics and used SAVE AS Button on the Portal to save the resultset. When I'm trying to use the variants, again say after  2 or 3 days i couldn't find updated data for particular variants upon using the same variants rather its refelecting the old data. Further more when I execute the report and try filtering on the same criteria altogether, I'm able to see updated result set.
    Is there any setting to be enabled when we personalise variants or variants are dependent on the data or the date on which they are created. Not sure why the reports are behaving this way. Or Do I need to create variants time and again.
    Any pointers would be of great help.
    Regard,
    Yaseen

    Hello,
    In the BEx report, when you get the variable selection screen there input your selection and at the bottom you have the option of saving them as a variant.
    Now in future when you run the report simply use this variant and execute the report. It should work fine.
    Also remember date selection can be tricky. If you input todays date in the variant, it wil consider the same date in further references. So do a check on that too.
    Regards,
    Shashank

  • How to use SYSDATE as a default value of a bind variable in a query report?

    Hi,
    I want to use SYSDATE as default value for a bind variable in Query based report.
    I don't see any way to do it, someone helps?
    Thanks a lot.
    Paulo.

    You can aslo use #sysdate directly.
    Hi,
    The way I'm doing in my report is, I have a database function (f_ret_sysdate) with the following code
    create function f_ret_sysdate return varchar2
    begin
    return to_char(sysdate,'mm/dd/yyyy');
    end;
    Now, in the 'Customization Form Display Options' section of the report I'm calling this function as #f_ret_sysdate in the default value field of corresponding bind variable to display SYSDATE with the format.
    Hope this helps!...
    -Krishnamurthy

  • Need a Syatem variable for Executing the report by RFC.

    Hi Experts,
    Need a Syatem variable for Executing the report by RFC.
    what i mean to say is,i can execure the report directly ...then no issues.
    But if i execute the Report by RFC ,then i should put a condition with system variable...
    Please suggest me ,how can put a condition when i am executing the report through RFC.
    Thanks
    Babu

    Hello Friend,
    what I understood that you want to put some extra condition if that report is getting called from RFC...
    you can use the system variable SY-CPROG....it will hold the value of the report when it is geeting executing directly...
    but when it is getting executed therough RFC...it will hold that RFC name...
    Thanks
    Krish

  • How to assign a variable value to crystal report viewer formula with CR2008

    Hi ,
    I am using crystal reports 2008 and i am not able to find how to assign  variable value  to crystal report viewer formula.
    In CR 8.5 , i used to have crystalreport1.Formulas(0) = variable1
                                             crystalreport1.Formulas(1) = variable2
    but, i don't find similar kind  in crystal reports 2008.
    How can i achieve the same functionality using crystal reports 2008.
    Thanks in Advance
    Regards,
    Ramnath

    Hi,
    Can i anyone help me out with this.
    I am generating crystal reports in vb6 using CR 8.5 and vb6 and below is the code snippet for the same
    CrystalReport1.Formulas(0) = "PrintTitle= '" & strMyTitle & "'"
    CrystalReport1.Formulas(1) = "FromDate= '" & MskFromDate.Text & "'"
    CrystalReport1.Formulas(2) = "ToDate= '" & MskToDate.Text & "'"
    Please let me know how the same functionality can be achieved in VB.Net using Crsytal reports 2008
    Any code snippet would be of great Help.
    Thanks in Adnvance.
    Ramnath

  • ALL variables in one single report

    Hi Experts,
    I have one requirement, i am creating report on multi provider , so i have to create report to include all variable and it's definition(for wht purpose the variables are created means with description in report.).
    So is there any posibility Please explaine me clearly how we crarte report on all variables.
    Thanks in advance
    Bharati

    Hi Bharati,
    Still not clear about the requirement ......
    There is a table for variable name and its description been stored.  Please do generic extraction using table of view and load data to cube.  then generate a report on top of it.  But purpose of variable may be differ for each report , identifying of the purpose of the variable not possible with out manual intervention.   eg. i have calmonth variable reference to document data which ready for input .. using the same I am deriving a customer exit variable to populate ytd or mtd how will you analyze this ??  if I want to use same variable to any other report which used to used as it is based on doc date..
    Thanks
    BVR

  • How to pass Presentation Variable Value from Main Report to Detail Report

    Hello,
    I've 2 reports that is attached to each other. In my main report i've several report prompts and i am using i"s prompted" on my detail report to attach them.
    But 2 of my report prompts are presentation variables(Names : FIRST, SECOND). Both are in date format. I've a filter in my main report like;
    "ASSIGNMENTS_F"."EFFECTIVE_START_DATE" BETWEEN @{FIRST} AND {SECOND}
    It works fine when i run the main report. But when i click on the numbers, i see that i can not filter my detail report with the chosen values for 2 presentation variables. It just shows all the dates.
    I've tried adding both presentation variables in both reports as columns and adding 'is prompted' filter to them. But did not work either.
    I just cant pass the written values for presentation variable prompts to detail report..
    Please help :)

    Hi,
    What you can try is refer the filte condition in the main report to the detailed report with the option--> Filter based on another request.
    Or you try creating another intermediate report which will refer the main report filters and pass the filters to the detailed report.
    Hope this helps.
    Regards
    MuRam

  • Importing a text file with variable values into web reporting

    Hello,
    I'm looking for a possibility to import values from a text file into a variable selection in Web reporting.
    With BEx reporting in Excel this is possible, by clicking on the multiple selection button in the variable popup screen, and subsequently selecting the "Import from Text file" button.
    However, this function seems not to be available for web-reporting...
    It would be great if someone could help me out with this!
    Thanks & regards,
    Arvid

    Hi,
    we could resolve this issue, so i thought it may also be helpful for others:
    In our example we used a file with numbers for materials. This file is stored somewhere in a directory, to which SAP BI must have authorization to read.
    The file looks something like this:
    4711
    4712
    4713
    4714
    The file is named "import.txt" and lays in directory "/usr/sap/EC6/files/bi/"
    *&  Include           ZXRSRU01
    * global variables
    Data: intern_range LIKE LINE OF i_t_var_range,
          l_s_range    TYPE rsr_s_rangesid,
          line(100)    TYPE c,
          p_file(128)  TYPE c,
          length_rangelow  type i,
          tmp_rangelow     like l_s_range-low.
    * internal tables for selection-transfer from transaction
    * Data: BEGIN OF it_file occurs 0,
    *        it_p_file(128) TYPE c,
    *      END of it_file.
    IF i_step = 1.
    ** variables can be changed or set before pop-up appears
      CASE i_vnam.
    * take material from external file to selection-list
         WHEN 'ZSD_UPMA'.
    ** call of transaction, with which the path can be set
    *CALL TRANSACTION 'ZBW_VARIABLE' using it_file
    *MODE 'A'      " call should be visible, so that variable can be set
    *UPDATE 'S'.   " first transaction, then processing
    ** Der Pfad, der in dem Selektionsbild eingegeben wird, wird an die Variable übergeben
    ** Der Set-Parameter ist in Report ZSD_SELECT_VARIABLE
    *  get parameter id 'VAR' field p_file.
    p_file = '/usr/sap/EC6/files/bi/import.txt'.
    * further handling of variable in BI
          OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
          IF sy-subrc = 0.
            READ DATASET p_file INTO line.
            WHILE sy-subrc = 0.
              IF line(2) <> '//'.
                l_s_range-sign = 'I'.
                l_s_range-opt  = 'EQ'.
                l_s_range-low  = line.
    * fill with leading Zeros
    * in variable tmp_rangelow the value from l_s_range-low is taken
        tmp_rangelow    = l_s_range-low.
    * read the length
        length_rangelow = strlen( tmp_rangelow ).
    * in our case: material has 18 characters
        while length_rangelow lt 18.
          CONCATENATE '0' tmp_rangelow INTO tmp_rangelow.
          length_rangelow = length_rangelow + 1.
        endwhile.
    * initialize l_s_range-low
        clear l_s_range-low.
    * set with filled values
        l_s_range-low = tmp_rangelow.
    * transfer to structure
                APPEND l_s_range TO e_t_range.
              ENDIF.
              READ DATASET p_file INTO line.
            ENDWHILE.
          ENDIF.
          CLOSE DATASET p_file.
        ENDCASE.
    ELSEIF i_step = 2.
    ** in step 2 all variable values from pop-up input can be processed or
    ** User Exit variables can be derived
    * UserExit Ende.
    ENDIF.
    Hope i could help!
    Best regards,
    Tobias

  • Display variable values in Web report

    Hi Bw Mates,,,
    I am trying to display the variable values in Web Report.
    I put one text Item in Template and checked the Variable Display and entered the variable name in List.
    still I cannot see the variable values in the report.
    Thanks for your help.
    RSB

    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="GET_ITEM"/>
             <param name="NAME" value="TEXTELEMENTS_1"/>
             <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_TEXT_ELEMENTS"/>
             <param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
             <param name="GENERATE_LINKS" value=""/>
             <param name="GENERATE_CAPTION" value="BORDER"/>
             <param name="SHOW_COMMON_ELEMENTS" value=""/>
             <param name="ELEMENT_TYPE_1" value="VARIABLE"/>
             <param name="ELEMENT_NAME_1" value="Z_CP_018"/>
             ITEM:            TEXTELEMENTS_1
    </object>
    as the other poster mentioned the variable name has to be in upper case.
    if only_values = 'X' you will just get the value other wise
    you will get something like below.
    variable description = variable value
    Regards
    Raja
    Reward the helpful answers and close the thread once its answered.
    sorry for the delay in answering, it was weekend for us

  • Variable issue in crystal report

    Hi Experts,
    I hope you are doing the good job and i developed the BEX report which is developed 3 variables , one of the variable is in navgational attribute and remain 2 attributes in char which is working fine  and we developed the crystal report on top of bex query  its working fine after that  as per requirement i changed navgational attribute and variable .Now the crystal report is not showing the variable prompt which i build on Nav attribute.So plz pass your inputs on this issue.
    Regards
    RK

    Dear Kumar,
    Thank you very much for you reply and we using the below mentioed details.
    Exact version:4.1,support pack/service pack:sp3,patch level of CR:0
    SAP BI:7.3
    Regards
    RK

  • Using Bind variables in SQL PLUS Report

    using Bind variables in SQL PLUS Report. This report gets the arguments from the application concurrent program. Now my need is to convert the start_date and end_date to bind Variables to improve the performance. I have commented the original code in 'prompt List of Unapproved Adjustments' and used my Bind Variable but it is giving an error
    error: Bind Variable "ENDING_DATE" not declared
    Report Date and Time:
    26-OCT-2010 15:44:13
    List of Unapproved Adjustments
    Bind Variable 'ENDING_DATE" not declared
    Please see below the code for the sql plus report:
    define p_org_id           = '&1'
    define p_fy_begin_date = '&2'
    define p_start_date = '&3'
    define p_end_date = '&4'
    define p_conversion = '&5'
    declare
    variable begin_date date;
    exec :begin_date := p_start_date;
    variable ending_date date;
    exec :ending_date := p_end_date;
    /* Begin
    :begin_date := to_date('&p_start_date','YYYY/MM/DD HH24:MI:SS');
    :ending_date := to_date('&p_end_date','YYYY/MM/DD HH24:MI:SS');
    End; */
    set newpage none
    set termout off
    set pagesize 55
    set linesize 180
    set heading on
    set feedback off
    set wrap off
    set space 1
    set heading on
    begin
    dbms_application_info.set_client_info('&p_org_id');
    end;
    prompt
    prompt Report Date and Time:
    prompt ----------------------
    select to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')
    from dual ;
    prompt
    prompt List of Unapproved Adjustments
    prompt -------------------------------
    select b.trx_number,
    a.adjustment_number,
    f.user_name created_by
    from apps.ar_adjustments a,
    apps.ra_customer_trx b,
    apps.fnd_user f
    where a.customer_trx_id = b.customer_trx_id
    and a.status <> 'A'
    and a.created_by = f.user_id
    and a.creation_date between :begin_date
    and :ending_date
    -- and a.creation_Date between to_date('&p_start_date','YYYY/MM/DD HH24:MI:SS')
    -- and to_date('&p_end_date','YYYY/MM/DD HH24:MI:SS')
    order by
    b.trx_number ;

    Hi
    Please go to customization part of the report and verify..You have set a default value out there ..And also verify your lov and look at the values ..If it is again giving you the problem ..pl delete the report and develop it again from the scratch it will be solved...
    vishnu
    null

  • Create New Variable for COPA Drilldown Reports in KE3E

    Hi,
    How can we create a formula variable for COPA Drill down reports in KE3E? In standard global variables formula variable is not avaiable, I need to create a formula variables like ...from period, to period, last fiscal year and next fiscal year..
    While creating report in KE31/KE35 trying create local variables, but it doesn't.
    Can any body advise how can we create a new variables for  "from period, to period, last fiscal year and next fiscal year.."
    Thanks
    VS Rao

    Hi Rao
    For Period (From &To)
    1. KE3E
    2. Type of Var = Char Value
        Enter variable name, say, ZPERIOD
        Field Name = PERDE
        Replacement type = Entry
        Enter Description
        Parameter/selectop = Selection Option
    For Fiscal Year
        Type of Var = Char Value
        Enter variable name, say, ZGJAHR
        Field Name = GJAHR
        Replacement type = Entry
        Enter Description
        Parameter/selectop = Parameter
    For Next and Last Fiscal Year
    When you define your form in KE34/KE35
    Use the variable ZGJAHR in your report
    In the column for Next Year, Enter "ZGJAHR+1" as the local variable for GJAHR
    In the Column for Last year, Enter  "ZGJAHR-1" as the local variable for GJAHR
    Regards
    Ajay M

Maybe you are looking for