Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAPScript - PROTECT.....ENDPROTECT problem

Hello,

I can't get a PROTECT......ENDPROTECT block to work.

Here is my ABAP:

-


LOOP AT IT_MAIN.

MOVE IT_MAIN-RECORD TO WA_MAIN-RECORD.

  • CALL FUNCTION 'CONTROL_FORM'

  • EXPORTING

  • COMMAND = 'PROTECT'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'WORK_AREA_RECORD'

WINDOW = 'MAIN'

EXCEPTIONS

OTHERS = 8.

IF SY-SUBRC <> 0.

WRITE: / 'Error in get_main_data'.

ENDIF.

  • CALL FUNCTION 'CONTROL_FORM'

  • EXPORTING

  • COMMAND = 'ENDPROTECT'.

-


Here is my SAPScript:

-


/E WORK_AREA_RECORD

/: PROTECT

  • &WA_MAIN-RECORD&

/: ENDPROTECT

-


I want to keep WA_MAIN-RECORD (3-5 lines) together on the same page.

I put the PROTECT..ENDPROTECT commands in the MAIN window but that does not work.

I've tried to issue the PROTECT..ENDPROTECT commands in ABAP and that doesn't work.

Can someone tell me what I'm missing?

Thx.

Andy

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question