SUBMIT rkaep000 in background

Hi Guru's,
I've created a selection wirh differents parameters :
1)Controlling area - KOKRS
2)Partner Object -PAROB
3)Posting date - BUDAT
4)Debit TYPE-BELTP
5)Business Transaction - VRGNG
I try to pass those parameters in background to the report rkaep000  but the names in this reports are completely differents.
For the Controlling area, posting date and the cost it is ok but not for the others. I don't find them.
*  "Partner Object
  LOOP AT s_parob.
    CLEAR wa_p.
    wa_p-selname = 'PAROB1'.
    wa_p-kind = 'S'.
    wa_p-sign = s_parob-sign.
    wa_p-option = s_parob-option.
    wa_p-low = s_parob-low.
    wa_p-high = s_parob-high.
    APPEND wa_p TO i_tab.
  ENDLOOP.
*  "Posting Date
  LOOP AT s_budat.
    CLEAR wa_p.
    wa_p-selname = 'R_BUDAT'.
    wa_p-kind = 'S'.
    wa_p-sign = s_budat-sign.
    wa_p-option = s_budat-option.
    wa_p-low = s_budat-low.
    wa_p-high = s_budat-high.
    APPEND wa_p TO i_tab.
  ENDLOOP.
*  "Debit Type
*  CLEAR wa_p.
*  wa_p-selname = 'BELTP'.
*  wa_p-kind = 'P'.
*  wa_p-sign = 'I'.
*  wa_p-option = 'EQ'.
*  wa_p-low = p_beltp.
*  APPEND wa_p TO i_tab.
*  "Bus. Transaction
*  LOOP AT s_vrgng.
*    CLEAR wa_p.
*    wa_p-selname = 'VRGNG'.
*    wa_p-kind = 'S'.
*    wa_p-sign = s_vrgng-sign.
*    wa_p-option = s_vrgng-option.
*    wa_p-low = s_vrgng-low.
*    wa_p-high = s_vrgng-high.
*    APPEND wa_p TO i_tab.
*  ENDLOOP.
    SUBMIT rkaep000
      WITH p_tcode = 'KSB1'
     WITH SELECTION-TABLE i_tab
       TO SAP-SPOOL
         SPOOL PARAMETERS print_parameters
         ARCHIVE PARAMETERS archi_parameters
         WITHOUT SPOOL DYNPRO
         VIA JOB w_name NUMBER w_number
       AND RETURN.
Anybody could help me please?
Regards,
Mohamed.

Of course but the problem it is it doesn't help me.
I tried also to expand the submit but I don't for which of those fields I have to enter the parameters.
SUBMIT rkaep000
        with aufgr ...
        with aufnr ...
        with f_belnr ...
        with gr_wrttp ...
        with g_tname ...
        with g_values ...
        with i_kstrg ...
        with i_matnr ...
        with i_posnr ...
        with i_procnr ...
        with i_salor ...
        with i_werks ...
        with koagr ...
        with kostl ...  * Cost Center
        with kstar ...
        with kstgr ...
        with przgr ...
        with prznr ...
        with p_actvrs ...
        with p_afabe ...
        with p_arobj ...
        with p_aufnr ...
        with p_disvar ... * Layout
        with p_fixvar ...
        with p_gesw ...
        with p_infsys ...
        with p_item ...
        with p_kokrs ... * COntrolling Area
        with p_maxsel ...
        with p_obj ...
        with p_open ...
        with p_tcode ...
        with p_usear ...
        with p_usedb ...
        with p_usegrd ...
        with p_valtyp ...
        with r_arsel ...
        with r_awvrs ...
        with r_belnr ...
        with r_budat 
        with r_budat1 ...
        with r_budat2 ...
        with r_gjahr ...
        with r_gjahr1 ...
        with r_gjahr2 ...
        with r_obdat ...
        with r_perio ...
        with r_perio1 ...
        with r_versa ...
        with r_versn ...
But I don't know where are the Partner Object (PAROB), Business Transaction (VRGNG) and the Debit Type (BELTP).

