Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Time out issue.

Former Member
0 Likes
1,908

Hello Experts,

I have a program that is expected to upload roughly 20000 records. Sessions for these records are created by the program in batches of 5000 records each.

The Problem-

The program times out and no sessions are created.

Category               ABAP Programming Error
Runtime Errors         TIME_OUT
ABAP Program           SAPLSBDC
Application Component  BC-ABA-SC
Date and Time          26.11.2013 13:47:07

Short text
     Time limit exceeded.

I was asked to increase the value of parameter rdisp/max_wprun_time from 600 to 2000 which didnt lead to any positive results either.

Please suggest how this can be handled.

THanks,

Deepti

11 REPLIES 11
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,456

First of all you can excecute your program for less number of records and check in SE30/SAT what are performance bottlenecks in your code which can be improved. Once you have identify the area you can share with us your issues and what all you have tried.

Nabheet

Read only

rosenberg_eitan
Active Contributor
0 Likes
1,456

Hi ,

I think that you need to isolate the source of the timeout.

To do that comment out the transaction call and run the program.

Are you clearing BDCDATA for each set of records  ?

Regards.

Read only

0 Likes
1,456

Hello Eitan,

Thanks for your reply, yes I am clearing BDCDATA for each set.

-Deepti

Read only

0 Likes
1,456

Hello Deepti,

Try to comment out the transaction call and run the program how is the performance in this case ?

I simply want to eliminate the SAP program from the performance problem (You cannot change the SAP program).

Regards.

Read only

former_member195698
Active Contributor
0 Likes
1,456

Is background execution not an option?

If no, then optimization of the code would have to be done. Also reduce the batch size as per the performance.

Read only

0 Likes
1,456

Hi Abhishek,

I Set up the files in Application server and created a variant. I then created a background job with this varient.

This job has been running for the past one hour and not yet completed.

Any clue what may be causing this issue..?

Read only

0 Likes
1,456

What kind of records it is updating?

Nabheet

Read only

Former Member
0 Likes
1,456

Hello Deepti,

             If you upload the record so 1st you upload the data in application server ,  than run program in background (After execute > select file> goto program> execute in bacckgraound)

hear u have useful code for application  server data upload as well as download .

TYPE-POOLS truxs.

DATA:

number             LIKE  bapiebanc-preq_no,

requisition_items LIKE bapiebanc           OCCURS 0 WITH HEADER LINE,

requisition_account LIKE bapiebkn          OCCURS 0 WITH HEADER LINE,

requisition_services LIKE bapiesllc        OCCURS 0 WITH HEADER LINE,

requisition_srv_values LIKE bapiesklc      OCCURS 0 WITH HEADER LINE,

return             LIKE bapireturn         OCCURS 0 WITH HEADER LINE,

return1            LIKE  bapiret2          OCCURS 0 WITH HEADER LINE,

requisition_item_text LIKE bapiebantx  OCCURS 0 WITH HEADER LINE.

DATA v_accasserial_no TYPE i ."VALUE '01'.

DATA v_req_services_line_no TYPE i ."VALUE 1.

DATA v_req_services_ext_line TYPE i VALUE 0.

DATA v_packno TYPE i.

DATA unit(02) TYPE c .

DATA: it_inter TYPE truxs_t_text_data.

DATA: s_file TYPE string.

DATA: p_input(10) ,

        p_output(10),

        p_input1(12),

        p_output1(12).

DATA : BEGIN OF itab OCCURS 0,

        preqno(02),

        preqitem(05),

        seritem(05),

        doc_type(10) ,

        acctasscat(01),

        pur_group(03),

        plant(04),

        deliv_date LIKE bapiebanc-deliv_date,

        short_text(40),

        mat_grp(09),

        preq_name(12),

        g_l_acct(10),

        cost_ctr(10),

        order_no(12),

        short_text_ser(40),

        gr_price(23),

        quantity(13),

        unit(3),

        text_line(132),

       END OF itab.

*******Error message

       TYPES: BEGIN OF i_errmsg ,

         id(20),

         number(03),

         message(220),

         log_no(20),

         log_msg_no(06),

         message_v1(50),

         message_v2(50),

         message_v3(50),

         message_v4(50),

         parameter(32),

         row(10),

         field(30),

         system(10),

*       type LIKE bdcmsgcoll-msgtyp,

*       message(480),

*       ind(3),                      "Indicator

*       cnt   TYPE string,"INCLUDE STRUCTURE bapiret2.

       END OF i_errmsg.

DATA : errmsg TYPE TABLE OF i_errmsg WITH HEADER LINE.

DATA : errmsg1 TYPE TABLE OF i_errmsg WITH HEADER LINE .

DATA: it_fcat TYPE slis_t_fieldcat_alv,

       wa_fcat TYPE slis_fieldcat_alv,

       layout  TYPE  slis_layout_alv,

        repname  LIKE sy-repid.

   DATA :p(02), v_flag(02), fl_item(02).

****Upload data in appliction server.

DATA : lt_file_table TYPE  rsanm_file_table ,

        ls_file_table TYPE rsanm_file_line.

