on 07-14-2008 1:32 PM
Dear Guru
here i have encountered an issue in populating and internal table's data into a SAP-Script Form.
char1_val_tab_1 is an internal table and i am trying to populate its
char1_val_tab_1-atnam -->> characteristics names
char1_val_tab_1-atflv --->> characteristics value
into a sap-script form.
so in sapscript's from i have passed this two variable
like below
&char1_val_tab_1-atnam&
&char1_val_tab_1-atflv&
and in driver prog of that sap-script form i have written code like below in order to populate all the lines of these internal table char1_val_tab_1
LOOP at char1_val_tab_1.
PERFORM write_form USING 'ITEM' ' ' ' ' 'MAIN'.
ENDLOOP.
But the issue i am facing this looping only printing the last line of that internal table but i want from 1st line to last line.
so guru i want to know what are the necessary changes i should make in to above looping in order to print 1st line to last line of that internal table char1_val_tab_1.
Pls help
Thanx & Regards
Saifur Rahaman
Hi,
I think you need to have a work area in your print program and then in text element use the workarea to display the fields.
All other code lines are fine but use the statement .
LOOP AT itab INTO workarea.
I believe it is printing the last line due to lack of the workarea.
Regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Now use the workarea and its fields in the text element to display the contents.
Let me know the result.
It should work.
Regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saifur,
Try to write this way :
LOOP at char1_val_tab_1.
PERFORM write_form.
ENDLOOP.
FORM write_form .
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = ' <Text element Name> '
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.
WRITE 'Write_Error'.
ENDIF.
ENDFORM. " write_form
Now for all the values the loop runs and fetches you all the records.
Regards,
Swapna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did PERFORM write_form USING 'ITEM' ' ' ' ' 'MAIN'.
with following code and its not coming... it is showing only last line of that internal table into sap-scripts o/p
FORM write_form USING p_element
p_function
p_type
p_window.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = p_element
* function = p_function
* type = p_type
window = p_window
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
OTHERS = 8.
ENDFORM. " WRITE_FORM
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.