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

Similar Messages

  • How can we call a transaction from a report?

    hi
    experts can u help me for this

    check this:
      CHECK sy-ucomm = '&IC1'.
    CASE sy-ucomm.
        WHEN 'MATNR'.
          READ TABLE it_final INDEX selfield-tabindex.
          IF sy-subrc EQ 0.
            SET PARAMETER ID 'MAT' FIELD it_final-matnr.
            SET PARAMETER ID 'WRK' FIELD it_final-werks.
            SET PARAMETER ID 'LAG' FIELD it_final-lgort.
            SET PARAMETER ID 'CHA' FIELD it_final-charg.
            CALL TRANSACTION 'MMBE' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
    In this case, if ur report has material code(matnr), plant(werks), storage location(lgort), batch(charg) as the output fields and u click on the material, then it will display the details of that material for the T- code MMBE.
    reward points if useful.
    Message was edited by: anju
            anju sinha

  • 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

  • Can we call another transaction from the Userexit

    Hi all,
            Can we call another transaction from the Userexit?
    Thanks,
    Balaji

    Hi
    Because the statament CALL TRANSACTION triggers the end of the LUW so COMMIT WORK, so you should be sure not to insert that statament while some updating actions are been doing.
    So that exit shouldn't be triggered while updating
    Max

  • Calling SAP transaction from Webi report?

    Hi experts,
    With BI/BW query, we can retrieve data from R/3 source system via report-to-report interface. For instance, from a Purchasing query with data aggregated by Vendor, the user can trigger the R/3 transaction ME2L by clicking on a row.
    Is there a similar feature in BOBJ Webi report? For instance, can we use hyperlink or some other means to do this?
    Any idea will be much appreciated.
    Thanks and regards,
    Linda

    Hi Stratos,
    Really appreciate your advice. Following your suggestion of using blank cell, the server is determined dynamically for the hyperlink.
    However, there're still some issues with defining a hyperlink for table columns. For instance, I have 2 columns in the table - Cost Centre and Cost Element. SAP transactions KS03 and KA03 are to be launched respectively for these 2 columns. The value of the clicked column (Cost Centre, Cost Element) is to be passed to the SAP transaction.
    I've created the following hyperlink for the Cost Centre column:
    http://[[MyServer]]?sap-client=([Client])&sap-language=EN&~transaction=KS03
    with Tool Tip = [[L01 Cost Center Key]]
    The link is not working immediately, so I adjusted the formula as follows via the formula editor (by adding double quotes for <MyServer>):
    ="<a href=\""[[MyServer]]"?sap-client="URLEncode(""[[Client]])"&sap-language=EN&%7Etransaction=KS03\" title=\"\" target=\"_self\" nav=\"web\">"[[L01 Cost Center Key]]+"</a>"
    Clicking the <tick> button does not return any error.
    When I click on the Cost Center column, the SAP transaction is launched successfully. However, there're still a few issues:
    1) The Cost Center Key is not passed to the SAP transaction. Is Tool Tip the way to go?
    2) When checking the hyperlink (via right-click > Hyperlinks > Edit Hyperlink), I found the Tool Tip (L01 Cost Center Key) has disappeared
    3) After I've clicked <OK> to exit the Edit Hyperlink window, I got the error message 'Invalid character '[[MyServer]]' at position 14. (Error: WIS10080)'.
    -- It seems correct syntax in the formula editor is considered invalid in the hyperlink editor.
    Do you mind commenting on what could have caused the above issues?
    Thanks again for your time.
    Linda

  • Can we call standard transaction from bsp

    Hi,
    Can anyone tell me how to call a standard transaction(va01) from bsp.
    Points will be awarded,
    Ugandhar.

    Hello,
    check out this coding in a new bsp page and give it a try in your system landscape. It creates an sap short cut file with the .sap extension writes dynamically to the server cache and get the url back.
    Regards, Bernd
    Layout:
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title="Start SAP GUI Transaction via BSP" >
        <htmlb:form>
          <htmlb:textView text   = "Start SAP GUI Transaction via BSP"
                          design = "header1" />
          <htmlb:textView layout = "paragraph"
                          text   = "Fill in fields and press the button to create the link." />
          <table width=200>
          <tr>
          <td>
          <htmlb:label for  = "client"
                       text = "Client" />
          </td>
          <td>
          <htmlb:inputField id    = "client"
                            value = "<%= client %>" />
          </td>
          </tr>
          <tr>
          <td>
          <htmlb:label for  = "sysid"
                       text = "SystemID" />
          </td>
          <td>
          <htmlb:inputField id    = "sysid"
                            value = "<%= sysid %>" />
          </td>
          </tr>
          <tr>
          <td>
          <htmlb:label for  = "userid"
                       text = "UserID" />
          </td>
          <td>
          <htmlb:inputField id    = "userid"
                            value = "<%= userid %>" />
          </td>
          </tr>
          <tr>
          <td>
          <htmlb:label for  = "transactioncode"
                       text = "Transaction Code" />
          </td>
          <td>
          <htmlb:inputField id    = "transactioncode"
                            value = "<%= transactioncode %>" />
          </td>
          </tr>
          <tr>
          <td colspan="2">
          <htmlb:button id      = "myButton"
                        text    = "Create Link to start SAP Transaction"
                        onClick = "create_mime" />
          </td>
          </tr>
          </table>
          <%
      if display_url is not initial.
          %>
          <htmlb:textView layout = "paragraph"
                          text   = "Click the link to start SAP GUI Transaction." />
          <htmlb:link id        = "mylink"
                      reference = "<%= display_url %>"
                      text      = "Link to Start SAP Transaction" />
          <%
      endif.
          %>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Page Atributes:
    file_content     TYPE     STRING
    guid     TYPE     GUID_32
    host     TYPE     STRING
    isolangu     TYPE     T002-LAISO
    page_name     TYPE     STRING
    parameters     TYPE     TIHTTPNVP
    port     TYPE     STRING
    sapworkdir     TYPE     SDOK_CHTRD
    sysid     TYPE     SYSYSID
    transactioncode     TYPE     TCODE
    userid     TYPE     XUBNAME
    OnInputProcessing:
    * event handler for checking and processing user input and
    * for defining navigation
    * event handler for data retrieval
      event = cl_htmlb_manager=>get_event( runtime->server->request ).
      IF event->name = 'button' AND event->event_type = 'click'.
        button_event ?= event.
        IF button_event->server_event NE 'create_mime'.
          RETURN.
        ENDIF.
    * get users workdir
        CALL FUNCTION 'IW_C_GET_SAPWORKDIR'
          IMPORTING
            sapworkdir = sapworkdir.
    * get iso language
        CALL FUNCTION 'LANGUAGE_CODE_SAP_TO_ISO'
          EXPORTING
            sap_code = sy-langu
          IMPORTING
            iso_code = isolangu.
        CONCATENATE
        '[System]'
        cl_abap_char_utilities=>cr_lf
        'Name='
        sysid
        cl_abap_char_utilities=>cr_lf
        'Description='
        cl_abap_char_utilities=>cr_lf
        'Client='
        client
        cl_abap_char_utilities=>cr_lf
        '[User]'
        cl_abap_char_utilities=>cr_lf
        'Name='
        userid
        cl_abap_char_utilities=>cr_lf
        'Language='
        isolangu
        cl_abap_char_utilities=>cr_lf
        'Password='
        cl_abap_char_utilities=>cr_lf
        '[Function]'
        cl_abap_char_utilities=>cr_lf
        'Title='
        cl_abap_char_utilities=>cr_lf
        'Command='
        transactioncode
        cl_abap_char_utilities=>cr_lf
        '[Configuration]'
        cl_abap_char_utilities=>cr_lf
        'WorkDir='
        sapworkdir
        cl_abap_char_utilities=>cr_lf
        '[Options]'
        cl_abap_char_utilities=>cr_lf
        'Reuse=1'
        INTO file_content.
        CREATE OBJECT cached_response TYPE cl_http_response EXPORTING add_c_msg = 1.
        cached_response->set_cdata( file_content ).
        cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                           value = 'application/octet-stream ' ).
        cached_response->set_status( code = 200 reason = 'OK' ).
        cached_response->server_cache_expire_rel( expires_rel = 180 ).
        CALL FUNCTION 'GUID_CREATE'
          IMPORTING
            ev_guid_32 = guid.
        CONCATENATE guid
                    '.sap'
               INTO page_name.
    * get server information
        CALL METHOD cl_http_ext_webapp=>create_url_for_bsp_application
          EXPORTING
            bsp_application      = runtime->application_url
            bsp_start_page       = page_name
            bsp_start_parameters = parameters
          IMPORTING
            abs_url              = display_url.
        cl_http_server=>server_cache_upload( url      = display_url
                                             response = cached_response ).
      ENDIF.

  • 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

  • Calling a Transaction from Selection screen of Z Program...

    Hi,
    I am trying to call a Standard transaction from a report when they clicked one push button on selection screen.
    when i used CALL TRANSACTION 'MM01'. When i press save after entering the values in MM01, it is saving and coming out to selection screen of my Z program.
    But my question is when they press in BACK button in MM01 then only it should come out from MM01 and it should display the my Z Program selection screen. suppose if they press SAVE button on MM01 it should save and screen should be MM01 only.
    when i used LEAVE TO TRANSACTION 'MM01'. it is working fine but when i press BACK button from MM01 it is coming out and showing SAP EASY ACCESS screen. My requirement is when i press back button in MM01 then it must come to my Z program selection screen only.
    I hope it is clear.
    Regards,
    Sunny

    >
    sunny_143 wrote:
    > Hi,
    >
    > I am trying to call a Standard transaction from a report when they clicked one push button on selection screen.
    >
    > when i used CALL TRANSACTION 'MM01'. When i press save after entering the values in MM01, it is saving and coming out to selection screen of my Z program.
    >
    > But my question is when they press in BACK button in MM01 then only it should come out from MM01 and it should display the my Z Program selection screen. suppose if they press SAVE button on MM01 it should save and screen should be MM01 only.
    >
    >
    > when i used LEAVE TO TRANSACTION 'MM01'. it is working fine but when i press BACK button from MM01 it is coming out and showing SAP EASY ACCESS screen. My requirement is when i press back button in MM01 then it must come to my Z program selection screen only.
    >
    > I hope it is clear.
    >
    > Regards,
    > Sunny
    I'm not clear about what happens when you press the BACK button.
    First, LEAVE TO TRANSACTION is no help.  That ends your Z program.  CALL TRANSACTION is your only option.  If it doesn't work as you'd like, you're a bit stuck, as MMnn are standard SAP transactions, and you can't modify that. (well, you can, but that's a whole other tin of worms). 
    Perhaps if you told us what you're trying to achieve with the Z program, there might be another approach that will do that.
    matt

  • How to call a package from the Report in Oracle Application Express

    How to call a package from the Report in Oracle Application Express

    Hello,
    What do you mean? Something like SELECT mypackage.function( par1, par2) from dual?
    Or do you want to execute a procedure when something happens on the page, like clicking a button?
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • 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

  • Possible to call a transaction from a planning book using a macro button?

    Hi All,
    Is it somehow possible to call a transaction using a macro button in the planning book? Also, the current selection should be passed as input parameters to the transaction.
    In my example, I am trying to run the transaction /SAPAPO/MC90 - Release to Supply Network Planning from the Demand Planning  Planning Book/Data View. This way if planners need to change forecasts mid month for specific selections, they can easily transfer to SNP without having to go out of interactive planning.
    Thank you,
    Maria

    Hello Maria,
              It's possible to call a transaction from a planning book using a macro button.
    What you can do is ..... Create a function module and inside it use the command "Call Transaction Tcode"  (ABAPer can do this) to call ur specific transaction. And this module can in turn be called from your macro. Please find the below link which explanis how to call a function module from a macro. Do let me know if you need more information on this.
    Calling a function module from APO Macro
    Regards,
    Siva.

  • Calling SAP Transaction from BSP

    I wonder whether it is possible to call SAP transaction from BSP application and pass to it some data; e.g., PO# when calling VA02?
    The called transaction could appear in a separate MS IE Window (like in some Portal applications) or in SAP GUI.
    Any help will be appreciated.
    Thank you in advance

    I have launched the Java SAPGui from BSP pages before.  I used SNC so that the users were logged on via Single Sign On.  I store the Java Gui in the Mime directory.  You can force the startup transaction.  Theorectically you could also Gui Scripting to try and control the Gui and force in the default value for your PO field.  I have not tried that however.  You will probably want to check the Service Marketplace for documents on the Gui Scripting.  The following is the code from my BSP page to launch the Java Gui in the Browser as an applet:
    <%@page language="abap"%>
    <%@extension name="htmlb" prefix="htmlb"%>
    <HTML>
    <HEAD>
      <TITLE>SAPGUI for the Java Environment</TITLE>
      <STYLE type="text/css">
          body { margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0px; }
      </STYLE>
    </HEAD>
    <BODY scroll="no">
    <SCRIPT language="JavaScript">
    // user configurable part starts here
    var pluginurl         = '';
    var scriptable     = 'true';
    var codebase         = '.';
    var jnlp           = 'platin.jnlp';
    var keepalive      = 'true';
    var frog           = 'true';
    var trace          = '';
    var tracefile      = '';
    var connectionData = 'conn=/M/nts163/S/3620/G/SPACE/&tran=SE80&clnt=088&fast=true&sncon=true&sncname=p:[email protected]&sncqop=9';
    // user configurable part ends here
    // verify if Java Plugin as control in Internet Explorer or Java Plugin for Netscape or native JRE of browser must be used
    var jre = 'control';
    if(navigator.platform.indexOf("Mac") > -1)
       jre = 'native';
    else if (navigator.appName.indexOf("Netscape") != -1)
       jre = 'plugin';
    document.open();
    switch (jre)
    case 'control':
        document.writeln('<OBJECT CLASSID  = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"                               ');
        document.writeln('    ID       = "PlatinGUI"                                                                    ');
        document.writeln('    CODEBASE = "j2re-1_3_1_02-win-i.exe#Version=1,3,1,0"                             ');
        document.writeln('    WIDTH    = "100%"                                                 ');
        document.writeln('    HEIGHT   = "100%"                                                 ');
        document.writeln('    BORDER   = 0>                                                      ');
        document.writeln('<PARAM NAME = "TYPE"           VALUE = "application/x-java-applet;jpi-version=1.3.1">         ');
        document.writeln('<PARAM NAME = "SCRIPTABLE"     VALUE = "', scriptable,'">                                ');
        document.writeln('<PARAM NAME = "code"           VALUE = "com.sap.platin.GuiApplet2">                   ');
        document.writeln('<PARAM NAME = "codebase"       VALUE = "', codebase,'">                             ');
        document.writeln('<PARAM NAME = "jnlp"           VALUE = "', jnlp,'">                             ');
        document.writeln('<PARAM NAME = "archive"        VALUE = "GuiStartS.jar">                             ');
        document.writeln('<PARAM NAME = "keepalive"      VALUE = "', keepalive,'">                             ');
        document.writeln('<PARAM NAME = "frog"           VALUE = "', frog,'">                             ');
        document.writeln('<PARAM NAME = "trace"          VALUE = "', trace,'">                             ');
        document.writeln('<PARAM NAME = "tracefile"      VALUE = "', tracefile,'">        ');
        document.writeln('<PARAM NAME = "connectionData" VALUE = "', connectionData,'">                               ');
        document.writeln('                                                                ');
        document.writeln('This page requires a Sun Java Plugin 1.3 and a SAPGUI for Java to view.                      ');
        document.writeln('                                                                ');
        document.writeln('</OBJECT>                                                           ');
        break;
    case 'plugin':
        document.writeln('<EMBED TYPE        = "application/x-java-applet;version=1.3"                         ');
        document.writeln('    PLUGINURL      = "', pluginurl,'"                                          ');     
        document.writeln('    WIDTH          = "100%"                                            ');                                        
        document.writeln('    HEIGHT         = "100%"                                             ');
        document.writeln('    ALIGN          = "BASELINE"                                                ');
        document.writeln('    code           = "com.sap.platin.GuiApplet2"                                      ');
        document.writeln('    codebase       = "', codebase,'"                                        ');
        document.writeln('    jnlp           = "', jnlp,'"                                                ');
        document.writeln('    archive        = "GuiStartS.jar"                                       ');
        document.writeln('    keepalive      = "', keepalive,'"                                       ');
        document.writeln('    frog           = "', frog,'"                                            ');
        document.writeln('    trace          = "', trace,'"                                            ');
        document.writeln('    tracefile      = "', tracefile,'"                                       ');
        document.writeln('    connectionData = "', connectionData,'"                                        ');
        document.writeln(' <NOEMBED>                                                      ');
        document.writeln(' </NOEMBED>                                                      ');
        document.writeln(' </EMBED>                                                              ');
        break;
    case 'native':
        document.writeln('<APPLET CODEBASE  = "', codebase,'"                                                           ');
        document.writeln('        ARCHIVE   = "GuiStartS.jar"                                                           ');
        document.writeln('        CODE      = "com.sap.platin.GuiApplet2"                                               ');
        document.writeln('        WIDTH     = "100%"                                                                    ');
        document.writeln('        HEIGHT    = "100%">                                                                   ');
        document.writeln('<PARAM NAME = "SCRIPTABLE"     VALUE = "', scriptable, '">                                    ');
        document.writeln('<PARAM NAME = "jnlp"           VALUE = "', jnlp, '">                                          ');
        document.writeln('<PARAM NAME = "keepalive"      VALUE = "', keepalive, '">                                     ');
        document.writeln('<PARAM NAME = "frog"           VALUE = "', frog, '">                                          ');
        document.writeln('<PARAM NAME = "trace"          VALUE = "', trace, '">                                         ');
        document.writeln('<PARAM NAME = "tracefile"      VALUE = "', tracefile, '">                                     ');
        document.writeln('<PARAM NAME = "connectionData" VALUE = "', connectionData, '">                                ');
        document.writeln('</APPLET>                                                                                ');
        break;
    document.close();
    </SCRIPT>
    </BODY>
    </HTML>

  • How to call a Workflow from a Report in SE38?

    How to call a Workflow from a Report in SE38?
    Please can Anyone Send me a Source code (with Explanation)which I can use for calling Workflow >> WS99900253?
    Regards,
    Shashank.

    you can use FM
    SAP_WAPI_CREATE_EVENT
    SWE_EVENT_CREATE
    OR
    SAP_WAPI_START_WORKFLOW
    Regarding usge of this FMS search the forums you will get ample examples.
    Thanks
    Arghadip

  • Call sap transaction from java

    can anyone tell me how to call SAP transaction from JCO,
    cheers
    Ajay

    Hi Ajay,
    You should find or create functional module which covers your requrements.
    Best regards, Maksim Rashchynski.

  • How can i call a servlet from a servlet ?

    Hello,
    Can i call a Servlet from within a Servlet ?
    and is it "right thing" to Do ?
    Thanks

    JMO, but I wouldn't do it like this.
    Don't have a remote object like a servlet doing database queries for your app. That will mean TWO network hops for every query if the database resides on another machine. The network is the biggest bottleneck you've got.
    Write a JavaBean that does the database stuff for you and just have the first servlet instantiate it when it needs it. A Bean has a better chance of being reused, too. Write a TableGateway or DAO for your object.
    Or write an EJB to do it.
    The only time I've done a servlet-to-servlet connection like that was for one servlet running in a DMZ that would authenticate a user and then forward the request to another servlet running inside the second firewall.
    I wouldn't encapsulate database query logic in a servlet like that. JMO - MOD

Maybe you are looking for

  • Why does iTunes Match keep getting stuck on Step 1?

    I realise there are already countless threads on here from people with the same problem but none of them seem to be able to help me. I've recently renewed my iTunes Match subscription after many months but it keeps getting stuck nearly halfway throug

  • JCo Server does not start

    Hi, I'm trying to create and start a JCoIDoc.Server on a Web Application Server 700 system. Because I could not find the required classes in the trfc.jar archive on the server I downloaded and packaged the required java connector classes sapidoc.jar

  • GN_GENERATE_CHECK and SM_SERVICE_CONTENT_UPDATE background jobs are failing

    We recently upgraded our Solution Manager to 7 ehp1.  A couple of the background jobs are not able to complete. Both jobs have the following entry in the job logs Step 001 started (program RAGS_DSWP_SERV_CONTENT_UPDATE, variant , user ID SOLMAN_ADMIN

  • I just downloaded the trial version of cloud tools. Photoshop has no menu items

    Allows me to import a picture but there are no tool items to crop, modify etc. Please let me know if I need to download another one of the packages that's included on the list or if this is how the trial software is supposed to be. Thanks.

  • C2-00: Can't watch online videos

    Why i cant watch online videos in c2-00 Moderator's note: We have amended the title of this post as this was moved from another thread.