2006 Oct 04 8:14 AM
Hi Friends,
I am working on scripts in that i have given conditional page break, though its working but lastly it is printing one more additional page, I want to avoid that page. pls go thro the code and guide me how to avoid that?
LOOP AT XVBPLK WHERE KZOBE = 'X'.
PERFORM PACKING_TREE USING XVBPLK-VENUM.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'NEW-PAGE'.
ENDLOOP.
FORM PACKING_TREE USING VALUE(SHENR).
Daten des Versandelements shenr ausgeben, also Wurzel des Teilbaums
MOVE SPACE TO XVBPLK.
XVBPLK-VENUM = SHENR.
READ TABLE XVBPLK.
VBPLK = XVBPLK.
CALL FUNCTION 'WRITE_FORM'
EXPORTING ELEMENT = 'SHELEM'.
LOOP AT XVBPLP WHERE VENUM = SHENR.
SELECT PVSART RBEZEI FROM LIKP AS P INNER JOIN T173T AS R
ON PVSART = RVSART INTO CORRESPONDING FIELDS OF TABLE IT
WHERE VBELN = XVBPLP-VBELN AND SPRAS EQ 'E'.
IF XVBPLP-POSNR IS INITIAL.
Versandelement
PERFORM PACKING_TREE USING XVBPLP-UNVEL.
ELSE.
Lieferposition (Anteil)
VBPLP = XVBPLP.
LOOP AT IT INTO IT.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'MODE'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'DESPATCH'.
ENDLOOP.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'DELPOS'.
ENDIF.
clear vbplp.
ENDLOOP.
ENDFORM. "PACKING_TREE
Thanks and regards,
Pritesh
2006 Oct 04 9:25 AM
Try the below logic.
XVBPLK1[] = XVBPLK[].
DELETE XVBPLK WHERE KZOBE <> 'X'.
LOOP AT XVBPLK.
PERFORM PACKING_TREE USING XVBPLK-VENUM.
AT LAST.
LFLAG = 'X'.
ENDAT.
CHECK LFLAG <> 'X'.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'NEW-PAGE'.
ENDLOOP.
2006 Oct 04 8:21 AM
Hi,
can you try this one ..
LOOP AT XVBPLK WHERE KZOBE = 'X'.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'NEW-PAGE'.
PERFORM PACKING_TREE USING XVBPLK-VENUM.
ENDLOOP.
Regards
Sudheer
2006 Oct 04 9:03 AM
Hi Sudheer,
I have already tried this and its printing more pages i.e. its not working properly.
2006 Oct 04 9:25 AM
Try the below logic.
XVBPLK1[] = XVBPLK[].
DELETE XVBPLK WHERE KZOBE <> 'X'.
LOOP AT XVBPLK.
PERFORM PACKING_TREE USING XVBPLK-VENUM.
AT LAST.
LFLAG = 'X'.
ENDAT.
CHECK LFLAG <> 'X'.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'NEW-PAGE'.
ENDLOOP.
2006 Oct 04 9:33 AM
Hi,
can you try this one ..
LOOP AT XVBPLK WHERE KZOBE = 'X'.
if sy-tabix ne '1'.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'NEW-PAGE'.
endif.
PERFORM PACKING_TREE USING XVBPLK-VENUM.
ENDLOOP.
2010 Dec 09 6:53 PM
Hello Experts ...
Could you please tell me relevance of KZOBE field...
Why we require check on this field ...as shown above ...
Is it mandatory at Handling Unit level also
Thanks in advance ..