2013 Aug 07 8:42 AM
Hi Abapers,
I have a new requirement where I need to print a form depending on the number of inputted records, example:
input 10 records to be retrieved from table MAKT..displaying matnr and maktx
output should be:
Page 1. 1 Coke light
Page 2. 2 Pepsi
Page 3. 3 Mirinda
Page 4. 4 Sarsi
.
.
.
Page 10 10 RC
Please let me know what approach should be done to achieve this. print preview should have 10 pages but different records per page.
Thank you in advance.
Thanks,
Jeffbroodwar
2013 Aug 14 1:09 PM
Hi Abapers,
I have a new requirement where I need to print a form depending on the number of inputted records, example:
input 10 records to be retrieved from table MAKT..displaying matnr and maktx
output should be:
Page 1. 1 Coke light
Page 2. 2 Pepsi
Page 3. 3 Mirinda
Page 4. 4 Sarsi
.
.
.
Page 10 10 RC
Please let me know what approach should be done to achieve this. print preview should have 10 pages but different records per page.
Thank you in advance.
Thanks,
Jeffbroodwar
2013 Aug 07 10:01 AM
2013 Aug 07 1:06 PM
Hello,
As per my understanding you can do it multiple ways,
-> By using B. Wallagh suggested link OR
-> Make the Main window size in such a way that only one record should be fixed and make
Next page as same First Page(PAGE1) ,So that the number of pages will contain unique record.
Regards,
Pavan
2013 Aug 07 1:25 PM
Hello,
First u have to Create a LOOP and Mark the GO TO NEXT PAGE and give the page in which the data should go.
Regards,
Ashwini
2013 Aug 07 1:36 PM
Hi Jeff,
You can use Smartform events on the table that containing material records. In that events call new page using "Command", so that for every new material record new page will be triggered and remaining data in the page will be printed normally.
Thanks & Regards,
-Vijay
2013 Aug 07 2:25 PM
Hi, thanks for the inputs, I tried the suggestion of B. Wallagh but got only the last record... I would like to get many pages containing different CARRID per page..
Thanks!
Jeffbroodwar
2013 Aug 07 2:28 PM
Please see form used and let me know how to achieve the requirement...
Thanks in advance.
Jeffbroodwar
2013 Aug 07 4:26 PM
Hi Jeff,
I saw your form and their you used the command and also a condition.
it will work fine if you change the condition.
Just remove the code section and in the command, put the condition as
With this, for the first record page break will not be triggered, but for all other records Page-Break would trigger and all the records would come in next page.
Regards,
Sumit
2013 Aug 08 8:57 AM
I just followed the instruction in the link...and if I remove the code in the code section, how will I get the records? code selects records from sflight table...
Thanks,
Jeffbroodwar
2013 Aug 08 9:01 AM
Followed as instructed, removed code node but still getting the last record only and only 1 page...table contains 30 records, I'm expecting 30 pages each having unique carrid values.... hope you can help me guys...
Thanks,
Jeffbroodwar
2013 Aug 08 10:41 AM
Did you put the conditions as sy-tabix ne 1 in the command?????
2013 Aug 08 11:31 AM
Hi Jeff,
I found the solution of the problem. I tried to show 5 entries and they came in 5 different pages.
Instead of Loop use Table in the main window of the Tflight.
By this I can see that I am getting 5 pages for 5 entries. Your problem would then be solved.
2013 Aug 13 9:34 AM
Hi Sumit Sharma,
I tried the same but I don't get anything... can you please attache the form you used?
Thanks
Jeffbroodwar
2013 Aug 13 5:35 PM
Hi Jeff,
I am unable to upload the XML form. Kindly guide me how to upload that form on SCN.
2013 Aug 13 6:46 PM
Try this,
data: wa_control type ssfctrlop.
data: wa_output_options type ssfcompop.
form sub_process_print .
wa_output_options-tdimmed = 'X'.
wa_output_options-tddest = 'LOCL'.
wa_control-no_open = 'X'.
wa_control-no_close = 'X'.
wa_control-no_dialog = ' '.
wa_control-preview = ' '.
gv_count = gv_count + 1.
if gv_count = 1.
wa_control-no_dialog = ' '.
elseif gv_count > 1.
wa_control-no_dialog = 'X'.
endif.
if gv_count = 1.
call function 'SSF_OPEN'
exporting
control_parameters = wa_control
output_options = wa_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.
exit.
endif.
endif.
if wa_final is not initial.
call function gv_fm_nam
exporting
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
control_parameters = wa_control
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
output_options = wa_output_options
user_settings = ' '
wa_final = wa_final
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5
.
if gv_count eq gv_lines.
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.
endif.
endform. " F_PROCESS_PRINT
*&---------------------------------------------------------------------*
*& Form SUB_PRINT_LETTER
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form sub_print_letter .
gv_lines = lines( it_final ) .
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'smartform_name'
importing
fm_name = gv_fm_nam.
loop at it_final into wa_final .
perform sub_process_print .
endloop .
endform.
2013 Aug 14 6:28 AM
Do not use the reply to specific person, use the REPLY TO ORIGINAL POST at the bottom of the thread then use the link advanced controls, there you will see the attach files option on the new page that will be generated.
Thanks,
Jeffbroodwar
2013 Aug 11 10:54 AM
Dear jeff,
I think you can go for another way to call smartform within loop passing different work area value and design the form accordingly.
with regards
vikas pandey
2013 Aug 14 9:09 AM
Hi Jeff,
Here is the form which i used to get 5 pages for 5 entries.
2013 Aug 14 12:30 PM
2013 Aug 14 1:12 PM
I have put it again...
If you didn't get it yet...Please share your E-mail ID I will send the attachment to you.
2013 Aug 14 10:12 AM
Dear Jeff,
With the help of a global variable for storing the previous Material No, and a Command in the smartform for checking whether the current Material No is equal to or not equal to the previous assigned Material No. If the Material differs from the previous one, then in the Command give the next Page.
This way you can display different Material details in different page. Use Code for assigning previous Material No and Command for checking and moving to next Page.
Thanks and Regards,
Rinzy Deena Mathews
Applexus Technologies (P) Ltd.
2013 Aug 14 1:09 PM
2013 Aug 14 3:59 PM
Thanks for all who contributed, I guess the problem is that I forgot to remove the logic in the condition tab of the table node, this results to only one page being displayed. I now know how to use the command node to achieve this requirement.
Thanks,
Jeffbroodwar
2014 Dec 09 6:41 AM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |