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

Protect-Endprotect Command

Former Member
0 Likes
550

Hoz exactly we use Protect-EndProtect command to avoide output text which should not spilt in two pages. Plz explain with example of Codes.

Thanks.

4 REPLIES 4
Read only

Former Member
0 Likes
497

Hi

It is used to protect the address or info to print in one page only

If the space in one page is not sufficient it will print in the second page

see the sample

/: PROTECT

/: ADDRESS PARAGRAPH AS

/: TITLE &LFA1-ANRED&

/: NAME &LFA1-NAME1&, &LFA1-NAME2&, &LFA1-NAME3&,

/: STREET &LFA1-STRAS&

/: POBOX &LFA1-PFACH& CODE &LFA1-PSTL2&

/: CITY &LFA1-ORT01&, &LFA1-ORT02&

/: POSTCODE &LFA1-PSTLZ&

/: COUNTRY &LFA1-LAND1&

/: REGION &LFA1-REGIO&

/: FROMCOUNTRY &T001-LAND1&

/: ENDADDRESS

/: ENDPROTECT

Reward points if useful

Regards

Anji

Read only

0 Likes
497

hi!

some one told me that If I want to display the paragraph at one place i mean with out any page break then first use control_form for protect then u r required element then end protect.

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

command = 'PROTECT'.

call function 'WRITE_FORM'

exporting

window = 'MAIN'

element = 'ITEM_LINE'

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

command = 'ENDPROTECT'.

*********************************************************

How much the above method is useful?

Thanks.

Read only

former_member673464
Active Contributor
0 Likes
497

hi..

Protect and Endprotect is used to prevent the page-breaks during that text.Suppose we want to display data regarding particular sales order in a single page instead of spreading it to multiple page we use protect and endprotect to avoid spreading of data to multiple pages.

eg:

protect

&carrid&,,&connid&

,,&fldate&,,&seatmax&

endprotect

If we give as above then for every carrid and connid, fldate and seatmax are displayed in the same page .Otherwise carrid and connid will be displayed in one page and their fldate and seatmax are displayed in another page.If we use protect and protect then carrid and connid and fldate and seat max will be displayed in the same page with out any break.

regards,

veeresh

Read only

Former Member
0 Likes
497

Hi Khan,

Let me share my points with u:

If u want to display the paragraph at one place i mean with out any page break then first use control_form for protect then u r required element then end protect.

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

command = 'PROTECT'.

call function 'WRITE_FORM'

exporting

window = 'MAIN'

element = 'ITEM_LINE'

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

command = 'ENDPROTECT'.

Hope this helps you. Reply for queries, shall post the updates.

Regards.

Kumar.