Background processing for ABAP report with selection screen

Hi ABAP Gurus,
I m facing a strange problem in scheduling a background job for my report with a selection screen. I have a variant for the report.
I scheduled a job, but it seems to be not doing anything though all the system resources are available. The job overview shows "Acive" for the job. The job is neither stopping anything, it is just sitting there In SM50, the status shows "On Hold".
Any ideas/comments on the problem and how this can be overcome?
Qucik replies and solutions will be highly appreciated as this is a crucial part for a go-live project.
Thanks in advance.
Shivani.

Yes. My report has a selection-screen which requires user input. But I have created  a variant for the report and trying to run it in background using this variant. But facing this problem.
Strange thing is, instead of the usual SM36/SM37 option where we schedule and monitor background jobs, this option does not work for my report.
But I tried through SE38, and from my selection screen I selected "Schedule background job" and "run immediately" option, and this works. Though I still use SM37 to monitor this background job.
I have never faced such a situation before.
Any hints/tips why this happens and how this can be overcome in the future?
Thanks in advance.
Shivani.

Similar Messages

  • How to create tcode for modulepool program with selection screen?

    hi,
       How to create tcode for modulepool program with selection screen?
    thanks,
    sagar

    Hi,
    We need to goto SE80.
    In our program we right click on object name and goto create
    -> transaction. Enter the module pool program and screen number and save and activate.
    Or by SE93 also we can create a transaction code for our program.
    Hope ths helps.
    plz reward if useful.
    thanks,
    dhanashri..
    Edited by: Dhanashri Pawar on Jul 22, 2008 8:29 AM

  • Call a report with selection screen as subscreen.

    Hi all,
    i need to Submit And Return a Report having some parameters and Select options, from a Function Module.
    all i want that the Selection Scrren of Report should appeared as Subscreeen, so that Calling Screen sould be visible in Background.
    Is this Possible , if yes then How ?
    thanks in advance,
    Nitin

    Running new report means opening new internal session. This can't be embeded within the current internal session where your function group (function module specifically) runs. So there is no such a way which you could run a report inside a subscreen area.
    If you however want only selection screen of the report to be embeded inside your subscreen area (not run) you can use
    "report Z_SUBSCREEN_REPORT
    SELECTION-SCREEN BEGIN OF SCREEN 0200 as SUBSCREEN.
      PARAMETERS pa type c.
    SELECTION-SCREEN end of SCREEN 0200.
    "main screen's flow logic in function group with subscreen area
    PROCESS BEFORE OUTPUT.
      call SUBSCREEN area INCLUDING 'Z_SUBSCREEN_REPORT '0200'.
    Regards
    Marcin

  • How to create a report with selection screen that can run in background

    Sorry to ask these basic questions but I am knew to ABAP Programming.
    To keep it simply, I am attempting to create a report that has a simple parameter driven selections screen with one field.  That field takes in a folder path from the user.  The user executes the report.  The report creates a simply BDC that goes into SE16, gathers data from a table, and exports the results to a text file using the folder path provided.  I created a variant for the folder path field in the selection screen hoping to use it while executing the report in the background.  The report is not exporting the file as it did when run in the foreground for some reason.
    I am wondering what event is triggered when a report is executed in the background.  In the foreground (or when I execute the program via SE38->Execute->With Variant) the user needs to execute the program by hitting the execute button once the variant has populated the folder path field.  It works then, so I am trying to get the same to work in the background.  I am thinking I didn't put the program together correctly to accommodate the running in the background.  How can you create a report that can accept user input via variant into a selection screen and then run in the background?
    Please, any information would be greatly appreciated.
    Thanks you all for reading this!!!

    Ok, finally I understand what you're doing. Initially you lost me with the SE16 reference...
    Not sure what you're trying to achieve overall, but apart from the fact that you cannot export/download a file to a user's PC via background job (unless you have a mapped network share on the server or something like an FTP server on the user's PC, but both are pretty hypothetical scenarios and unlikely to occur).
    Also, the BDC approach to get data via SE16 is pretty awkward. Note that SE16 is guarded by some authorization checks and often users won't have access in production (which might not matter if you intend to always run your program in background via dedicated batch user). However, I have no clue why you wouldn't want to use [open SQL|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_READING.htm] to read the data. You could then save it on the application server or if you really have to get it to the user you can consider e-mailing the file (extracts should be compressed before sending). For the latter you'll find plenty of references here, basically it's the [business communication services|http://help.sap.com/saphelp_nw2004s/helpdata/en/2d/1c5d3aebba4c38e10000000a114084/frameset.htm] that you'd need to look at.

  • Background processing of S_ALR_87013558 report with output in txt file

    Dear Friend's,
    Here I have a requirement of, to execute standard report S_ALR_87013558 (Budget/Actual/Commitment/Rem Plan/Assigned) in background processing mode. Here we have to run this report in background on daily basis at a particular given time.
    Once this report gets executed in background, output of this report should get converted automatically into txt file and this converted txt file must be downloaded in a respective folder automatically by giving desired path.
    After completion of this process, downloaded txt file they have to use for internal MIS reporting purpose.
    Is this possible via standard PS or else I have to go for the development.Please suggest, what should be the approach?
    Regards,
    Sandeep

    Hi Sandeep,
    Check if you can create batch job to run for S_ALR_87013558 using SM36
    The Program name is GP8YTY7TBR1TYRPCIPKAC6X9GZG
    Please check with ABAP.
    Regards,
    Nitin

  • Report with Selection screen

    I have a stupid report.
    In the initialization event I have put that
    initialization.
    set pf-status '123'.
    But in the start of selection/at user-command
    sy-ucomm is empty ... any idea is welcome
    REWARD PROMISED
    Message was edited by: STEPHAN KAMINSKI

    SELECTION-SCREEN PUSHBUTTON fmt name USER-COMMAND ucom.
    SELECTION-SCREEN FUNCTION KEY <Number>. "This is for displaying in Application Toolbar.
    Check the following help documentation..
    SELECTION-SCREEN PUSHBUTTON fmt name USER-COMMAND ucom.
    Addition: MODIF ID modid.
    Effect
    Generates a pushbutton on the selection screen. When you define the button, you also define a user command ucom (no inverted commas), up to 20 characters long, which is triggered when the user pushes the button. The rest of the syntax is the same as for SELECTION-SCREEN COMMENT
    You can define the name name either statically or at runtime (see also the BEGIN OF BLOCK, COMMENT and SELECTION-SCREEN BEGIN OF SCREEN variants).
    When you define a pushbutton, you must always specify a format fmt.
    By specifying a Modif ID, you can assign the pushbutton to a modification group.
    Notes
    The best way of reacting to the pushbutton is in the AT SELECTION-SCREEN event, or, for pushbuttons in the selection include, in the PAI routine (with FNAME = '*' and MARK = SPACE) in the database program SAPDBldb. The field SSCRFIELDS-UCOMM contains the user command ucom. (You need to declare the SSCRFIELDS table using the TABLES statement).
    You can create your own pushbuttons in the application toolbar using the FUNCTION KEY n addition.
    Within the selectoin include : Additions FOR NODE node ,FOR TABLE dbtab und ID id.
    Example
    TABLES SSCRFIELDS.
    SELECTION-SCREEN PUSHBUTTON /10(20) CHARLY USER-COMMAND ABCD.
    INITIALIZATION.
    MOVE 'My text' TO CHARLY.
    AT SELECTION-SCREEN.
    IF SSCRFIELDS-UCOMM = 'ABCD'.
    ENDIF.
    A pushbutton appears on the selection screen with the text 'My text'. In the AT SELECTION-SCREEN event, the field SSCRFIELDS-UCOMM has the contents ABCD after the button has been pushed.

  • Creation of spool request for a report without selection-screen.

    Hi Experts ,
    I need to create a spool request for ALV Grid report which is not having any selection-screen , after pressing F8 it will directly display the ALV Grid out put.
    Can any one help me how to run the above report in background which is not having selection-screen?
    Thank you & Regards.
    Rajasekhar.P

    HI,
    At transaction SE38 click Program -> Execute -> Background.
    Regards
    Sudheer

  • Pop-up in a report with selection screen

    Hi all,
    I need to display a pop-up as an input component for a report as it is executed.
    The controlling area has to entered inthe pop-up.The pop-up is same as the one in Transaction code CO99.
    How do i do this for report? Its not a module pool development.
    Pls help with your ideas.
    Thanks,
    stock

    Use this code for this purpose. 
    Write this subroutine where u want the popup.
    PERFORM POPUP USING ST CHANGING ST.
    Write the following code in the subroutine of pop up.
    FORM POPUP USING P_INVST CHANGING P_VALUE.
    DATA: FIELDS LIKE SVAL OCCURS 0 WITH HEADER LINE.
      DATA : TITLE(40).
      REFRESH : FIELDS. CLEAR ANS.
      P_VALUE = P_INVST.
      FIELDS-TABNAME = 'TKA01'. FIELDS-FIELDNAME = 'KOKRS'.
      FIELDS-VALUE = P_VALUE.
        APPEND FIELDS.
    heading of the title box
    TITLE = 'Please give the controlling area'
    function to get the pop up
      CALL FUNCTION 'POPUP_GET_VALUES'
           EXPORTING
                POPUP_TITLE = TITLE
           IMPORTING
                RETURNCODE  = ans
           TABLES
                FIELDS      = fields.
      if ans = 'A'.
      else.
        read table fields index 1.
        P_VALUE = FIELDS-VALUE.
      endif.
    ST = P_VALUE.
    ENDFORM.                    " POPUP

  • Run alv report without selection screen in background

    Hello Every body,
    i programmed a ALV Report without selection screen, and i want to create a job for this alv report.
    Any help?
    Thank u.
    Ouail.

    Hi Steve,
    Can you tell me where i have to put your code?
    this is my abap code:
    START-OF-SELECTION.
       p_filref = '\\SAPSERVER\f\SAFT\ivat\FI_Extract_1000_20140709_102346_910.XML'.
       PERFORM copy_from_xml_to_itab TABLES it_ref_file
                                     ref_xml_data
                                     USING p_filref.
    **Begin Extraction File
       SUBMIT ZZ_FI_IVAT_EXTRACTOR
       WITH p_bukrs EQ '1000'
       WITH p_gjahr EQ '1998'
       WITH filepath EQ '\\SAPSERVER\f\SAFT\iVAT_Extractie\'
       WITH cldata eq space
       AND RETURN.
       DATA: FILE_TABLE  TYPE TABLE OF SDOKPATH,
       DIR_TABLE  TYPE TABLE OF SDOKPATH.
       CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
         EXPORTING
           DIRECTORY  = '\\SAPSERVER\f\SAFT\iVAT_Extractie\'
           FILTER     = '*.*'
         TABLES
           FILE_TABLE = FILE_TABLE
           DIR_TABLE  = DIR_TABLE
         EXCEPTIONS
           CNTL_ERROR = 1
           OTHERS     = 2.
       IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
       "get file name
       LOOP AT FILE_TABLE INTO p_filref.
       ENDLOOP.
       CONCATENATE '\\SAPSERVER\f\SAFT\iVAT_Extractie\' p_filref INTO path.
       PERFORM copy_from_xml_to_itab TABLES t_ext_file
                                     ext_xml_data
                                     USING path.
       PERFORM fill_xml_tab_in .
       perform build_fieldcatalog.
       PERFORM compare_data_ref_ext.
       PERFORM send_email.
       perform display_alv_report.
       PERFORM delete_extraction_file.
    in the perform copy_from_xml_to_itab TABLES it_ref_file......, i use this code:
       CREATE OBJECT gcl_xml.
    *Upload XML File
       CALL METHOD gcl_xml->import_from_file
         EXPORTING
           filename = p_filref
         RECEIVING
           retcode  = gv_subrc.
       IF gv_subrc = 0.
         CALL METHOD gcl_xml->render_2_xstring
           IMPORTING
             retcode = gv_subrc
             stream  = gv_xml_string
             size    = gv_size.
         IF gv_subrc = 0.
           REFRESH gt_xml_data[].
    * Convert XML to internal table
           CALL FUNCTION 'SMUM_XML_PARSE'
             EXPORTING
               xml_input = gv_xml_string
             TABLES
               xml_table = gt_xml_data
               return    = gt_return.
         ENDIF.
       ENDIF.

  • Abap objects and selection screen

    Hello everybody,
    I am interested in your ways of implementing selection-screens in the style of ABAP Objects.
    In earlier times (when I used to implement ABAP objects in a procedural way) I just put the selection-screen commands in an include or a form routine of my ABAP report. So it was possible to run the report in background.
    Now I read something about selection-screens/dynpros and "separation of concerns" in the book "ABAP Objects" written by Keller. He advises using function groups to encapsulate presentation from logical matters. (Selection-screen commands are in an automatically generated include now). I implemented this way. (ABAP report with a local class, which has a main method, where function module of the function group is called). It works, but i see no chance to run my report in background now.. but I need to run the report in background.
    Does anybody know a solution without deleting function group?
    What do you think is the best way of using selection-screen-commands and ABAP Objects, especially regarding running in background?
    Thx for your advise in advance.
    Kind regards,
    Anne

    Hi Naimesh,
    thx for explanation. I am not sure, if I understood everything in the right way.
    Where do you write the code for building the selection-screen? (PARAMETERS, SELECT-OPTIONS etc.)
    If you write these commands in a class method, you will get a syntax error ( because it's forbidden per definition of ABAP objects). So, am I right assuming that you put the coding just at the beginning of the ABAP report ? And after START-OF-SELECTION-event you start the processing... ?
    Furthermore, I don't really understand why you create an separate class for ALV. I found your "SAP abap help"-blog, where you explained the concept of MVC ((By the way, well done!), but you didn't mention an "ALV class" there..
    Mh.. another question - have you ever combined MVC with object services?
    At the moment I'm working on a software project where I use object services. I created 2 persistent classes via SE24 and one local class in my ABAP Report.
    I don't really see possibility to implement MVC in this project without change very much of coding and class structure...
    In my opinion the M (data&business logic) are my existing global classes and my local class is kind of Controller class?!
    Thx in advance,
    Anne

  • Background Processing Option in Report

    Hi Fellow Abapers,
    I need to edit a report whereby there is an option to display further fields. Now if they select this option, the report NEEDS to run in the background and output to the file. This will later be retrieved byt the SAP Output Controller (Which there is already a program). It is a must.
    Does anybody have any links, codes, tips? Helpful posters will be awarded.

    Hi You can do that programatically, no need to say execute it in background from se38. Make sure you are not using file download but use open dataset. here is the sample program. Just copy and paste this in test program and check it. hope this will be helpfull. this report reads only materials for plant and there is an option on the selection screen to print or email or you can write it to spool. ofcourse it does automatically and then you can retrieve or print from SP01 but in your case you have to write to application server.
    REPORT  ysam_test5 MESSAGE-ID zsummit.
    DATA: marc TYPE marc.
    TYPES: BEGIN OF t_marc,
           matnr TYPE matnr,
           werks TYPE werks_d,
           mmsta TYPE mmsta,
           maabc TYPE maabc,
           END OF t_marc.
    DATA: it_marc TYPE TABLE OF t_marc,
          wa_marc TYPE t_marc.
    DATA  : gr_table   TYPE REF TO cl_salv_table.
    DATA  : gr_functions TYPE REF TO cl_salv_functions_list.
    *fields used for variant create
    DATA: wa_var_desc         TYPE varid,
          it_var_contents     TYPE TABLE OF rsparams,
          it_var_text         TYPE TABLE OF varit,
          wa_var_text         TYPE varit,
          w_var_varname       TYPE variant.
    *printer information
    DATA: wa_print_options TYPE fpm_parcon,
          wa_arc_options   TYPE fpm_parcon,
          w_print_options  TYPE pri_params.
    *email information
    INCLUDE <cntn01>.
    DATA: w_recipient     TYPE swc_object,
          w_recipient_obj TYPE swotobjid.
    *container macro
    swc_container      w_swc_container.
    *batch job information
    INCLUDE lbtchdef.
    DATA: w_job       TYPE tbtcjob.
    *constants
    CONSTANTS: c_on VALUE 'X',
               c_off VALUE space,
               c_int(11) VALUE ' 0123456789'.
    SELECTION-SCREEN BEGIN OF BLOCK main with frame.
    SELECT-OPTIONS: s_matnr FOR marc-matnr,
                    s_werks FOR marc-werks.
    SELECTION-SCREEN BEGIN OF BLOCK back WITH FRAME TITLE text-ss2.
    PARAMETERS: p_fore RADIOBUTTON GROUP proc DEFAULT 'X', "foreground
                p_ball radiobutton group proc,
                p_berr radiobutton group proc.
    SELECTION-SCREEN END OF BLOCK back.
    SELECTION-SCREEN BEGIN OF BLOCK mail WITH FRAME TITLE text-ss3.
    PARAMETERS: p_print RADIOBUTTON GROUP mail DEFAULT 'X',
                p_email RADIOBUTTON GROUP mail.
    SELECTION-SCREEN END OF BLOCK mail.
    SELECTION-SCREEN END OF BLOCK main.
    START-OF-SELECTION.
      IF sy-batch = c_off AND p_fore = c_off.
        PERFORM create_variant.
        PERFORM build_print_parameters.
        IF p_email = c_on.
          PERFORM build_email_container.
        ENDIF.
        PERFORM open_job.
        PERFORM submit_job.
        PERFORM close_job.
        MESSAGE i000 WITH 'Job' w_job-jobname
                          'has been submitted'.
        perform delete_variant.
        EXIT.
      ENDIF.
    perform select_data.
    END-OF-SELECTION.
      PERFORM salv_grid.
    *&      Form  salv_grid
          text
    FORM salv_grid .
      DATA:      lref TYPE REF TO cx_root .
      DATA:      lr_layout TYPE REF TO cl_salv_layout,
                 ls_key    TYPE salv_s_layout_key.
      TRY.
          cl_salv_table=>factory(
            IMPORTING
              r_salv_table   = gr_table
            CHANGING
              t_table        = it_marc ).
        CATCH cx_salv_msg INTO lref.
      ENDTRY.
    ***Sub Total
    PERFORM sub_total.
    ***Layout
      lr_layout = gr_table->get_layout( ).
      ls_key-report = sy-cprog.
      lr_layout->set_key( ls_key ).
      lr_layout->set_default( 'X' ).
      lr_layout->set_save_restriction( if_salv_c_layout=>restrict_none ).
    ***toolbar
      gr_functions = gr_table->get_functions( ).
      gr_functions->set_all( 'X' ).
    *final display
      gr_table->display( ).
    ENDFORM.                    " salv
    *&      Form  sub_total
    FORM sub_total .
      DATA: lr_aggregations TYPE REF TO cl_salv_aggregations.
      lr_aggregations = gr_table->get_aggregations( ).
      lr_aggregations->clear( ).
      TRY.
          lr_aggregations->add_aggregation( columnname = 'Z_BALANCE_REM' ).
        CATCH cx_salv_not_found cx_salv_data_error cx_salv_existing.
      ENDTRY.
      TRY.
          lr_aggregations->add_aggregation( columnname = 'Z_PAY_AMT' ).
        CATCH cx_salv_not_found cx_salv_data_error cx_salv_existing.
      ENDTRY.
    ENDFORM.                    " sub_total
    *&      Form  select_data
    form select_data .
    select matnr werks mmsta maabc into table it_marc
           from marc
           where matnr in s_matnr
             and werks in s_werks.
    endform.                    " select_data
    *&      Form  create_variant
    form create_variant .
      CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
        EXPORTING
          curr_report           = sy-cprog
        TABLES
          selection_table       = it_var_contents
       EXCEPTIONS
         not_found             = 1
         no_report             = 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.
      CONCATENATE sy-datum sy-timlo INTO w_var_varname.
      wa_var_desc-mandt = sy-mandt.
      wa_var_desc-report = sy-cprog.
      wa_var_desc-variant = w_var_varname.
      wa_var_desc-transport = 'F'.
      wa_var_desc-environmnt = 'A'.
      wa_var_desc-version = '1'.
      wa_var_text-mandt = sy-mandt.
      wa_var_text-langu = sy-langu.
      wa_var_text-report = sy-cprog.
      wa_var_text-variant = w_var_varname.
      CONCATENATE 'Batch Job Variant -' sy-uname INTO wa_var_text-vtext.
      APPEND wa_var_text TO it_var_text.
      CALL FUNCTION 'RS_CREATE_VARIANT'
        EXPORTING
          curr_report                     = sy-cprog
          curr_variant                    = w_var_varname
          vari_desc                       = wa_var_desc
        TABLES
          vari_contents                   = it_var_contents
          vari_text                       = it_var_text
       EXCEPTIONS
         illegal_report_or_variant       = 1
         illegal_variantname             = 2
         not_authorized                  = 3
         not_executed                    = 4
         report_not_existent             = 5
         report_not_supplied             = 6
         variant_exists                  = 7
         variant_locked                  = 8
         OTHERS                          = 9
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    endform.                    " create_variant
    *&      Form  build_print_parameters
    form build_print_parameters .
      IF p_print = c_on.
        CALL FUNCTION 'MAINTAIN_PRINT_PARAMETERS'
          EXPORTING
            i_title_text         = 'Select your printer'
          CHANGING
            c_pri_params         = wa_print_options
            c_arc_params         = wa_arc_options
          EXCEPTIONS
            parameters_not_valid = 1
            OTHERS               = 2.
        IF sy-subrc <> 0.
          MESSAGE e000 WITH 'Print parameters could not be gathered'.
        ENDIF.
      ENDIF.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'CHECK_PRINT_PARAMETERS'
        EXPORTING
          i_title_text               = 'Select your printer'
          i_pri_params               = wa_print_options
          i_arc_params               = wa_arc_options
       IMPORTING
         e_pri_params                = w_print_options
       EXCEPTIONS
         parameters_not_valid       = 1
         OTHERS                     = 2
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      IF sy-subrc <> 0.
        MESSAGE e000 WITH 'Print parameters could not be assigned'.
      ENDIF.
      IF p_print = c_on.
        w_print_options-primm = c_on.
      ELSE.
        w_print_options-primm = c_off.
      ENDIF.
    endform.                    " build_print_parameters
    *&      Form  build_email_container
    form build_email_container .
      swc_create_object w_recipient 'RECIPIENT' space.
      swc_clear_container w_swc_container.
      swc_set_element w_swc_container 'AddressString' sy-uname.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      swc_set_element w_swc_container 'TypeId' 'B'.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      swc_call_method w_recipient 'CreateAddress' w_swc_container.
      IF sy-subrc <> 0.
        MESSAGE e000 WITH 'Could not determine email address'.
      ENDIF.
      swc_set_element w_swc_container 'SendExpress' 'X'.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
                          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      swc_call_method w_recipient 'SetExpress' w_swc_container.
      swc_call_method w_recipient 'Save' w_swc_container.
      swc_object_to_persistent w_recipient w_recipient_obj.
    endform.                    " build_email_container
    *&      Form  open_job
    form open_job .
      CONCATENATE sy-cprog '-' sy-uname INTO w_job-jobname.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobname          = w_job-jobname
          jobclass         = 'A'
        IMPORTING
          jobcount         = w_job-jobcount
        EXCEPTIONS
          cant_create_job  = 1
          invalid_job_data = 2
          jobname_missing  = 3
          OTHERS           = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    endform.                    " open_job
    *&      Form  submit_job
    form submit_job .
      CALL FUNCTION 'JOB_SUBMIT'
        EXPORTING
          authcknam               = sy-uname
          jobcount                = w_job-jobcount
          jobname                 = w_job-jobname
          priparams               = w_print_options
          report                  = 'YSAM_TEST5'
          variant                 = w_var_varname
        EXCEPTIONS
          bad_priparams           = 1
          bad_xpgflags            = 2
          invalid_jobdata         = 3
          jobname_missing         = 4
          job_notex               = 5
          job_submit_failed       = 6
          lock_failed             = 7
          program_missing         = 8
          prog_abap_and_extpg_set = 9
          OTHERS                  = 10.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    endform.                    " submit_job
    *&      Form  close_job
    form close_job .
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             = w_job-jobcount
          jobname              = w_job-jobname
          strtimmed            = c_on
          recipient_obj        = w_recipient_obj
        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.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    endform.                    " close_job
    *&      Form  delete_variant
    form delete_variant .
    CALL FUNCTION 'RS_VARIANT_DELETE'
      EXPORTING
        report                     = sy-cprog
        variant                    = w_var_varname
       FLAG_CONFIRMSCREEN         = 'X'
       FLAG_DELALLCLIENT          = 'X'
    IMPORTING
      VARIANT                    =
    EXCEPTIONS
       NOT_AUTHORIZED             = 1
       NOT_EXECUTED               = 2
       NO_REPORT                  = 3
       REPORT_NOT_EXISTENT        = 4
       REPORT_NOT_SUPPLIED        = 5
       VARIANT_LOCKED             = 6
       VARIANT_NOT_EXISTENT       = 7
       NO_CORR_INSERT             = 8
       VARIANT_PROTECTED          = 9
       OTHERS                     = 10
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endform.                    " delete_variant

  • Table Maintaince with Transaction SM30 with selection Screen

    Hi Friends,
    I have a requirement for maintance of Z table "ABC" and it need to be maintanied.
    This Ztable should have Ztransaction Code connecting to transaction SM30.
    Also this should have a selection screen with 3 fields to filter the data and only the selected data needs to be used to enter the values in SM30 with the Maintain mode.
    I have created the table and t code and below is the report .
    REPORT  zrktest.
    ******************Declaration*************************
    ***Tables Declaration*******
    TABLES : zkexxirac_calend.
    DATA : gt_calend TYPE STANDARD TABLE OF zkexxirac_calend,
               wa_calend TYPE zkexxirac_calend.
    ***SELECTION SCREEN***
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-100.
    SELECT-OPTIONS : s_burks   FOR zkexxirac_calend-bukrs ,
                    s_zbukrs  FOR zkexxirac_calend-zzbukrs,
                    s_partn   FOR zkexxirac_calend-partner_number.
    SELECTION-SCREEN END OF BLOCK b1.
    ******************Start - Of - Selection*************************
    START-OF-SELECTION.
    ******************Main Processing*************************
    *&      Form  get_data
    *      Get the Data from the table after satisfying
    *          the condition form Selection Screen
    *  -->  p1        text
    *  <--  p2        text
    ******Select the data from the table***
      SELECT *
      FROM zkexxirac_calend
      INTO CORRESPONDING FIELDS OF TABLE gt_calend
      WHERE bukrs          EQ s_burks
      AND   zzbukrs        EQ s_zbukrs
      AND   partner_number EQ s_partn.
    CALL TRANSACTION 'ZITXXIRACCALEND' AND SKIP FIRST SCREEN.
    but when i execute the report it goes to the 1st screen of SM30 and gives the error message to selecting the option of No restriction , enter condition .. etc .
    I have already ticked the Check box to skip initial Screen in the SM93, while creating the Transaction Code.
    Let me know what chnages needs to be done and what code should i write.

    Rabiya,
    You actually do not need to do any data selection beforehand to accomplish this.  Just convert the select-options to a different format and then call FM 'VIEW_MAINTENANCE_CALL'.instead of CALL TRANSACTION.  The process is described here:
    Add a Selection Screen to a Table Maintenance Dialog
    Best,
    Eric

  • Code for execute button on selection screen to get result

    hi experts,
    I need a help for writing a code for execution button on selection screen.Like in normal report on abap editor
    we insert selection criteria like number and we get the result according that particular number on next screen.
    same thing i am trying here also. So i am writing a code on button that when i press the button it will go to the next
    screen according to the selection criteria.
    Plz help me helpful answers are appriatiated !!!
    Thanks & regards
    Vipul Gupta

    hi,
    In the OnAction write :
    1. get the values entered in selection criteria using :
    DATA lo_nd_cn_check TYPE REF TO if_wd_context_node.
        DATA lo_el_cn_check TYPE REF TO if_wd_context_element.
        DATA ls_cn_check TYPE wd_this->element_cn_check.
        DATA lv_ca_check LIKE ls_cn_check-ca_check.
      navigate from <CONTEXT> to <CN_CHECK> via lead selection
        lo_nd_cn_check = wd_context->get_child_node( name = wd_this->wdctx_cn_check ).
      get element via lead selection
        lo_el_cn_check = lo_nd_cn_check->get_element(  ).
      get single attribute
        lo_el_cn_check->get_attribute(
          EXPORTING
            name =  `CA_CHECK`
          IMPORTING
            value = lv_ca_check ).
    Now lv_ca_check has your value entered in Selection criteria.
    2.  write the select query to fetch data according to selection criteria.
        select *  from <table> into correponding field of table <internl table>
           where Field = lv_ca_check.
    3. Now in the internal table <internl table> you have values according to search criteria.
    4. Bind the internal table with node  which is binded to table to show data.
    lo_nd->bind_table( internaltable ).
    I hope it is clear .

  • An ABAP report with ALV in EP6

    I have a report done in ABAP R/3, selection screen and ALV.
    now, I have to put it in EP. I allready search in the forum and I found these options:
    1- Create a Transaction iView, but the problem is that is not showed in the browser of portal, right ?
    2- Create a BSP, and create a BSP iView, but this option is showed "nicely" in the EP ?
    3- I wanna know if it´s easy create a report with the tool Visual Composer.
    4- There is another option besides usign Web Dynpro Java ?
    Any info about these options would be very appreciated.
    Thx

    Hi Rodrigo,
    Creating and deploying an application for displaying ABAP R/3 report using Visual Composer is quite easy as no coding involves.
    Also u can create the same using Web Dynpro, but for that u have to configure SLD in J2ee, get the model in Web Dynpro and requires a bit of coding.
    So the best solution is to go for VC.
    If u need any help on VC revert back to me.
    With regards,
    Amol.

  • HELP WITH SELECTION SCREENS

    Dear All,
        I am new to SAP(ABAP) have been given this assignment sort of ....plz help
    1.     Write a program to fetch all the sales orders and line items with in a data range.
      Selection screen fields: Sales Order Number
                                           Document type
                                           Sales order date.
      To display in the output report should contain following fields:
    1.     Sales Order number
    2.     item number
    3.     net price
    4.     net value
    5.     document type
    Use Tables :vbak and vbap.

    Hi,
    Try this out.
    REPORT yjjtest MESSAGE-ID zm.
    TABLES: vbap, vbak.
    DATA: BEGIN OF i_output OCCURS 0,
                 vbeln LIKE vbap-vbeln,
                 posnr LIKE vbap-posnr,
                 netwr LIKE vbap-netwr,
                 netpr LIKE vbap-netpr,
                 auart LIKE vbak-auart,
               END OF i_output.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    " text-001 as Selection
    SELECT-OPTIONS: s_vbeln  FOR vbap-vbeln,
                    s_auart  FOR vbak-auart ,
                    s_audat  FOR vbak-audat.
    SELECTION-SCREEN END OF BLOCK blk1.
    START-OF-SELECTION.
      SELECT a~vbeln
                    a~posnr
                    a~netwr
                    a~netpr
                    b~auart
                    INTO TABLE i_output
                    FROM vbap AS a
                    INNER JOIN vbak AS b
                    ON a~vbeln = b~vbeln
                    WHERE    a~vbeln IN s_vbeln
                    AND      b~auart IN s_auart
                    AND      b~audat IN s_audat.
      IF sy-subrc NE 0.
      MESSAGE e000 WITH text-002. " No data found for the selection criteria
      ENDIF.
      WRITE:/  'Program to fetch all the sales orders and line items'.
      ULINE.
      WRITE:/001 'Sales Order number',
             012 'Item Number',
             025 'Net Price',
             050 'Net Value',
             070 'Document Type'.
      ULINE.
      LOOP AT i_output.
        WRITE:/001 i_output-vbeln,
               012 i_output-posnr,
               025 i_output-netwr,
               050 i_output-netpr,
               070 i_output-auart.
        CLEAR i_output.
      ENDLOOP.
    Hope this solves ur query.
    Sample output
    TEST Program                                                                               
    Program to fetch all the sales orders and line items                                                                               
    Sales OrderItem Number  Net Price                Net Value           Document Type                                                                               
    10000000   000010                       0.00                0.00     ZNOR                  
    10000000   000020                       0.00                0.00     ZNOR                  
    10000006   000010                       0.00                0.00     ZNOR                  
    10000007   000060                       0.00                0.00     ZERO                  
    10000007   000020                       0.00                0.00     ZERO                  
    10000007   000050                       0.00                0.00     ZERO                  
    10000007   000040                       0.00                0.00     ZERO                  
    10000007   000030                       0.00                0.00     ZERO                  
    10000007   000010                       0.00                0.00     ZERO                  
    10000008   000010                  13,825.35            3,675.00     ZERO                  
    10000009   000010                       0.00                0.00     ZERO                  
    10000010   000010                  47,002.06            2,637.60     ZERO                  
    10000011   000010                       0.00                0.00     ZERO                  
    10000012   000010                  36,193.40            1,522.01     ZERO                  
    10000014   000010                       0.00                0.00     ZERO                  
    10000015   000050                       0.00                0.00     ZERO                  
    10000015   000010                       0.00                0.00     ZERO                  
    10000015   000020                       0.00                0.00     ZERO
    Please reward points and clos ethe thread.

Maybe you are looking for

  • How to create report condition based on "total"

    Hello, I have a Discoverer report that shows revenue by city and sub-totals revenue by state. I need to modify this report so that only cities in states with revenue (sub-total) more than one million are pulled. Example: Pittsburgh - 100,000 Harrisbu

  • Can not update on windows server 2008 R2

    Hi All I have been trying to update windows server 2008 R2 after doing a fresh install. i have used HP smart Start to do the install. I have a HP ML 350 G5 Server     this is the 3rd time i have tried to install . first time i used smart start and se

  • Open Pdf on report execution

    Hello All, I want to open the pdf file Whenever I execute the report. but Without saving that file to my system. that is the main issue. <b>I donot want to save the file on my system.</b> eq. Select * from sflight into table itab_sfight. Data in the

  • Total number of users in NetPoint License has been exceeded

    I am keep getting this msg on my website. I goto admin > business partner > license users and delete all users except manager the msg goes away and after few hours it comes back again Total number of users in NetPoint License has been exceeded. Some

  • How to set the value of MaxRow Property of DB Adapter 11g dynamically

    I have the following requirement:- i am using DB Adapter to connect with MsSQL server for fetching the records from the table by using simple Select Query in my DB adapter. 1. Receive request from Web Service Client number of records as input to fetc