Row Grouping in Excel through ABAP OLE

Hi Experts,
I am downloading some ALV report output using OLE with different formatting. The downloaded file has to show data
in the grouping format.
For example;
Interanl table contains fields : Customer Number and sales Order, Amount,
Customer Number sales Order Amount
1000                     120000001   3000.30
1000                     120000002   3400.00
1001                     122000001   2000.00
1001                     122000002   3440.00
After it downloaded the Excel should contains only two line(by dfaultt)
+    1000                120000001  3000.30
+    1001                 122000001 2000.00
When you click on symbol(+)  then hidden rows will shown.
We can do it in Excel by using Group. Just select few rows(row number 1 to 5) and then go to
DATA->GROUP AND OUTLINE->GROUP.
Then u will see one line for the selected rows.
Can anybody tell me how to achieve it through OLE in ABAP. Your inputs are highly needed for me. Thank you so mush!
Regards,
Meera.

We can do it,  Can anybody tell me OLE Mehod which should I use in the reprot?

Similar Messages

  • Invoking Openoffice calc through ABAP OLE Object

    I want to show the output of my ABAP process  through openoffice calc worksheet.
    I tried to invoke calc using ABAP OLE object.
    But even a blank calc sheet is not getting opened with the following statements.
    Type-pools: OLE2.
    TYPES:
    service_manager type OLE2_OBJECT,
    DESKTOP type OLE2_OBJECT,
    DOCUMENT type OLE2_OBJECT.
    CREATE OBJECT service_manager 'com.sun.star.ServiceManager'.
    CALL METHOD OF SERVICE_MANAGER 'createInstance' = DESKTOP
    EXPORTING #1 = 'com.sun.star.frame.Desktop'.
    CALL METHOD OF DESKTOP 'loadComponentFromURL' = DOCUMENT
    EXPORTING #1 = 'private:factory/scalc'
              #2 = '_blank'
              #3 = 0
              #4 = '' .
    What is wrong with this code?. Is there any other setting required at the system/OS/ABAP/BASIS
    level to invoke openoffice applications?.
    I have registered the classid for openservice manager in the transaction SOLE. Still it is not working.
    Iam able to invoke openoffice applications with Visual Basic/Power builder lanaguages.
    Please respond.
    Thanks in advance
    Liju

    I don't think it's possible.
    4th parameter of loadComponentFromURL method is an array ( http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html )
    Arrays are not supported as parameters in ABAP OLE Automation. (see note [633105|https://service.sap.com/sap/support/notes/633105] - OLE automation: ABAP type for OLE array parameters )

  • Creating Excel Using OLE through ABAP

    Hi Experts,
    Can anyone help me in running an abap program to give an Excel file using OLE..
    Regards,
    Seshadri

    Hi Seshadri,
          Here is ur expected coding...
    REPORT ZCREATEEXCEL.
    TYPE-POOLS OLE2.
    DATA: EXCEL     TYPE OLE2_OBJECT,
          WORKBOOKS TYPE OLE2_OBJECT,
          WORKBOOK  TYPE OLE2_OBJECT.
    DATA: FILENAME LIKE RLGRAP-FILENAME.
    START THE EXCEL APPLICATION
      CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.
      PERFORM ERR_HDL.
    PUT EXCEL IN FRONT
      SET PROPERTY OF EXCEL  'VISIBLE' = 1.
      PERFORM ERR_HDL.
    INFORM USER OF THE CURRENT STATUS
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
           EXPORTING
                PERCENTAGE = 0
                TEXT       = TEXT-I08
           EXCEPTIONS
                OTHERS     = 1.
    CREATE AN EXCEL WORKBOOK OBJECT
      CALL METHOD OF EXCEL 'WORKBOOKS' = WORKBOOKS.
      PERFORM ERR_HDL.
      CALL METHOD OF WORKBOOKS 'ADD' = WORKBOOK.
      PERFORM ERR_HDL.
    EXCEL FILENAME
      CONCATENATE SY-REPID '_' SY-DATUM6(2) '_' SY-DATUM4(2) '_'
                  SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
      CALL METHOD OF WORKBOOK 'SAVEAS' EXPORTING #1 = FILENAME.
      FORM ERR_HDL.
      IF SY-SUBRC <> 0.
        WRITE: / 'OLE ERROR: RETURN CODE ='(I10), SY-SUBRC.
        STOP.
      ENDIF.
    ENDFORM.
    hope it helps..

  • Is there any way to insert a sharp into excel through OLE?

    Dear Expert,
    Is there any way to insert a sharp into excel through OLE ?If have , Would you please give a sample code?
    BR Edward

    Hi,
    Check this link..[OLE2, Excel, WinWord |http://translate.google.com/translate?hl=en&sl=ru&u=http://www.sapnet.ru/] you can find the code snippets.

  • Excel from abap using OLE, trying to make an excel cell-property currency

    Hello everyone,
    I have build an abap application which generates a price list as a MS Excel file using OLE techniques (ole2incl).
    One small thing in the excel file is lacking and I hope some one can help me out:
    I want to give certain cells in excel the "cell property - currency", so that excel shows the amounts as currency values. 
    Has anyone done or seen that before?
    Thanks a lot in advance.
    Kind regard, Archie Oomen

    Hi,
    I am having a similiar problem trying to fix the CELL format as TEXT.
    No matter how I try, it often ends up as 'GENERAL.
    Have you resolved your issue?
    Prehaps, you could share it if you had already rectify your problem.
    Thanks a lot

  • Error in using ABAP OLE wrong cell value

    Dear All..
    I'm facing a problem while using ABAP OLE..
    the problem is the ABAP OLE writes the wrong value in Excel file
    the value is 121.000 but it written in Excel file : 121
    the weird thing is .. other value of  9.000.000 written correctly in Excel File .. and also lots of other values..
    i've trace the value until it goes to the method of :
    CALL METHOD OF h_excel 'Cells' = h_zl
         EXPORTING
           #1 = i_row
           #2 = i_col.
       SET PROPERTY OF h_zl 'Value' = i_value.
       GET PROPERTY OF h_zl 'Font' = h_f.
       IF i_bold = 'X'.
         SET PROPERTY OF h_f 'Bold' = 1.
       ENDIF.
       and the values of variable i_value is still correct which is : 121.000 but after writing in excel it becomes 121
       i believe it will become faulty at the specific amount with format of XXX.000  because if I changed the value to 121.001 it displays correctly in Excel file..
    i_value is a pass value from variable ld_val with data type of is --> ld_val(20) type n.
    is this are originally bugs from the OLE ? how to solved it ?
    please advice ..

    yes it is clear, but how excel manage the passed data is unclear.
    However, to solve you can try this:
    DATA : ld_val(20).
    WRITE value1 TO ld_val CURRENCY CURR.
    REPLACE ALL OCCURRENCES OF '.' IN ld_val WITH space.
    CALL METHOD OF h_excel 'Cells' = h_zl
         EXPORTING
         #1 = i_row
         #2 = i_col.
       SET PROPERTY OF h_zl 'Value' = ld_val.
       GET PROPERTY OF h_zl 'Font' = h_f.
       IF i_bold = 'X'.
         SET PROPERTY OF h_f 'Bold' = 1.
       ENDIF.
    Regards,
    Angelo.

  • How do you freeze the tablix header row in an Excel export file in SSRS 2008?

    So this is totally killing me.
    I've found out how to make a tablix header row repeat on each page of a PDF export file in SSRS 2008 (which I won't even get started on because all I can say is that 2005 is way better), but I cannot figure out how to make a simple header row of a tablix
    freeze in an Excel export file.  The tablix is right at the top of the body and spans the entire width of the design area.  How in the world do you get it to freeze in the Excel export file?

    Rashiki777,
    From your information, I get that you want to freeze the tablix header when view the report in Excel. Please follows
    these steps:
     Click
    the header row
    Click
    View menu on  top of the toolbar, then you will Freeze Panes
    Select one kind of Freeze based on your requirement.
    This link supplies the detailed steps
    http://inpics.net/tutorials/excel2007/vis5.html If you have any concern, please feel free to ask.
    Of course,
    you could utilize the list control to display a certain rows on one sheet, then every sheet in Excel will have one header, the steps are following:
    Drag a list into report body, right-click
    Details in Row Groups panel to select Group Properties….
    Click
    Add button, then type in expression =ceiling(RowNumber(nothing)/25)
    in the textbox Note: 25 is just 25 rows per page, you could reset this value based on your requirement.
    Drag the table control into this list control.
    If you want to display every page in every sheet, you could add a page break to the table control in the list.
    Best regards,
    Challen Fu

  • Export Custom List into Excel through custom Ribbon

    Hi i have a requirement, in that i need to export custom list into EXCEL through custom Ribbon. For Example in my list, i have Col1, Col2, Col3. Col3 has multiple values (allow mutiple values) and when export this into excel all values in Col3 should
    come as new rows and rest of the column values should duplicate. please helpout from this requirement.
    List View
    Col1   Col2      Col3
    v1        v2    v31,v32,v33
    Excel View
    Col1  Col2  Col3
    v1      v2      v31
    v1      v2      v32
    v1      v2      v33
    Nihath

    Hello Nihath,
    As per your description, you have to read each and every items in list with column value then only you can generate excel. There is direct way to export datatable to excel but in your case you will also need to iterate Col3 value to create new row in excel.
    I would suggest to use CAML query to get all items then check Col3 value. If there are multiple value then add them as new datatable row and finally export full datatable to excel.
    Here is link for CAML:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spquery.listitemcollectionposition.aspx
    Export datatable to excel:
    http://stackoverflow.com/questions/12533626/export-datatable-to-excel
    Finally add this feature in ribbon:
    http://ankurmadaan.blogspot.in/2012/10/custom-ribbon-action-for-specific-list.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • ABAP & OLE Automation Controller

    Hi everybody,
    When I use ABAP & OLE Automation Controller to build a Excel file, I don't find a documentation about the values of the properties parameters.
    For example:
    (DATA gs_cell TYPE ole2_object.)
    SET PROPERTY OF gs_cell  'HorizontalAlignment' = -4108 .
    I found in Visual Basic Editor all properties of the OLE objects. But the number -4108 remains a mystery for me.
    Where can we find this value ?
    I tried to read the official Microsoft and ABAP documentation without success.
    Can you help me ?
    I thank you in advance.
    Patrocle

    Hi,
    I use http://msdn.microsoft.com/en-us/library/ms262200.aspx site
    In the documentation for Range.HorizontalAlignment You can find it uses XlHAlign:
    http://msdn.microsoft.com/en-us/library/bb241313(v=office.12).aspx
    Name                    Value     Description
    xlHAlignCenter               -4108     Center.
    xlHAlignCenterAcrossSelection         7     Center across selection.
    xlHAlignDistributed          -4117     Distribute.
    xlHAlignFill                   5     Fill.
    xlHAlignGeneral                   1     Align according to data type.
    xlHAlignJustify               -4130     Justify.
    xlHAlignLeft               -4131     Left.
    xlHAlignRight               -4152     Right.
    Regards,
    Przemysław

  • Embedding external application in SAP through ABAP

    Hi All,
    I wanted to know that can we embed external application in a subscreen through ABAP.
    Thanks in advance,
    Points to helpful replies.
    Regards,
    Bharat Mistry.

    Hi Bharat,
    SAP did a lot in Terma of integration of programs running on the frontend. They have some intefaces with SAP office; I'm not too familar with them.
    What you want, is connected to the subject "Desktop Office Integration (BC-CI)".
    See the link
    http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
    for more information on this.
    SAP propvides a good pdf explaining a lot. You can find at help.sap.com; foro Additional Information->Print Files->SAP R/3 Release 4.6C->English->PDF Index->Desktop Office Integration (BC-CI): data/pdf/BCCIOFFI/BCCIOFFI.pdf
    This is not the latest version because SAP does not provide the new documentation in the form of print files, but it is good.
    Yo could have your Excel running in a subscreen will full data connection to the ABAP program. Any many tgings more.
    Depends on what you want and what you need.
    Regrads,
    Clemens

  • Bold data of a excel through forms 6i

    I can send data into excel through forms 6i using DDE.POKE command. But I can not bold the data of a row.
    Pls help me ASAP.

    Hi!
    I have a same problem, please if you found the solution email me ([email protected])...
    Thanks!!
    René

  • Creating a chart using ABAP OLE

    Hi all,
    I have a requirement to
    1) Output data from an internal table into excel, and
    2) Create a chart from the data in excel
    The ABAP program is driving the creation of the chart in excel.
    So far I have been able to export the data using OLE calls, created a chart object,.
    My question:
    1. How to put Data Lables
    2. How to put Data Table under the Chart
    3. How to rename the series names
    Below is the recorded Macro. I don't know how to convert it to ABAP.
    Sub Macro1()
    ActiveSheet.Shapes.AddChart.Select
    ActiveChart.ChartType = xlColumnClustered
    Application.CutCopyMode = False
    ActiveChart.SetSourceData Source:=Range("B1:E4")
    ActiveChart.SeriesCollection(1).Name = "=Sheet2!$A$2"
    ActiveChart.SeriesCollection(2).Name = "=Sheet2!$A$3"
    ActeChart.SeriesCollection(3).Name = "=Sheet2!$A$4"
    ActiveChart.SetElement (msoElementDataLabelOutSideEnd)
    ActiveChart.SetElement (msoElementDataTableWithLegendKeys)
    End Sub
    I have attached the current output and expected output.
    I have searched about this in google but i could not find any solution for this.
    Your help is greatly appreciated.
    Thanks,
    Lakshmi.

    To my knowledge, charts are only available for work item queries in TFS web access. If you want to generate test result charts, you can do that using the TFS reporting data in the data warehouse (if your administrator configured it when setting up TFS).
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Regading Excel Creation using OLE

    hi friends,
    i got a new requirement where i have to create the Excel document using OLE. one more thing is some cells has to be filled with some colour and in some cells the text has to come in Vertical manner, this text is used for Header purpose.
    please help me urgently...
    Suitable Answers will get more points..........

    Hello,
    Also take a look at this code
    *& Report  ZKRIS_OLE3_PALETTE
    *& Displays the full OLE color range in excel
    REPORT  ZKRIS_OLE3_PALETTE.
    TYPE-POOLS ole2 .
    DATA:  count TYPE i,
           count_real TYPE i,
           application TYPE ole2_object,
           workbook TYPE ole2_object,
           excel     TYPE ole2_object,
           sheet TYPE ole2_object,
           cells TYPE ole2_object.
    CONSTANTS: row_max TYPE i VALUE 256. " change to 16384 for excel 2007
    DATA index TYPE i.
    DATA:
          h_cell        TYPE ole2_object,        " cell
          h_f           TYPE ole2_object,        " font
          h_int         TYPE ole2_object,
          h_width       TYPE ole2_object,
          h_columns     TYPE ole2_object,
          h_rows        TYPE ole2_object,
          h_font        TYPE ole2_object,
          h_entirecol   TYPE ole2_object.
    DATA: h_range       TYPE ole2_object.
    DATA: h_merge       TYPE ole2_object.
    CREATE OBJECT excel 'EXCEL.APPLICATION'.
    IF sy-subrc NE 0.
      WRITE: / 'No EXCEL creation possible'.
      STOP.
    ENDIF.
    SET PROPERTY OF excel 'DisplayAlerts' = 0.
    CALL METHOD OF excel 'WORKBOOKS' = workbook .
    SET PROPERTY OF excel 'VISIBLE' = 1.
    * creating workbook
    SET PROPERTY OF excel 'SheetsInNewWorkbook' = 1.
    CALL METHOD OF workbook 'ADD'.
    CALL METHOD OF excel 'WORKSHEETS' = sheet
      EXPORTING
        #1 = 1.
    SET PROPERTY OF sheet 'NAME' = 'Color Palette'.
    CALL METHOD OF sheet 'ACTIVATE'.
    DATA: col TYPE i VALUE 1,
    row TYPE i VALUE 2,
    col1 TYPE i VALUE 2,
    col_real TYPE i VALUE 1.
    row = 1.
    col = 3.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'No.'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Background'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with white background'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with black background'.
    CALL METHOD OF excel 'Rows' = h_rows
      EXPORTING
        #1 = '2:2'.
    SET PROPERTY OF h_rows 'WrapText' = 1.
    col = 9.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'No.'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Background'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with white background'.
    SET PROPERTY OF h_cell 'Bold' = 1.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with black background'.
    CALL METHOD OF excel 'Rows' = h_rows
      EXPORTING
        #1 = '1:1'.
    SET PROPERTY OF h_rows 'WrapText' = 1.
    GET PROPERTY OF h_rows 'Font' = h_font.
    SET PROPERTY OF h_font 'Bold' = 1.
    count = 1.
    count_real = count.
    row = 2.
    col = 3.
    DO 56 TIMES.
      PERFORM write_num_and_color.
    ENDDO.
    * autofit
    CALL METHOD OF excel 'Columns' = h_columns
      EXPORTING
        #1 = 'C:L'.
    GET PROPERTY OF h_columns 'EntireColumn' = h_entirecol.
    SET PROPERTY OF h_entirecol 'Autofit' = 1.
    * write palette on lhs
    *range
    CALL METHOD OF excel 'Range' = h_range
      EXPORTING
        #1 = 'A2'
        #2 = 'A20'.
    CALL METHOD OF h_range 'Merge' = h_merge .
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = 2
        #2 = 1.
    SET PROPERTY OF h_cell 'Value' = 'Palette'.
    SET PROPERTY OF h_cell 'Orientation' = 90.         "angled.
    SET PROPERTY OF h_cell 'HorizontalAlignment' = 3.  "center align
    GET PROPERTY OF h_cell 'Font'    = h_f.
    SET PROPERTY OF h_f 'Bold' = 1.                    "bold
    SET PROPERTY OF h_f 'Name' = 'Comic Sans MS'.
    SET PROPERTY OF h_f 'Size' = '14'.
    SET PROPERTY OF h_cell 'VerticalAlignment' = 2.  "center align
    * autofit
    CALL METHOD OF excel 'Columns' = h_columns
      EXPORTING
        #1 = 'A:A'.
    GET PROPERTY OF h_columns 'EntireColumn' = h_entirecol.
    SET PROPERTY OF h_columns 'ColumnWidth' = 4.
    *&      Form  write_num_and_color
    *       text
    FORM write_num_and_color.
      index = row_max * ( row - 1 ) + col.
      CALL METHOD OF sheet 'Cells' = cells
        EXPORTING
          #1 = index.
      SET PROPERTY OF cells 'Value' = count_real.
      col = col + 1.
      CALL METHOD OF excel 'Cells' = h_cell
        EXPORTING
          #1 = row
          #2 = col.
      GET PROPERTY OF h_cell 'Interior'   = h_int.
      SET PROPERTY OF h_int  'ColorIndex' = count_real.
      col = col + 1.
      CALL METHOD OF excel 'Cells' = h_cell
        EXPORTING
          #1 = row
          #2 = col.
      SET PROPERTY OF h_cell 'Value' = 'Sample Text'.
      GET PROPERTY OF h_cell 'Font'    = h_f.
      SET PROPERTY OF h_f 'ColorIndex' = count_real.
      col = col + 1.
      CALL METHOD OF excel 'Cells' = h_cell
        EXPORTING
          #1 = row
          #2 = col.
      GET PROPERTY OF h_cell 'Interior'   = h_int.
      SET PROPERTY OF h_int  'ColorIndex' = 1.
      SET PROPERTY OF h_cell 'Value' = 'Sample Text'.
      GET PROPERTY OF h_cell 'Font'    = h_f.
      SET PROPERTY OF h_f 'ColorIndex' = count_real.
      row = row + 1.
      col = col - 3.
      count = count + 1.
      IF count = 29.
        count = 1.
        row = 2.
        col = col + 6.
      ENDIF.
      count_real = count_real + 1.
    ENDFORM.                    "write_num_and_color

  • Calculate percentage between two rows in a matrix report with a single row group in SSRS 2008

    I need your help. I have a matrix report in ssrs 2008. The report contain one field value column and one value column. I need to calculate a percentage for two values. For example : row 1 : Discount 10 Row 2 : Sales 100 Result : 10/100. I have only one
    row group, I need to have a condition where Field = Discount % on Revenue then Discount/Total Turnover. Because of the  grouping for total, I am not being able to calculate the %, its just totalling the % discount. Kindly refer to the snapshot of the
    report.

    Hi Thanks a lot for your answer, but unfortunately it didn't work,the report is reading from a stored procedure which I have unpivot to convert all columns into rows, so that's why Discount % on Revenue, Discount and Total Turnover is found in one column.
    So the Field!Col.Value is the Discount % on Revenue, Discount and Total Turnover. I have tried to change the code to
    "=SUM(IIF(Fields!Col.Value = "Discount",Fields!value.Value),0))
    /IIF(SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)) = 0 ,
    Nothing,SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)))" but to no avail. Any other suggestion will be most welcome.
    Thanks.
    If everything you're getting from stored procedure then you need to calculate and bring the value from there itself.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Creation of IDOC through abap program.

    hello all,
    I hav created idoc through abap program. I hav used FM 'Master_idoc _distrribute'.this program creates an idoc but giving status 30. can any one tell me how to get status 03. I hav already created port, Logical sys,partner no.,distribution model.
    My Program is as follows:
    ABLES : CRMD_ORDERADM_I,CRMD_ORDERADM_H,CRMD_SCHEDLIN.
    DATA : S_CTRL_REC LIKE EDIDC OCCURS 0 WITH HEADER LINE,"Idoc Control Record
           ORDER_NO TYPE CRMT_OBJECT_ID VALUE '5000000032'," SEGMENT ORDER DATA
           PRODUCT TYPE CRMT_ORDERED_PROD VALUE 'SRV_01',
           QUANTITY TYPE CRMT_SCHEDLIN_QUAN VALUE '1.000'.
    DATA : ZORDER LIKE ZORDER_NUM OCCURS 0 WITH HEADER LINE.
    DATA :  T_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE.     "Data Records
    DATA :  T_COMM_IDOC LIKE EDIDC OCCURS 0 WITH HEADER LINE. "Generated Communication IDOc
    CONSTANTS :
    C_ZRZSEG1 LIKE EDIDD-SEGNAM VALUE 'ZORDER_NUM'.
    PARAMETERS :  C_MESTYP LIKE EDIDC-MESTYP DEFAULT 'ZORDER_IDOC2', "Message Type
                  C_RCVPRT LIKE EDIDC-RCVPRT DEFAULT 'LS',          "Partner type of receiver
                  C_LOGSYS LIKE EDIDC-RCVPRN DEFAULT 'BSNL_OUT',
                  C_RCVPOR LIKE EDIDC-RCVPOR DEFAULT 'A000000006',
                  C_SNDPOR LIKE EDIDC-SNDPOR DEFAULT 'SAPBCD0000',
                  C_SNDPRN LIKE EDIDC-SNDPRN DEFAULT 'BCDCLNT100',
                  C_IDOCTP LIKE EDIDC-IDOCTP DEFAULT 'ZORDER2',
                  C_SNDPRT LIKE EDIDC-SNDPRT DEFAULT 'LS'.          "Destination System
    ***START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM GENERATE_CONTROL_RECORD.
      PERFORM SEND_IDOC.
    *&      Form  generate_control_record
    FORM GENERATE_CONTROL_RECORD .
      S_CTRL_REC-RCVPOR = C_RCVPOR. "Receiver Port
      S_CTRL_REC-MESTYP = C_MESTYP. "Message type
      S_CTRL_REC-IDOCTP = C_IDOCTP. "Basic IDOC type
      S_CTRL_REC-RCVPRT = C_RCVPRT. "Partner type of receiver
      S_CTRL_REC-SNDPOR = C_SNDPOR. "SENDER PORT
      S_CTRL_REC-RCVPRN = C_LOGSYS. "Partner number of receiver
      S_CTRL_REC-SNDPRT = C_SNDPRT. "Sender Partner type
      S_CTRL_REC-SNDPRN = C_SNDPRN. "Sender Partner Number
    APPEND S_CTRL_REC.
    ENDFORM.                    " generate_control_record
    *&      Form  send_idoc
    FORM SEND_IDOC.
    ZORDER-ORDER_NO = ORDER_NO.
    ZORDER-PRODUCT = PRODUCT.
    ZORDER-QUANTITY = QUANTITY.
    APPEND ZORDER.
    T_EDIDD-SEGNAM = C_ZRZSEG1.
    T_EDIDD-SDATA = ZORDER.
    APPEND T_EDIDD.
      CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
        EXPORTING
          MASTER_IDOC_CONTROL            = S_CTRL_REC
        TABLES
          COMMUNICATION_IDOC_CONTROL     = T_COMM_IDOC
          MASTER_IDOC_DATA               = T_EDIDD
        EXCEPTIONS
          ERROR_IN_IDOC_CONTROL          = 1
          ERROR_WRITING_IDOC_STATUS      = 2
          ERROR_IN_IDOC_DATA             = 3
          SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
          OTHERS                         = 5.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        COMMIT WORK.
        LOOP AT T_COMM_IDOC.
          WRITE:/ 'IDoc Generated - ', T_COMM_IDOC-DOCNUM.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " send_idoc
    I hav created segment , basic type,message typealso and release also .I also linked them.
    Plz help me.
    Hemlata

    Hi Hemalatha,
    Just call this Progream RSEOUT00 from your Zprogram and pass the basic parameters like IDOC number, Basic type,Partner number etc.
    You can check the parameters by executing the Program RSEOUT00.
    This Program will change the status of your IDOC 30 to 03.
    Thanks.
    Note:Reward Points if you find useful.

