Can we call a BDC from REPORT program.

hi
can anybody tell me that
can we call a BDC from REPORT program.
thanks&regards

Yes, It can be called.
Infact you can generate a program from SHDB recording and in the program generated you can put necessary report logic and call the BDC/CALL TRANSACTION as required.
<b>Please check here for a sample program,</b>
http://www.sapdevelopment.co.uk/bdc/bdc_ctcode.htm
Regards
Kathirvel

Similar Messages

  • Can we call a bdc from a report program?

    hi
    Can we call a bdc from a report program?
    Thanks
    Rama

    Hello,
    Yes..
    Check this example:
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                      RS_SELFIELD TYPE SLIS_SELFIELD.
      DATA : L_EBELN TYPE EKPO-EBELN,
             L_EBELP TYPE EKPO-EBELP.
      DATA : L_DATE1 TYPE SY-DATUM,
             L_DATE2 TYPE SY-DATUM,
             L_YEAR(4),
             L_MONTH(2),
             L_DATE(2).
      DATA: L_AMOUNT1 LIKE RK40C-WTGBTR.
      DATA: L_POSID_OLD TYPE PS_POSID.
      DATA: L_POSID_NEW TYPE PS_POSID.
      DATA: LS_COBK  LIKE COBK.
      DATA: LT_ITEMS    LIKE RK40C OCCURS 0 WITH HEADER LINE,
            LT_COEP     LIKE COEP  OCCURS 0 WITH HEADER LINE,
            LT_COEPL    LIKE COEPL OCCURS 0 WITH HEADER LINE,
            LT_COEPR    LIKE COEPR OCCURS 0 WITH HEADER LINE,
            LT_MESG     LIKE MESG  OCCURS 0 WITH HEADER LINE.
      DATA: LV_NUM TYPE POSNR_ACC VALUE '1'.
      DATA: CD_SEND_REC_REL LIKE COHEADER-SEND_REC_REL,
            LD_STATUS LIKE RK23F-STATUS.
      DATA: L_DYNNR LIKE FELD-DYNNR.
      CLEAR : L_DATE,L_DATE1,L_DATE2,L_YEAR,L_MONTH.
      L_DATE1 = SY-DATUM.
      L_YEAR = L_DATE1(4).
      L_MONTH = L_DATE1+4(2).
      L_DATE = L_DATE1+6(2).
      CONCATENATE L_DATE L_MONTH L_YEAR INTO L_DATE2 .
      CASE R_UCOMM.
        WHEN '&IC1'.   "doubleclick
          CHECK RS_SELFIELD-FIELDNAME = 'EBELN'.
          READ TABLE G_T_FINAL INDEX RS_SELFIELD-TABINDEX.
          IF SY-SUBRC = 0.
            READ TABLE G_T_TEMP WITH KEY LOGNUM = G_T_FINAL-LOGNUM.
            IF SY-SUBRC = 0.
              MESSAGE I899(KB) WITH TEXT-004.
            ELSE.
              CLEAR : L_EBELN,L_EBELP,LS_COBK,LT_ITEMS,G_T_BDC,G_T_MESSAGE,
                      CD_SEND_REC_REL,LD_STATUS.
              REFRESH: LT_ITEMS,G_T_BDC,G_T_MESSAGE.
              SET PARAMETER ID 'BES' FIELD G_T_FINAL-EBELN.
              GET PARAMETER ID 'BES' FIELD L_EBELN.
              SET PARAMETER ID 'BSP' FIELD G_T_FINAL-EBELP.
              GET PARAMETER ID 'BSP' FIELD L_EBELP.
              SORT G_T_FINAL BY EBELN EBELP.
              READ TABLE G_T_FINAL WITH KEY EBELN = L_EBELN
                                            EBELP = L_EBELP
                                            BINARY SEARCH.
              IF SY-SUBRC = 0.
                LS_COBK-KOKRS = G_T_FINAL-KOKRS.
                LS_COBK-GJAHR = SY-DATUM+0(4).
                LS_COBK-VRGNG = 'RKU1'.
                LS_COBK-PERAB = SY-DATUM+4(2).
                LS_COBK-PERBI = SY-DATUM+4(2).
                LS_COBK-BLDAT = SY-DATUM.
                LS_COBK-BUDAT = SY-DATUM.
                LS_COBK-CPUDT = SY-DATUM.
                LS_COBK-USNAM = SY-UNAME.
                LS_COBK-WSDAT = SY-DATUM.
                LS_COBK-KURST = 'M'.
                LS_COBK-VARNR = '05SAP'.
                LS_COBK-KWAER = G_T_FINAL-WAERS.
                LS_COBK-CPUTM = SY-UZEIT.
                CLEAR : L_POSID_OLD,L_POSID_NEW.
                CALL FUNCTION 'CONVERSION_EXIT_ABPSP_INPUT'
                     EXPORTING
                          INPUT  = G_T_FINAL-POSID_NEW
                     IMPORTING
                          OUTPUT = L_POSID_NEW.
                CALL FUNCTION 'CONVERSION_EXIT_ABPSP_INPUT'
                     EXPORTING
                          INPUT  = G_T_FINAL-POSID_OLD
                     IMPORTING
                          OUTPUT = L_POSID_OLD.
                L_AMOUNT1 = G_T_FINAL-AMOUNT.
                LT_ITEMS-ZLENR = LV_NUM.
                LT_ITEMS-EPSPNR = L_POSID_NEW.
                LT_ITEMS-SPSPNR = L_POSID_OLD.
                LT_ITEMS-KSTAR  = G_T_FINAL-KSTAR.
                LT_ITEMS-WAERS  = G_T_FINAL-WAERS.
                LT_ITEMS-WTGBTR = L_AMOUNT1.
                LT_ITEMS-WKGBTR = L_AMOUNT1.
                APPEND LT_ITEMS.
                CLEAR: LT_ITEMS.
    * For reposting the Cost
                CHECK NOT LT_ITEMS[] IS INITIAL.
                CALL FUNCTION 'K40C_COBK_CHECK_POST'
                     CHANGING
                          ITCOBK                  = LS_COBK
                     EXCEPTIONS
                          PERIOD_BLOCKED          = 1
                          EXTERNAL_NUMBER_MISSING = 2
                          ERROR_OCCURED           = 3.
                IF SY-SUBRC IS INITIAL.
                  CALL FUNCTION 'K40C_DOCUMENT_LINE_CHECK'
                       EXPORTING
                            DOC_HEADER      = LS_COBK
                            IGNORE_WARNINGS = 'X'
                       TABLES
                            DOC_ITEMS       = LT_ITEMS.
    *...Create Tables for database
                  CALL FUNCTION 'K40C_DOCUMENT_CREATE'
                       EXPORTING
                            DOC_HEADER = LS_COBK
                       TABLES
                            DOC_ITEMS  = LT_ITEMS
                            ITCOEP     = LT_COEP
                            ITCOEPL    = LT_COEPL
                            ITCOEPR    = LT_COEPR.
                  CALL FUNCTION 'K40C_DOCUMENT_POST'
                       TABLES
                            ITCOEP     = LT_COEP
                            ITCOEPL    = LT_COEPL
                            ITCOEPR    = LT_COEPR
                       CHANGING
                            DOC_HEADER = LS_COBK.
                ENDIF.
              ENDIF.
              IF SY-SUBRC = 0.
                GET PARAMETER ID 'KBXXN_P_VAR_RKU1' FIELD CD_SEND_REC_REL.
                GET PARAMETER ID 'KBXX_START_DYNPRO' FIELD LD_STATUS.
                IF CD_SEND_REC_REL IS INITIAL AND LD_STATUS IS INITIAL.
                  CLEAR L_DYNNR.
                  L_DYNNR = '1220'.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' '1200'.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'COHEADER-SEND_REC_REL'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=PVAR'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'L'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' '1200'.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'RK23F-STATUS'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=LISI'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'S'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
                ENDIF.
                IF CD_SEND_REC_REL EQ '05SAP' AND LD_STATUS EQ 'S'.
                  CLEAR L_DYNNR.
                  L_DYNNR = '1220'.
                  PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
                ELSEIF CD_SEND_REC_REL EQ '05SAP' AND LD_STATUS EQ 'L'.
                  CLEAR L_DYNNR.
                  L_DYNNR = '1220'.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' L_DYNNR.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'RK23F-STATUS'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=LISI'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'S'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
                ELSEIF CD_SEND_REC_REL NE '05SAP' AND LD_STATUS EQ 'S'.
                  CASE CD_SEND_REC_REL.
                   WHEN '01SAP' OR '02SAP' OR '04SAP' OR '08SAP' OR '09SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1220'.
                    WHEN '03SAP' OR '07SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1230' .
                    WHEN '06SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1210'.
                    WHEN '10SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1270'.
                  ENDCASE.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' L_DYNNR.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'COHEADER-SEND_REC_REL'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=PVAR'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'S'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM BDC_FIELD       USING 'RK23F-WAERS'
                                                'EUR'.
                  PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
                ELSEIF CD_SEND_REC_REL NE '05SAP' AND LD_STATUS EQ 'L'.
                  CASE CD_SEND_REC_REL.
                   WHEN '01SAP' OR '02SAP' OR '04SAP' OR '08SAP' OR '09SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1220'.
                    WHEN '03SAP' OR '07SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1230' .
                    WHEN '06SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1210'.
                    WHEN '10SAP'.
                      CLEAR L_DYNNR.
                      L_DYNNR = '1270'.
                  ENDCASE.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' '1200'.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'COHEADER-SEND_REC_REL'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=PVAR'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'L'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM BDC_DYNPRO      USING 'SAPLK23F1' '1200'.
                  PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                                'RK23F-STATUS'.
                  PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                                '=LISI'.
                  PERFORM BDC_FIELD       USING 'COHEADER-SEND_REC_REL'
                                                '05SAP'.
                  PERFORM BDC_FIELD       USING 'RK23F-STATUS'
                                                'S'.
                  PERFORM BDC_FIELD       USING 'COHEADER-BLDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-BUDAT'
                                                L_DATE2.
                  PERFORM BDC_FIELD       USING 'COHEADER-PERIO'
                                                L_MONTH.
                  PERFORM FILL_BDC_SCREEN USING L_DYNNR L_DATE2 L_MONTH.
                ENDIF.
                CALL TRANSACTION 'KB11N' USING G_T_BDC MODE G_MODE MESSAGES
                                                          INTO G_T_MESSAGE.
                IF NOT G_T_MESSAGE[] IS INITIAL.
                  READ TABLE G_T_MESSAGE WITH KEY MSGTYP = 'S'.
                  IF SY-SUBRC = 0.
               DELETE FROM BALHDR WHERE LOGNUMBER = G_T_FINAL-LOGNUM    AND
                                           OBJECT = G_T_FINAL-OBJECT    AND
                                            SUBOBJECT = G_T_FINAL-SUBOBJECT.
                    COMMIT WORK.
                    G_T_TEMP = G_T_FINAL.
                    APPEND G_T_TEMP.
                  ENDIF.
                ENDIF.
              ENDIF.
            ENDIF.
            CLEAR G_T_MESSAGE.
            REFRESH G_T_MESSAGE.
    *refresh g_t_bdc.
            CLEAR G_T_BDC.
            REFRESH G_T_BDC.
          ENDIF.
      ENDCASE.
    ENDFORM.                    " USER_COMMAND
    Vasanth

  • Calling Webdynpro application from report program

    Hi All,
    I am working with report program which displays ALV grid and if i select a row and click the button in application toolbar it should navigate to webdynpro application.
    This webdynpro application should get loaded with the datas that i ve selected in the ALV output.
    for eg., in alv display
    select carrid connid
    X        10      10
               20      20
    Webdynpro Application
    carrid   10
    connid  10  
    Kindly help me in acheving this.

    Hi,
    SET/GET parameters wont work in WD Envoirment, because WDA programs are executed in browser and that doesnt has a connection to SAP GUI.
    You may use the shared memory to transfer work area from the report program, and import the work area agin in the WDA in the WDDOINIT method of the controller where you want to set the fields.
    data: send type string.
    send = 'enter file name here'.
    export send TO shared memory indx(XY)  id 'wda'.
    CALL FUNCTION 'CALL_BROWSER'
    EXPORTING
       URL                          = 'http://SSR11S07.8000/sap/bc/webdynpro/sap/ztest_wda1 '.
    And in the WDDOINIT method of the controller, you may import the variable.
    data receive type string.
    import send = receive from shared memory indx(xy) id 'wda'.
    Then you may use the method set_attribute to set the value to respective UI element on the screen.
    Regards,
    Runal

  • How to call a badi implementaion from report program

    Hi ABAP Guru,
    I have ZBADI_FALLBACK_DEF new badi created by me and there two implementation ZBADI_FALLBACK_IMP and ZBADI_FALLBACK_IMP1
    Now I am calling this badi from report program
    DATA:
       W_HANDLE TYPE REF TO ZBADI_FALLBACK_DEF.
    * GET BADI - for getting objects..................
    GET BADI W_HANDLE.
    * CALL BADI - for calling interface methods.
    CALL BADI W_HANDLE->ADD.
    This is fine,,,
    But I want to call only one implementaion ZBADI_FALLBACK_IMP.But here two implementaion is called.Please help....

    Hi Palash,
    Then you create filter BADI  and  use filter in implementation.
    While getting BADI reference use filter
    GET BADI W_HANDLE FILTERS
    Thanks & Regards,
    Arun

  • How can i use bapi in my report program

    hi
    am new to this forum , i have doubt in bapi's how can i call bapi into my report program and what is the difference between normal function module and bapi, and bdc plz clear my doubts
    Moderator message: please search for available information/documentation.
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    Edited by: Thomas Zloch on Apr 12, 2011 7:12 PM

    i have the same problem...
    anybody can help us??
    it`s urgent...
    thanks

  • Call the BAPI from the program..

    Hey guys,
    can we  call the BAPI from the program..
    if yes how can  we  can show sales orders being loaded..
    thanks its urgent

    Nishant,
    yes easily you can call bapi from program.
    for getting all sales order use:
    BAPI_SALESORDER_GETLIST
    also am providing a program so that you can see how bapi has to call in program.
    CALL FUNCTION 'BAPI_SALESORDER_GETLIST'
                 EXPORTING
                      customer_number    = lf_customernumber
                      sales_organization = if_sales_organization
                      document_date      = lf_document_date_from
                      document_date_to   = lf_document_date_to
    *              PURCHASE_ORDER     = IF_PURCH_ORDER
                      material           = lf_matno
                 IMPORTING
                      return             = ls_return
                 TABLES
                      sales_orders       = sales_orders.
    Am afraid to say you that above solution you get about bapi it is not for showing the list of SO these are for creating SO.
    Edited by: Amit Gujargoud on Jul 3, 2008 3:12 PM

  • Can we call a bdc program from report program

    hi
    can we call a bdc program from report program

    Yes you can any program from another program using
    SUBMIT <repname>   statement
    SUBMIT <repname> USING SELECTION-SCREEN dynnr.
    or
    SUBMIT <repname> VIA SELECTION-SCREEN USING SELECTION-SET variant
    SUBMIT <repname> VIA SELECTION-SCREEN WITH SELECTION-TABLE rspar
    etc.
    Regards
    Prax

  • Can we call a transaction from a report

    hi
    can we call a transaction from a report

    hi,
    we can call
    check it
    *& Report  ZSALESORDERDETAILS_ASHOK
    REPORT         ZSALESORDERDETAILS_ASHOK
                   NO STANDARD PAGE HEADING
                   LINE-SIZE 50
                   LINE-COUNT 35(5).
    *data declaration.
    tables :vbak.
    tables: VBAP.
    DATA : TVBAK LIKE VBAK  OCCURS 0 WITH HEADER LINE,
           TVBAP LIKE VBAP  OCCURS 0 WITH HEADER LINE,
           TEMP TYPE p decimals 5 VALUE '0.0' ,
           A type i,
           FIELDNAME TYPE STRING,
           FIELDVALUE TYPE VBAP-VBELN.
    DATA G_CB.
    selection-screen  begin of block screen1  with frame title TEXT-001.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN COMMENT /32(35) COMM1.
    SELECTION-SCREEN ULINE /27(35).
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS TVBELN FOR VBAK-VBELN.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN ULINE.
    SELECTION-SCREEN COMMENT /30(50) COMM2.
    SELECTION-SCREEN ULINE /27(40).
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS TERDAT FOR VBAK-ERDAT.
    SELECTION-SCREEN SKIP.
    selection-screen  end of block screen1.
    *Initialization
    Initialization .
    TVBELN-low = 4000.
    TVBELN-high = 5000.
    TVBELN-option = 'BT'.
    TVBELN-sign = 'I'.
    APPEND TVBELN.
    TERDAT-low = '19960202'.
    TERDAT-high = '20020302' .
    APPEND TERDAT.
    AT SELECTION-SCREEN .
    SELECT *
           FROM VBAK
           INTO TABLE TVBAK
           WHERE  VBELN IN TVBELN AND erdat IN Terdat .
           IF sy-subrc ne 0.
           MESSAGE 'ENTERED ORDER NOT FOUND' type 'E'.
           ENDIF.
           START-OF-SELECTION.
           REFRESH TVBAK.
           SELECT *
                  FROM VBAK
                  INTO TABLE TVBAK
                  WHERE  VBELN IN TVBELN AND ERDAT IN TERDAT.
            END-OF-SELECTION.
            LOOP AT TVBAK.
                    WRITE: /2 SY-VLINE,
                    TVBAK-VBELN INPUT ON ,
                    15 SY-VLINE,TVBAK-ERDAT hotspot on,
                    30  SY-VLINE, 35 TVBAK-ERNAM,
                    46 SY-VLINE,
                    g_cb AS CHECKBOX.
           ENDLOOP.
           A = SY-LINCT - SY-LINNO - 1.
         SKIP A .
      RESERVE A LINES.
              AT SELECTION-SCREEN OUTPUT.
              comm1 ='SELECT SALES ORDER RANGE'.
              comm2 ='SELECT SALES ORDER CREATION DATE'.
           TOP-OF-PAGE.
           ULINE.
           WRITE /15    '     SALES ORDER REPORT    ' COLOR = 1 .
           ULINE.
           WRITE : /7 '  VBELN  ' COLOR = 5 ,
                   19 '  ERDAT  ' COLOR = 5,
                   34 ' ERNAM  ' COLOR = 5.
            ULINE.
            END-OF-PAGE.
            IF SY-LSIND = 0.
            ULINE.
            WRITE : /2 'NUMBER OF LINE IN THIS PAGE = ', SY-LINNO.
                    SKIP.
            WRITE: /30 'PAGE NUMBER = ', SY-PAGNO.
            ULINE.
            ELSEIF SY-LSIND = 1.
            ULINE.
            WRITE : /12 'TOTAL PRICE = ' ,TEMP.
            CLEAR TEMP.
            SKIP.
            WRITE : /30 'PAGE NUMBER = ', SY-PAGNO.
            ULINE.
            ENDIF.
            at line-selection.
            GET CURSOR FIELD FIELDNAME VALUE FIELDVALUE.
            IF FIELDNAME = 'TVBAK-VBELN'.
            CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
              EXPORTING
                INPUT         = FIELDVALUE
             IMPORTING
                OUTPUT        = FIELDVALUE.
            WINDOW STARTING AT 60 2 ENDING AT 120 25.
            IF SY-LSIND = 1.
            SELECT
                   FROM VBAP
                   INTO TABLE TVBAP
                   WHERE VBELN EQ FIELDVALUE.
            LOOP AT TVBAP.
            TEMP = TEMP + TVBAP-NETPR.
            WRITE :  /2 SY-VLINE, TVBAP-matnr,
                      17 SY-VLINE,TVBAP-VBELN,
                      30 SY-VLINE,TVBAP-NETPR currency 'IN',
                      49 SY-VLINE.
            ENDLOOP.
            ULINE.
            A = SY-LINCT - SY-LINNO - 1.
           SKIP A .
           RESERVE A LINES.
         ENDIF.
            <b>ELSEIF SY-LSIND = 2.
           call transaction 'MM01' .
           ENDIF.</b>
             TOP-OF-PAGE DURING LINE-SELECTION.
              WRITE : /  SY-ULINE,
                      /7 '    DETAIL OF GIVEN SALES ORDER    ' COLOR = 5,
                      /  SY-ULINE,
                      /4 'MATNR',
                      22 'VBELN',
                      35 'NETPR',
                      /  SY-ULINE.
      Regards
    ASHOK
    Message was edited by:
            ASHOK KUMAR

  • Can we create purchase order through report programming?

    hi experts.....
    can we create purchase order through report programming?If yes plz give me the thread details?

    Hi,
    Use this code in a program by using a BAPI function module
    Anothe rway is using classical/ALV report using call transaction from a report for changing the PO
    loop at i_header.
        header-ref_1         = i_header-legacy.
        headerx-ref_1        = c_x.
        header-doc_type      = i_header-bsart.
        headerx-doc_type     = c_x.
        header-comp_code     = i_header-bukrs.
        headerx-comp_code    = c_x.
        header-purch_org     = i_header-ekorg.
        headerx-purch_org    = c_x.
        header-pur_group     = i_header-ekgrp.
        headerx-pur_group    = c_x.
        header-vendor        = i_header-lifnr.
        headerx-vendor       = c_x.
        concatenate i_header-bedat+4(4)
                    i_header-bedat+0(2)
                    i_header-bedat+2(2)
                    into header-doc_date.
        headerx-doc_date     = c_x.
        header-created_by    = i_header-ernam.
        headerx-created_by   = c_x.
        header-currency      = i_header-waers.
        headerx-currency     = c_x.
        concatenate i_header-kdatb+4(4)
                    i_header-kdatb+0(2)
                    i_header-kdatb+2(2)
                    into header-vper_start.
        headerx-vper_start   = c_x.
        loop at i_items where legacy = i_header-legacy.
          item-po_item            =  i_items-ebelp.
          itemx-po_item           =  i_items-ebelp.
          itemx-po_itemx          =  c_x.
          if i_header-bsart = 'NB'.
            item-material            =  i_items-ematn.
            itemx-material           =  c_x.
            schedule-quantity        =  i_items-menge * 1000.
            schedulex-quantity       =  c_x.
          else.
            item-short_text          = i_items-ematn.
            itemx-short_text         = c_x.
            item-matl_group          = '1000'.
            itemx-matl_group         = c_x.
            schedule-quantity        =  '1'.
            schedulex-quantity       =  c_x.
          endif.
          item-plant               =  i_items-werks.
          itemx-plant              =  c_x.
          schedule-po_item         = i_items-ebelp.
          schedule-sched_line      = '1'.
          schedulex-po_item        = i_items-ebelp.
          schedulex-sched_line     = '1'.
          schedulex-po_itemx       = c_x.
          schedulex-sched_linex    = c_x.
          concatenate  i_items-eildt+0(2)
                       i_items-eildt+2(2)
                       i_items-eildt+4(4)
                       into schedule-delivery_date.
          schedulex-delivery_date  =  c_x.
          item-price_unit          =  i_items-peinh * 100.
          itemx-price_unit         =  c_x.
          item-tax_code            =  i_items-mwskz.
          itemx-tax_code           =  c_x.
          item-shipping            =  i_items-evers.
          itemx-shipping           =  c_x.
          account-po_item          = i_items-ebelp.
          accountx-po_item         = i_items-ebelp.
          accountx-po_itemx        = c_x.
          if i_header-bsart = 'FO'.
            item-pckg_no  = sy-tabix.
            itemx-pckg_no = 'X'.
            limits-pckg_no        = sy-tabix.
            limits-limit          = i_items-overalllimit.
            limits-exp_value      = i_items-expectedoverall.
            posrvaccessvalues-pckg_no    = sy-tabix.
            posrvaccessvalues-line_no    = '0'.
            posrvaccessvalues-serno_line = '00'.
            posrvaccessvalues-percentage = '100.0'.
            posrvaccessvalues-serial_no  = '01'.
            account-serial_no     = '1'.
            accountx-serial_no    = '1'.
            accountx-serial_nox   = c_x.
            account-quantity  = '1'.
            accountx-quantity = c_x.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
              exporting
                input  = i_items-kostl
              importing
                output = account-costcenter.
            accountx-costcenter   = c_x.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
              exporting
                input  = i_items-sakto
              importing
                output = account-gl_account.
            accountx-gl_account   = c_x.
            item-acctasscat       = i_items-knttp.
            itemx-acctasscat      = c_x.
            item-item_cat         = i_items-epstp.
            itemx-item_cat        = c_x.
          endif.
          append:item,itemx,schedule,schedulex,account,accountx,limits,posrvaccessvalues.
          clear :item,itemx,schedule,schedulex,account,accountx,limits,posrvaccessvalues.
        endloop.
        call function 'BAPI_PO_CREATE1'
          exporting
            poheader                     = header
            poheaderx                    = headerx
    *   POADDRVENDOR                 =
    *   TESTRUN                      =
    *   MEMORY_UNCOMPLETE            =
    *   MEMORY_COMPLETE              =
    *   POEXPIMPHEADER               =
    *   POEXPIMPHEADERX              =
    *   VERSIONS                     =
    *   NO_MESSAGING                 =
    *   NO_MESSAGE_REQ               =
    *   NO_AUTHORITY                 =
    *   NO_PRICE_FROM_PO             =
            importing
            exppurchaseorder             = ponumber
    *   EXPHEADER                    =
    *   EXPPOEXPIMPHEADER            =
            tables
            return                       = return
            poitem                       = item
            poitemx                      = itemx
    *   POADDRDELIVERY               =
            poschedule                   = schedule
            poschedulex                  = schedulex
            poaccount                    = account
    *   POACCOUNTPROFITSEGMENT       =
            poaccountx                   = accountx
    *   POCONDHEADER                 =
    *   POCONDHEADERX                =
    *   POCOND                       =
    *   POCONDX                      =
            polimits                     = limits
    *   POCONTRACTLIMITS             =
    *   POSERVICES                   =
       posrvaccessvalues            = posrvaccessvalues.
    *   POSERVICESTEXT               =
    *   EXTENSIONIN                  =
    *   EXTENSIONOUT                 =
    *   POEXPIMPITEM                 =
    *   POEXPIMPITEMX                =
    *   POTEXTHEADER                 =
    *   POTEXTITEM                   =
    *   ALLVERSIONS                  =
    *   POPARTNER                    =
        if ponumber eq space.
          loop at return where type = 'E'.
            clear buffer.
            move-corresponding return to e_return.
            concatenate i_header-legacy e_return into buffer.
            transfer buffer to p2_file.
          endloop.
          move-corresponding i_header to i_eheader.
          transfer i_eheader to p3_file.
          loop at i_items where legacy = i_header-legacy.
            move-corresponding i_items to i_eitems.
            transfer i_eitems to p4_file.
          endloop.
        else.
          commit work and wait.
        endif.
        clear:ponumber,header,headerx,item,itemx,account,accountx,limits,return,schedule,schedulex,posrvaccessvalues.
        refresh:item,itemx,account,accountx,limits,return,schedule,schedulex,posrvaccessvalues.
      endloop.
      close dataset p2_file.
      close dataset p3_file.
      close dataset p4_file.
    Regards
    Krishna

  • Calling Forms 6i from Reports 6i. Is this possible. Run Product in Reports

    Re: Calling Forms 6i from Reports 6i. Is this possible?
    Hello,
    I have need programming in Oracle 9.x and using Forms and Reports for about 1.5 years. My ERP application calls a report from a form. I DO NOT have source code for the FORM. But, I DO have source code for the Report. So, from the Report 6i, I would like to call an Oracle Form 6i. Note: Not WEB based. My question is, IS THIS POSSIBLE. I can not find a command like Run Product in Report for calling a Form Application. Can someone please help me. I am under the gun to have this ready in a couple of days. Can I call an Active X Application from Reports..if Oracle Forms DOES NOT WORK. This needs to be a Form Application because of the nature of this request.
    Thank you
    Dennis

    Thank you
    ...the ERP vendor based on a form icon button will call a report. They will pass a TAG_NUMBER from a database record (that they just inserted) to the report. This tag_number will link to other tables and will display the report. The problem is ??..there is additional information that the user needs to scan into the database BEFORE the report runs. This is part of the business work flow.
    I have options.
    1) Get the ERP Vendor to call a FORM based on the name I provide to them.(Not really an option since they are unwilling to make custom mod changes.)
    2) Have the user key into the REPORTS PARM FORM. And I will update the tables...
    3) Call an Active OCX popup FORM from Reports and then update tables. Is this possible from Reports???..I am not sure if I like to introduce ms vb into an oracle application. It just does not seem to be a correct solution/procedure.
    4) Pay the ERP Vendor as a custom mod to make the changes for us. (unlikely because they do not like making custom mod changes)
    5) ....any more ideas/comments please let me know..
    Thank you Again
    Dennis Aubrey

  • How to Call .XDO file From Java Program

    Hi,
    I have developed a report in using BI Publisher version 10.1.3.
    I created the report and it only created XDO files. If I want to call XDO file from Java program how I can do that.
    What are the APIs available to do that.
    Thanks
    -Ashutosh

    Hi,
    the JavaAPI didn't work with the xdo-Files. But you can create a proxy stub for the Web Service API of BI Publisher which uses the xdo's in the repository.
    regards
    Rainer

  • How can i call a zreport from my bsp page.

    Hi friends,
    How can i call a zreport from my bsp page.
    Moosa

    Hi Friend,
    These are the codings  to be wirtten in BSP for transferring values to the REPORT
    DATA:wf_date TYPE ztable-ID.
          data:seltab type standard table of rsparams,
           wa_seltab like line of seltab,
         event TYPE REF TO if_htmlb_data.
    DATA:p_value TYPE REF TO CL_HTMLB_INPUTFIELD.
    event = cl_htmlb_manager=>get_event( runtime->server->request ).
    p_requ ?= CL_HTMLB_MANAGER=>GET_DATA(
                                            request  = runtime->server->request
                                            name     = 'inputField'
                                            id       = 'i1'
    if p_requ is not initial.
      wf_date = p_requ->value.
    endif.
    clear wa_seltab.
    if wf_date is not initial.
      wa_seltab-selname = 'P_REQU'.
      wa_seltab-kind = 'P'.
      wa_seltab-option = 'EQ'.
      wa_seltab-low = wf_date.
      append wa_seltab to seltab.
    endif.
    submit *ZSAMPLEAP1* with selection-table seltab AND RETURN  .(ZSAMPLEAP1 refers to the report name and AND RETURN for coming back to the BSP page after the completion of its operation in Report )
    IMPORT int_name TO int_name FROM MEMORY ID '*zid*'.(For importing the obtained value from Report)
    In Report
    REPORT  ZSAMPLEAP1.
    SELECT-OPTIONS: p_requ FOR ztable-id  NO INTERVALS.
    SELECT SINGLE name from ztable into int_name WHERE id = p_requ-low.
    WRITE:int_name.
        EXPORT int_name TO MEMORY  ID 'zsharmila'.
    With Regards,
    SHARMILA BRINDHA.M

  • Call SXPG _ CALL _ SYSTEM from ABAP program

    Hi,
    Someone may help me?  I need to call the function module SXPG _ CALL _ SYSTEM from ABAP program for to encrypt a file.
    I created the command by SM49 , but I don't know how I can call it from ABAP program.
    Thanks
    Maria C

    Hi Maria.
    This is a possible code you can use:
    DATA: log LIKE TABLE OF btcxpm WITH HEADER LINE.
    Can contain STDOUT, STDERR
    commandname =
    CALL FUNCTION ‘SXPG_CALL_SYSTEM’
    IMPORTING
      COMMANDNAME = commandname
      PARAMETERS = parameters
    EXPORTING
    STATUS = status
      TABLES
      EXEC_PROTOCOL = log
    EXCEPTIONS
      NO_PERMISSION = 1
      COMMAND_NOT_FOUND = 2
      PARAMETERS_TOO_LONG = 3
      SECURITY_RISK = 4
      WRONG_CHECK_CALL_INTERFACE = 5
      PROGRAM_START_ERROR = 6
      PROGRAM_TERMINATION_ERROR = 7
      X_ERROR = 8
      PARAMETER_EXPECTED = 9
      TOO_MANY_PARAMETERS = 10
      ILLEGAL_COMMAND = 11
      OTHERS = 12.
    The following are the comments of the parameters taken from:
    http://help.sap.com/saphelp_40b/helpdata/en/fa/0971ee543b11d1898e0000e8322d00/content.htm
    Parameters
    IMPORTING Parameters
    Parameter name
    Use
    COMMANDNAME
    The name of the definition of the external command, as specified in the maintenance function (transaction SM69).
    PARAMETERS
    Arguments for the external command as specified by the definition in the R/3 System and by the calling program or user.
    These arguments are checked for impermissible characters, such as the ; under UNIX. Problems are registered with the SECURITY_RISK exception.
    EXPORTING Parameters
    Parameter name
    Use
    STATUS
    Returns the final status of the execution of the external command:
    · Value ‘O’: The external command was started and ran to end successfully.
    · Value ‘E’: An error occurred; the external command was not run successfully.
    Tables Parameters
    Parameter name
    Use
    EXEC_PROTOCOL
    Contains the STDOUT and STDERR output of the external command and any output from the target host system.
    Exceptions
    Exception name
    Meaning
    X_ERROR
    Reserved for future use.
    NO_PERMISSION
    The AUTHORITY-CHECK of the user’s authorization for the authorization object S_LOG_COM failed. The user is not authorized to carry out the command named with the specified arguments on the target system.
    COMMAND_NOT_FOUND
    Command name, as identified by COMMANDNAME and OPERATINGSYSTEM, has not been defined in the maintenance function (transaction SM69).
    PARAMETERS_TOO_LONG
    The combined argument string (ADDITIONAL_PARAMETERS and the DEFINED_PARAMETERS, as returned in ALL_PARAMETERS) exceeds the limit of 128 characters in length.
    SECURITY_RISK
    Either:
    · The command contains impermissible characters. These are characters with potentially dangerous properties, such as ; under UNIX.
    · The command definition specifies that an extra-check function module be run. This function module has rejected execution of the command.
    WRONG_CHECK_CALL_
    INTERFACE
    The command definition specifies that an extra-check function module is to be run. Either this function module is missing, or the interface defined for this function module does not match that of the standard R/3 function module SXPG_DUMMY_COMMAND_CHECK. For more information, please see SXPG_DUMMY_COMMAND_CHECK: Interface for Extra-Check Function Modules.
    TOO_MANY_PARAMETERS
    The command definition specifies that user-specified arguments for the external command are not allowed. However, an additional string of command arguments was specified.
    PARAMETER_EXPECTED
    The command definition includes the placeholder character ?, which signifies that additional user-defined arguments are required. However, no additional arguments string was supplied.
    PROGRAM_START_ERROR
    An error occurred while starting the external command. The R/3 system field SY-MSGV1 contains additional information on the problem.
    PROGRAM_TERMINATION_
    ERROR
    An error occurred while trying to obtain the return code of the external program. The R/3 system field SY-MSGV1 contains additional information on the problem.
    ILLEGAL_COMMAND
    The external command definition was modified "illegally". That is, the command was not modified by means of the maintenance function (transaction SM69).
    The modified command is registered in the system log in its substituted form. The message is registered under the system log ID "LC".
    OTHERS
    Catch any new exceptions added to this function module.
    Hope this will be useful.
    Sandro Lombardo

  • Insert records from report program into R3 table

    Hi
    I wanted to insert records from report program into R3 table.
    here is my code
    data : itab type standard table of zemp initial size 10 with header line.
    itab-EMPNO = '012'.
    itab-ENAME = 'XXXX'.
    itab-JOB = 'XXXX'.
    APPEND itab.
    insert ztable from table itab.
    but i am getting the following error
    the type of the data base table and work area/internal table "ITAB" are no unicode-converible.
    how can I insert records from report program into R3 table
    should I have to write move corresponding
    pls guide
    thanks
    manian

    Hi,
    itab-EMPNO = '012'.
    itab-ENAME = 'XXXX'.
    itab-JOB = 'XXXX'.
    APPEND itab.
    insert ztable from table itab.
    Do one thing
    Data : itab type table of ztable with header line.
    itab-EMPNO = '012'.
    itab-ENAME = 'XXXX'.
    itab-JOB = 'XXXX'.
    APPEND itab.
    insert ztable from table itab.
    error will resolve, then try to make structure similar to ZTABLE

  • Can we call multiple Smartforms from single Driver Prog?

    Hi all,
    Can we call multiple smartforms from single Driver Program. Here Driver program is custom Program.
    I want to give Print Parameter only once and output should get printed one after the another smartform in same order of smarforms were called.
    If yes, then how?
    Thanks in advance.

    Yes, you can do this in your Smartform driver program.
    Each time you call you Smartform function module you will need to change the values in structure OUTPUT_OPTIONS slightly.
    On the first call set TDNEWID to X.
    After this, set it to space
    On the last form set TDFINAL to X.
    This will put all of the output into one spool request, in the order they are called in the program.
    Regards,
    Nick

Maybe you are looking for