on 12-01-2010 5:31 AM
Hi experts,
I want to print material number through smartform. i have a internal table containing material number and its quantity. I want to print particular material number for number of quantity times. it means if i have 3 rows in internal table , that means 3 material numbers are there and number of quantity is 50 for each material . so i want to print each material number for 50 times.
Do one things
Lets say may table is GT_MATNR containg quantity and material.
Loop at GT_MATNR.
LV_Count = LWA_MATNR-QUANTITY.
DO----> ENDOO LVCOUNT times and print inside it.
thanks
Nabheet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nabheet ,
Problem is the page break is not happening . i have given print but whole data comes on one page and it appends the previous data on that page only.
i have made a loop on internal table called GT_MATNR in smartform main window. Then inside it i called another loop and inside that loop i jst pass the text thn i put page break command . But the pagebreak command is not workong nd whole data is printed on one page .
hi vishwa ,
i have called first loop in main window than in program lines fill the internal table with serial no and material code for quantity times. than loop on that internal table and under that loop i select one textfield and pass the material number to it . than under textfield one program line and in that program line sfsy-page = sfsy-page + 1. and than in command pagebreak : go to page page1.
Hi Rupesh,
You can try following code.
Lets take an example of just one material number in your internal table.
what you can do here is create two similar tables with quantity & material number.
Loop at itab.
here capture the quantity field.
do < quantity times >
append the material numbers to the second internal table.
enddo.
endloop.
This way you can build an internal table with material numbers for total number of quantities.
Then use this table in your smartform.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create program line in your smartform and build the following logic.
1) you need additional internal table, with material.(ex: it_new)
2) loop at internal table that has material and quantity. (ex: internal table name it_mat)
Do quantity times " Make sure quantity does not have decimals
populate it_new.
end do.
endloop.
Example:
Loop it_mat.
Do it_new-quantity times. " make sure quantity does not have decimals
it_new-matnr = it_mat-matnr.
append it_new.
Enddo.
Endloop.
3) now try to display the contents of new internal table in the output.
I guess, above solution will help you to close the thread.
Regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First we need to take two LOOPS.
First place under the main window
Second loop place in the table write the condion in the main view how many records u want to display in that mainview
every u can display 30 records.
After that use the page break statment for that table.
between first loop and endloop we can create pagebreak statement.
After main window.
First loop: LOOP AT ITAB INTO WA.
LOOP AT IT_MAT INTO WA_MAT. "give inthe table
****write the conditon display the 20 rrcords for each page.
page break statement.
ENDLOOOP.
If second loop condtion 100 records First loop must be excuted 10 times.
Regards,
MURlii
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.