Maybe you are looking for

  • How to track the emails

    hi... i am developing an application through which i sendm mails.I have to track the emails sent out. ie. 1. i need the count of mails sent(which is easy) 2. Count of undelivered mails? 3. Whether the email is opened or not?' To track whether the ema

  • How to easily spot color cast in aperture

    Hi, I am having difficulties to properly spot/analyze a color cast in my (scanned from color negatives) images. There is no neutral grey or white present and I'd like to get a handle on correcting this color cast without just trial and error (and mak

  • Does anyone else have issues with Adobe Premiere on Mavericks?

    We just purchase a new Mac Pro for our video producer and are having major issues. Scrubbing and viewing video is dicey at best. Audio drop-outs, studdering playback, compression artifacts. Really unusable at this point. Seems like the video hardware

  • When to take the OCA certification

    Hi! I am barely 6 months within the job in the Database Administration field (fresh graduate) and I believe I'm still learning the ropes, I would like to ask when is the best time to take an OCA certification and what are the preparations you suggest

  • Windows Authentication login cannot access backup files stored in Users\[User] folder.

    I am currently logged in to my database engine using SSMS and Windows Authentication; specifically, I am logged in with Joe-PC\Joe, where Joe-PC is the domain name of the machine hosting the database, and Joe is the user that created the database.  I