Similar Messages

  • SUBMIT rkaep000 with "Further Selection Criteria"

    Hi all,
    Could anyone please tell me how to call the transaction KSB1 with it's "Further Selection Criteria" (i.e. Document Number). I have tried the following but it didn't work.
    SUBMIT rkaep000
      WITH p_tcode = 'KSB1'
      WITH kostl = '7062'
      WITH r_belnr BETWEEN '101727316' AND '101727316'
      WITH r_budat BETWEEN '20070101' AND '20070131'
      AND RETURN.
    Many thanks!
    Steve.

    try using submit rkaep000 with with selection-table t_Screen_tab.
    t_screen_tab is a table of type rsparams.
    rsparams is a structure with following field.
    SELNAME
    KIND
    SIGN
    OPTION
    LOW
    HIGH
    fill with an entry for each screen selection object.
    eg.
    t_screen_Tab-selname = 'R_BELNR'.
    t_Screen_tab-kind = 'S'. "S for select option, P for parameter
    t_Screen_tab-sign = 'I'. "I include E exclude
    t_screen_tab-option = 'BT'. "between, EQ or NE
    t_Screen_Tab-low = '101727316'.
    t_screen_tab-high = '101727316'.
    append t_screen_Tab.
    repeat for all selection entries required.
    Here is the abap help on topic
    Addition 3
    ... WITH SELECTION-TABLE rspar
    Effect
    If you specify this addition, parameters and selection criteria on the selection screen are supplied from an internal table rspar. You must specify an internal table with the row type RSPARAMS for rspar. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR:
    SELNAME (length 8),
    KIND (length 1),
    SIGN (length 1),
    OPTION (length 2),
    LOW (length 45),
    HIGH (length 45).
    To supply parameters and selection criteria for the selection screen with specific values, the lines in the internal table rspar must contain the following values:
    SELNAME must contain the name of a parameter or selection criterion for the selection screen in block capitals
    KIND must contain the type of selection screen component (P for parameters, S for selection criteria)
    SIGN, OPTION, LOW, and HIGH must contain the values specified for the selection table columns that have the same names as the selection criteria; in the case of parameters, the value must be specified in LOW and all other components are ignored.
    If the name of a selection criterion is repeated in rspar, this defines a selection table containing several lines and passes it on to the selection criterion. If parameter names occur several times, the last value is passed on to the parameter.
    The contents of the parameters or selection tables for the current program can be entered in the table by the function module RS_REFRESH_FROM_SELECTOPTIONS.
    Note
    In contrast to selection tables, the data types of the components LOW and HIGH in table rspar are always of type CHAR and are converted to the type of the parameter or selection criterion during transfer, if necessary.

  • Submit RSEOUT00 as background job

    Hi all,
    Here is my requirement.There is a Z program from which RSEOUT00 program has to be called , so that it will change the Idoc status to '03'. I tried using Submit RSEOUT00..and return and also tried JOB_open and then SUBMIT rseout00 WITH docnum EQ p_idocno  user sy-uname  via  job jobname number jobcount and return and then JOB_CLOSE .I checked SM37 also where i can see this job as finished..
    I tried COMMIT WORK statement and also WAIT statement .
    But still the idoc status wont change to '03' .
    Can anyone plase advise on how to correct this .
    Regards,
    Sudheer

    Hi,
    I have created background job for RSEOUT00 and written the below code. It worked.
    DATA: w_number           TYPE tbtcjob-jobcount,
               w_name              TYPE tbtcjob-jobname VALUE 'ZTEST_JOB'.
       CALL FUNCTION 'JOB_OPEN'
         EXPORTING
           jobname          = w_name
         IMPORTING
           jobcount         = w_number
         EXCEPTIONS
           cant_create_job  = 1
           invalid_job_data = 2
           jobname_missing  = 3
           OTHERS           = 4.
       IF sy-subrc = 0.
         SUBMIT rseout00  VIA JOB w_name NUMBER w_number AND RETURN.
         IF sy-subrc = 0.
           CALL FUNCTION 'JOB_CLOSE'
             EXPORTING
               jobcount             = w_number
               jobname              = w_name
               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
               OTHERS               = 8.
           IF sy-subrc <> 0.
           ENDIF.
         ENDIF.
       ENDIF.
    Thanks,
    Appanaboina

  • How to get data from the called program using SUBMIT in a background job?

    Hi Experts,
    I've a program which creates a background job using JOB_OPEN and JOB_CLOSE function modules.
    Between the above function modules I need to call a program using SUBMIT VIA JOB statement.
    My problem is, How do I fetch some data in an internal table in the called program to the calling program after the SUBMIT statement?
    I tried to EXPORT and IMPORT the data, but they are giving a failed sy-subrc when using this background job.
    Kindly let me know your inputs and valuable suggestions.

    Kumar,
    When we execute a program as a background job then the output will be sent to Spool which needs to be fetched again.I guess we need to use Submit via spool as mentioned by Rajat.
    Check these threads to get some idea
    submit report to spool & import spool id
    Re: Generate Spool for a report
    K.Kiran.

  • Submit + LIST_FROM_MEMORY in background mode

    Hi,
    I need to capture the output results from standard program RFKORK00 and hence I designed a wrapper program that calls the standard program.
    RFKORK00 generates a report output and I am able to capture the results correctly using the FM LIST_FROM_MEMORY and FM LIST_FROM_ASCI in foreground mode. But when I try to run the same job in background, the FM LIST_FROM_MEMORY does not return any results (I have checked the log by inserting information messages at various points in the program).
    I have searched for similar contexts here on SDN and everyone is in agreement that LIST_FROM_MEMORY would work well even in the background mode too but I am unable to find the fault in this case. Could you please help, attached is the code -
    SUBMIT RFKORK00
          USING SELECTION-SET c_variant
          EXPORTING LIST TO MEMORY
          AND RETURN.
        CALL FUNCTION 'LIST_FROM_MEMORY'
          TABLES
            listobject = lt_abaplist
          EXCEPTIONS
            not_found  = 1
            OTHERS     = 2.
        IF sy-subrc = 0.
          CALL FUNCTION 'LIST_TO_ASCI'
            EXPORTING
              list_index         = '-1'
              with_line_break    = ' '
            TABLES
              listasci           = lt_vlist[]
              listobject         = lt_abaplist[]
            EXCEPTIONS
              empty_list         = 1
              list_index_invalid = 2
              OTHERS             = 3.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          MESSAGE i099(z1) WITH 'LIST TO ASCI CALL'.
       ENDIF.

    Well, RFKORK00 is indeed a print program that triggers spool in the background.
    I gave up playing around memory id, instead I am using the following code to check whether a spool was created in table TSP03.
    CLEAR r_rqcretime[].
        r_rqcretime-sign    = 'I'.
        r_rqcretime-option  = 'BT'.
        CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
          EXPORTING
            i_datlo     = sy-datlo
            i_timlo     = sy-uzeit
            i_tzone     = 'EST'
          IMPORTING
            e_timestamp = v_tzntstmps.
        r_rqcretime-low = v_tzntstmps.
    **Submit job with changed variant
        SUBMIT (p_prog)
          USING SELECTION-SET c_variant
          EXPORTING LIST TO MEMORY
          AND RETURN.
        WAIT UP TO 5 SECONDS.
    **Fetch the spool number generated by the program
        CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
          EXPORTING
            i_datlo     = sy-datlo
            i_timlo     = sy-uzeit
            i_tzone     = 'EST'
          IMPORTING
            e_timestamp = v_tzntstmps.
        r_rqcretime-high = v_tzntstmps.
        CONDENSE: r_rqcretime-low,r_rqcretime-high.
        CONCATENATE r_rqcretime-low   '00' INTO r_rqcretime-low.
        CONCATENATE r_rqcretime-high  '00' INTO r_rqcretime-high.
        APPEND r_rqcretime.
        SELECT SINGLE rqident FROM tsp01
                      INTO v_rqident
                     WHERE rqowner = sy-uname
                       AND rqcretime IN r_rqcretime.

  • Submit RIMODGEN in Background

    Does anyone know how to submit RIMODGEN in the background?  Here's a small clip of my code.  I don't think the problem is with my parameters.  The program executes but the integration model is not created.
        CLEAR gt_params.
        PERFORM load_params USING 'I_INCR'   'P' 'I' 'EQ' 'X'.  "Dark Mode
        PERFORM load_params USING 'I_MODID'  'P' 'I' 'EQ'  p_model.
        PERFORM load_params USING 'I_LOGSYS' 'P' 'I' 'EQ'  p_lsys.
        PERFORM load_params USING 'I_APPL'   'P' 'I' 'EQ' 'MATERIALS'.
        PERFORM load_params USING 'I_MATINC' 'P' 'I' 'EQ' 'X'.
        LOOP AT gt_mara INTO gs_mara.
          PERFORM load_params USING 'MA_MATNR' 'S' 'I' 'EQ' gs_mara-matnr.
        ENDLOOP.
        SUBMIT rimodgen
          WITH SELECTION-TABLE gt_params
           AND RETURN.
    Thanks in advance for any help someone can provide.
    Mike

    Could you please elaborate on your requirement. In general we use SM36 and SM37 for IM creation and scheduling. For IM activation you have to use program RIMODAC2 and create and schedule job using SM36 and SM37
    Thanks
    Aparna
    Edited by: Saradha Ramesh on Jun 12, 2009 6:15 PM

  • Submit job in background

    Hi All
    I have a program with selection screen. The selection screen has Job name as one of the parameters. When I press F8 (Execute), this program should get scheduled in the background with the job name taken from selection screen. How to submit a program by itself in background.
    Please suggest.
    Thanks
    Shakir

    Hi,
    Press F9 from the program itself after entering the selection parameters
    Or
    Create a selection variant and go to SM36 and give some valid name , program name with variant and save and schedule.
    Regards,
    Nandha

  • SUBMIT issue in background

    Hi experts,
           I am submitting the other program which is using the LDB in my program. When i execute the program in foreground it is working properly. But when i execute the same program in background, the job is getting cancelled by giving the error message as 'fill in all required entry fields'. But there are no mandatory fields in calling program. I have been strugling with this from last one week. please help me regarding this issue

    u have to enter job name.
    SUBMIT <REPORT>
           USER <USER> VIA JOB <JOB NAME> NUMBER <JOB NUMBER>
           WITH PARAM1 =
           WITH PARAM2 =
              AND RETURN
    Refer this Thread:
    how to pass parameters to a background job?

  • Submit Trnsc in Background and know the Sucess/failure status

    Hello All,
    I need to submit a transaction with variants in the background. I need to knwo whether the transaction completed successfully or failed in my Program and then send an email to a list of people based on the status .
    Can anyone tell me how to achieve this? How to know in the program that the transaction completed/failed?
    Thanks

    Hello,
    If you had scheduled a transaction with some variants as a background job then I believe you should be able to see whether that is successful or not using transaction se37.
    If you want to send an email of the output of that job then you may have to set up groups in lotus notes or outlook and the people in that group will receive an email when the job is succesfully finished or failed otherwise.
    There is a FM which will help you to display the detail log of the background jobs. Do a displaylog* in se37 transaction.
    Thanks,
    Message was edited by: Naren Somen

  • Submit report in background on specific server

    Hi,
    I like to execute a report on a specific server in background. Is there a FM to do this. I know I can use SM36, but that's not the way I want it.
    Regards,
    GJ van Holland

    Hi,
    Here is a sample code.
    Report bkgnd.
    Perform dobackground.
    FORM dobackground.
    Local parameters declaration
      DATA : jobname    LIKE tbtcjob-jobname,
             jobcount   LIKE tbtcjob-jobcount.
      DATA : ws_spld    LIKE pri_params-pdest,
             ws_lstname LIKE pri_params-plist,
             ws_listext LIKE pri_params-prtxt.
      DATA : params     LIKE pri_params,
             arparams   LIKE arc_params,
             days(1)    TYPE n VALUE 2,
             valid      TYPE c.
      jobname    = 'job_name'.
      ws_lstname = 'list_name'.
      ws_listext = 'List_text'.
    Create a job
      CALL FUNCTION 'JOB_OPEN'
           EXPORTING
                jobname          = jobname
           IMPORTING
                jobcount         = jobcount
           EXCEPTIONS
                cant_create_job  = 1
                invalid_job_data = 2
                jobname_missing  = 3
                OTHERS           = 4.
    Set print parameters
      SELECT SINGLE spld INTO ws_spld FROM usr01 WHERE bname = sy-uname.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING destination       = ws_spld
                  list_name         = ws_lstname
                  list_text         = ws_listext
                  immediately       = ' '
                  line_size         = 200
                  line_count        = 65
                  no_dialog         = c_true
        IMPORTING out_parameters         = params
                  out_archive_parameters = arparams
                  valid                  = valid.
    Submit the report to create spool with retreived print parameters
      SUBMIT your_program
        WITH    parameters_if_any
        TO      SAP-SPOOL
        SPOOL   PARAMETERS params
        ARCHIVE PARAMETERS arparams
        WITHOUT SPOOL DYNPRO
        VIA     JOB jobname NUMBER jobcount
        AND     RETURN.
    Close job
      CALL FUNCTION 'JOB_CLOSE'
           EXPORTING
                jobcount             = jobcount
                jobname              = jobname
                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.
    ENDFORM.
    Hope this was of use to you.
    Thanks,
    Susmitha

  • Submit report in background

    Hai friends,
    Requirement is " I need to submit the report in background and program should execute only on every monday of the week.
    Pl do the needful and clarify with hard coding.
    Good answers expect good points.
    Regards,
    Vamsykrishna.

    Hi Vamshy,
    Execute Program with some values in selection-screen and save the selection screen values as some variant.
    Goto SM36 tcode and give some job name,job class ..etc.Then Press
    Start_Conidtion Button in Application tool bar.Here you choose Date/Time button and select Period_Values button in the same screen after choosing some coming Monday's date selected_start option.
    here you can provide Weekly option in period_values option.
    dont forget to save all those values you entered.
    Execute the job in SM37 tcode
    If its not solved your problem feel free to ask further.
    You can achieve the same thing thru function modules like job_submit,job_close..
    Reward if it useful to you
    Thanks
    Sivaparvathi

  • Submit Report (Regarding Background Processing)

    Hi Guru's,
    I want help regarding Background Processing.
    I have developed a program which is running fine in forground but in Background mode no values are comming.
    All values are becomig Zero.
    Plz help.
    *--- Submit Report for 'COGI' (Postprocessing of Error Records from Automatic Goods Movements)
      SUBMIT coruaffw USING SELECTION-SCREEN '1000'
                      WITH  r_cumul = 'X'
                      EXPORTING LIST TO MEMORY
                    AND RETURN.
    *---- Get the List
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          listobject = it_list_tab
        EXCEPTIONS
          not_found  = 1
          OTHERS     = 2.
      IF sy-subrc = 0.
    *--- Convert to Ascii
        CALL FUNCTION 'LIST_TO_ASCI'
          TABLES
            listobject         = it_list_tab
            listasci           = it_asci_tab
          EXCEPTIONS
            empty_list         = 1
            list_index_invalid = 2
            OTHERS             = 3.
        IF sy-subrc <> 0.
    *      MESSAGE i000 WITH 'Problem in converting LIST to ASCII'.
        ENDIF.
        DESCRIBE TABLE it_asci_tab LINES w_cogi.
        w_cogi = w_cogi - 5.
      CALL FUNCTION 'LIST_FREE_MEMORY'
        TABLES
          listobject = it_list_tab.

    Hi Arbind,
                  You have used return you need to add the addition with.Try this way hope it works
    SUBMIT zreport EXPORTING LIST TO MEMORY
                    AND RETURN
                    WITH P_1 = P_1
                    WITH P_2 = P_2
                    WITH P_3 = P_3
                    WITH S_4  IN S_4
                    WITH S_5 IN S_5
                    WITH S_6 IN S_6.

  • Problem in Submit Program in background

    Hi Expert,
    I have one progam which fetch the sales order data as per input selection and pass it to COOISPI  T.Code.
    Through the program
          SUBMIT PPIO_ENTRY
                  USING SELECTION-SCREEN '1000'
                      WITH P_TCODE = 'COOISPI'
                      WITH P_AUTYP = '40'
                      USING SELECTION-SET 'SAP&COOISPI'
                      WITH SELECTION-TABLE rspar_tab
                     AND RETURN.
    But when i schedule the job of program then it is not running.
    Submit statement is running in background mode or not.
    Is there any other way to doing this work.

    HI ,
      yes it works
    You check the statement SY-BATCH  ..
    Or u can call the transaction and pass the values...
    Please see the sample code :

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

  • Submit program in background job

    Hi all.
    Somehow I'm not able of using the following source code within a program executed within a scheduled job:
    SUBMIT RFEBKA00 USING SELECTION-SET 'VAR1'.
    The above program is the transaction FF_5.
    Does any one

    try to code in the below mentioned ...
    use BATCH = 'X' option.
    submit rfebka00 USING SELECTION-SET 'VAR1'
      with batch  = 'X' AND RETURN

