01-04-2015 10:13 PM
Hello Experts,
I have a task where I need to display data using the following conditions in a smartform:
1. Print Item data [one line] as a header on each page.
2. Print all material characteristic of that specific item on the page and if exceeds then go to the next page beginning item data as a header.
3. For each new item, begin with a new page.
I have two internal tables. i. For Item data with item number and other data and such as material and ii. For Material Characteristics with item number.
I tried to use Table node before main window for Item data to display as header. And Loop & Template for Material Characteristics inside main window. But I am not able to display as required in 1. 2. & 3.
I am looking for expert's advise to resolve this issue. I need a fresh solution. Probably I am missing certain conditions. Please help for solution. I will award points for a correct solution that work for me.
I have search forum but could not find a solution.
Thanks in advance.
Stacy
01-05-2015 2:31 AM
You would have to display your item/ material information in the main window as well (Also extend the main window so it covers the header area).
You will have to use table/ loop inside the main window to display item data and then use another table/ loop within this (a nested one) to display characteristic details.
After the end of loop/ table for characteristics detail you will have to insert a command node to trigger a page break
Page 1
Main window
Table/ Loop 1 - For item details
Table/ Loop 2 - For material characteristics
Command node for page break
02-19-2015 5:24 PM
Hello Pulkit,
Sorry, I was not able to reply earlier.
Thanks for the suggestion. I have used it but I have another issue with protecting multiple table lines at the page break. Could you please suggest some solution?
I have done this way:
Page 1
Main window
Loop 1 - For item details
Table - For material characteristics
Header
Line Type - for Item Header & Data
Line Type - for Material Characteristic Header
Main
Line Type - for Material Characteristic Data
Command node for page break
I want to protect three table lines for (1) Item Header & Data (2)Material Characteristic Header and (3) Material Characteristic Data against a page break for output in the main area. If there is not enough space at the end of the page and if there is a new item then all three lines should be printed on next page.
In table node-> table tab --> details, I have set the Protection against page break checkbox in the table for all three line types. But sometime they split up during a page break. Item header, Item data are displayed on previous page and Material characteristic header/data displayed on different page. I tried to use also folder for protection but there are two lines in header and one in main area so I cannot combine in one folder. I also tried to protect through smartstyles but problem still exists.
Please advise for a working solution. I have tried all different options but nothing stopping the splitting of thee table lines.
Thanks.
Stacy
02-23-2015 2:44 AM
Hi Stacy,
A bit tricky to achieve what you are trying. But give this a try
Page 1
Main window
Loop 1 - For item details
Table - For material characteristics
Header
Main
Folder 1*
Line Type - for Item Header & Data
Line Type - for Material Characteristic Header
Line Type - for Material Characteristic Data
Command node for page break
* - Checkbox related to pagebreak settings checked only at folder and not at other rows/ line type
Regards,
Pulkit
02-19-2015 5:47 PM
Hi,
Please have a look at program SF_EXAMPLE_03 .
All the loops are done in the program .
This way you reduce the complexity of the smart form.
Note the use of:
call function 'SSF_OPEN'
call function 'SSF_CLOSE'
regards.
02-19-2015 10:20 PM
Hello Eitan,
The SF_EXAMPLE_03 has a loop in main area of the Table loop.
I tried to use the same way so I have now
Page 1
Main window
Table Loop 1 - For item details
Header
Line Type - for Item Header & Data
Line Type - for Material Characteristic Header
Main
Loop for material characteristics
Line Type - for Material Characteristic Data
Command node for page break
Footer
But when there is item change it does not display Item header & Data & Material Characteristic Header. How to give page break here?
Thanks.
02-20-2015 8:02 AM
Hi,
Can you post a picture how the output should looks like (use excel) ?
- For each Item perform the call for the smart form
- In a dedicated window - Print Item data [one line] .
In "Main window" Print all material characteristic as a table for the given Item.
Also look here for a sample of using deep structures .
http://scn.sap.com/community/abap/blog/2013/10/22/deeper-dive-into-deep-structure--part-3
Regards.
02-23-2015 10:19 AM
Hi Stacy,
The header should be reprinted on a new page if you've checked the 'at Page Break' option in the Header 'Output Options' tab.
02-21-2015 6:17 AM
Hi,
Hope you are linking item data internal table and material characteristics internal table with common field ?.
Try
eg: table entries.
itab 1.
item material code.
10 p4101
itab 2.
material code type
p4101 zbou
p4101 fert
final_itab 3.
item material code type
10 p4101 zbou
10 p4101 fert.
sort final_itab 3 by item.
" create programming lines.
loop at final_itab3 into wa_final.
CHECK sy-tabix NE 1.
AT new of item.
lv_new_page = 'X'.
endat.
endloop.
Create command.
In condition tab.
lv_new_page = 'X'.
Goto to new page.
Hope it helpful,
Regards,
Venkat.