Application Development 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: 

Table Controls: LOOP WITH CONTROL skips code

Former Member
0 Kudos

Hi experts,

i use a table control to get data from the dialog.

Both in PBO and in PAI there is a LOOP transfering the datasets from the internal table to the table control and vice versa.

In PBO the "LOOP WITH CONTROL"-statement works fine.

In PAI the "LOOP WITH CONTROL"-statement is execute and sy-stepl/sy-loopc are filled with the correct values.

But in PAI "LOOP WITH CONTROL" skips the source-code inside the loop. The debugger jumps to the ENDLOOP-statement ignoring all statements between LOOP .. and ENDLOOP.

Can anybody help ?

Thanks in advance.

Matt

3 REPLIES 3

Former Member
0 Kudos

Matthias,

In PAI code that I've written with Table Controls, I do not use the WITH CONTROL option. Here is one example.


  loop at WT_ZLMACT.
    chain.
      field WK_ZLMACT-SEQNO.
      field WK_ZLMACT-CONT_TY.
      field WK_ZLMACT-CONT_DT.
      field WK_ZLMACT-CONT_TM.
      field WK_ZLMACT-CONTRE.
      field WK_ZLMACT-COMP_DT.
      field WK_ZLMACT-COMP_TM.
      field WK_ZLMACT-COMP_NM.
      field WK_ZLMACT-AEDAT.
      field WK_ZLMACT-AETIM.
      field WK_ZLMACT-AENAM.
      field WK_ZLMACT-ERDAT.
      field WK_ZLMACT-ERTIM.
      field WK_ZLMACT-ERNAM.
      field WK_ZLMACT-DISP_NOTE.
    endchain.
    field WK_ZLMACT-SEL
      module TABCTL_ZLMACT_mark on request.
  endloop.

Former Member
0 Kudos

I've used this style plenty of times for data entry screens


"[ in PBO ]
  loop with control tc_8888_sr.

    module d8888_fill_tc.     "load data from internal table row

  endloop.

"[ in PAI ]
  loop with control tc_8888_sr.

    chain.

      field:
        gs_8888_tc-sel,
        gs_8888_tc-ltext.
      module d8888_line_tc_handler.  "line validation / capture into internal table row

    endchain.

  endloop.

and not had a problem... The symptom you describe sounds more like the module in PAI isn't actually implemented - what happens when you double click on it? (extended check will also show up exceptions).

Jonathan

Former Member
0 Kudos

Hi all,

thanks a lot for the advices.

I found the problem. It is rather simple. There are 4 lines displayed in my table control and all of them are initial.

PAI skips initial lines automatically.

I'm so stupid. That took me a long time.