Maybe you are looking for

  • App store in iphone looks stretched

    i have an iphone 4 and ipad 3rd gen. Sometimes when i use the app store. The app store in iphone looks like an ipad version ( stretched like ipads) . Bigger icons and need to pan to see the apps. The app store in iPad looks like a iphone version . sm

  • Vista: 1.3 Downloader Doesn't See Sony a700 .ARW's; Odd Mouse Behavior

    On my Vista system,the LR 1.3 downloader (now "Adobe Photodownloader 3.0 Component") doesn't see Sony a700 .ARW's when I choose Camera Or Card Reader as the source. I don't know about a100 .ARW's. The downloader for 1.2 didn't recognize either. I can

  • Creating Subtitles for Existing DVD

    Hello, I am just planning some investments and I am thinking about buying FCP Studio. But the frist project we should be working on is subtitling a collection of training DVD's. The lectures on them are in english and they now should be subtitled in

  • CS6 trial vs student edition

    Hi! I just bought a Phothoshop CS6 extended student-teacher edition (DVD + license)! Right now, I'm using the trial (30 days) it will end in 6 days. This trial is version Photoshop CS6 extended 13.0x64. My question: Do I have to wait the end of this

  • LONG column Manipulation

    Hi, I want to put a message at a paricular position in a long column like LONG Value Part1 ||message || LONG Value Part2. As every body knows i can't use SUBSTR for the same since the Data Type is long and at the same time i can't change the dataType