on 11-23-2008 3:27 AM
Hello Experts,
I created a custom form for the standard checque program RFFOUS_C. Now, in my MAIN window, I
called a subroutine in a custom program which loops through the line items but the problem is
only the last line item is being shown. I tried using CONTROL_FORM to create a new line
but it does not work. Note that I did not customize RFFOUS_C since it is being used by
multiple companies. Below is my code:
SAPSCRIPT:
510-C
Begin of insertion DEVK940799 11/10/2008 DEL_HIDALGO
DEFINE <YC_XBLNR& = ''
DEFINE <YC_BLDAT& = ''
DEFINE <YC_SGTXT& = ''
DEFINE <YC_DMBTR& = ''
PERFORM WRITE_LINE_ITEMS IN PROGRAM Z9999RFI_Z2574FFI_RA
USING ®UH-LAUFD&
USING ®UH-LAUFI&
USING ®UH-XVORL&
USING ®UH-ZBUKR&
USING ®UH-LIFNR&
USING ®UH-VBLNR&
CHANGING <YC_XBLNR&
CHANGING <YC_BLDAT&
CHANGING <YC_SGTXT&
CHANGING <YC_DMBTR&
ENDPERFORM
PROTECT
<YC_XBLNR& <YC_BLDAT& <YC_SGTXT& <YC_DMBTR&
ENDPROTECT
End of insertion DEVK940799 11/10/2008 DEL_HIDALGO
PROGRAM:
IF gt_regup[] IS NOT INITIAL.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
* APPLICATION = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
* DEVICE = 'PRINTER'
* DIALOG = 'X'
form = lcc_z2574ffi_ra
* LANGUAGE = SY-LANGU
* OPTIONS =
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
* SPONUMIV =
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
EXCEPTIONS
canceled = 1
device = 2
form = 3
OPTIONS = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
spool_error = 10
codepage = 11
OTHERS = 12.
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 gt_regup INTO lw_regup.
m_line_items 'LTYC_XBLNR' lw_regup-xblnr.
m_line_items 'LTYC_BLDAT' lw_regup-bldat.
m_line_items 'LTYC_SGTXT' lw_regup-sgtxt.
m_line_items 'LTYC_DMBTR' lw_regup-dmbtr.
DELETE ex_output WHERE value IS INITIAL.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = '510-C'
function = 'APPEND'
* TYPE = 'BODY'
window = 'MAIN'
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
codepage = 9
OTHERS = 10.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-LINE'
EXCEPTIONS
unopened = 1
unstarted = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
* IMPORTING
* RESULT =
* RDI_RESULT =
* TABLES
* OTFDATA =
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
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.
Hi
I think u might have skip to write the append statement before ending the loop for the line items.
U r looping all the line items so the last item record only getting printed.
For each line item u should append.
I think it can solve ur problem.
Plz check ur code.
Regards,
Farook
Edited by: farook shaik on Nov 24, 2008 7:10 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Write the at last event in the program and check if it works
At last.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-LINE'
EXCEPTIONS
unopened = 1
unstarted = 2
OTHERS = 3.
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,
Sravanthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In the Write_Form, i think u need to uncomment
TYPE = 'BODY'.
Also in I think, Control_form is not needed.
For ur reference, u can see about WRITE_FORM in
http://help.sap.com/saphelp_47x200/helpdata/en/d6/0db4f7494511d182b70000e829fbfe/frameset.htm
Pls try
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Viray
Did u get all the line items.Plz If u solved the problem share with me how u have come across that prob.
Regards,
Fk.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.