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

Program going into sleep mode!

Former Member
0 Likes
1,508

Hello All:

I have a type 1 program that posts journal entries to ledger and everything was working fine yesterday and it used to take only 20 seconnds! Today I am running the same program for similar data and it takes 560sec every single time! It takes exactly 560seconds to run! I went to BASIS and they said it is going into sleep mode and I don't have any command in code to force it to sleep mode. Could someone please give me any ideas?

Thanks.

Mithun

Edited by: Alvaro Tejada Galindo on Mar 10, 2008 3:29 PM

9 REPLIES 9
Read only

Former Member
0 Likes
1,291

What does it do after 560 seconds - succeed or dump?

rob

Read only

Former Member
0 Likes
1,291

It succeeds.

Thanks.

Mithun

Read only

0 Likes
1,291

Does it run exactly for 560 seconds in foreground also? Is the behavior same in the QA system also?

Is the program dealing with locks or locked tables?

I would also see if there is an option to debug and step through to look which statement is making the program to wait.

Read only

Former Member
0 Likes
1,291

I am not sure what the reason could be! Is it because the program is running in background? Does running program in background might cause it to go to sleep mode?

Thanks.

Mithun

Read only

0 Likes
1,291

Would you post the code please?

Rob

Read only

Former Member
0 Likes
1,291

It is more than 3000 lines. Is it allowed to post here?

Thanks

Mithun

Read only

0 Likes
1,291

Please don't.

You can e-mail me the code and I will see if anything jumps out at me.

rob

Read only

Former Member
0 Likes
1,291

Thanks Rob. I emailed you the code.

Mithun

Read only

0 Likes
1,291

OK - I had a look at it. The problem is likely in this portion:

LOOP AT br INTO wa_br.
  CASE wa_br-type.
    WHEN 'S' OR 'I'.

      CLEAR wa_schd.

      CLEAR w_loop. ADD 1 TO w_loop.

      LOOP AT itab_schd INTO wa_schd.
        MOVE: wa_br-message_v2(10) TO wa_schd-belnr,
              sy-uname TO wa_schd-crea_uname,
              'X' TO wa_schd-passfail,
              p_postd TO wa_schd-postdat,

              sy-datum TO wa_schd-proc_date,                "IJHCHG001

              sy-uzeit TO wa_schd-posttime,
              handle TO wa_schd-applog.

        MODIFY itab_schd FROM wa_schd TRANSPORTING belnr crea_uname
                  passfail postdat posttime applog.

        INSERT zfigl_close_schd FROM wa_schd.
        COMMIT WORK.                                        "RY030608.1

      ENDLOOP.
*-----------check the Doucments Existance in GLPCA and wait until the
      document is saved to db
      data: v_found type flag,
            "v_wait type int4 value 300,
            v_wait type int4 value 120,                     "Ry031308
            v_try type int4 value 1,
            v_smessage type char200,
            v_message type char200,
            v_rc type subrc,
            w_glpca type glpca,
            l_compcode type glpca-sbukrs,
            l_kostl type glpca-rprctr,
            l_hkont type glpca-racct,
            l_stagr_wk(10),
            l_poper type poper,
            l_stagr type stagr.

      "BEGIN RY031208
      l_poper = wa_schd-postper.
      IF wa_schd-type = '01'.
        "l_compcode = wa_schd-sbukrs.
        l_kostl = wa_schd-skostl.
        l_hkont = wa_schd-shkont.
      ELSEIF wa_schd-type = '02'.
        l_kostl = wa_schd-kostl.
        l_hkont = wa_schd-hkont.
        "l_compcode = wa_schd-bukrs.
      ELSE.
        l_kostl = wa_schd-kostl.
        l_stagr_wk = wa_schd-hkont.
        PACK l_stagr_wk TO l_stagr_wk.
        CONDENSE l_stagr_wk NO-GAPS.
        l_stagr = l_stagr_wk.
      ENDIF.
      "END RY031208
*-----------use the variables above to make call to FM
      PERFORM wait_for_document_in_glpca       USING wa_schd-postyr
                                                     l_poper
                                                     wa_schd-skostl
                                                     wa_schd-sbukrs
                                                     wa_schd-belnr
                                                     wa_schd-shkont
                                                     v_wait
                                                     v_try
                                                     l_stagr
                                            CHANGING v_found
                                                     v_message
                                                     v_smessage
                                                     w_glpca
                                                     v_rc.

*-------------end of logic to check for the documents existance
    WHEN OTHERS.

      MOVE 'X' TO w_error.

      CLEAR wa_schd.

      LOOP AT itab_schd INTO wa_schd.
        MOVE: wa_br-message_v2(10) TO wa_schd-belnr,
              sy-uname TO wa_schd-crea_uname,
              ' ' TO wa_schd-passfail,
              p_postd TO wa_schd-postdat,

              sy-datum TO wa_schd-proc_date,                "IJHCHG001

              sy-uzeit TO wa_schd-posttime,
              handle TO wa_schd-applog.

        MODIFY itab_schd FROM wa_schd TRANSPORTING belnr crea_uname
passfail postdat posttime applog.

        INSERT zfigl_close_schd FROM wa_schd.
        COMMIT WORK.                                        "RY030608.1

      ENDLOOP.

  ENDCASE.

ENDLOOP.

You have a couple of nested loops here (and in another portion of the code). That could cause problems right there and you are also doing some SELECTs in the inner loops, so that is also a problem.

But the main problem is probably where you wait for the database to be updated. This is also in the inner loop. If you are doing a WAIT UP TO NNN SECONDS, that will be the main problem.

Rob