ALE triggering ABAP program instead of iDoc

Is it possible to have ALE trigger an ABAP program instead of an iDoc?
We need to send changes in Master Data to a system that can't handle iDoc, but does know what to do with SOAP.

We're talking about an All-in-One system on NetWeaver 700 and ECC 6.0. My company has developed an Add-On for Business One and now they want to develop a similar Add-On for All-in-One. That Add-On should integrate an Open Source system into an SAP system, or at least make the flow of data seem seamless.
I should be very careful with my comments, as I'm not really understanding enough about your requirements. I must admit key words changes in master data and ALE triggered my initial comment.
On second thought it might actually be worthwhile to think about other alternatives. E.g. you could look at the technique SAP uses for BW extractors, which might also be suitable.
I might just be able to hook into the Change Doc system by defining new Change Doc and Change Pointer Types.
Well, per my comment above, maybe you don't even need change pointers. However, if you do, you can mostly rely on existing change documents unless you're dealing with some odd or custom object.
Am I right if I think that IDocs handle those Change Pointers from some kind of scheduled background job?
Part of the setup for change pointers for a specific message type is to define which function module is used for evaluating the change pointers. All change pointers are then evaluated via transaction BD21, program RBDMIDOC, which can also be scheduled in the background.
but we only need less than 5% of the information contained in an iDoc
Well, in theory SAP offers some options: You can filter segments via ALE, use reduced message types or define IDoc views. However, depending on the technique this sometimes requires that the actual application (function module creating the IDocs) has to support it (because it's additional API calls that have to be present).
Defining new IDoc types isn't that attractive to us.
Though I do understand such statement in specific cases, it's hard to relate to it on a general level. I.e. in the latter case it's often more driven by strange company policies than by good design choices.
Anyhow, in the end I'm tempted to think that change pointers with IDocs are one option among many. In your specific case however it sounds as if there's possibly other techniques that might be more suitable. So I'll stop for now before I tell you too much crap pushing you in a wrong direction...

Similar Messages

  • Problem in triggering abap program in process chain

    i m running a infopackage in a process chain .
    this infopackage creates the request in the DSO .
    after infopackage i m including the abap program to delete the same request in the process chain .
    but the abap program is not getting triggered .i have maintained the variant correctly for the program in the process chain .
    what can be done so that the program gets triggered .

    Hi,
    You can trigger you ABASP program from
    1. SM64  : copy the ABAP program's Afer event and parambeter and give it there and execute
    2.or go to
    SE37 >>Program : BP_EVENT_RAISE  >> say test execute
    and give the same after event and parameter ..and execute
    this might trigger your program
    Hope this helps you,
    Regrads,
    shikha

  • Event Triggering ABAP Programs

    Hi SDN User,
    I have a strange issue. We have many process chains and there are triggering by Events and these events are triggering by ABAP programs. My question is I want to know which even is triggering by which ABAP program.
    Any idea guys.
    Thanks
    Sravu2019

    Hi VIkram
    Thanks foir u r input but thiis also not working and am not able to fine the ABAP Program name.
    Thanks
    Srav's

  • Triggering ABAP Program upon file drop

    Hi Gurus,
    I would like to trigger an ABAP program as and when a file is dropped in a drive. Please let me know what is the best way to do this.
    Also please let me know how to handle in the program if 2 or more files are dropped at a time.
    Appreciate it. thanks.

    Hello,
    You can create a Z program and schedule a job for the time what you need.
    Sample code:
    "......... definitions .......
    START-OF-SELECTION.
         PERFORM read_files_in_dir_on_server USING p_wfile
                                          CHANGING gt_files.
    LOOP AT gt_files INTO gv_filepath.
         gv_progress = sy-tabix / lines( gt_files ).
         PERFORM read_server_file USING gv_filepath
                               CHANGING gt_file_content
                                        gv_filelenght.
         "do what you need here!  
         CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
           EXPORTING
             percentage = gv_progress
             text       = 'Processing the files'(003).
       ENDLOOP.
    *&      Form  READ_FILES_IN_DIR_ON_SERVER
    *       Read all files in a directory (server)
    *      -->IV_DIR     Directory
    *      <--CT_FILES   Files in Directory
    FORM read_files_in_dir_on_server  USING     iv_dir     TYPE string
                                       CHANGING ct_files   LIKE gt_files.
       DATA: lv_dir_name TYPE ocs_file-name,
             lt_filelist TYPE STANDARD TABLE OF ocs_file,
             ls_filelist LIKE LINE OF lt_filelist,
             ls_file     LIKE LINE OF ct_files,
             lv_offset   TYPE i,
             lv_dummy    TYPE i,
             lv_error    TYPE boolean.
       lv_dir_name = iv_dir.
       CALL FUNCTION 'OCS_GET_FILE_INFO'
         EXPORTING
           dir_name                  = lv_dir_name
         TABLES
           dir_list                  = lt_filelist
         EXCEPTIONS
           no_authority              = 1
           activity_unknown          = 2
           not_a_directory           = 3
           no_media_in_drive         = 4
           too_many_errors           = 5
           too_many_files            = 6
           bracket_error_in_filename = 7
           no_such_parameter         = 8
           OTHERS                    = 9.
       IF sy-subrc <> 0.
         MESSAGE 'Error on directory selected' TYPE 'E'.
       ENDIF.
       LOOP AT lt_filelist INTO ls_filelist.
         lv_error = abap_false.
              "check a specific prefix
         IF ls_filelist-name(4) NE 'out_'.
           lv_error = abap_true.
         ENDIF.
               "check a specific extension
         FIND '.xml' IN ls_filelist-name MATCH OFFSET lv_offset.
         IF sy-subrc IS NOT INITIAL.
           lv_error = abap_true.
         ENDIF.
              "needs to end with a number (not chars allowed)
         lv_offset = lv_offset - 1.
         TRY .
             lv_dummy = ls_filelist-name+lv_offset(1).
           CATCH cx_root.
             lv_error = abap_true.
         ENDTRY.
              "check if the dir is complete filled (end with \ )
         lv_offset = strlen( iv_dir ) - 1.
         IF iv_dir+lv_offset EQ '\'.
           CONCATENATE iv_dir
                       ls_filelist-name
                  INTO ls_file.
         ELSE.
           CONCATENATE iv_dir '\'
                       ls_filelist-name
                  INTO ls_file.
         ENDIF.
         IF lv_error NE abap_true.
           APPEND ls_file TO ct_files.
           CLEAR ls_file.
         ENDIF.
       ENDLOOP.
    ENDFORM.                    " READ_FILES_IN_DIR_ON_SERVER
    *&      Form  READ_SERVER_FILE
    *       Read server file
    *      -->IV_FILEPATH  text
    *      <--CT_FILE_CONTENT  text
    *      <--CV_FILELENGHT  text
    FORM read_server_file  USING iv_filepath     TYPE string
                         CHANGING ct_file_content TYPE table_of_strings
                                  cv_filelenght   TYPE i.
       DATA: lv_content LIKE LINE OF ct_file_content,
             lv_msg     TYPE string.
       REFRESH ct_file_content.
       CLEAR cv_filelenght.
       OPEN DATASET iv_filepath FOR INPUT
                                IN TEXT MODE
                                ENCODING UTF-8
                                MESSAGE lv_msg.
       DO.
         READ DATASET iv_filepath INTO lv_content.
         IF sy-subrc IS NOT INITIAL.
           EXIT.
         ENDIF.
         APPEND lv_content TO ct_file_content.
         gv_filelenght = gv_filelenght + strlen( lv_content ).
       ENDDO.
    ENDFORM.                    " READ_SERVER_FILE

  • ABAP program / Idocs - MDX from SAP

    Hello friends,
    There are two systems:
    One is SAP system other one is CRM system (non SAP). When someone enters data in CRM system to create orders, it reaches SAP system through IDocs and order number generates. All the SAP master data is maintained in kind of data base table in the external CRM system. So the orders get create in SAP without any errors. So far the data comes only from SAP to CRM. Now I would like to transfer the changes made in SAP master data (changes in customer/material/condition records) to be transferred to CRM system.
    Can it be done through ABAP program or through IDocs? Which way is the accurate? Can you please give detail information how can this be done?
    Thank you & Br,
    Sats.

    Hi Erik,
    I am stuck up with a similar requirement, wherein I have an ABAP program in my process chain and I need the technical name of the process chain in the ABAP program at run-time.
    Did you get a solution or work-around for this scenario?
    Thanks in advance.
    Regards,
    Chetana.

  • ABAP programming standards for SELECT...ORDER BY....

    I recently saw a set of programming standards that stated it was better not to use an ORDER BY clause on a SELECT statement. Instead SELECT into an internal table and use SORT. The actual statement was....."In most cases it is preferable to do the sorting within the ABAP program instead of on the database server.  That means: fill the internal table via a SELECT statement and then sort via the SORT statement instead of coding a SELECT u2026 ORDER BY.  The sorting of large amounts of data on the database server affects the performance of all users on the system, whereas the sorting within the ABAP program u2018onlyu2019 affects the application server.  However, if an index exists on the table that can be used for the sorting then the SELECT u2026 ORDER BY doesnu2019t cause any undue strains on the system."
    I think this is no longer correct particularily with regards to Systemi/iSeries which we normally run in 2 tier mode.
    What are people opinion on this?

    Peter,
    the correct answer for DB2 on IBM i is "it depends". To implement "ORDER BY", the optimizer has basically these choices:
    - If an index with the columns of the "ORDER BY" clause exists, the database can access the data through this index, which returns them in the desired order. However, the data needs to be fetched row by row, so for each returned row you need one I/O request.
    - If such an index does not exist, the database can choose to perform a sequential read into a temporary storage and sort the temporary result set before returning the data to the caller. This is basically the same as reading the data into an internal table and let ABAP do the sort. Even if an index exist, reading the whole table into memory and sorting it there may be faster, because on a sequential read, the database can execute a "blocked" fetch rather than many individual I/O operations. You may see this if the table is relatively small.
    - If such an index does not exist, the database could also choose to create a temporary index and access the data through the temporary index. For the first execution, you don't gain much, but subsequent executions may perform much better. However, after an IPL you loose all temporary indexes, so the index needs to be built again on the first execution after the IPL.
    If you code your ABAP to read the table sequentially and sort it in memory, you are forcing the second implementation. If you code ABAP with the ORDER BY in the SELECT statement, you allow the database optimizer to choose the best possible implementation depending on the size of the table, the size of the result set, and the available indexes.
    If your table is relatively large but the result set (based on the WHERE clause) is relatively small, make sure to have an index that combines the WHERE clause elements returning only one value with the ORDER BY clause elements.
    For example, if you have a query like:
    SELECT * FROM T
    WHERE A = ? AND B = ? AND C IN (?, ?, ?)
    ORDER BY D, E
    you should have an index over columns A, B, D, and E for the best possible performance. A and B in the index can be used to limit the result set without any influence on the sort order D, E, but C cannot.
    Kind regards,
    Christian Bartels.

  • How to read an IDoc with an ABAP program?

    Hi experts!
    I am new to SAP and I need to read an IDoc with an ABAP program... how to do it?
    Maybe it is possible to read an IDoc into inner table...?
    Hellpful answers and advices will be rawarded.
    Regards,
    Mindaugas.

    hi
    I understand your issue, to pickup an IDOC flat file & post it to R/3 (with or without mapping).
    There is no straight forward solution but there are some ways (Normal way of Working as of now ?!!!) provided in the "How to"
    check this link
    https://websmp101.sap-ag.de/nw-howtoguides
    and look for this guide
    How To Convert Between IDoc XML and Flat Files in XI.30
    Probably you need to automate this using some programs,
    - Create an ALE port of type File
    using transaction WE21 on your
    Integration Engine.
    - Run report RSEINB00 on your
    Integration Engine. The report will
    upload the file, filter the IDoc header
    data, perform the conversion to IDoc
    XML and put the data into the
    pipeline of the Integration Server.
    Therefore it is crucial, that the IDoc
    control record data is populated
    correctly and corresponds to the
    adapter-specific identifiers of your
    sender service. Once the message
    is put successfully into the pipeline
    of the Integration Server, the file is
    deleted.
    Hope this fixes your issue
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • Triggering Event in BW through a ABAP Program in R/3

    Hello Friends,
    I am working on triggering a process chain in BW using ABAP program in R/3.
    1.  I have created a test process-chain in BW which sends test email upon running. This process chain is triggered by an event "Z_START_PC".
    2.  I created a function module "ZBW_EVENT_RAISE" which triggers this event.
         ( This function module is "remote enabled module")
    3.  I tested running the process chain, with function-module (SE37), which works fine.
         ( i.e. I do receive test-email after..)
    4.  Now I created a ABAP program "ZBW_EVENT_RAISE" in R/3.
         The code of which is as follows:
         REPORT  ZBW_EVENT_RAISE.
        parameters: rfcdest like t000-logsys.
        parameters: bwevent like tbtco-eventid.
        call function 'ZBW_EVENT_RAISE'
        destination rfcdest
         exporting
         eventid = bwevent.
    5.  When I try to run this ABAP program in R/3 (SE38),
         The process chain does not get triggered.
      (a)  The "<b>rfcdest</b>" i got from SM59 - RFC Destinations -
            R/3 Connections - BW Development Server Client
            Value is "BWDCLNT999".
    How do I go about debugging this issue? I know for sure, the BW- function module -- to Trigger -- to Process-chain is working fine. Only part is R/3 to B/W function module starting.
    Any help is appreciated.
    I promise to award points.
    Thanks
    PK

    in ST05 there is an option for RFC trace. Not sure how much detail that will give you but you can try.
    It is possible that your userid doesn't have an RFC call authorization in R/3. Do a SU53 immediately after running the program.
    Also, replace the FM with any other FM that you know for sure runs  (eg some BAPI FM) and run it - either in SE37 in R/3 with RFC destination for BW, or, from your code itself and see if that works (you can check return code).

  • How to create Inbound Idocs in a ABAP program? Any function Module?

    Hello Experts,
    My requirement is : I have sales order data which I extracted from third party system in my internal tables. In the same box I need to create inbound Idocs and then consequently create sales orders.
    I have used the function module IDOC_INBOUND_WRITE_TO_DB to create inbound Idocs from Sales Orders data in internal tables. I have populated all the data records with correct PSGNUM and HLEVEL values. My plan is to create inbound idocs with this function module and send those to IDOC_INPUT_ORDERS function module which creates Sales Orders.
    If a sales order in the internal table in ABAP program contains only one item, then I am getting correct idocs. But if more than one item exists for a sales order then the line item segments which got repeated in Idoc are having PSGNUM and HLEVEL values as zero when I checked in WE02. As a result the hierarchy from the second item segment is getting disturbed and getting the status 60.
    I populated T_EDIDD with data records from  IDOC_INBOUND_WRITE_TO_DB.
    To the function module IDOC_INPUT_ORDERS,  T_EDIDC and T_EDIDD are the input. I observed that in T_EDIDD also the PSGNUM and HLEVEL values are blank.
    I am getting Status 60 with message 'EDI: Syntax error in IDoc (segment cannot be identified)' for idocs which have more than one item.
    I need to extract sales data from third party and create inbound idocs and create sales orders in one ABAP program only. I need to display corresponding Idoc numbers for the corresponding third party sales order number in a listoutput.
    Can anybody please provide inputs?
    Regards.

    Hi Anjali,
    Thanks for the response.
    I have passed the PSGNUM and HLEVEL values while populating the data records. Then I sent the data records and control record information to the function module IDOC_INBOUND_WRITE_TO_DB. Inside this function module there is code to clear the PSGNUM values and HLEVEL values.
    for compatibility: clear administration data of data records
               perform data_records_wipe
                                      tables
                                          t_data_records.
    FORM DATA_RECORDS_WIPE
                      TABLES
                          T_DATA_RECORDS_IN  STRUCTURE EDIDD.
      LOOP AT  T_DATA_RECORDS_IN.
        CLEAR: T_DATA_RECORDS_IN-MANDT,
               T_DATA_RECORDS_IN-DOCNUM,
               T_DATA_RECORDS_IN-SEGNUM,
               T_DATA_RECORDS_IN-PSGNUM,
               T_DATA_RECORDS_IN-HLEVEL.
        modify t_data_records_in.
      ENDLOOP.
    ENDFORM.                               " DATA_RECORDS_WIPE
    This is the code which is clearing all the PSGNUM and HLEVEL values. After coming out of this function module we are getting the error idocs created with disturbed hierarchy.
    I need to create INBOUND Idocs with the data in ABAP program.
    Please let me know if any inputs? Is there any function module existing to create Inbound Idocs inside an ABAP program?
    Regards

  • 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.

  • How to call a idoc in abap program and updates catsdb table

    how to call a idoc in abap program and updates catsdb table
    thank you,
    Jagrut BharatKumar Shukla

    Hi Kishan,
    You can refer to following help document,
    http://help.sap.com/saphelp_nw04/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/content.htm
    Regards,
    Meera

  • Program that generates idoc in ale/edi

    friends can  you please tell  which  program creates an idoc or  how  are idocs generated  while  customizing ale and edi ., in which step?

    Hi
    The following code is used to create and populate IDOC
    REPORT ZALE_USR.
    CONSTANTS: C_DOCTYP TYPE EDIDC-IDOCTP VALUE 'ZUSRDET01',Idoctype
    C_SEGNAM TYPE EDIDD-SEGNAM VALUE 'Z1USRDET01', segmenttype
    C_MESTYP TYPE EDIDC-MESTYP VALUE 'ZUSRDET'. message type
    DATA: IT_ZUSR02 TYPE USR02 OCCURS 10,
    IT_EDIDC TYPE EDIDC OCCURS 0,
    IT_EDIDD TYPE EDIDD OCCURS 0,
    WA_ZUSR02 TYPE USR02,
    WA_EDIDC TYPE EDIDC,
    WA_EDIDD TYPE EDIDD,
    WA_Z1USRDET01 TYPE Z1USRDET01,
    V_OCCMAX TYPE IDOCSYN-OCCMAX,
    V_NBSEG TYPE I.
    CLEAR WA_ZUSR02.
    CLEAR WA_EDIDC.
    Save the message type and the basic IDoc type in the control segment.
    MOVE C_MESTYP TO WA_EDIDC-MESTYP.
    MOVE C_DOCTYP TO WA_EDIDC-IDOCTP.
    Retrieve the maximum number of segments in the basic IDoc type.
    SELECT MIN( OCCMAX ) FROM IDOCSYN INTO V_OCCMAX WHERE IDOCTYP EQ C_DOCTYP AND SEGTYP EQ C_SEGNAM.
    Save the whole USR02 table content in the IT_ZUSR02 internal table.
    SELECT * FROM USR02 INTO CORRESPONDING FIELDS OF TABLE IT_ZUSR02.
    Create a data segment for each line of IT_ZUSR02.
    LOOP AT IT_ZUSR02 INTO WA_ZUSR02 .
    MOVE-CORRESPONDING WA_ZUSR02 TO WA_Z1USRDET01.
    CLEAR WA_EDIDD.
    MOVE C_SEGNAM TO WA_EDIDD-SEGNAM.
    MOVE WA_Z1USRDET01 TO WA_EDIDD-SDATA.
    APPEND WA_EDIDD TO IT_EDIDD.
    CLEAR WA_ZUSR02.
    CLEAR WA_Z1USRDET01.
    ENDLOOP.
    Count the number of data segments.
    DESCRIBE TABLE IT_EDIDD LINES V_NBSEG.
    If the number of data segments exceeds the maximum allowed number,then display an error message.
    IF V_NBSEG GT V_OCCMAX.
    WRITE:/ 'ERROR'.
    ENDIF.
    CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
    EXPORTING
    master_idoc_control = WA_EDIDC
    OBJ_TYPE = ''
    CHNUM = ''
    tables
    communication_idoc_control = IT_EDIDC
    master_idoc_data = IT_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.
    ENDIF.
    Reward points for helpful ans
    Regards
    Aarti

  • RRI calling Web Browser instead ABAP program

    Hi All,
    I have created a RRI to call an ABAP program. However, when I try to call the ABAP program (via GOTO) it opens a web browser.
    If I execute the same query via RSRT, and call the ABAP program it works fine.
    I have also create another RRI to call another query from within BEx and it works fine.
    It only fails when calling ABAP program from BEx.
    I have read on to apply SAP NOTE 972514 - Set the ms/redirect_version parameter to value 1 and restart your ABAP Web Application.
    My ms/redirect is already = 1
    Any ideas?
    Thanks,
    Flavio

    I do have authorization. There is no error. It just open a internet explore (URL) instead of executing the ABAP program.
    Again, if I run the query via RSRT, it works just fine.
    Any ideas?
    cheers,
    Flavio

  • Triggering a background job of class 'A' from within the ABAP program

    Dear All,
    We are implementing SAP ECC 6.0 on IBM System i, i5/OS V5R4,  SAP kernel 7.00, kernel patch level 173.
    Is there a way to control that when a background job is triggered from within an ABAP program using the : CALL FUNCTION 'JOB_OPEN' statement, the background job is of class A ?
    I know that through transaction SM37, the job class for a background job can be changed manually, but the situation is an outsource company did for us some changes in the native SAP ABAP programs related to some SAP native transactions, and those programs trigger at their end some background jobs, each job running with the name of user running the transaction.
    Through SM37, I can't find a template background job, to be changed to have class 'A'
    The following is an excerpt from the ABAP code, bearing the CALL FUNCTION 'JOB_OPEN' statement :
    FUNCTION z_cs_technical_completion.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(AUFNR) TYPE  VBRP-AUFNR
      DATA jobcount TYPE tbtcjob-jobcount.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobname                = 'CS_TECH_COMPLETE'
      SDLSTRTDT              = NO_DATE
      SDLSTRTTM              = NO_TIME
      JOBCLASS               =
       IMPORTING
         jobcount               = jobcount
    CHANGING
      RET                    =
       EXCEPTIONS
         cant_create_job        = 1
         invalid_job_data       = 2
         jobname_missing        = 3
         OTHERS                 = 4
      SUBMIT zcs_technical_completion
              WITH p_aufnr EQ aufnr
                AND RETURN
              VIA JOB 'CS_TECH_COMPLETE'
              NUMBER jobcount.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             = jobcount
          jobname              = 'CS_TECH_COMPLETE'
          strtimmed            = 'X'
        EXCEPTIONS
          cant_start_immediate = 1
          invalid_startdate    = 2
          jobname_missing      = 3
          job_close_failed     = 4
          job_nosteps          = 5
          job_notex            = 6
          lock_failed          = 7
          invalid_target       = 8
          OTHERS               = 9.
    ENDFUNCTION.
    Thank you in advance for your cooperation.
    Best regards.
    Reda Khalifa

    Dear Darren,
    Thank you very much for your cooperation and for your prompt reply.
    Could you please explain to me how to find out the template background job that was first used, or in other words, how things were set up in the first place, i.e. when first the ABAP program was written and executed, there had to be at least one background job created through transaction SM36 ?
    Thank you in advance for your cooperation.
    Best regards.
    Reda Khalifa

  • Write an ABAP program in BW which triggers an event in R/3

    Hello People
    Method: I need to create a Process Chain in BW for info package loading. In the PC, after the loading occurs, I need to write an ABAP program which has the FM: RSSM_EVENT _RAISE , which triggers a pre-defined event in R/3.  This event in turn triggers a 'z' program in R/3.
    Now, I know that we can use SM62 in R/3 to create the event. But how and where do i need to write the abap code in BW. And do i just place it in the PC after the loading process? Do i need to inculde the FM in the ABAP code? Does the FM know the server in R/3 ( DEV or QA or PROD ) where it needs to trigger the event? And how do i schedule the 'z' prog, so that it starts after the event?
    Please help.
    Thanks in advance.

    Create and rfc function module in r/3 in which code you trigger the event, created in r/3 too.
    You can, and should to do it, include a report as step in your process chain in order to trigger event at finish of process chain.
    Here a sample
    r/3 side.RFC function (get and trigger event)
    FUNCTION Z_RAISE_EVENT.
    ""Interfase local
    *"  IMPORTING
    *"     VALUE(EVENTID) TYPE  TBTCO-EVENTID
    *"  EXCEPTIONS
    *"      BAD_EVENTID
    *"      EVENTID_DOES_NOT_EXIST
    *"      EVENTID_MISSING
    *"      RAISE_FAILED
    *"      OTHERS
      CALL FUNCTION 'BP_EVENT_RAISE'
        EXPORTING
          EVENTID                      = EVENTID
        EXCEPTIONS
          BAD_EVENTID                  = 1
          EVENTID_DOES_NOT_EXIST       = 2
          EVENTID_MISSING              = 3
          RAISE_FAILED                 = 4
          OTHERS                       = 5
      CASE SY-SUBRC .
        WHEN 1.
          RAISE BAD_EVENTID.
        WHEN 2.
          RAISE EVENTID_DOES_NOT_EXIST.
        WHEN 3.
          RAISE EVENTID_MISSING.
        WHEN 4.
          RAISE RAISE_FAILED.
        WHEN 5.
          RAISE OTHERS.
      endcase.
    ENDFUNCTION..
    BW side.Report to call previous rfc function
    REPORT  Z_RAISE_EVENT                           .
    parameters: EVENTID like TBTCO-EVENTID.
    parameters: destino like RFCDES-RFCDEST.
    parameters: test as checkbox default 'X'.
    IF TEST EQ SPACE.
      CALL FUNCTION 'Z_RAISE_EVENT'
        DESTINATION DESTINO
        EXPORTING
          EVENTID                      = EVENTID
        EXCEPTIONS
          BAD_EVENTID                  = 1
          EVENTID_DOES_NOT_EXIST       = 2
          EVENTID_MISSING              = 3
          RAISE_FAILED                 = 4
          OTHERS                       = 5
      CASE SY-SUBRC .
        WHEN 1.
          RAISE BAD_EVENTID.
        WHEN 2.
          RAISE EVENTID_DOES_NOT_EXIST.
        WHEN 3.
          RAISE EVENTID_MISSING.
        WHEN 4.
          RAISE RAISE_FAILED.
        WHEN 5.
          RAISE OTHERS.
      ENDCASE.
      ENDIF.

Maybe you are looking for