on 02-18-2013 12:03 PM
i am using 'sales order number' as a select-options in my driver program , according to the entered values in its low and high parameters by user , i want to print smart form for all the sales order number lies between low and high parameters exclusively.
select-options : order for vbak-vbeln.
now i am calling smart form function module but the smart form is printed only for higher value of sales order.
let say low-5100 high-5104 then smart form which is printed only for sales order no 5104 i.e only for higher value printed on the form and the below corresponding line items are shown for all of the sales order from 5100 to 5104.
i want that after executing the driver program for smart form , then select-option comes i gave low and high value that is range
,print preview comes and then i must get 5100 order on one page and 5101 on next page and so on till higher value..
plzz help ..... if anyone having any idea....
For multiple spool : Change your driver program
For reference for Smartforms, read some documentation like Integrating the Smart Form into the Application. Also use the search tool for wiki guide at scn on Smartforms.
To get a single spool generated use SSF_OPEN and SSF_CLOSE as described in Printing Several Forms in One Print Request.
Regards,
Raymond
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi raymond ,
i have used this concept and it is working
fine
but now my new requirement is that while printing smart form that is printpreview, i am unable to go back and forth .
let say i am printing order no from 5100 -5102 .
so i am unable to see the preview of previous orders once i saw preview of 5102.
navigation to back and forth is not working.
that is pg up and page dwn functionality is not possible in your concept.
please have a look to this attached smart form.
run it at ur end..
Hi,
Please check this program
SF_EXAMPLE_03
Regards,
Suman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
PLZZ CHK THIS PDF .. OF SMART FORM FINAL OUTPUT..
MY LAST PAGE IS COMING BLANK..
I HAVE USED PAGE BREAK AT END OF TABLE ...
AFTER FOOTER OF TABLE..
MY TABLE HAS HEADER , MAIN AND FOOTER AREAS DEFINED IN SMART FORM..
AFTER FOOTER THERE IS A PAGE BREAK,,
WHY THE LAST PAGE COMING BLANK.................?
WHEN I PASS SELECT-OPTIONS WITH LOW ORDER NO AS -->5100 AND HIGH ORDER NO AS--->5102
PLZZ HELP..?
LAST PAGE IS BLANK BUT WITH OTHER DETAILS AND NO MAIN WINDOW CONTENT... I WANT THE PAGES TO BE PRINT ONLY 3 ... PAGES
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI DNYANESHWAR...
i am using table and used a loop on table to print line items in main window ..
in table i have used
the header , main and footer.
header--> my header details
main--> line item values are printed
and in footer---> final calculation
SUB_TOTAL:
TAX :
Net amt:
Cash disc:
TOTAL_AMOUNT:
kk after that i have used command break to trigger the ouput of next sales order on next page..
hi syed ghulam..
i dnt understand it clearly bro...
i have used command break after footer that is below footer....
chk my tree of smart form
suggest me... in this scenario my last page coming blank with//........other contents such as logo and adress etc...... but not the content of table.. on this last page..
means i want to say that from order no 5100-5102 if i am printng
4 pages are printed ..... but this is not correct bcoz only 3 pages must pe printed .. from 5100 to 5102.
my fouth page do not have main window content but other details... which are shown in previous printed pages...
plzz suggest...?
or you can change the smart form.
1. declare all the variables, workareas, iternal table required and a variable flag with initial value 'X'
1. In Global Definition: Fetch all the data for every order number passed.
2. dummy window: set a condition if 'flag' is equal to 'X'.
program lines:
3. sold to party window: is dispalyed with the respective data in workarea.
4. info window: is dispayed in dispalyed with the respective data in workarea.
5. additional data window: is dispalyed with the respective data in workarea.
6. table: this should be in main window. use the internal table that has item level data and also use the current logic that you have used calculating the subtotal and tax etc..
7. dummy window2: check the checkbox "After Main Window".
This was the logic i used when i made one of the similar forms so i told hope that this would be helpfull to you.
hi syed ghulam ,
thanks for ur suggestions..
in driver progarm
select-options : order for vbak-vbeln.
select * from vbak into corresponding fields of table itab_vbak where vbeln in order.
as we know that internal table with name order is created with fields
sign , option , low and high ..kk
in LOW AND HIGH parameters .
ie order-low
order-high
i am pasing this entry when calling smart form
like this ..
SSF_FUNCTION_MODULE_NAME
AND THEN
CALL FNAME..
PASSING LOW AND HIGH VALUES HERE WHILE CALLING .
NOW THESE VALUES WILL RECEIVED BY SMART FORM FORM
CAPTURING these values in form interface parametrs
low type vbak-vblen.
high type vbak-vbeln.
kk
then
in this sf in select record program lines
i am fetching data from vbak , vbap , konv , vbkd tables in an internal table ..
all itab and their wa are declared in global parametrs ..
kk
after select_record
main loop is to loop the internal table itab_vbak that is header table with sales order no.
then in table loop of line item table let say itab_vbap
printing all line items value in main area
header details print in header area of table
finally calculative part in footer area of table.
after footer i have used a page break command the other secondary window such as sold to party
etc,,,,,,
i think my tree structure maintained in smart form is mistaken somewhere
i am getting my last page without main window content .....but with pther deatils ..logo adress info , additional info windows signature and all..
this page must not come...
i am unable to omit this page.....
Sir in that case i have two requests,
1. Clear the work areas which contain data for sold to party, information and additional information details after the main folder has finished processing. i think you can do it in the place where you are breaking the page for next order.
2. check the number of records available for the order 5102 at item level there might be more records.
your problem should resolve if you follow the first step. the reason is your workareas have the data even when the table has finished printing the item level data thats the reason i guess only the header data is getting printed.
points if helpfull
Hi Deepak,
Use parameter CONTROL_PARAMETERS while calling the smartform.
Example,
loop at T_VBAK .
* Initially set both the properties to 'X' as given below,
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.
AT FIRST.
control_parameters-no_open = ' '. "open form
control_parameters-no_close = 'X'. "dont close form
ENDAT.
AT LAST.
control_parameters-no_close = ' '. "close form
ENDAT. "AT LAST.
CALL FUNCTION fname
EXPORTING
control_parameters = control_parameters.
endloop.
Thanks & Regards,
Tushar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FINALLY I GOT IT...... CORRECTLY.. HERE IS MY CODE
REPORT ZSMARTFM.
TABLES : VBAK, VBAP.
DATA: IT_VBAK TYPE STANDARD TABLE OF VBAK WITH HEADER LINE,
IT_VBAP TYPE STANDARD TABLE OF VBAP WITH HEADER LINE.
DATA : wa_cparam TYPE ssfctrlop,
wa_output TYPE ssfcompop.
wa_cparam-preview = 'X'.
wa_cparam-no_dialog = 'X'.
wa_output-tddest = 'LP01'.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : ORDER FOR VBAK-VBELN ."NO INTERVALS NO-EXTENSION.
SELECTION-SCREEN END OF BLOCK B1.
INITIALIZATION .
ORDER-LOW = '5100'.
ORDER-HIGH = '5102'.
APPEND ORDER.
START-OF-SELECTION.
*
*SELECT p~vbeln
* f~netwr f~posnr f~fkimg f~gsber
* b~name1 b~kunnr
* INTO CORRESPONDING FIELDS OF TABLE itab
* FROM ( ( vbrk AS p
* INNER JOIN vbrp AS f ON p~vbeln = f~vbeln )
* INNER JOIN kna1 AS b ON p~kunrg = b~kunnr ).
DATA : FNAME TYPE RS38L_FNAM.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZNEW_FORM'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
FM_NAME = FNAME
* EXCEPTIONS
* NO_FORM = 1
* NO_FUNCTION_MODULE = 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.
CALL FUNCTION fname "'/1BCDWB/SF00000451'
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = wa_cparam
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
OUTPUT_OPTIONS = WA_OUTPUT
USER_SETTINGS = ' '
LOW1 = order-low
HIGH1 = order-high
* 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 SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
instead of passing the data from driver program to smartform with select queries and calling then function module,,, ,,,,,i straight way in driver program pass low and high values and calling my function module and then sf is called and in form interface capturing low and high values of select options and all the data declared in types and global defination finally doing manipulation with inner and outer loops in sf and displaying content in smart form... i think this will be helpful for all who faced such problemss earlier also..... ..
thanks all for ur suggestions guys..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepak,
try to change the your piece of code like this.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSALES_ORDER'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
FM_NAME = FNAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
call FM CALL FUNCTION 'SSF_OPEN'.
loop at t_vbak.
CALL FUNCTION FNAME
* EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
wa_vbak = wa_vbak
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
VBAK1 = T_VBAK
VBAP1 = T_VBAP
VAT1 = T_J_1IMOCUST
VBKD1 = T_VBKD
VBRP1 = T_VBRP
T685T1 = T_T685T
KONV1 = T_KONV
new_table = new_itab
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.
ENDIF.
endloop.
SSF_CLOSE.
also check this link http://scn.sap.com/thread/526988
Regards,
Gurunath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi all,
here is my code driver program ...
*&---------------------------------------------------------------------*
*& Report ZSALES_ORDER_PROG
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZSALES_ORDER_PROG.
TABLES : VBKD.
TABLES : VBAK.
TABLES : VBEP,
J_1IMOCUST.
tables : vbap.
TABLES : KONV.
*"--------------------------------------------------------------------*
* Internal Table to Hold SALES ORDER DOCUMENT *
*"--------------------------------------------------------------------*
*DATA : ITAB_VBAK LIKE STANDARD TABLE OF VBAK WITH HEADER LINE.
DATA : T_KONV LIKE STANDARD TABLE OF KONV WITH HEADER LINE.
DATA :
T_VBAK LIKE
STANDARD TABLE
OF VBAK WITH HEADER LINE.
DATA T_J_1IMOCUST LIKE TABLE OF J_1IMOCUST WITH HEADER LINE.
DATA:
T_VBAP type table of vbap with header line.
*STANDARD TABLE
* OF VBAP.
DATA : T_VBKD LIKE TABLE OF VBKD WITH HEADER LINE.
DATA : lt TYPE TABLE OF konv WITH HEADER LINE.
"-------------------------------------------------------
" SELECTION SCREEN ELEMENTS
selection-screen begin of block b1 with frame.
SELECT-OPTIONS : SALES_NO FOR VBAK-VBELN ." NO INTERVALS NO-EXTENSION.
*PARAMETERS: s_order TYPE vbak-VBELN.
selection-screen end of block b1.
INITIALIZATION.
SALES_NO-LOW = '5100'.
SALES_NO-HIGH = '5104'.
APPEND SALES_NO.
*AT SELECTION-SCREEN.
* SELECT SINGLE VBELN FROM VBAK INTO CORRESPONDING FIELDS OF TABLE ITAB_NEW WHERE VBELN IN SALES_NO-LOW .
START-OF-SELECTION.
SELECT * FROM VBAK INTO CORRESPONDING FIELDS OF TABLE
T_VBAK WHERE VBELN IN SALES_NO.
"-----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
SELECT * FROM VBAP INTO CORRESPONDING FIELDS OF TABLE T_VBAP FOR ALL ENTRIES IN T_VBAK WHERE
VBELN EQ T_VBAK-VBELN.
SELECT * FROM J_1IMOCUST INTO TABLE T_J_1IMOCUST FOR ALL ENTRIES IN T_VBAK
WHERE KUNNR = T_VBAK-KUNNR.
SELECT * FROM VBKD INTO CORRESPONDING FIELDS OF TABLE T_VBKD FOR ALL ENTRIES IN T_VBAP
WHERE VBELN = T_VBAP-VBELN.
SELECT * FROM KONV INTO CORRESPONDING FIELDS OF TABLE T_KONV FOR ALL ENTRIES IN T_VBAK
WHERE KNUMV = T_VBAK-KNUMV.
PERFORM SMART.
" DRIVER PROGRAM FOR ZSALES_ORDER
FORM SMART.
loop at T_VBAK .
DATA:fname TYPE rs38l_fnam.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSALES_ORDER'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
FM_NAME = FNAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 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.
CALL FUNCTION FNAME
* EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
VBAK1 = T_VBAK
VBAP1 = T_VBAP
VAT1 = T_J_1IMOCUST
VBKD1 = T_VBKD
KONV1 = T_KONV
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.
ENDIF.
ENDLOOP.
ENDFORM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
while calling the FM pass the final table which is having the sales order no.check the below link.
http://scn.sap.com/thread/526988
Regards,
Gurunath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Below things are to be done in smart form after passing the data from the driver program
1. get all the sales order values between low and high EG: lt_orders.
2. fetch all item level data for the sales order in another table lt_itemdata.
then,
loop at lt_order in wa_order. ********* this is to be done using loop node in create--> flow logic-->loop.
create a program line node in flow logic and read the data relating to wa_order-order.
print it.
endloop.
you have to design the item level data display inside the loop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepak Bishat,
You can make loop for the vbeln number (header and item) inside the loop you can call your smartform function module it may print multiple sales orders.
i think this may hep you.
thanks and regards,
vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Are you passing the sales order in a table to the smartform from your driver program? If so, I think your desire output should come.
Call the function module generated from SSF_FUNCTION_MODULE_NAME and pass your table.
"i want that after executing the driver program for smart form "
Then how you will pass all the sales order to smartform?
Thanks,
Abhijit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello.
do a loop and inside call the smartform. The IT_VBELN table contains the data that will be show on the smartform.
LOOP AT IT_VBELN.
CALL smartform
ENDLOOP.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.