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

Script Issue

Former Member
0 Likes
354

Hi All,

Can any one of you help me out of this issue.

A delivery group has deliveries with line items.

we had a Ztransaction code to print all the deleveries in a delivery group.in that it displays all the deliveries line items in a single page.

but recently a new Ztransaction code has been created with some upgrade and in this the issue is for a delivery group it is not printing all the delivery items in a single page. it is displaying each delivery and its items in different pages.

but our requirement is to display all the deliveries in a delivery group with items in a single page.

can you please suggest where to find the problem to fix the issue.

Thanks & Regards,

Rayudu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
330

Hi Sarva,

The record that you want to put on the single page.Put all of them within block

Protect

<field values to be on the single page>

Endprotect.

Try to use this code as per your requirement

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

COMMAND = 'PROTECT'.

LOOP AT IT_MAIN.

MOVE IT_MAIN-RECORD TO WA_MAIN-RECORD.

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.

ENDLOOP.

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

COMMAND = 'ENDPROTECT'.

Message was edited by: mukesh kumar

2 REPLIES 2
Read only

Former Member
0 Likes
331

Hi Sarva,

The record that you want to put on the single page.Put all of them within block

Protect

<field values to be on the single page>

Endprotect.

Try to use this code as per your requirement

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

COMMAND = 'PROTECT'.

LOOP AT IT_MAIN.

MOVE IT_MAIN-RECORD TO WA_MAIN-RECORD.

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.

ENDLOOP.

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

COMMAND = 'ENDPROTECT'.

Message was edited by: mukesh kumar

Read only

aris_hidalgo
Contributor
0 Likes
330

Hi,

Please check for the text NEW-PAGE in both your report program that calls the sapscript and the form. Maybe in your report program you have a function module 'CONTROL_FORM' that calls a new page. Please check its condition.

Regards!

P.S. Kindly award points for helpful replies:)