cancel
Showing results for 
Search instead for 
Did you mean: 

SAPSCRIPT: loop in a not main window

pablo_marn
Active Participant
0 Kudos

Hi,

I have created an text element in a NO main window:


SA	Objasnienia do jednostek miar:
/E	VRKME_TE
/	 &I_VRKME-VRKME& - &I_VRKME-MSEHT&

This is the code of the control program that writes the content of the IT:


  LOOP AT i_vrkme.
    CALL FUNCTION 'WRITE_FORM'
      EXPORTING
        WINDOW  = 'VRKME'
        ELEMENT = 'VRKME_TE'
      EXCEPTIONS
        OTHERS  = 1.
  ENDLOOP.

The problem is that only appears the last line of the IT in the form. If IT is empty, appears the header. I think that each call to WRITE_FORM overrides the last one.

How could I solve this problem?

Best regards,

Pablo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pablo,

Create the text element in the main window.In the variable window the text gets override.

Regards,

Sravanthi

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi pablo,

I think its not possible to use a loop of an internal table inside a window other than the main window.

the loop takes always the last entry.

pablo_marn
Active Participant
0 Kudos

That's a pity.

Thank you very much!!

pablo_marn
Active Participant
0 Kudos

Thanks Sravanthi, but I cannot create it in Main window. It's necessary that it will be in a Var Window.

Is not there a way to solve this with Var Windows?

Thank you very much.

Former Member
0 Kudos

in varible window possible to display only one value that is the last records......

pablo_marn
Active Participant
0 Kudos

Hi,

I have added this code:


  LOOP AT i_vrkme.
    CALL FUNCTION 'WRITE_FORM'
      EXPORTING
        WINDOW  = 'VRKME'
        ELEMENT = 'VRKME_TE'
      EXCEPTIONS
        OTHERS  = 1.
    CALL FUNCTION 'CONTROL_FORM'
      EXPORTING
        COMMAND = 'NEW-LINE'.
  ENDLOOP.

but it doesnt work. Any suggestion?

former_member480923
Active Contributor
0 Kudos

Call a Control form in between with a command equal to new line.

Hope That Helps

Anirban M.