data p_filnam type string.

field-symbols: <fs> type any.

field-symbols: <fs1> type any.

DATA : lv_applserv         TYPE char01,

        lv_title            TYPE string,

        lv_gui_extension    TYPE string,

        lv_gui_ext_filter   TYPE string,

        lv_canceled         TYPE as4flag,

        lv_applserv_logical TYPE as4flag,

        lv_applserv_al11    TYPE as4flag,

        lv_file_name        TYPE string,

        lv_lines_written    TYPE i.

  data:lv_length type i,

        wf_ref type ref to data.

DATA: errflag.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002 .

PARAMETERS : I_filnam LIKE rlgrap-filename LOWER CASE.

SELECTION-SCREEN END OF BLOCK b2 .

IF p_filnam IS INITIAL.

   MESSAGE 'Plaese Select file' TYPE 'S'.

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR I_filnam.

   CALL FUNCTION 'WS_FILENAME_GET'

     EXPORTING

       def_filename     = space

       def_path         = space

       mask             = ',*.*,*.*.'

       mode             = space

       title            = space

     IMPORTING

       filename         = I_filnam

*     RC               =

     EXCEPTIONS

       inv_winsys       = 1

       no_batch         = 2

       selection_cancel = 3

       selection_error  = 4

       OTHERS           = 5.

   IF sy-subrc <> 0 AND sy-subrc <> 3.

     MESSAGE e102(yb) WITH 'Error Selecting File'(007).

   ENDIF.

   s_file = I_filnam.

   CALL FUNCTION 'GUI_UPLOAD'

     EXPORTING

       filename                = s_file

       filetype                = 'ASC'

       has_field_separator     = ' '

       dat_mode                = ' '

     TABLES

       data_tab                = it_inter

     EXCEPTIONS

       file_open_error         = 1

       file_read_error         = 2

       no_batch                = 3

       gui_refuse_filetransfer = 4

       invalid_type            = 5

       no_authority            = 6

       unknown_error           = 7

       bad_data_format         = 8

       header_not_allowed      = 9

       separator_not_allowed   = 10

       header_too_long         = 11

       unknown_dp_error        = 12

       access_denied           = 13

       dp_out_of_memory        = 14

       disk_full               = 15

       dp_timeout              = 16

       OTHERS                  = 17.

   IF sy-subrc <> 0.

* Implement suIt_table error handling here

   ENDIF.

   IF sy-subrc = 0.

     CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

       EXPORTING

         i_field_seperator    = 'X'

         i_line_header        = 'X'

         i_tab_raw_data       = it_inter

         i_filename           = I_filnam

       TABLES

         i_tab_converted_data = Itab.

     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.

****Upload data in appliction server.

   LOOP AT itab.

       do.

        assign component sy-index of structure itab to <fs>.

        if sy-subrc <> 0.

         APPEND ls_file_table TO lt_file_table.

         clear ls_file_table.exit.

        endif.

        lv_length = 0.

        describe field <fs> output-length lv_length.

        create data wf_ref type c length lv_length.

        if wf_ref is bound.

         assign wf_ref->* to <fs1>.

         check <fs1> is assigned.

         <fs1> = <fs>.

        endif.

        if sy-index = 1.

         ls_file_table = <fs1>.

        else.

         concatenate ls_file_table <fs1> INTO ls_file_table SEPARATED BY '|'.

        endif.

       enddo.

     ENDLOOP.

*lt_file_table[] = It_tab[].

     PERFORM sys_selection CHANGING P_filnam.

     lv_file_name = P_filnam.

CLEAR : lv_lines_written.

     CALL METHOD cl_rsan_ut_appserv_file_writer=>appserver_file_write

       EXPORTING

         i_filename      = lv_file_name

         i_overwrite     = abap_true

         i_data_tab      = lt_file_table

       IMPORTING

         e_lines_written = lv_lines_written

       EXCEPTIONS

         open_failed     = 1

         write_failed    = 2

         close_failed    = 3

         OTHERS          = 4.

START-OF-SELECTION.

****download data in appliction server.

PERFORM sys_selection CHANGING P_filnam.

REFRESH lt_file_table[].

CLEAR lt_file_table[].

CALL METHOD cl_rsan_ut_appserv_file_reader=>appserver_file_read

     EXPORTING

       i_filename   = p_filnam

     CHANGING

       c_data_tab   = lt_file_table

     EXCEPTIONS

       open_failed  = 1

       read_failed  = 2

       close_failed = 3

       OTHERS       = 4.

DELETE DATASET P_filnam.

CLOSE DATASET P_filnam.

REFRESH itab[].

else u have 2nd option is increasing your time out limit to RZ11.


Read only

0 Likes
1,456

Hello,

The backgroud job is also not completing successfully for some reason.

I set the value of rdisp/max_wprun_time in  RZ11 to 2000 from 600 (default). Still no effect.

-Deepti

Read only

0 Likes
1,456

hope its not stuck in some infinte loop..  check in SM50 and check where its stuck...

Read only

0 Likes
1,456

hi dipati

can you share your code

with file