ALV - simulate a enter in background

Hi all,
i have an ALV with an editable field. Now i import some values from a Excel File.
How can i simulate in background that i fill a field and click enter on this field. I need this because a have some checks on this field and with REFRESH_TABLE_DISPLAY and CHECK_CHANGED_DATA there only fill the fields without checks.
Best regards,
Markus

the checks will be start automatically when i change a field.
When changing fields while the report is running in the back(ground), ALV cannot reckognize that data has been changed
Here my Coding. Maybe it helps
  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      filename                = p_datei
      i_begin_col             = 1
      i_begin_row             = 1
      i_end_col               = 255
      i_end_row               = 65000
    TABLES
      intern                  = gt_excel
    EXCEPTIONS
      inconsistent_parameters = 1
      upload_ole              = 2.
  LOOP AT gt_excel INTO gs_excel WHERE row <> '001'. " ohne erste Zeile, da Überschriftenzeile
    IF row <> gs_excel-row AND row <> space.
      APPEND gs_excel_up TO gt_excel_up.
      CLEAR gs_excel_up.
    ENDIF.
    CASE gs_excel-col.
      WHEN '001'.
        gs_excel_up-lifnr = gs_excel-value.
      WHEN '003'.
        gs_excel_up-matnr = gs_excel-value.
      WHEN '007'.
        gs_excel_up-zzreakzeit = gs_excel-value.
    ENDCASE.
    row = gs_excel-row.
  ENDLOOP.
Die letzte Zeile auch noch speichern.
  APPEND gs_excel_up TO gt_excel_up.
  LOOP AT gt_excel_up INTO gs_excel_up.
    LOOP AT gt_outtab INTO gs_outtab_line WHERE matnr = gs_excel_up-matnr
                                          AND lifnr = gs_excel_up-lifnr.
      gs_outtab_line-zzreakzeit = gs_excel_up-zzreakzeit.
      MODIFY gt_outtab FROM gs_outtab_line.
      CLEAR gs_outtab_line.
      CLEAR gs_excel_up.
    ENDLOOP.
  ENDLOOP.
  CALL METHOD go_grid->check_changed_data.
  CALL METHOD go_grid->refresh_table_display.
Best regards,
Markus

