on 05-06-2008 10:15 AM
Hello experts,
In my internal table vendor & its invoice vise details.
now my problem is
on first page i want to print vendor - name
address
and on second page invoice details.
i want when vendor change again i go to first page automaticaly.
means in itab there are 30 vendor then
30 first pages
30 second pages
means after execution of report i get 60 pages.
how to do this.
Thanks in advance.
Hi ,
Please use open form and close form in your print program.
Please use the following code for reference. :
DATA: L_BSEG TYPE STANDARD TABLE OF ZFI518S,
L_WK_BSEG TYPE ZFI518S.
MOVE:
PR_PRINT TO WK_OUTPUT_OPTIONS-TDDEST,
'X' TO WK_OUTPUT_OPTIONS-TDIMMED,
PR_BACK TO WK_CONTROL_PARA-NO_DIALOG,
'X' TO WK_CONTROL_PARA-NO_OPEN,
'X' TO WK_CONTROL_PARA-NO_CLOSE.
Open form
CALL FUNCTION 'SSF_OPEN'
EXPORTING
OUTPUT_OPTIONS = WK_OUTPUT_OPTIONS
USER_SETTINGS = SPACE
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT ITAB_ZFI516S INTO WK_ZFI516S.
LOOP AT ITAB_BSEG INTO WK_BSEG
WHERE BELNR = WK_ZFI516S-BELNR
AND BUKRS = WK_ZFI516S-BUKRS
AND GJAHR = WK_ZFI516S-GJAHR.
MOVE:
WK_BSEG-BUKRS TO L_WK_BSEG-BUKRS,
WK_BSEG-BELNR TO L_WK_BSEG-BELNR,
WK_BSEG-GJAHR TO L_WK_BSEG-GJAHR,
WK_BSEG-BUZEI TO L_WK_BSEG-BUZEI,
WK_BSEG-SGTXT TO L_WK_BSEG-SGTXT,
WK_BSEG-ZTERM TO L_WK_BSEG-ZTERM,
WK_BSEG-LIFNR TO L_WK_BSEG-LIFNR,
WK_BSEG-KUNNR TO L_WK_BSEG-KUNNR,
WK_BSEG-PSWSL TO L_WK_BSEG-PSWSL,
WK_BSEG-KOART TO L_WK_BSEG-KOART,
WK_BSEG-BUZID TO L_WK_BSEG-BUZID,
WK_BSEG-WRBTR TO L_WK_BSEG-WRBTR.
IF WK_ZFI516S-BLART EQ 'CB'.
CONCATENATE L_WK_BSEG-SGTXT '-' WK_BSEG-XREF1
INTO L_WK_BSEG-SGTXT.
ENDIF.
APPEND L_WK_BSEG TO L_BSEG.
ENDLOOP.
IF L_BSEG IS NOT INITIAL.
CALL FUNCTION V_FORMNAME
EXPORTING
CONTROL_PARAMETERS = WK_CONTROL_PARA
EXP_BKPF = WK_ZFI516S
EXP_BSEG = ZFI518S
EXP_PR_ATTN = PR_ATTN
TABLES
TBL_BSEG = L_BSEG
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CLEAR WK_ZFI516S.
REFRESH L_BSEG.
ENDLOOP.
Close form
CALL FUNCTION 'SSF_CLOSE'
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
Chitrakant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1.Put a loop based on vendor and invoice details.
2.Place the vendor details in one window and check the conditions-->tab as only on first page.
3.For invoice details check as only on second page.
Regards,
Shiva.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.