Userexit or BADI for program *RMMRP000* for background job

Hi,
We are scheduling background job for MRP through SM36 using program  RMMRP000 or Through Transaction MDBT (MDBT is calling program RMMRP000) which creates PR (through background job).
I want to default one field in PR (PO Price field in valuation tab in PR default to gross) using any userexit or BADI.
Can any body suggest me userexit or BADI for program RMMRP000 for background job
Regards.

Hi,
1. The below are the List of  Userexit for this MDBT t.CODE.
2. But i dont see any one helping to resolve your issue.
3. May be you should lookg at the Userexit for me21n or relevant Purhcase requisition creation transaction.
reg
dsk

Similar Messages

  • How to find Spool number for a 2 steps background job.

    Hi All,
    How to find spool number (and also the background job name ) for a 2 steps background job.
    in the table TBTCO i can see step numbers but i dont get the spool number. Is there any link between TBTCO and TSP01.
    Also after getting the spool number i need to drill down on ALV report. I hard coded the spool number and was able to drill down using BDC and call transaction but when i press back button it is not returning to the ALV report.
    Thanks,
    Shiva.

    Which one creates the spool? (first one I guess)
    What kind of spool? (WRITE, sapscript, smartform, pdf...)
    Do you use special statements like NEW-PAGE, or other things?
    Are you sure that the spools are generated by these jobs? (did you compare the spool generation times and job run dates to be sure...)

  • Program works but background job for that program fails....

    I have a requirement where I have to collect the details of the purchase order and put the details in XML file format and FTP the XML file to an external third party FTP Server.
    To realize this I developed a report program which follows following logic.
    1)     First I collected the PO details by calling the BAPI BAPI_PO_GETDETAIL1.
    2)     Then using the following link "/people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach
    I converted these PO details to the XML file format that the third party people accept.
           In the code I used u201CCALL METHOD cl_gui_frontend_services=>gui_downloadu201D and in this process first the XML file is generated and is getting stored on my deskytop.
    3)     Then I called HTTP_SCRAMBLE, FTP_CONNECT, FTP_COMMAND , FTP_DISCONNECT and RFC_CONNECTION_CLOSE.
    This works perfectly well and each time I execute the report the file is getting FTPu2019ed to the third party FTP server.
    Now I tried to schedule a batch job for this and the batch job fails with follwing errors
    02/25/2009 15:08:47 Error in Control Framework
    Message Class  = FES         
    Message Number = 022  
    Message Type   = E
    02/25/2009 15:08:47 Job cancelled after system exception ERROR_MESSAGE 
    Message Class  = 00        
    Message Number = 564  
    Message Type   = A                
    Can some one tell me what is going wrong. My report works perfect in front end but fails if I try to schedule a background job for it in SM36.
    Can you please tell me whatz going wrong with batch job? Any Help is highly appreciated.
    Regards,
    JEssica SAm

    Robert...Thanks for the reply...
    I am using follwing code
    l_xml_size = l_ostream->get_num_written_raw( ).
        CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
            bin_filesize = l_xml_size
            filename     = FILEPATH
            filetype     = 'BIN'
          CHANGING
            data_tab     = l_xml_table
          EXCEPTIONS
            OTHERS       = 24.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    Now what changes should i make..where should i store my XML file then instead of my desktop?
    and whih Function Module should i Use..

  • Setting format for spool requests in background jobs, for emails

    Hi,
    Don't know if this is the correct forum, but I'll give it a go (will appricate info regarding what forum is applicable otherwise.)
    For some periodical background jobs that we run in ECC, we have in the job set up that a mail group of people to receives the spool request via mail. Vi have used this a few years now. When we recently uppgraded from R/3 to ECC, the format of the spool request sent as mail attachment changed from .txt to .htm. This is however not the problem for us.
    We now have a scenario with a daily mail report, i.e. delivered as an attachment (htm-format) in our email system (Lotus Notes).
    So far so good, and nothing really new about this, except the changed format.
    What the users want is to print this report. It can be done, but it is a wide report, so it cuts the report in three pieces, as there is no automatic sizing to landscape printout and/our automatic sizing to one page. The best solution would be if it automatically was set up to landscape + automatically fit page size. Which format (.txt .htm .xls .pdf...) we receive the file in, is not really important, as long as we can print it directly without having to reformat it. Now we have to save the file to excel manually after we receive it, and then format the excel sheet. Just for printout purpose, so it is annoying work.
    Any solution available? (preferrably without coding)
    BR,
    Niclas

    Hi NTR,
    If you are using FM REUSE_ALV_LIST_DISPLAY to print your ALV Report it has got a paramter IS_PRINT in which you can pass your format type. Below is the field name where you have to pass your format type.
    IS_PRINT-print_ctrl-PRI_PARAMS-PAART
    Regards
    Bala

  • Do not get printouts for some custoemrs through background job

    Hi ,
    I am getting the printouts through back ground jobs, suppose what ever the billing documents by end of the day and there is back ground job which runs and give the print outs for that i have maintained in VV31 medium 1 printout and dispatch time 1 periodical scheduled back ground job. Now i want to for some customers i don't want to get the printouts through back ground job.
    Can you please suggest me how to control do not print for some customers.
    Regards
    Venkat

    Hi Sri nath,
    I have one access sequence for the combination sales org/dist channel/billing type and have maintained in vv32  sales org ,dist,billing type for that access sequence and medium is print out and dispatch time is 1 schedule back ground job
    and now i created one more table which is combination of  sales org/billing type/customer and medium is 1 and dispatch time 4 maintained in the vv32.
    what ever the customer i maintained in vv32 for the new combination. after i created sales order and now creating the billing document even though output is triggering first combination which is background job, but i want  to trigger 4 when saved application.
    can you please suggest how to resolve this issue.
    Regards
    Venkat

  • Can we debug programs called in background job?

    Hi Everyone,
    Here is my question:
    I set some breaakpoints in program A which is call by another program B.
    And in B, it defines a background job to run A.
    but when i run program B , the berakpoints set in A don't work,why???
    (I can not run A directly, for it needs a large amount of parameters which can't be input manually)
    How to solve it? Thanks
    Regards.

    Hi,
    Yes if it is a custom program.
    Here how it works.
    - Put a endless loop in your code.
    - Run the program.
    - Go to SM50 and select your process.
    - Then go to Program/Session->Program-> Debugging.
    - It will open the debugger. Now come out of endless loop by changing values and check whatever you want.
    Regards,
    pranaya

  • How to transfer a  bdc program online to background   job ?

    Hi,
       I have created a  program using BDC for inserting items into a specific sales order, which woks well inline.
       Now i want to transfer it to background  job,Could u
    give me steps in detail?  thanks in advance.

    I understand that with your program you can create BDC seesion ( and not use Call Transaction ).
    I am not sure if you want your program to run in batch or you want the session created by your program to run in batch. I am giving solution for both.
    To schedule the processing of session in backgroud you can use report RSBDCSUB.
    You can do in two ways -
    Ist Method
    Define a batch job in SM36 with two steps -
    First Step - Your Custom Program ( with a variant )
    Second Step - RSBDCSUB ( With a variant having
                             the session name ).
    2nd Method
    In your program after BDC_CLOSE_GROUP add a line.
    SUBMIT RSBDCSUB WITH MAPPE EQ <SESSION_NAME>.
    Scedule you program as a batch job in SM36 ( Single Step ). ( You can also test the program by running in online mode . After your programs executes , go and see in SM35. You will see that your session created in being processed or has been processed in background).
    In Both ways the session created by BDC_OPEN_GROUP will be processed in background,

  • How can I generate clock in labview 8.0 and use it for programming and for hardware?

    I have to generate clock for synchronizing hardware with my program, so I need to to use this clock inside the program and as an output from A/D. The clock frequency has to be aproximately 3kHz.  

    *Insufficient information*
    First of all, i suspect that you are somehow believing that software can be timed by external signals. That is normally not the case, at least if you are using a standard Desktop PC.
    So please do not mix software with "data acquisition". Data acquisition can be configured to be "buffered" which means externally clocked. You can use the onboard clock for this or (in case of most hardware) any other TTL compatible "clocksource". This will ensure a clocked acquisition of the samples. The samples are then transferred to your PC and stored there as an array. So your program has to fetch the data "in time", but not "hardwaretimed".
    So please share some more information about:
    -What is your task
    -What is the hardware you are using
    -Software versions (driver, LV)
    -What is your current approach
    thanks,
    Norbert
    [Edit] There is a difference between "softwaretimed" and "hardwaretimes" acquisition. What i described in my reply would be the hardwaretimed acquisition, which i would say make the majority of all acquisitions. Softwaretimed acquisition describes a single point acquisition where a single sample is requested by the software. So each time the software requests a new sample, it will be acquired. This method heavily depends on the performance of the systems and does most often not exceed  few kHz (maybe 2 or 3). Furthermore, if you do not have a realtime or fpga, the acquisition if not deterministic which means that the samples are not acquired in a "static timeframe"; the delta t is not constant.....
    Single point acquisition is only worth for very slow signals (most often up to 1kHz) or control circuits.
    Message Edited by Norbert B on 12-01-2009 04:11 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Good HDTV for Program Monitor for Premiere?

    Hi, firstly aplogies as I know there are quite a few threads on this subject. However, I have yet to find the answer I'm looking for. I need a monitor to connect to the HDMI port on a GTX 560 will will show the video ouput only. I have a CRT for SD material (going through firewire - although pretty useless as Premiere reverses the fields!?), this one will be for HD material.
    I know baout the Ezios and Flanders etc but these are out of my budget. I also understand that using a computer monitor will not give the correct representation for video. So I'm looking for a a good HDTV at 24inches (if possible), under £500.
    Please only supply your model recomendations and why. I'm not looking for another discussion on the benefits of blackmagic vs matrox vs HDMI etc please! If anyone has direct experience of a particular model in their own set up that would be great.
    Thanks in advance.

    why not get a 40 inch?
    cheapest is dynex
    but if you really want a awesome tv with good sound i would pick sony because speakers are on the bottom of the tv and it shoots the forward. samsung is good too but, the speakers are weak they shoot down not forward.

  • Handle submit program for background jobs in RFC FM to send email in ITS

    Hi all
    I am facing a problem in ITS, i.e. I have called a RFC Function Module on the page load event of one of the HTML template. In that FM I have used <b>submit program</b>. This RFC FM is working fine in background i.e. it is sending pdf as email to a particular email address
    but in the frontend it is not responding.
    I wanted to ask whether we can handle submit <program-name> in background job from ITS
    <b>If you are unable to understand the problem i can share with you my code as well.</b>
    Thanks
    Ekta Tuli

    Hi Tobias
    The Function Module <b>ZV_FUNC_CCK_EMAIL_PDF</b> is used to generate the email with pdf as attachement. it is generating email at backend but not in frontend.
    thanks
    ekta
    please find the code below for the FM
    FUNCTION zv_func_cck_email_pdf.
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(CONTRACT) LIKE  VBAP-VBELN
    *"     VALUE(EMAIL) LIKE  ADR6-SMTP_ADDR
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  CHAR4
    data: i_vbak like vbak .
      DATA: v_cont(10) TYPE c.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = contract
        IMPORTING
          output = v_cont.
    DATA: z_element(30)         TYPE c.
    DATA: gv_fb_addr_get_selection  LIKE addr1_sel.
    DATA:  BEGIN OF mtab_contract OCCURS 0, "sap field
        ordno(10),                                              "vbeln (10)
        terr(6),
        vkorg     LIKE vbak-vkorg,
        vkgrp     LIKE knvv-vkgrp,
        repname(35),
        repmailbox(10),
        gueen(10),                          "expires dated -same as valid to
        kunnr(10),
        name1(35),                                              "name1(35)
        stras(35),                                              "stras(35)
        pstlz(10),                                              "pstlz(10)
        ort01(35),                          "ort01(35) city
        regio(3),                                               "regio(3)
        kunnr2(10),
        name2(35),                                              "NUM?(35)
        stras2(35),                                             "stras(35)
        pstlz2(10),                                             "pstlz(10)
        ort012(35),                          "ort01(35) city
        regio2(3),                                              "regio(3)
        kit1     LIKE vbap-matnr,     " currently 41315
        kit1-qty(6),  " like vbap-zmeng,
        kit2     LIKE vbap-matnr,     " currently 41316
        kit2-qty(6),  "  like vbap-zmeng,
        kit3     LIKE vbap-matnr,     " currently 41317
        kit3-qty(6),  "  like vbap-zmeng,
        kit4     LIKE vbap-matnr,     " currently 91869US
        kit4-qty(6),  "  like vbap-zmeng,
        med1     LIKE vbap-matnr,     " currently 7408cp
        med1-qty(6),  "  like vbap-zmeng,
        med2     LIKE vbap-matnr,     " currently 0211CP
        med2-qty(6),  "  like vbap-zmeng,
        med3     LIKE vbap-matnr,     " currently 0578CP
        med3-qty(6),  "  like vbap-zmeng,
        med4     LIKE vbap-matnr,     " currently 0068CP
        med4-qty(6),  "  like vbap-zmeng,
        med5     LIKE vbap-matnr,     " currently 0069CP
        med5-qty(6),  "  like vbap-zmeng,
        med6     LIKE vbap-matnr,     " currently other
        dis6     LIKE makt-maktx,     " currently other
        med6-qty(6),  "  like vbap-zmeng,
        med7     LIKE vbap-matnr,     " currently other
        dis7     LIKE makt-maktx,     " currently other
        med7-qty(6),  "  like vbap-zmeng,
        med8     LIKE vbap-matnr,     " currently other
        dis8     LIKE makt-maktx,     " currently other
        med8-qty(6),  "  like vbap-zmeng,
        med9     LIKE vbap-matnr,     " currently other
        dis9     LIKE makt-maktx,     " currently other
        med9-qty(6),  "  like vbap-zmeng,
        med10    LIKE vbap-matnr,     " currently other
        dis10    LIKE makt-maktx,     " currently other
        med10-qty(6),  "  like vbap-zmeng,
      END OF mtab_contract.
    DATA:  BEGIN OF mtab_material OCCURS 0,
              ordno(10),
              matnr LIKE vbap-matnr,
              qty  LIKE vbap-zmeng,
           END OF mtab_material.
    DATA: w-mm(4) VALUE ' MM '.
    *SELECT-OPTIONS: s_vkorg FOR vbak-vkorg,
    *                s_vkgrp FOR knvv-vkgrp,    "Sales Group
    *                s_terr  FOR knvp-kunn2.    "Territory Code
    *PARAMETERS:     p_parvw LIKE vbpa-parvw MEMORY ID par OBLIGATORY,    "Partner ID
    **                   DEFAULT 'Z1'.
    *                p_vbeln LIKE vbak-vbeln MEMORY ID aun,
    *                p_email LIKE adr6-smtp_addr MEMORY ID email. "Sales Document #
    *SELECT-OPTIONS: "s_vbeln FOR vbak-vbeln MEMORY ID aun, "Sales Document #
    *                s_guebg FOR vbak-guebg,    "Valid-From Date
    *                s_gueen FOR vbak-gueen,    "Valid-To Date
    *                s_ship  FOR vbpa-kunnr,    "Ship-to customer
    *            s_bstzd FOR vbak-bstzd MEMORY ID bst ."DEFAULT 'CCK'.    "P.O. # Supplement
    DATA: i_otf TYPE STANDARD TABLE OF itcoo,
          i_content_txt TYPE table of solisti1, "Content
          i_content_bin TYPE solix_tab, "Content
          i_content_bin1 TYPE solix_tab, "Content
          i_objhead TYPE soli_tab,
          w_pdf TYPE solisti1, "For PDF
          w_res TYPE itcpp, "SAPscript output
          w_otf TYPE itcoo, "For OTF
          w_transfer_bin TYPE sx_boolean, "Content
          prog(60).
    data : t_obj_bin type standard table of solisti1.
    DATA: w_arc_params LIKE arc_params,
          w_pri_params LIKE pri_params.
    *DATA: lcl_cls TYPE REF TO cl_gui_frontend_services.
    CONSTANTS : c_x TYPE c VALUE 'X', "X
                c_locl(4) TYPE c VALUE 'LOCL', "Local Printer
                c_otf TYPE sx_format VALUE 'OTF', "OTF
                c_pdf TYPE sx_format VALUE 'PDF', "PDF
                c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER
                c_bin TYPE char10 VALUE 'BIN'. "BIN
    DATA:       v_name TYPE string ."Downloading File Name
    DATA: v_len_in TYPE so_obj_len,
          v_tempdir(50) TYPE c,
          v_size TYPE i.
    DATA : x_pdf_bag_tline TYPE  rcl_bag_tline,
           v_pdf_fsize TYPE i,
           objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE,
           objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
           objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
           objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
           reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE,
           doc_chng LIKE sodocchgi1,
           tab_lines LIKE sy-tabix.
    DATA : v_pnum LIKE usr21-persnumber,
           v_anum LIKE usr21-addrnumber,
           smtp_addr LIKE adr6-smtp_addr.
    DATA: v_path TYPE  string,
          v_code TYPE i.
    DATA : wa_obj_txt TYPE solisti1.
    DATA : t_obj_txt TYPE STANDARD TABLE OF solisti1.
    DATA : t_rec_list TYPE STANDARD TABLE OF  somlreci1.
    DATA : t_obj_pack TYPE STANDARD TABLE OF sopcklsti1.
    DATA : wa_document_data TYPE sodocchgi1. "Mail data
    DATA : wa_rec_list TYPE somlreci1.
    DATA: reciever TYPE sadrud.    "Email address of the receiver
    DATA : wa_obj_pack TYPE sopcklsti1.
    DATA: v_lines(10) TYPE n.
    DATA: binfilesize TYPE i.
    DATA : wa_obj_header TYPE solisti1.
    DATA : t_obj_header TYPE STANDARD TABLE OF solisti1.
    DATA : obj_id TYPE sofolenti1-object_id. "To send a file as attatchment
    data: pdftab type table of tline with header line.
    data : flag_sent_to_all type sonv-flag.
    *START-OF-SELECTION.
    *  IF lcl_cls IS INITIAL.
    *    CREATE OBJECT lcl_cls.
    *  ENDIF.
      CLEAR i_vbak.
      SELECT  * FROM vbak into i_vbak
                      WHERE
    *                    guebg IN s_guebg AND          "Valid-From Date
    *                    gueen IN s_gueen AND          "Valid-To Date
    *                    vkorg IN s_vkorg AND
                        vbeln = v_cont AND
    *                   AUART = 'LP  ' AND  "Converts to 'CO  ' Scheduling A
                        auart = 'KM  ' AND  "Converts to 'CQ  ' Qty contract
    *                   VBTYP = 'E' AND     "sales doc cat?              JM
                        vbtyp = 'G' ."AND     "sales doc cat              "JM
    *                    bstzd IN s_bstzd.
        mtab_contract-kunnr = i_vbak-kunnr.
        mtab_contract-ordno = i_vbak-vbeln.
        mtab_contract-vkorg = i_vbak-vkorg.
        WRITE i_vbak-gueen TO mtab_contract-gueen.                "CHG014419
        APPEND mtab_contract.
      ENDSELECT.
      LOOP AT mtab_contract.
    *    PERFORM get_contract.     "CO sales orders line items
    ******Get Contract*********
    * SELECT SINGLE kunnr            "partner
    *    INTO vbpa-kunnr
    *    FROM vbpa
    *   WHERE vbeln EQ  mtab_contract-ordno
    *     AND posnr EQ '000000'
    *     AND parvw EQ 'WE'               "Ship-To's
    *     AND kunnr IN s_ship.           "Ship-To ID added 04/01/99
    *  IF sy-subrc EQ 0 .
    *    MOVE vbpa-kunnr TO mtab_contract-kunnr2.
    *    MODIFY             mtab_contract.
    *  ELSE.
    *    EXIT.
    *  ENDIF.
      CLEAR knvp.
      SELECT SINGLE kunn2            "territory
             INTO   knvp-kunn2
             FROM   knvp
             WHERE  kunnr  EQ mtab_contract-kunnr2
             AND    vkorg  EQ mtab_contract-vkorg
             AND    parvw  EQ 'Z6'.
    *         AND    kunn2  IN s_terr .
      IF sy-subrc EQ 0 .
        MOVE knvp-kunn2 TO mtab_contract-terr.
        MODIFY             mtab_contract.
      ELSE.
        EXIT.
      ENDIF.
      CLEAR kna1.     "get rep name and mail box
      SELECT SINGLE name2 FROM kna1 INTO (kna1-name2)
        WHERE kunnr = knvp-kunn2.
      IF sy-subrc EQ 0 .
        SPLIT kna1-name2 AT w-mm INTO mtab_contract-repname
        mtab_contract-repmailbox.
        mtab_contract-repmailbox+3 = mtab_contract-repmailbox.
        mtab_contract-repmailbox(3) = 'MM'.
        MODIFY             mtab_contract.
      ENDIF.
      CLEAR knvv.
      SELECT SINGLE vkgrp
             INTO   knvv-vkgrp
             FROM   knvv
             WHERE  kunnr EQ knvp-kunn2
             AND    vkorg EQ mtab_contract-vkorg.
    *         AND    vkgrp IN s_vkgrp.
      IF sy-subrc EQ 0 .
        MOVE knvv-vkgrp TO mtab_contract-vkgrp.
        MODIFY             mtab_contract.
      ELSE.
        EXIT.
      ENDIF.
      mtab_contract-med1-qty = '_______'.
      mtab_contract-med2-qty = '_______'.
      mtab_contract-med3-qty = '_______'.
      mtab_contract-med4-qty = '_______'.
      mtab_contract-med5-qty = '_______'.
      mtab_contract-med6-qty = '_______'.
      mtab_contract-med7-qty = '_______'.
      mtab_contract-med8-qty = '_______'.
      mtab_contract-med9-qty = '_______'.
      mtab_contract-med10-qty = '_______'.                           "JM
      mtab_contract-kit1-qty = '____'.
      mtab_contract-kit2-qty = '____'.
      mtab_contract-kit3-qty = '____'.
      mtab_contract-kit4-qty = '____'.
      mtab_contract-dis6 = 'OTHER  _____________________'.              "JM
      mtab_contract-dis7 = 'OTHER  _____________________'.              "JM
      mtab_contract-dis8 = 'OTHER  _____________________'.              "JM
      mtab_contract-dis9 = 'OTHER  _____________________'.              "JM
      mtab_contract-dis10 = 'OTHER  _____________________'.             "JM
    *  SELECT  * FROM VBAP WHERE VBELN = MTAB_CONTRACT-ORDNO.
    *     IF VBAP-MATNR = '7408CP'.
    *       MTAB_CONTRACT-MED1 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR = '0211CP'.
    *       MTAB_CONTRACT-MED2 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR =  '91865US'.
    *       MTAB_CONTRACT-MED3 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR =  '0578CP'.
    *       MTAB_CONTRACT-MED4 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR =  '0068CP'.
    *       MTAB_CONTRACT-MED5 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR =  '0069CP'.
    *       MTAB_CONTRACT-MED6 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR =  '92055CP'.                          "JM
    *       MTAB_CONTRACT-MED7 = VBAP-MATNR.                       "JM
    *     ELSEIF VBAP-MATNR =  '90799CP'.                          "JM
    *       MTAB_CONTRACT-MED8 = VBAP-MATNR.                       "JM
    *     ELSEIF VBAP-MATNR = '41315'.
    *       MTAB_CONTRACT-KIT1 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR = '41316'.
    *       MTAB_CONTRACT-KIT2 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR = '41317'.
    *       MTAB_CONTRACT-KIT3 = VBAP-MATNR.
    *     ELSEIF VBAP-MATNR = '91869US'.
    *       MTAB_CONTRACT-KIT4 = VBAP-MATNR.
    *     ELSE.
    *       SELECT SINGLE MAKTX INTO MAKT-MAKTX
    *                           FROM MAKT WHERE MATNR = VBAP-MATNR.
    *     ENDIF.
    *     MODIFY MTAB_CONTRACT.
    *   ENDSELECT.
      MODIFY mtab_contract.
    *    IF.
    **        mtab_contract-terr IN s_terr AND
    **       mtab_contract-kunnr2 IN s_ship AND
    **       mtab_contract-vkgrp IN s_vkgrp.
    **      PERFORM get_address.
    *    ELSE.
    *      DELETE mtab_contract INDEX sy-tabix.
    *    ENDIF.
      ENDLOOP.
      SORT mtab_contract BY terr.
    *  PERFORM set_print_option.
    *  Print defaults should be immed and delete after print...
      itcpo-tdimmed  = ' '.
      itcpo-tddelete = 'X'.
      itcpo-tdnewid  = 'X'.
      itcpo-tdcopies = 1.
      itcpo-tdnoprev = 'X'.
      itcpo-tdgetotf = 'X'.
      itcpo-tddest  = 'LOCL'.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          destination            = 'LOCL'
          no_dialog              = 'X'
        IMPORTING
          out_archive_parameters = w_arc_params
          out_parameters         = w_pri_params.
    *exit if cancel chosen*
      IF sy-subrc NE 0.
        EXIT.
      ENDIF.
      sadr-regio = 'CA'.
      sadr-pstlz = '92620'.
      LOOP AT mtab_contract.
    *    PERFORM check-for-values.
    IF mtab_contract-ordno = space.
        mtab_contract-ordno = '___________'.
      ENDIF.
      IF mtab_contract-terr = space.
        mtab_contract-terr = '______'.
      ENDIF.
      IF mtab_contract-repname = space.
        mtab_contract-repname = '___________________________________'.
      ENDIF.
      IF mtab_contract-repmailbox = space.
        mtab_contract-repmailbox = '__________'.
      ENDIF.
      IF mtab_contract-kunnr = space.
        mtab_contract-kunnr = '__________'.
      ENDIF.
      IF mtab_contract-name1 = space.
        mtab_contract-name1 = '___________________________________'.
      ENDIF.
      IF mtab_contract-stras = space.
        mtab_contract-stras = '___________________________________'.
      ENDIF.
      IF mtab_contract-pstlz = space.
        mtab_contract-pstlz = '__________'.
      ENDIF.
      IF mtab_contract-ort01 = space.
        mtab_contract-ort01 = '___________________________________'.
      ENDIF.
      IF mtab_contract-regio = space.
        mtab_contract-regio = '___'.
      ENDIF.
      IF mtab_contract-kunnr2 = space.
        mtab_contract-kunnr2 = '__________'.
      ENDIF.
      IF mtab_contract-name2 = space.
        mtab_contract-name2 = '___________________________________'.
      ENDIF.
      IF mtab_contract-stras2 = space.
        mtab_contract-stras2 = '___________________________________'.
      ENDIF.
      IF mtab_contract-pstlz2 = space.
        mtab_contract-pstlz2 = '__________'.
      ENDIF.
      IF mtab_contract-ort012 = space.
        mtab_contract-ort012 = '___________________________________'.
      ENDIF.
      IF mtab_contract-regio2 = space.
        mtab_contract-regio2 = '___'.
      ENDIF.
    *    PERFORM open_form.
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          dialog   = ' '
          form     = 'ZREV_CCK_AGREMT'
          language = sy-langu
          OPTIONS  = itcpo
        EXCEPTIONS
          canceled = 1
          device   = 2
          form     = 3
          OPTIONS  = 4
          unclosed = 5
          OTHERS   = 6.
      IF sy-subrc <> 0.
        MESSAGE e000(zz) WITH 'Open Form Error. ' sy-subrc.
      ENDIF.
        z_element = 'MAIN'.
    *    PERFORM write_form.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element   = z_element
        EXCEPTIONS
          element   = 1
          function  = 2
          type      = 3
          unopened  = 4
          unstarted = 5
          window    = 6
          OTHERS    = 7.
    *    PERFORM close_form.
    CALL FUNCTION 'CLOSE_FORM'
        IMPORTING
          RESULT   = w_res
        TABLES
          otfdata  = i_otf
        EXCEPTIONS
          unopened = 1
          OTHERS   = 2.
      IF sy-subrc <> 0.
        MESSAGE e000(zz) WITH 'Close Form Error. ' sy-subrc.
      ENDIF.
    *&---Convert OTF data to PDF data.
      call function 'CONVERT_OTF'
       exporting
         format                      = 'PDF'
       importing
         bin_filesize                = binfilesize
        tables
          otf                         = i_otf
          lines                       = pdftab[].
    data : name LIKE  RLGRAP-FILENAME.
      CONCATENATE 'C:Temp' mtab_contract-ordno '.pdf' INTO v_name.
    *CALL FUNCTION 'DOWNLOAD'
    * EXPORTING
    *      bin_filesize = v_size
    *      filename     = name
    *      filetype     = 'BIN'
    *  TABLES
    *    data_tab                      = pdftab[].
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
    *       BIN_FILESIZE                    =
            filename                        = v_name
           FILETYPE                        = 'BIN'
          tables
            data_tab                        = pdftab[].
    * Downloading the PDF File
    *  CALL METHOD lcl_cls->gui_download
    *    EXPORTING
    *      bin_filesize = v_size
    *      filename     = v_name
    *      filetype     = c_bin
    *    CHANGING
    *      data_tab     = pdftab[].
      CALL METHOD cl_gui_cfw=>flush.
    **Send PDF as Email.
    *  wa_obj_txt-line = 'CCK Contract Agreement'.
      APPEND wa_obj_txt TO t_obj_txt.
      CLEAR wa_obj_txt.
      wa_obj_txt-line = 'Please find attatched PDF document for Contract'.
      APPEND wa_obj_txt TO t_obj_txt.
      CLEAR wa_obj_txt.
      DESCRIBE TABLE t_obj_txt LINES tab_lines.
    **Prepare document data
      wa_document_data-obj_name = 'CCK Contract Agreement'.
      wa_document_data-obj_descr = 'CCK Contract Agreement'.
      wa_document_data-obj_langu = sy-langu.
      wa_document_data-proc_type = 'R'.
      wa_document_data-proc_name = 'CCK'.
      wa_document_data-priority  = c_x.
      wa_document_data-obj_prio  = c_x.
    **Receiving list
      wa_rec_list-receiver = sy-uname.
      wa_rec_list-rec_type = 'B'.
      wa_rec_list-com_type = 'INT'.
      wa_rec_list-notif_del = c_x.
      APPEND wa_rec_list TO t_rec_list.
      CLEAR wa_rec_list.
      wa_rec_list-receiver = '[email protected]'."p_email.
      reciever = wa_rec_list-receiver.
      wa_rec_list-rec_type = 'U'.
      wa_rec_list-com_type = 'INT'.
      wa_rec_list-notif_del = c_x.
      APPEND wa_rec_list TO t_rec_list.
      CLEAR wa_rec_list.
    *Object packet
      CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
        EXPORTING
          line_width_src                    = 134
          line_width_dst                    = 255
         TABLES
           content_in                        = pdftab[]
           content_out                       = t_obj_bin
        EXCEPTIONS
          err_line_width_src_too_long       = 1
          err_line_width_dst_too_long       = 2
          err_conv_failed                   = 3
          OTHERS                            = 4
      IF sy-subrc <> 0.
      ENDIF.
      DESCRIBE TABLE t_obj_bin LINES v_lines.
      CLEAR wa_obj_pack-transf_bin .
      wa_obj_pack-head_start = 1.
      wa_obj_pack-head_num = 0.
      wa_obj_pack-body_start = 1.
      wa_obj_pack-body_num = tab_lines.
      wa_obj_pack-doc_type = 'RAW'.
      wa_obj_pack-doc_size = tab_lines * 255.
      APPEND wa_obj_pack TO t_obj_pack.
      CLEAR wa_obj_pack.
      wa_obj_pack-transf_bin = 'X'.
      wa_obj_pack-head_start = 1.
      wa_obj_pack-head_num = 0.
      wa_obj_pack-body_start = 1.
      wa_obj_pack-body_num = v_lines.
      wa_obj_pack-doc_type = 'PDF'.
      wa_obj_pack-obj_name = 'ATTATCHMENT'.
      wa_obj_pack-obj_descr = mtab_contract-ordno.
      wa_obj_pack-doc_size = binfilesize.
      APPEND wa_obj_pack TO t_obj_pack .
      CLEAR wa_obj_pack.
    **Object header
      wa_obj_header-line = 'PDF'.
      APPEND wa_obj_header TO t_obj_header.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_document_data
          put_in_outbox              = c_x
          commit_work                = c_x
        IMPORTING
          sent_to_all                = flag_sent_to_all
          new_object_id              = obj_id
        TABLES
          packing_list               = t_obj_pack
          object_header              = t_obj_header
          contents_bin               = t_obj_bin
          contents_txt               = t_obj_txt
          receivers                  = t_rec_list
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
      IF sy-subrc <> 0.
      else.
      return = 'true'.
      ENDIF.
    ENDFUNCTION.
           <b> Flow Editor</b>
    <flow>
         <state name="Start">
              <module name="<b>ZV_FUNC_CCK_EMAIL_PDF</b>" type="RFC" stateful="1">
                   <inputmapping source="Contract" target="CONTRACT"/>
                   <inputmapping source="email" target="EMAIL"/>
              </module>
              <module name="ZV_FUNC_CCK_VALIDATE_SHIPTO" type="RFC" stateful="1">
                   <inputmapping source="SHIP_TO" target="KUNNR"/>
                   <inputmapping source="USERNAME" target="USER"/>
                   <outputmapping source="CITY" target="CITY"/>
                   <outputmapping source="NAME" target="NAME"/>
                   <outputmapping source="POSTAL" target="POSTAL"/>
                   <outputmapping source="REGION" target="REGION"/>
                   <outputmapping source="RETURN" target="RETURN"/>
                   <outputmapping source="SD_CITY" target="SD_CITY"/>
                   <outputmapping source="SD_NAME" target="SD_NAME"/>
                   <outputmapping source="SD_POSTAL" target="SD_POSTAL"/>
                   <outputmapping source="SD_REGION" target="SD_REGION"/>
                   <outputmapping source="SD_STREET" target="SD_STREET"/>
                   <outputmapping source="SOLDTO" target="SOLDTO"/>
                   <outputmapping source="STREET" target="STREET"/>
              </module>
         </state>
         <event name="onLoad" next_state="Start"/>
         <event name="Check2" next_template="ZV_CCO_CONFIRMED_ORDER"/>
    </flow>

  • Adding steps for a background job

    Hello All,
    I am creating a background job through a program and submitting another program for running in the background.
    I would like to add steps for the backgound job which I created trough my program.
    So background job will have different steps  for the same program which I submitted.
    Could any one of you help me on how to add steps for background job which is already running.
    Thanks and Regards,
    Vijay

    Hi Naimesh,
    Thanks for the Reply.
    Sorry for replying late.
    The problem I am facing is we need only one job with multiple step .
    for example if we have job named BCKGRD.
    Under this job we need to create Step 1, Step 2, Step 3..
    Regards,
    Vijay

  • Scheduling a Background Job for PM/CO Settlements (KO8G)

    Hi All,
    I've created variants for settlements of PM & CO orders using transaction KO8G. Now I want to schedule a background job using TCode SM36. What program name/ABAP name should I use for settlements when scheduling background jobs?
    Regards,
    Tso

    Hello Tso,
    Try transaction SCMO which provides you the option to set
    the start date to finish date and can also set the start time and
    finish time and allows you to specify the variant to be used.
    When in transaction KO8G fill out the fields as you wish them for
    the background job and then same the selection as a variant. There is
    an option to have the variant for background jobs and save the variant
    then you can specify this variant in the SCMO screen.
    SCMO is the sceduele manager which will allow you to scehedule many
    jobs as necessary.
    Some notes:
      332149  SCMA: Required workflow settings
      325118  Schedule Manager: link customer-specific reports
      317601  Schedule Manager: Customer reports for multilevel worklist
      332149  SCMA: Required workflow settings
      891042  SCHEDMAN: Automatic start of several flow definitions
    I hope this helps.
    Regards,
    Lucas

  • Is there a system variable indicator for a background job?

    Hello all.
    Is there a way for me to know, in the ABAP program, at runtime, whether the program is beeing run by a background job or not?
    Thanks!

    Hi
    check
    SY-BATCH for Program running in background cehck in SYST table for all.
    Thanks & Regards,
    Chandralekha.

  • Procedure for setting a background job

    Hi Experts,
    Please give me the step by step procedure in setting a background job.
    Thanks,
    Kavin

    Hi,
    Specifying ABAP Program to Run in Background
    ABAP program or external program can be specified to be run in the background. More than one program can be executed with a single background job. To do it you should add a job step for each program.
    Let us first discuss the procedure for creating an ABAP report.
    The Users field will, by default, display your name, indicating that the user (you) is authorized to run this program.
    In case there is another user authorized for scheduling the job, then the default name is changed and system displays the name of the other user.
    Now choose ABAP and enter the name of the report.
    Choose variant from the Variant list. Specify the language you want the report to be in.
    With Print specifications, you can specify whether you want the report output to be held in the SAP spool system or have it printed as soon as the job has run.
    For external command, by default, the job step will run under your SAP System authorizations. So your name will appear in the User field.
    But if the program is running under the authorization of another user, you can change this default option by entering another user name.
    Then choose External command and enter the predefined SAP name. If required, enter any additional arguments required for the command.
    The host system on which the command should run and the type of operating system at the host should be specified. You can determine the host name using the host name command on the target host system.
    You can also specify how the output from the external program should be treated, as well as other runtime options by using Control flags. It is advisable to use default settings for these options. If you are authorized for background processing, you can also choose External programs as a job step option.
    To run an external program, enter the exact path, program or script name, arguments required by the program, and the name of the host system on which the program is to run. After this, save the job step and return to the job identification screen.
    Note that in the SAP system the ABAP programs are not predefined; therefore, the system does not perform an authorization check. Hence, the system does not bother to check whether you are allowed to use the command.
    For detailed information on Background Job, Check the following link and help.sap.com,
    http://aspalliance.com/1129_Background_Processing_SAP_R3_System
    Hope this helps you.
    Regards,
    Vinodh

  • Trigger substitution rule for a background job

    Hi all,
    I ve written a subroutine in Substitution rules for FI in GGB1 tcode for F110 transaction to replace the section code (bseg-secco) while posting a fi document.
    but the substitution rule is not getting triggered as F110 runs a background job to post the document...
    The substitution is active and the activation level is active all the time.
    Could u please suggest how to get it triggered for a background job...

    Measuring External Processes
    Use
    The runtime analysis allows you to switch into work processes that are already running and to measure the runtime of dialogs running in them as though they were running in the current session. You can have up to ten external sessions, which may be of any type – for example, dialog, update, or spool. This runtime analysis variant is ideal for monitoring long-running background jobs.
    Filename and Directory
    If you do not want to use the default filename and directory to store files, you can change them using the profile parameter abap/atrapath. If the profile parameter does not contain an entry at all, an error occurs when you start the runtime analysis.

Maybe you are looking for

  • Ipod freezes when playing video through dock

    Okay, this is a challenging one. I will be surprised if someone can help me figure this one out, but I will be very grateful!! Picked up a brand new 60gb 5th generation video ipod the other day. 1.1 update already installed. Everything worked great.

  • Oracle forms --11g installation error

    Hi All, Configuration: Oracle Database: 10.2.0.5 Oracle forms to be installed Version: 11.1.2.0.0 OS version: Windows 7, 64 Bit JDK version: java version "1.7.0_03" Java(TM) SE Runtime Environment (build 1.7.0_03-b05) Java HotSpot(TM) 64-Bit Server V

  • 'Save to' file choices limited in Elements 13

    Elements 13 on a mac.  When I finish with an image and want to 'save as' it doesn't let me browse my files.  I have to choose one of five recent files or others that are too general.  Why can't I pick the specific file I want to save it in?

  • Mysql problem

    When I want to do a recordset for use my database, all the time I got a error message like that. What can I do ?

  • The error of PC00_M27_CALC_SIMU Division by zero not performed

    Dear Export,        When I run PC00_M27_CALC_SIMU  to simulation,occurs error:   /810 Partial period factor 10 Division by zero not performed Calculation rule    HKPF/810          RTE=TSDIVI RTE-TSDIVP RTEKGENAU RTE Can you tell me how to resolve? Be