Similar Messages

  • Simulate pressing Enter Key

    Hello all,
    Is there a way that in a Photoshop .jsx file I can insert at some point a snippet of code that simulates the user hitting the "Enter" key on the keyboard?
    Found this, does not work in a javascript. I think this is apple script? A solution in javascript will be more than welcomed...
    #target photoshop
    app.bringToFront();
    app.system( 'osascript -e \'tell application "System Events" to key code 13\'' );

    Hello,
    Using photoshop's script listner I recorded in a .jsx file some print actions. Just before printing I get the warning "The image is larger than the paper's printable area, and some clipping will occur". I do not whis to fix the problem that causes this warning, numerous reasons. I have to click "Proceed" (or hit the Enter key) to continue, No big deal, but when you do this thousands of times it becomes a big deal
    My plan:
    1. either stop photoshop from showing this warning (or any warnings). -  No luck
    2. Simulate an enter key hit and proceed with printing
    Here is part of the script, the problem appears just below the first block (see my comment):
    // =======================================================
    var id25 = charIDToTypeID( "setd" );
        var desc9 = new ActionDescriptor();
        var id26 = charIDToTypeID( "null" );
            var ref8 = new ActionReference();
            var id27 = charIDToTypeID( "Prpr" );
            var id28 = stringIDToTypeID( "printOptions" );
            ref8.putProperty( id27, id28 );
            var id29 = charIDToTypeID( "Dcmn" );
            var id30 = charIDToTypeID( "Ordn" );
            var id31 = charIDToTypeID( "Trgt" );
            ref8.putEnumerated( id29, id30, id31 );
        desc9.putReference( id26, ref8 );
        var id32 = charIDToTypeID( "T   " );
            var desc10 = new ActionDescriptor();
            var id33 = charIDToTypeID( "PgSt" );
                var desc11 = new ActionDescriptor();
                var id34 = charIDToTypeID( "Rslt" );
                var id35 = charIDToTypeID( "#Pxl" );
                desc11.putUnitDouble( id34, id35, 300.000000 );
                var id36 = charIDToTypeID( "PgPs" );
                var id37 = charIDToTypeID( "PgPs" );
                var id38 = stringIDToTypeID( "userDefined" );
                desc11.putEnumerated( id36, id37, id38 );
                var id39 = charIDToTypeID( "Left" );
                var id40 = charIDToTypeID( "#Rlt" );
                desc11.putUnitDouble( id39, id40, 0.000000 );
                var id41 = charIDToTypeID( "Top " );
                var id42 = charIDToTypeID( "#Rlt" );
                desc11.putUnitDouble( id41, id42, 1.417323 );
                var id43 = charIDToTypeID( "Scl " );
                var id44 = charIDToTypeID( "#Prc" );
                desc11.putUnitDouble( id43, id44, 100.000000 );
            var id45 = charIDToTypeID( "PgSt" );
            desc10.putObject( id33, id45, desc11 );
            var id46 = charIDToTypeID( "PMps" );
                var desc12 = new ActionDescriptor();
                var id47 = charIDToTypeID( "PstS" );
                desc12.putBoolean( id47, true );
                var id48 = charIDToTypeID( "Inte" );
                var id49 = charIDToTypeID( "Inte" );
                var id50 = charIDToTypeID( "Clrm" );
                desc12.putEnumerated( id48, id49, id50 );
                var id51 = charIDToTypeID( "SstI" );
                desc12.putData( id51, String.fromCharCode( 189, 0, 1, 0, 226, 2, 0, 0, 226, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 181, 33, 0, 0, 213, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 181, 33, 0, 0, 213, 23, 0, 0, 0, 1, 123, 5, 0, 0, 224, 3, 0, 0, 1, 0, 1, 0, 1, 0, 108, 108, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) );
            var id52 = charIDToTypeID( "PMps" );
            desc10.putObject( id46, id52, desc12 );
        var id53 = stringIDToTypeID( "printOptions" );
        desc9.putObject( id32, id53, desc10 );
    executeAction( id25, desc9, DialogModes.NO );
    // Here is where the warning pops up. It is here that I need to simulate an enter key hit...
    // =======================================================
    var id54 = charIDToTypeID( "Prnt" );
        var desc13 = new ActionDescriptor();
        var id55 = charIDToTypeID( "PstS" );
        desc13.putBoolean( id55, true );
        var id56 = charIDToTypeID( "Inte" );
        var id57 = charIDToTypeID( "Inte" );
        var id58 = charIDToTypeID( "Clrm" );
        desc13.putEnumerated( id56, id57, id58 );
        var id59 = charIDToTypeID( "SstI" );
        desc13.putData( id59, String.fromCharCode( 189, 0, 1, 0, 226, 2, 0, 0, 226, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 181, 33, 0, 0, 213, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 181, 33, 0, 0, 213, 23, 0, 0, 0, 1, 123, 5, 0, 0, 224, 3, 0, 0, 1, 0, 1, 0, 1, 0, 108, 108, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) );
    executeAction( id54, desc13, DialogModes.NO );

  • HOW to simulate the enter key???

    Hi , I have a jTable ,and i want that by leaving a specific
    cell ,to perform the same action that the enter key does!
    when im leaving my specific cell the following function is being called:
    public void editingStopped(ChangeEvent e) {
    //here I want to simulate the enter-key's action
    HOW to simulate the enter key???
    10x in advance
    Nir.
    p.s. My initial problem was that when i left my specific
    cell (the cell is editable combo box), an edited words
    which were written by me vanished , and when i get back to that cell the edited word showed again!!!
    when i pressed the enter key the edited word were stable in the cell!!!
    when I chose a word from the combo evrything was ok!!
    so if any one can solve me that problem ill be appreciate.
    thanks Nir

    yourActionListener.actionPerformed(new ActionEvent(yourCell))
    I am not sure about the constructor of actionevent.
    you could try if setText(getText()) produces a good result

  • Data not getting displayed in ALV grid when run in background

    Hello experts!
    Could anyone help me out please?
    I need to display an ALV grid in the background. My requirements are as follows:
    I first display an ALV grid in the foreground based on some input parameters. The user selects a few records for updating it and clicks on the "update" button. On the click of this button another report must be called and here the ALV report is displayed in the background.I am using "reuse_alv_grid_display" to display the grid.
    I am using Import/Export to get the selected rows in my called report. When i execute this report in the foreground i get the ALV grid along with the data. But when i execute it in the background, i get only the grid with the fieldnames and not the data when i check in SP01.
    Thanks in advance!
    Smitha

    Hi Smitha,
    If you are able to see in SP01 and only see the output layout or "List contains no data" shows clealry that the data is not getting passed in the called program or the data is not being used correctly in the called program.
    Cheers
    VJ

  • MiniSAP 6.20: ALV tree not working in background

    Good day!
    SAP provides a sample ALV tree program, BCALV_TREE_DEMO, which could be submitted in the background.
    However, it does not work in MiniSAP 6.20. It's kind of bizarre as it works in our Test system.
    Does anyone has any idea what's happening.

    Good day!
    The ALV tree report is submitted in the background.
    By right, it should produce an ALV tree report in the print spool.
    However, it does not seem to work. I checked the program and found there is a logic to check whether it's a background job or not. If it is, it would not create the container.
    It's bizarre that it does not work in MiniSAP 6.20 but it works in 6.10

  • Error in ALV display when run in background

    Hi All,
    My program gives ALV Block Display . I am getting an extra ALV block displayed before display of each of my ALV block . However , while in normal execution (F8) , the program is running fine.
    Can I debug a background job ? Please help.

    Hi,
    My program runs for few seconds (2-4) . when I switch from program to SM37 tcode , program execution is already complete . Is there any other way of debugging ?

  • ALV list display in a Background job - Spool output

    Hi,
    We are currently working on a report scheduled to be run in the background job, and the ALV list is displayed in the spool output.
    ALV list in the spool does not look the same as front run job, the column headers are all crowded together, and there is no grid in-between different columns or rows. It's hard to read.
    Is there a way to add grid for this kind of output?
    Thanks!

    Hi Deepak:
    I expanded your report into two rows display, and the grid in the spool display simply gone!
    report zzscratch line-size 120 no standard page heading.
    type-pools slis.
    tables pa0001.
    data : li_field type standard table of slis_fieldcat_alv,
    gi_events type standard table of slis_alv_event,
    gr_layout_bck type slis_layout_alv,
    gr_save like disvariant,
    gr_events type slis_alv_event.
    types : begin of gtt_emp,
    pernr type persno,
    ename  like pa0001-ename,
    uname  like pa0001-UNAME,
    end of gtt_emp.
    data : lr_field type slis_fieldcat_alv.
    data : lc_rep like syst-repid.
    data : li_emp type standard table of gtt_emp,
    lr_emp type gtt_emp.
    data : gv_ref_table type lvc_rtname.
    gv_ref_table = 'CATSDB'.
    lr_field-fieldname = 'PERNR'.
    lr_field-ref_tabname = gv_ref_table.
    lr_field-inttype = 'N'.
    lr_field-outputlen = 8.
    lr_field-seltext_l = 'EMPLOYEE Number'.
    append lr_field to li_field.
    lr_field-fieldname = 'ENAME'.
    lr_field-ref_tabname = 'PA0001'.
    lr_field-inttype = 'C'.
    lr_field-outputlen = 40.
    lr_field-seltext_l = 'EMPLOYEE Name'.
    append lr_field to li_field.
    lr_field-fieldname = 'UNAME'.
    lr_field-ref_tabname = 'PA0001'.
    lr_field-inttype = 'C'.
    lr_field-outputlen = 12.
    lr_field-seltext_l = 'User Name'.
    lr_field-row_pos = 2.
    lr_field-col_pos = 1.
    append lr_field to li_field.
    lc_rep = sy-repid.
    gr_layout_bck-edit_mode = 'D'.
    gr_save-report = sy-repid.
    lr_emp-pernr = '00000001'.
    lr_emp-ename = 'abc'.
    lr_emp-uname = 'testus'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000002'.
    lr_emp-ename = 'def'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000003'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000004'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000005'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000006'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000007'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000008'.
    append lr_emp to li_emp.
    end-of-selection.
    Function module for ALV grid display
      call function 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_buffer_active    = 'X'
                i_callback_program = lc_rep
                is_layout          = gr_layout_bck
                it_fieldcat        = li_field
                i_save             = 'A'
                is_variant         = gr_save
                it_events          = gi_events
           TABLES
                t_outtab           = li_emp[]
           EXCEPTIONS
                program_error      = 1
                others             = 2.
      if sy-subrc <> 0.
    clear gr_messages.
    message e023 into gr_messages.
    append gr_messages to gi_messages.
      endif.

  • ALV with splitter container in background

    Hi all,
    I have an ALV grid in which I am using a splitter container to display top of page and the alv grid.
    I am unaware how to use a docking container in conjunction with a splitter container, so that the ALV list is displayed in the background.
    Request assistance from you all...
    Regards,
    Vidya.

    Hi,
    In background , you can't dispaly the ALV with splitter container , dispaly ALV in foreground with splitter and in background use top-of-page to display header text with docking container.
    Code :
    DATA: o_grid             TYPE REF TO cl_gui_alv_grid,
          o_container TYPE REF TO cl_gui_custom_container,
          o_dockingcontainer TYPE REF TO cl_gui_docking_container .
      IF NOT sy-batch = 'X'.
        CREATE OBJECT o_container
                EXPORTING
                      container_name = 'CONTAINER'.
        CREATE OBJECT o_grid
                EXPORTING
                      i_parent = o_container.
      ELSE.
        CREATE OBJECT o_grid
          EXPORTING
         i_parent = o_dockingcontainer.
        IF sy-subrc NE 0.
        ENDIF.
      ENDIF
    METHOD handle_print_top_of_page.
        prev_linno = sy-linno.
        sy-linno = 64.
        SKIP.
        WRITE:/40 'Page:', sy-pagno .
        SKIP.
        sy-linno = prev_linno.
      ENDMETHOD.                    "handle_print_top_of_page
      METHOD handle_top_of_page.
        WRITE:/40 'Page:', sy-pagno .
      ENDMETHOD.                    "handle_top_of_page
    Regards
    Appana

  • Way to get alv grid varients info during background execution

    I have used the function module 'REUSE_ALV_GRID_LAYOUT_INFO_GET' to get info alv grid varients i.e already created layout info. Is there any other way of getting this info as this is not giving the exact layout during background execution.

    Hi Vijaya,
    It should work. I am giving you a sample code. Try this and let me know.
    REPORT TEST.
    data gt_lfa1 type standard table of lfa1.
    data gt_kna1 type standard table of kna1.
    start-of-selection.
      select * from lfa1 into table gt_lfa1 up to 10 rows.
      select * from kna1 into table gt_kna1 up to 20 rows.
    end-of-selection.
      if sy-batch eq 'X'.
        perform display_lfa1.
        perform display_kna1.
      endif.
    form display_lfa1 .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = sy-repid
          i_structure_name   = 'LFA1'
        tables
          t_outtab           = gt_lfa1
        exceptions
          program_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.
    endform.                    " DISPLAY_LFA1
    form display_kna1 .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = sy-repid
          i_structure_name   = 'KNA1'
        tables
          t_outtab           = gt_kna1
        exceptions
          program_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.
    endform.                    " DISPLAY_KNA1
    copy and paste the code and create a program. Activate it and come back to SE38 screen.
    Now, in program name give the name of the report created and then
    select PROGRAM->EXECUTE->BACKGROUND from the MENU bar.
    This will generate two separate spools . One for KNA1 data & one for LFA1 data.
    Let me know how it goes.
    Thanks,
    Abhishek

  • ALV GRID with two Containers Background Execution

    Hi Friends,
    I have to display two ALV GRIDS on two Container one below another in one screen.
    I tried with 'DOCKING CONTAINER' - it works fine in foreground and not in BACKGROUND exection.
    In background execution (F9) only one grid is getting displayed.
    Please suggent whether I can go for CUSTOM CONTAINER or SPLITTER or some other way.
    But I should use GRID DISPLAY and it should work in BACKGROUND EXECUTION also.
    Regards,
    Viji

    Hi Vijaya,
    It should work. I am giving you a sample code. Try this and let me know.
    REPORT TEST.
    data gt_lfa1 type standard table of lfa1.
    data gt_kna1 type standard table of kna1.
    start-of-selection.
      select * from lfa1 into table gt_lfa1 up to 10 rows.
      select * from kna1 into table gt_kna1 up to 20 rows.
    end-of-selection.
      if sy-batch eq 'X'.
        perform display_lfa1.
        perform display_kna1.
      endif.
    form display_lfa1 .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = sy-repid
          i_structure_name   = 'LFA1'
        tables
          t_outtab           = gt_lfa1
        exceptions
          program_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.
    endform.                    " DISPLAY_LFA1
    form display_kna1 .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = sy-repid
          i_structure_name   = 'KNA1'
        tables
          t_outtab           = gt_kna1
        exceptions
          program_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.
    endform.                    " DISPLAY_KNA1
    copy and paste the code and create a program. Activate it and come back to SE38 screen.
    Now, in program name give the name of the report created and then
    select PROGRAM->EXECUTE->BACKGROUND from the MENU bar.
    This will generate two separate spools . One for KNA1 data & one for LFA1 data.
    Let me know how it goes.
    Thanks,
    Abhishek

  • ALV layout variant missing in background job.

    hi guys,
    Having problem on getting the default ALV layout variant when run the job in backgorund. Please advise any correction needed in the following code.
    Thanks.
    *&  Include           Z_MM_KBR_AGSUBCONINV_MOD2                        *
    MODULE status_0100 OUTPUT.
      SET PF-STATUS '100'.
      SET TITLEBAR '100'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  display_data  OUTPUT
          text
    MODULE display_data OUTPUT.
    IF sy-batch IS INITIAL. "Foreground
      IF w_container IS INITIAL.
        IF cl_gui_alv_grid=>offline( ) IS INITIAL.
    *Creating the container
          CREATE OBJECT w_container
            EXPORTING
              container_name              = c_container
            EXCEPTIONS
              cntl_error                  = 1
              cntl_system_error           = 2
              create_error                = 3
              lifetime_error              = 4
              lifetime_dynpro_dynpro_link = 5
              OTHERS                      = 6.
          IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
        ENDIF.
    *Creating the ALV GRID
        CREATE OBJECT w_grid
          EXPORTING
            i_parent          = w_container
            i_appl_events     = c_check
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
        IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        else.
         exit.
        ENDIF.
      ELSE.
    *Creating the ALV GRID
        CREATE OBJECT w_grid
          EXPORTING
            i_parent          = go_dock_container
            i_appl_events     = c_check
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
        IF sy-subrc <> 0.
          WRITE:/ 'Error in grid'.
        ENDIF.
         CREATE OBJECT w_grid
          EXPORTING  i_parent = go_dock_container.
      ENDIF.
    *getting the variant option
        wa_variant-report     = sy-repid.
        wa_variant-username   = sy-uname.
        wa_layout-grid_title  = sy-title.
        wa_layout-cwidth_opt  = c_check.
        wa_layout-zebra       = c_check.
        wa_layout-no_f4       = c_check.
        wa_layout-sel_mode    = 'D'.
    *Excluding the unwanted buttons
         PERFORM exclude_toolbar_buttons.
    build field catalog.
        CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
          EXPORTING
            i_buffer_active        = c_check
            i_structure_name       = c_fcat_str
            i_bypassing_buffer     = c_check
          CHANGING
            ct_fieldcat            = t_fieldcat
          EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 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.
        loop at t_fieldcat into w_fieldcat.
         if w_fieldcat-FIELDNAME = 'AGING1'.
          W_FIELDCAT-NO_ZERO = 'X'.
          MODIFY t_fieldcat FROM W_FIELDCAT INDEX SY-TABIX.
         ENDIF.
        endloop.
    Generate sort critria
        PERFORM generate_sort.
    Create object of class lcl_event_receiver.
        CREATE OBJECT w_event.
    Handler for events.
       SET HANDLER w_event->handle_top_of_page       FOR w_grid.
       SET HANDLER w_event->handle_print_top_of_page FOR w_grid.
       SET HANDLER w_event->handle_print_end_of_list FOR w_grid.
        SET HANDLER w_event->handle_hotspot_click     FOR w_grid.
    *Displaying the alv
       IF NOT sy-batch IS INITIAL.
         PERFORM create_snp.
       ENDIF.
    t_data = i_final.
        CALL METHOD w_grid->set_table_for_first_display
          EXPORTING
            i_save                        = 'A'
            is_layout                     = wa_layout
            is_variant                    = wa_variant
          CHANGING
            it_outtab                     = t_data
            it_fieldcatalog               = t_fieldcat
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
        IF sy-subrc <> 0.
        ENDIF.
    ENDIF.
    ENDIF.
    ENDMODULE.                 " display_data  OUTPUT
    *&      Module  user_command_0100  INPUT
          text
    MODULE user_command_0100 INPUT.
      DATA: lt_rows TYPE lvc_t_row,
             w_rows TYPE lvc_s_row.
      CASE sy-ucomm.
        WHEN c_back.
          LEAVE TO SCREEN 0.
        WHEN c_exit.
          LEAVE TO SCREEN 0.
        WHEN c_cancel.
          LEAVE TO SCREEN 0.
       WHEN 'BILDET'.
         CALL METHOD w_grid->get_selected_rows
           IMPORTING
             et_index_rows = lt_rows.
         CALL METHOD cl_gui_cfw=>flush.
         IF sy-subrc EQ 0.
           READ TABLE lt_rows INTO w_rows INDEX 1.
           READ TABLE i_vbfa INTO w_vbfa INDEX w_rows-index.
           IF sy-subrc EQ 0.
             CLEAR i_zbw_br_nf4.
             LOOP AT i_zbw_br_nf3 INTO w_zbw_br_nf3 WHERE
                         refkey = w_vbfa-v_vbeln.
               APPEND w_zbw_br_nf3 TO i_zbw_br_nf4.
             ENDLOOP.
    call dialog screen and display new alv control
             CALL SCREEN 101 STARTING AT 10 5.
           ENDIF.
         ENDIF.
         WHEN 'NOTAF'.
         CALL METHOD w_grid->get_selected_rows
           IMPORTING
             et_index_rows = lt_rows.
         CALL METHOD cl_gui_cfw=>flush.
         IF sy-subrc EQ 0.
           READ TABLE lt_rows INTO w_rows INDEX 1.
           READ TABLE i_zbw_br_nf3 INTO w_zbw_br_nf3 INDEX w_rows-index.
           DATA docnum LIKE j_1bdydoc-docnum.
           docnum = w_zbw_br_nf3-docnum.
           SET PARAMETER ID 'JEF' FIELD docnum.
           CALL TRANSACTION 'J1B3N' AND SKIP FIRST SCREEN.
         ENDIF.
      ENDCASE.
      ENDMODULE.                 " user_command_0100  INPUT
    *&      Form  modify_col_name
          text
         -->P_<FCAT>  text
         -->P_TEXT_H01  text
    FORM modify_col_name  USING  pwa_fcat TYPE lvc_s_fcat
                                 value(pw_text) TYPE any.
      pwa_fcat-coltext   = pw_text.
      pwa_fcat-scrtext_l = pw_text.
      pwa_fcat-scrtext_m = pw_text.
      pwa_fcat-scrtext_s = pw_text.
    ENDFORM.                    " modify_col_name
          FORM display_hotspot                                          *
    FORM display_hotspot USING pw_row_id    TYPE lvc_s_row
                               pw_column_id TYPE lvc_s_col.
      FIELD-SYMBOLS <l_data> TYPE zbrforecast.
    READ TABLE t_br_nf_acum ASSIGNING <l_data> INDEX pw_row_id-index.
    CHECK sy-subrc = 0.
    IF pw_column_id = ' '.
    ENDIF.
    ENDFORM.                    "display_hotspot
    *&      Form  generate_sort
          Genereate Sort criteria
    FORM generate_sort.
    Local variables
    DATA: wal_sort TYPE lvc_s_sort,
           wl_pos   TYPE numc2.
    wl_pos = 01.
    sort ORDER
    wal_sort-spos      = wl_pos.
    wal_sort-fieldname = c_aufnr.
    wal_sort-up        = c_check.
    APPEND wal_sort TO t_sort.
    ENDFORM.                    "generate_sort
    *&      Form  f4_variant
          text
         <--PW_VARI  text
    FORM f4_variant CHANGING pw_vari TYPE disvariant-variant.
    wa_variant-report = sy-cprog.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant    = wa_variant
          i_save        = c_u
        IMPORTING
          es_variant    = wa_variant
        EXCEPTIONS
          not_found     = 1
          program_error = 2
          OTHERS        = 3.
      IF sy-subrc IS INITIAL.
        pw_vari = wa_variant-variant.
      ELSE.
        MESSAGE s208(00) WITH text-t04.
      ENDIF.
    ENDFORM.                    " f4_variant
    *&      Form  validate_layout
    *This subroutine is to validate the layout
    No parameters are passed to this subroutine
    FORM validate_layout.
    IF NOT p_layout IS INITIAL.
      Check Layout
       wa_variant-report   = sy-repid.
       wa_variant-username = sy-uname.
       wa_variant-variant  = p_layout.
       CALL FUNCTION 'LVC_VARIANT_EXISTENCE_CHECK'
         EXPORTING
           i_save     = c_u
         CHANGING
           cs_variant = wa_variant
         EXCEPTIONS
           OTHERS     = 01.
       IF NOT sy-subrc IS INITIAL.
         SET CURSOR FIELD 'P_LAYOUT'.
         MESSAGE s001(00) WITH text-t06 p_layout.
         STOP.
       ENDIF.
    ELSE.
      clear wa_variant.
    ENDIF.
    ENDFORM.                    " validate_layout
    *&      Form  validate_data
          text
    FORM validate_data .
    PERFORM validate_layout.
    ENDFORM.                    " validate_data

    Hi,
    Before the call to method set_table_for_first_display, populate
    wa_variant-report = sy-repid.
    Best regards,
    Prashant

  • Ragarding ALV Report output  running  in background

    Hi All,
                When i running report in background , the output is not formatted. i.e. output is not coming
    in single row for a particular row in a report,it is down to second row.
    as result when i spool this output to excel (spread sheet) ,the output is not formatted in excel file also.
    please suggest.
    Tks
    Shailesh

    Hi Shailesh,
    Check in SPAD-> Full administration->format types.
    Check whether you have any formats with column size 1024. That is the maximum allowed.
    If it exists then use that while schduling the job.
    If not you may create a new one and attach it to you device type so that you can use it with default printer like LOCL.
    Let me know if you need any further info. I had this problem in past and I solved it through SAP notes.
    BR/Manas

  • CJIC/CJ88 : How to simulate this flow in background mode without CT

    Hi everybody,
    I would like to know if it exists some FM, BAPI or Idoc to implement CJIC and CJ88 tcode.
    My requirement is the following :
    "From the input CSV file, the transaction CJIC must be executed to settle rule and after the transaction CJ88 must be executed by external document number to generate a posting document to capitalize asset project."
    So I try to find any solution for the background mode.
    Thank in advance
    Edited by: LudovicBento on Dec 17, 2010 4:09 PM

    check the value of sy-BINPT

  • Error when OO ALV report run in background

    Hello all,
    We recently applied stack 12 for a 7.0 system.  My custom ALV report using CL_GUI_CUSTOM_CONTAINER coding now returns an error when run in Background.  It works fine in dialog.
    The error occurred in program CL_GUI_CUSTOM_CONTAINER=======CP.  The log message was "Control Framework: Fatal error - GUI cannot be reached".
    Is there a solution for OO ALV reports run in the background?  I would not like to re-write my ALV reports using the function call.  Any advice is appreciated.  Thanks!!

    Yes, you need to code it a little differently, but you can still use CL_GUI_ALV_GRID.  Here is an example. 
    REPORT ZRICH_0006 .
    DATA: ITAB TYPE TABLE OF MARA.
    DATA: R_GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: R_CONTROL TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: G_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER.
    DATA: OKCODE type sy-ucomm.
    START-OF-SELECTION.
      SELECT * FROM MARA INTO TABLE ITAB  up to 100 rows.
      CALL SCREEN 100.
    *& Module STATUS_0100 OUTPUT
    * text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS '0100'.
      SET TITLEBAR '0100'.
      IF R_CONTROL IS INITIAL.
    * Check whether the program is run in batch or foreground
        IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
    * Run in foreground
          CREATE OBJECT R_CONTROL EXPORTING CONTAINER_NAME = 'CONTAINER_1'.
          CREATE OBJECT R_GRID EXPORTING I_PARENT = R_CONTROL.
        ELSE.
    * Run in background
          CREATE OBJECT R_GRID EXPORTING I_PARENT = G_DOCK.
        ENDIF.
        CALL METHOD R_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
        I_STRUCTURE_NAME = 'MARA'
        CHANGING
        IT_OUTTAB = ITAB.
      ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    * text
    MODULE USER_COMMAND_0100 INPUT.
      CASE OKCODE.
        WHEN 'BACK'.
          leave program.
      ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    Regards,
    Rich Heilman

  • Background task problem with alv grid display

    Hello !
    I have a problem when executing my program in background.
    In foreground I have no problem, my ALV appears. In the background I have a dump.
    The current ABAP program "SAPLKKBL" had to be terminated because one of the statements could not be executed.
    I use the function module 'REUSE_ALV_GRID_DISPLAY'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
            i_callback_program      = gd_repid
            i_callback_user_command = 'F533_USER_COMMAND'
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
            it_special_groups       = i_fgroup[]
            i_save                  = 'X'
            it_sort                 = gd_sort
            i_buffer_active         = ' '
            i_callback_pf_status_set = 'F534_SET_PF_STATUS'
         TABLES
            t_outtab                = mytab
         EXCEPTIONS
            program_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.
    I don't understand where the problem is. Please help me.
    Thank you.

    I love replying to old threads:
    Try this link
    http://scn.sap.com/people/prashant.patil12/blog/2007/02/20/displaying-alv-grid-in-background-job

Maybe you are looking for

  • How to assign status profile to components in service order

    Hi, For my business requirement, I want to assign status to individual components planned in the service order. Even though there is a status button on the component tab, there is no config where I can assign the status profile. We can only assign st

  • How to move a rented movie from IPAD to Macbook Itunes?

    Hi, I've rented a movie and downloaded it on my IPAD4. I didn't watch it yet and I prefer to move the movie to my Macbook pro Itunes. I've connected the IPAD4 to the Macbook using the USB cable provided with the IPAD power supplier but I cannot find

  • How to setup Final Cut to preivew on HD TV (beginner question)

    FINAL CUT NEWBIE HERE... I just got a new Mac Pro and the new Final Cut studio. I'm trying to figure out the best way to set everything up. I've been watching a lot of the videos on Apple's website about the new features and the "In action" videos. O

  • Java App on Linux : Unable to read iso-8859-1 encoded file correctly.

    I have a file which is encoded as iso-8859-1, and contains characters such as ô . I am reading this file with java code, something like: File in = new File("myfile.csv"); InputStream fr = new FileInputStream(in); byte[] buffer = new byte[4096]; while

  • Relation between qRFC and SXMB_Moni tables.

    Hello Experts, I would like to know if there exists any rerference OR any link between the qRFC tables (TRFCQOUT / TRFCQIN) with the backend master tables of SXMB_MONI (SXMSPMAST, SXMSPERR, SXMSPHIST) ETC. This would give me an idea whether I can fet