Problem in invoice printing smartform
Sir,
I am encoutring a problem in smartform of invoice printing,
the customer and invoice details are taken in secondary windows,
and the item details are taken in mainwindow.
the main is repeating if that invoice has more no items, to next page.
but the secondary windows for customer and invoice details are not
repeating.
pls provide the solution.
Regards.
Satish.P.
HI friend,
Please specify check the Check box only At end of main window in the conditions tab of those two secondary windows ie customer and invoice details secondary windows.
I think this will solve your problem. Revert me if you have any issues i will help you.
Thanks,
Sri Hari
Similar Messages
-
Problem In Invoice Printing...!!
Hi all,
I have a custom invoice which I've prepared using smartforms. It has got a bigger size & I have a new Page format to serve this purpose.
I am able to see the print preview. Its fine. The page being used for printing has got the correct size. But when I try to print it, nothing is getting printed. It says 'Output Cannot Be Issued'. Even the spool request is not getting created.
But when I re-assign the SAP's standard program & smartform, Its printing fine.
Please help me...Thanks, I solved it.
-
Hi Gurus,
I Have got a problem in Invoice Printing.I had attached a Pgm Name say <b>Z_PGM_NAME</b>, Form Name <b>Z_ROUT_NAME1</b> And Smartform say SF_NAME1.The Invoice No I used to pick from NAST-OBJKY.Also the NAST Table entries were used to get the NO OF MESSAGES , PROCESSING STATUS to print multiple copies.Everything was fine when I was taking the printout from VF02,VF03. But now we have set that the printouts will be automatically created once the Invoice is saved.
Now the problem is I save the invoice but no printout comes.Then in VF02 when I check the Header-Output, In processing Log , I get the error message <b>The Routine Z_ROUT_NAME in program Z_PGM_NAME does not exist</b>'for that output type.
What scan be the problem.I checked the Program Name And Routine.In VF02 if I use the same output Type it gives the Print.Hello Moses,
Please check the attributes of the output type.
There will be a option like this :
Print immediately while saving
Send to spool
Choose the relevant options for the output type.
Hope this will help you.
Reward points if helps.
Best Regards,
krishnakumar -
Printing Problem on Canon Printer
Hi Gurus,
Greetings and Thanks in advance!
I have problem in Invoice printing on new Canon LBP 2900 B printer. Whenever I print on this printer the one character from right side does not print. Whereas if the same printing we are doing on HP Laserjet printer it comes perfectly.
I tried to create a new output device through SPAD in which I have used following:
Device Type: SWIN Windows printing via SAPlpd (since i didnt find Canon printer in the list so i used windows standard)
Device Class: Standard Printer
Host Spool Access Method: G:Front End Printing with control Tech.
Host Printer: _Default
But it was giving the same problem. Please suggest the solution.
Regards
Rajesh
Edited by: Rajesh Gupta on Jul 7, 2010 3:59 PMCheck
1135052 - Printer-Vendor-Programm - Wizard-Note:: CANON
Markus -
How to print Smartform in Draft mode.
HI all,
we are using Wipro LQ DSI 5232 printer, our problem is while printing smartform , its coming in Roman but it should come in Draft Mode.
When it goes to Roman mode the printing become very slow.
How to set in default Draft mode.
Regards,
Rahul.Hi,
there is an SBO setting inside
Administation>System Init>Print preferences>Print Draft Watermark on Draft
Then a "DRAFT" watermark will appear if it's printed before adding.
In CR use a stored proc to get data back according to the Objectid@.
Then if its the object id of a draft then add a CR watermark.
Hope this helps.
Regards,
D -
Commercial Invoice Printing Problem
Dear Gurus,
I prepared a 'Z' output type to print Commercial Invoice & i want to print 2 invoice in one page but page skiping after 1 invoice print.
How to resolve this because i am using VF31 for printing.
Thanks & Regards
Varun
Moderator Message: Cross Post.
Edited by: kishan P on Dec 10, 2010 3:54 PMHi Varun,
Your issue is no way related to the output types. The problem can be solved by adjusting the logic inside your commercial Invoice smartform.
To make two invoices to be printed on one page, handle the events where your invoice contents are looped(do inside your main window). Use command prompt, to trigger page break after every two invoices.
I guess, the above information will help you to close the thread.
Regards,
SaiRam -
Excise invoice printing problem (page skiping)
Hi all,
Issue: Excise invoice printing as maintained in billing document.
In each page, page no, address, so no etc will come in the header portion.
In main window, I have to print out 10 line items of billing doc.
If line items exceeds 10 lines then subsequent items should be printed in the following page. And at the very last page, asseable amount, vat, tax amount, mode of transport & amount in words should be printed.
It is getting printed superb without header text of billing doc.
Requirement is that after printing completed of all line items, first seven line of billing documents header details (eg FG, semifinished, packing, size, etc.) are to be printed.(eg if line item is 10, then header details will be printed in the last page containing footer details). I have declared two text element in main window (one is item, another is header text). My requirement is to control dynamically print of items as well as header text in main window. I have declared 7.60 MM of main window height which is suitable for only 10 line item printing. Header text will come only on last page. I have declared 7 different header text variable in main window as maintioned in driver program. If there is no header text in billing document, it is giving 7 blank line feed after items printed.(eg if i have 10 or 20 line items then it is giving one extra page for 7 lines blank header text). I want to control this page skipping. If there is no header text then I want to finish printing in that particular page where items are being finished. It should be dynamic.
Pls help.
SrimantaHi,
What i understand from request is to print the header data if exit and not then do not print the header data bust need to print the tiem data.
For this the solution is as follows:
1) define the header data in separate window (but not in main window) and name this windiw as header and also place this window on top of the page i.e. adjust the window to pribt on top of the page.
2) Now place the condition for this wibdow i.e. to print if the header data Internal table or variable field data is ne space.
with above said details te header window will print if there is data only and this will print on all pages.
Do let me know if ou need any more details in this regard.
Regards,
Raghotham Reddy.
if this is rght solution for you then do not forget to allocate reward points. -
Problem while printing smartform in dot matrix printer
Hi Experts,
When i am printing smartform using dot matrix printer only the last page prints but all the pages displays in print privew.
For example suppose there are three pages to be print 1/3, 2/3 , 3/3 , i get all the three pages in print privew as well as when i take its printout in laser printer i get all three pages as print, but when i am using dot matrix printer i get only the last page ie 3/3 as print.
Regards
Varun SharmaHai Varun,
If things are coming properly then its no more ABAP issue.
Need to check out with the BASIS team along with the IT / hardware department.
Just try to take print out on a other dotmatrix printer, if its somewhere close to you as usually they are heavy and large in size can't be moved.
Hope this helps,
Cheers,
Suvendu -
Excise invoice printing problem
hi experts,
I am working with excise invoice printing thru J1Ip .a document has three materials which has 3 batch splits each .so total items are 9 .Now they need the total of each item .so only 3 items should come imn the print out.what shll i do for it.i am using scripts ..
maniHi,
What i understand from request is to print the header data if exit and not then do not print the header data bust need to print the tiem data.
For this the solution is as follows:
1) define the header data in separate window (but not in main window) and name this windiw as header and also place this window on top of the page i.e. adjust the window to pribt on top of the page.
2) Now place the condition for this wibdow i.e. to print if the header data Internal table or variable field data is ne space.
with above said details te header window will print if there is data only and this will print on all pages.
Do let me know if ou need any more details in this regard.
Regards,
Raghotham Reddy.
if this is rght solution for you then do not forget to allocate reward points. -
Automation of invoice printing?!!!!!!
hi all ,
I am new to sap script. my requirement is i have a z program and a z form for invoice printing ., in foreground its working fine.,, problem is i want to print invoices automatically when the user creates a invoice and clicks save.,, what has to be done now ? i am not clear about output types and spool plz help me out.,
reg
kannanHi Kannan.
To use the sapscript in an invoice, it must be associated with the output message.
Check:
transaction SPRO->Sales and Distribution->Basic Functions->Output Control->Output Determination->Output Determination using the Condition technique->Mantain Output Determination for Billing Documents.
Then, in VF03 check what message is being called. Is it is, for example RD00, you shoud assign the print program and sapscript to the output message.
But i think normal invoice only has the SMARTFORM option, instead of SAPSCRIPT.
In Smartform you must use this SPRO procedure too.
Reward usefull ideas!
Best regards.
Valter Oliveira. -
In BI Publisher RTF table layout issue for invoice printing
Hi,
I am working on check printing and invoice printing project on bi publisher and i am facing one issue. That is i have used section break on check priting so because of that if the the records are more than 20 then check will print on second page and on first page there would be void printed othervise it should print on first page only. In this case the preprinted stationary is not having invoice table form. we are using blank preprinted stationary to print this .
Now i have done with invoice and cheque layout but in output if the number of records are more than 20 then its going to second page but the problem is that invoice table break into two parts and and the end lineof table layout is not coming on first page .even on second page i am not getting start layout line to make complete table outline.
I want that full table layouton both the pages of the table. i have tried to to create table skeleton and used it as a watermark to print all the records on it but it is coming in to the middle of the page .so it not working.
Please anyone knows the solution on this problem please let me know or share your thoughts on this issue.
As i have tried many options but still stuck into this issue .Kindly help me.
Regards,
Prachi G.Hmmm ... sounds like a regression bug.
I would contact support, provide, the version you are using, layout template, sample XML data, 2000 RTF output and 2003 RTF output and ask them to investigate.
Tim -
Invoice Print Selected Invoices program is failing when language is not US
Hi All,
I am trying to run "Invoice Print Selected Invoices" for multiple languages.
When language in customer setup under "Account Site Information" is 'US' then EN-US: (Invoice Print Selected Invoices) is completing successfully.
But when I am changing the language from US to some other language let’s say "F”, then "FR-FR: (Invoice Print Selected Invoices)" getting submitted and it is completing in error.
These are the log messages which I am getting:-
+-----------------------------
| Starting concurrent program execution...
+-----------------------------
Arguments
p_order_by='TRX_NUMBER'
p_customer_id='10044'
p_open_invoice='N'
p_check_for_taxyn='N'
p_choice='SEL'
p_header_pages='1'
p_debug_flag='N'
p_message_level='10'
APPLLCSP Environment Variable set to :
Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
FRENCH_FRANCE.AL32UTF8
Entrer mot de passe :
MSG-00100: DEBUG: AfterPForm_Trigger +
MSG-00100: DEBUG: Multi Org established.
MSG-00100: DEBUG: AfterParam_Procs.Get_Country_Details
MSG-00100: DEBUG: AfterParam_Procs.Switch_On_Debug
MSG-00100: DEBUG: AfterParam_Procs.Get_Trx_Number_Low
MSG-00100: DEBUG: AfterParam_Procs.Get_Trx_Number_High
MSG-00100: DEBUG: AfterParam_Procs.Get_Tax_Option
MSG-00103: lp_trx_date_clause = and a.trx_date = a.trx_date
MSG-00100: DEBUG: BeforeReport_Trigger.Build_Where_Clause
MSG-00100: DEBUG: P_Choice: SEL
MSG-00100: Oracle Error in call to Before Report Trigger -6502
REP-1419: 'afterpform': Abandon du programme PL/SQL.
Report Builder: Release 10.1.2.3.0 - Production on Ma Avr 2 05:59:27 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Can anyone please tell me what is the problem or is there any mistake in my approach?
Regards
AkashPlease see the following docs.
R12: Invoice Print Errors With REP-0069, REP-57054, REP-1419 [ID 557171.1]
Invoice Print Error: Printing Selected Invoices (Multiple Languages) Is Erroring Out With REP-0069: Internal error [ID 731171.1]
Thanks,
Hussein -
Excise invoice printing is required in preprinted stationary format.
Dear All,
I developed a new program & script for excise invoice printing. The requirement is as under: Page layout will be such where 10 line items( as maintained in billing document) can be printed in each page i.e. if billing document have 25 line items (including Finished goods & accessories) , so it should be printed in 3 pages. In each pages, page no should be printed first, then consignee address, customer address, Date, SO number, Tin no etc. Those above details should come in header portion of each page. Then first 10 line items can be printed. If there are more line items, then next 10 items get printed in next page & so on. In the very last page only assessable amount, Tax, VAT, Educes amt & Gross amt along with Excise number, removal time, type if invoice, payment mode etc (in footer section) should be printed. If billing document have only 10 line items, it will be printed in a single page.
I have declared First page & next page only. In each page I have declared required page window according to window size of preprinted stationary format. For that I have used DINA4 page format( size 210 / 297 MM). But actual height of stationary format is 12 inch ( 305 MM).
In print preview it is displaying supereb. All required data is being displayed properly. But when I am taking printout from Dot-matrix printer, from second page onwards it start printing two lines prior to actual position (two lines going up).
I did some permutation to adjust it. But I can not find a proper resolution to it. My thinking is that it is only printer setting problem. Also in PC level in printer setting I used custom paper size declaring actual paper width & height.
Please advise whether it is script/ program problem or printer setting problem.
Regards
SrimantaDear Bapujee/Santosh/Srimanta,
I know this is a very peculiar problem. Actually the SAP paper size definations are over-ruled by spool server's print manager's defination i.e. the setting of the PC's finally works.
Simple solution is create a paper size in the PC and set the printer with the new paper size.
Now, you will encounter another problem. The user may using the printer for other paper size printings also. To avoid the changing of PC's paper size every time the user prints different size, you can adopt this :
In the spool server (i.e. the PC with printer), create different printers with required paper size and name this printer with some meaniful names. Now, in R/3, while printing with LOCL output device the user can select the required printer.
This can be done for network printers also.
All the best.
With Regards,
Abhijeet. -
Hi All,
We need to take Excise Invoice (J1IV) print out. we are using ECC 6.O version, what is the Tcode for taking the excise invoice print out.
Thanks and Regards
ChandruHi All,
Thanks for your updates,
I have tested with Tcode J1IP to take print out of Excise invoice with out put type J1I0 and flagged inculde printed excise invoice.
After clicking print invoice (F8), i'm unable to take the print out. No pages displayed.
Please help me to resolve the problem.
Thanks and Regards
Chandru -
Problem in sending the smartform as an email in a country specific language
Hi,
I am facing a problem in sending a smartform as a email for all other Languages except english and another problem is its sending the email but the output status is still in RED in the messages tab.
the program is working fine for english.
Please do find the below code using which i would be sending the smartform as an email for a PO along with the line item attachments.
Please help.
Arun.
Determine smartform function module for purchase document
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lf_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
error handling
ent_retco = sy-subrc.
IF sy-subrc = 1.
MESSAGE e001(/smb40/ssfcomposer).
ENDIF.
IF sy-subrc = 2.
MESSAGE e002(/smb40/ssfcomposer) WITH tnapr-sform.
ENDIF.
PERFORM protocol_update_i.
ENDIF.
*Start of changes <Arun K Singarapu> C082493 <04/28/2008>
*for print preview
IF sy-ucomm = 'PREVOUTPUT' OR sy-ucomm = 'VIEW'.
CALL FUNCTION lf_fm_name "'/1BCDWB/SF00000197'
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_compop
user_settings = 'X'
is_ekko = l_doc-xekko
is_pekko = l_doc-xpekko
is_nast = l_nast
iv_from_mem = l_from_memory
iv_druvo = iv_druvo
iv_xfz = iv_xfz
IMPORTING
job_output_info = wa_return
TABLES
it_ekpo = l_doc-xekpo[]
it_ekpa = l_doc-xekpa[]
it_pekpo = l_doc-xpekpo[]
it_eket = l_doc-xeket[]
it_tkomv = l_doc-xtkomv[]
it_ekkn = l_doc-xekkn[]
it_ekek = l_doc-xekek[]
it_komk = l_xkomk[]
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.
EXIT.
ELSE.
wa_ctrlop-LANGU = nast-spras.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_compop-tdnoprev = 'X'.
CALL FUNCTION lf_fm_name "'/1BCDWB/SF00000197'
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_compop
user_settings = 'X'
is_ekko = l_doc-xekko
is_pekko = l_doc-xpekko
is_nast = l_nast
iv_from_mem = l_from_memory
iv_druvo = iv_druvo
iv_xfz = iv_xfz
IMPORTING
job_output_info = wa_return
TABLES
it_ekpo = l_doc-xekpo[]
it_ekpa = l_doc-xekpa[]
it_pekpo = l_doc-xpekpo[]
it_eket = l_doc-xeket[]
it_tkomv = l_doc-xtkomv[]
it_ekkn = l_doc-xekkn[]
it_ekek = l_doc-xekek[]
it_komk = l_xkomk[]
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.
*Convert the data from OTF to PDF format
it_otf[] = wa_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = l_len_in
bin_file = lp_xcontent
TABLES
otf = it_otf
lines = it_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 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.
TRY.
---------- create persistent send request ----------------------
send_request = cl_bcs=>create_persistent( ).
len = XSTRLEN( lp_xcontent ).
transform to solix tab
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = lp_xcontent ).
Create Body to the E-mail.
APPEND Text-005 TO l_text.
Attachment Name
l_ponumber = text-004.
CONCATENATE l_ponumber l_doc-xekko-ebeln INTO l_ponumber.
Subject for the E-Mail.
l_subject = text-001.
CONCATENATE l_subject l_doc-xekko-ebeln INTO l_subject.
*create document E-Mail.
CALL METHOD cl_document_bcs=>create_document
EXPORTING
i_type = 'RAW'
i_subject = l_subject
i_length = '13'
i_text = l_text
RECEIVING
result = l_email_object.
*Create PDF Document
bcs_doc = cl_document_bcs=>create_document(
i_type = 'PDF'
i_subject = l_ponumber
i_length = len
i_language = nast-spras
i_hex = lt_solix
*Type casting
obj_pdf_file ?= bcs_doc.
Add PDF document as an attachment
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_pdf_file.
get the attachments of the PO for each line item
SELECT ebeln
ebelp
FROM ekpo
INTO TABLE it_ekpo
WHERE ebeln = l_doc-xekko-ebeln.
concatenate PO and the Line Item Numebr to get the Object key
LOOP AT it_ekpo INTO wa_ekpo.
CONCATENATE wa_ekpo-ebeln wa_ekpo-ebelp INTO wa_temp-objky.
APPEND wa_temp TO it_temp.
CLEAR: wa_temp,wa_ekpo.
ENDLOOP.
*Get data from table DRAD
IF it_temp[] IS NOT INITIAL.
SELECT dokar
doknr
dokvr
doktl
objky
FROM drad
client specified
INTO TABLE it_drad
FOR ALL ENTRIES IN it_temp
WHERE mandt = sy-mandt
AND objky = it_temp-objky.
ENDIF.
IF NOT it_drad IS INITIAL.
SELECT * FROM dms_doc2loio
INTO TABLE it_dms_doc2loio
FOR ALL ENTRIES IN it_drad
WHERE dokar = 'SRM'
AND doknr = it_drad-doknr
AND dokvr = it_drad-dokvr
AND doktl = it_drad-doktl.
ENDIF.
Get the Physical object class and Object ID of the attachment
IF NOT it_dms_doc2loio IS INITIAL.
SELECT * FROM dms_ph_cd1
INTO TABLE it_dms_ph_cd1
FOR ALL ENTRIES IN it_dms_doc2loio
WHERE loio_id = it_dms_doc2loio-lo_objid.
ENDIF.
Get the file from the DMS server using the below function module.
LOOP AT it_dms_ph_cd1 INTO wa_dms_ph_cd1.
wa_object_id-class = wa_dms_ph_cd1-ph_class.
wa_object_id-objid = wa_dms_ph_cd1-phio_id.
CALL FUNCTION 'SDOK_PHIO_LOAD_CONTENT'
EXPORTING
object_id = wa_object_id
client = sy-mandt
TABLES
file_access_info = it_file_access_info
file_content_binary = it_sdokcntbin
EXCEPTIONS
not_existing = 1
not_authorized = 2
no_content = 3
bad_storage_type = 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.
READ TABLE it_file_access_info INTO wa_file_access_info INDEX 1.
IF wa_file_access_info-mimetype = 'application/msword'.
l_doc_type = 'DOC'.
CLEAR: a_xstring,len.
LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
CONCATENATE a_xstring wa_sdokcntbin-line
INTO a_xstring IN BYTE MODE.
ENDLOOP.
len = XSTRLEN( a_xstring ).
transform to solix tab - adding additional attachments
REFRESH lt_solix.
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = a_xstring ).
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_solix
*Type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for PDF document
ELSEIF wa_file_access_info-mimetype = 'application/pdf'.
l_doc_type = 'PDF'.
file_size = wa_file_access_info-file_size.
Convert the 1022 binary data to xstring
CLEAR a_xstring.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = file_size
IMPORTING
buffer = a_xstring
TABLES
binary_tab = it_sdokcntbin
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
DATA: w_output_length TYPE i.
Convert Xstring to 255 RAW
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = a_xstring
IMPORTING
output_length = w_output_length
TABLES
binary_tab = lt_content_bin.
len = w_output_length.
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_content_bin
type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for Excel Document
ELSEIF wa_file_access_info-mimetype = 'application/msexcel'.
l_doc_type = 'XLS'.
CLEAR: a_xstring,len.
LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
CONCATENATE a_xstring wa_sdokcntbin-line
INTO a_xstring IN BYTE MODE.
ENDLOOP.
len = XSTRLEN( a_xstring ).
transform to solix tab - adding additional attachments
REFRESH lt_solix.
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = a_xstring ).
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_solix
*Type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for text doxument
ELSEIF wa_file_access_info-mimetype = 'plain/text'.
l_doc_type = 'TXT'.
file_size = wa_file_access_info-file_size.
Get the file name
l_filename = wa_file_access_info-file_name.
CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
EXPORTING
input_length = file_size
TABLES
binary_tab = it_sdokcntbin
text_tab = file_data
EXCEPTIONS
failed = 1
OTHERS = 2.
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 METHOD cl_document_bcs=>create_document
EXPORTING
i_type = l_doc_type
i_subject = l_filename
i_text = file_data
RECEIVING
result = bcs_doc1.
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
ENDIF.
CLEAR:it_file_access_info,it_sdokcntbin.
CLEAR:wa_object_id,wa_file_access_info,file_size.
ENDLOOP.
CALL METHOD send_request->set_document( l_email_object ).
*Get the address number for the vendor
SELECT SINGLE adrnr
FROM lfa1
INTO l_adrnr
WHERE lifnr = l_doc-xekko-lifnr.
MOVE l_adrnr TO l_addrno.
Get the Email Address for the vendor using address number
CALL FUNCTION 'ADDR_GET_REMOTE'
EXPORTING
addrnumber = l_addrno
TABLES
adsmtp = it_adsmtp
EXCEPTIONS
parameter_error = 1
address_not_exist = 2
internal_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.
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flg_nouse = 'X'.
IF sy-subrc = 0.
LOOP AT it_adsmtp INTO wa_adsmtp WHERE flg_nouse = 'X'.
CALL METHOD cl_cam_address_bcs=>create_internet_address
EXPORTING
i_address_string = wa_adsmtp-smtp_addr
RECEIVING
result = recipient.
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
ENDLOOP.
ELSE.
READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flgdefault = 'X'.
IF sy-subrc = 0.
CALL METHOD cl_cam_address_bcs=>create_internet_address
EXPORTING
i_address_string = wa_adsmtp-smtp_addr
RECEIVING
result = recipient.
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
ENDIF.
ENDIF.
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = l_sent_to_all ).
CATCH cx_bcs INTO bcs_exception.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), bcs_exception->error_type.
EXIT.
ENDTRY.
ENDIF.Hi,
I am facing a problem in sending a smartform as a email for all other Languages except english and another problem is its sending the email but the output status is still in RED in the messages tab.
the program is working fine for english.
Please do find the below code using which i would be sending the smartform as an email for a PO along with the line item attachments.
Please help.
Arun.
Determine smartform function module for purchase document
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lf_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
error handling
ent_retco = sy-subrc.
IF sy-subrc = 1.
MESSAGE e001(/smb40/ssfcomposer).
ENDIF.
IF sy-subrc = 2.
MESSAGE e002(/smb40/ssfcomposer) WITH tnapr-sform.
ENDIF.
PERFORM protocol_update_i.
ENDIF.
*Start of changes <Arun K Singarapu> C082493 <04/28/2008>
*for print preview
IF sy-ucomm = 'PREVOUTPUT' OR sy-ucomm = 'VIEW'.
CALL FUNCTION lf_fm_name "'/1BCDWB/SF00000197'
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_compop
user_settings = 'X'
is_ekko = l_doc-xekko
is_pekko = l_doc-xpekko
is_nast = l_nast
iv_from_mem = l_from_memory
iv_druvo = iv_druvo
iv_xfz = iv_xfz
IMPORTING
job_output_info = wa_return
TABLES
it_ekpo = l_doc-xekpo[]
it_ekpa = l_doc-xekpa[]
it_pekpo = l_doc-xpekpo[]
it_eket = l_doc-xeket[]
it_tkomv = l_doc-xtkomv[]
it_ekkn = l_doc-xekkn[]
it_ekek = l_doc-xekek[]
it_komk = l_xkomk[]
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.
EXIT.
ELSE.
wa_ctrlop-LANGU = nast-spras.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_compop-tdnoprev = 'X'.
CALL FUNCTION lf_fm_name "'/1BCDWB/SF00000197'
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_compop
user_settings = 'X'
is_ekko = l_doc-xekko
is_pekko = l_doc-xpekko
is_nast = l_nast
iv_from_mem = l_from_memory
iv_druvo = iv_druvo
iv_xfz = iv_xfz
IMPORTING
job_output_info = wa_return
TABLES
it_ekpo = l_doc-xekpo[]
it_ekpa = l_doc-xekpa[]
it_pekpo = l_doc-xpekpo[]
it_eket = l_doc-xeket[]
it_tkomv = l_doc-xtkomv[]
it_ekkn = l_doc-xekkn[]
it_ekek = l_doc-xekek[]
it_komk = l_xkomk[]
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.
*Convert the data from OTF to PDF format
it_otf[] = wa_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = l_len_in
bin_file = lp_xcontent
TABLES
otf = it_otf
lines = it_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 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.
TRY.
---------- create persistent send request ----------------------
send_request = cl_bcs=>create_persistent( ).
len = XSTRLEN( lp_xcontent ).
transform to solix tab
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = lp_xcontent ).
Create Body to the E-mail.
APPEND Text-005 TO l_text.
Attachment Name
l_ponumber = text-004.
CONCATENATE l_ponumber l_doc-xekko-ebeln INTO l_ponumber.
Subject for the E-Mail.
l_subject = text-001.
CONCATENATE l_subject l_doc-xekko-ebeln INTO l_subject.
*create document E-Mail.
CALL METHOD cl_document_bcs=>create_document
EXPORTING
i_type = 'RAW'
i_subject = l_subject
i_length = '13'
i_text = l_text
RECEIVING
result = l_email_object.
*Create PDF Document
bcs_doc = cl_document_bcs=>create_document(
i_type = 'PDF'
i_subject = l_ponumber
i_length = len
i_language = nast-spras
i_hex = lt_solix
*Type casting
obj_pdf_file ?= bcs_doc.
Add PDF document as an attachment
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_pdf_file.
get the attachments of the PO for each line item
SELECT ebeln
ebelp
FROM ekpo
INTO TABLE it_ekpo
WHERE ebeln = l_doc-xekko-ebeln.
concatenate PO and the Line Item Numebr to get the Object key
LOOP AT it_ekpo INTO wa_ekpo.
CONCATENATE wa_ekpo-ebeln wa_ekpo-ebelp INTO wa_temp-objky.
APPEND wa_temp TO it_temp.
CLEAR: wa_temp,wa_ekpo.
ENDLOOP.
*Get data from table DRAD
IF it_temp[] IS NOT INITIAL.
SELECT dokar
doknr
dokvr
doktl
objky
FROM drad
client specified
INTO TABLE it_drad
FOR ALL ENTRIES IN it_temp
WHERE mandt = sy-mandt
AND objky = it_temp-objky.
ENDIF.
IF NOT it_drad IS INITIAL.
SELECT * FROM dms_doc2loio
INTO TABLE it_dms_doc2loio
FOR ALL ENTRIES IN it_drad
WHERE dokar = 'SRM'
AND doknr = it_drad-doknr
AND dokvr = it_drad-dokvr
AND doktl = it_drad-doktl.
ENDIF.
Get the Physical object class and Object ID of the attachment
IF NOT it_dms_doc2loio IS INITIAL.
SELECT * FROM dms_ph_cd1
INTO TABLE it_dms_ph_cd1
FOR ALL ENTRIES IN it_dms_doc2loio
WHERE loio_id = it_dms_doc2loio-lo_objid.
ENDIF.
Get the file from the DMS server using the below function module.
LOOP AT it_dms_ph_cd1 INTO wa_dms_ph_cd1.
wa_object_id-class = wa_dms_ph_cd1-ph_class.
wa_object_id-objid = wa_dms_ph_cd1-phio_id.
CALL FUNCTION 'SDOK_PHIO_LOAD_CONTENT'
EXPORTING
object_id = wa_object_id
client = sy-mandt
TABLES
file_access_info = it_file_access_info
file_content_binary = it_sdokcntbin
EXCEPTIONS
not_existing = 1
not_authorized = 2
no_content = 3
bad_storage_type = 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.
READ TABLE it_file_access_info INTO wa_file_access_info INDEX 1.
IF wa_file_access_info-mimetype = 'application/msword'.
l_doc_type = 'DOC'.
CLEAR: a_xstring,len.
LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
CONCATENATE a_xstring wa_sdokcntbin-line
INTO a_xstring IN BYTE MODE.
ENDLOOP.
len = XSTRLEN( a_xstring ).
transform to solix tab - adding additional attachments
REFRESH lt_solix.
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = a_xstring ).
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_solix
*Type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for PDF document
ELSEIF wa_file_access_info-mimetype = 'application/pdf'.
l_doc_type = 'PDF'.
file_size = wa_file_access_info-file_size.
Convert the 1022 binary data to xstring
CLEAR a_xstring.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = file_size
IMPORTING
buffer = a_xstring
TABLES
binary_tab = it_sdokcntbin
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
DATA: w_output_length TYPE i.
Convert Xstring to 255 RAW
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = a_xstring
IMPORTING
output_length = w_output_length
TABLES
binary_tab = lt_content_bin.
len = w_output_length.
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_content_bin
type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for Excel Document
ELSEIF wa_file_access_info-mimetype = 'application/msexcel'.
l_doc_type = 'XLS'.
CLEAR: a_xstring,len.
LOOP AT it_sdokcntbin INTO wa_sdokcntbin.
CONCATENATE a_xstring wa_sdokcntbin-line
INTO a_xstring IN BYTE MODE.
ENDLOOP.
len = XSTRLEN( a_xstring ).
transform to solix tab - adding additional attachments
REFRESH lt_solix.
lt_solix =
cl_document_bcs=>xstring_to_solix(
ip_xstring = a_xstring ).
CLEAR l_filename.
Get the file name
l_filename = wa_file_access_info-file_name.
bcs_doc1 = cl_document_bcs=>create_document(
i_type = l_doc_type
i_subject = l_filename
i_length = len
i_language = sy-langu
i_hex = lt_solix
*Type casting
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
for text doxument
ELSEIF wa_file_access_info-mimetype = 'plain/text'.
l_doc_type = 'TXT'.
file_size = wa_file_access_info-file_size.
Get the file name
l_filename = wa_file_access_info-file_name.
CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
EXPORTING
input_length = file_size
TABLES
binary_tab = it_sdokcntbin
text_tab = file_data
EXCEPTIONS
failed = 1
OTHERS = 2.
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 METHOD cl_document_bcs=>create_document
EXPORTING
i_type = l_doc_type
i_subject = l_filename
i_text = file_data
RECEIVING
result = bcs_doc1.
obj_file ?= bcs_doc1.
Add Attachment as a document to the email object
CALL METHOD l_email_object->add_document_as_attachment
EXPORTING
im_document = obj_file.
ENDIF.
CLEAR:it_file_access_info,it_sdokcntbin.
CLEAR:wa_object_id,wa_file_access_info,file_size.
ENDLOOP.
CALL METHOD send_request->set_document( l_email_object ).
*Get the address number for the vendor
SELECT SINGLE adrnr
FROM lfa1
INTO l_adrnr
WHERE lifnr = l_doc-xekko-lifnr.
MOVE l_adrnr TO l_addrno.
Get the Email Address for the vendor using address number
CALL FUNCTION 'ADDR_GET_REMOTE'
EXPORTING
addrnumber = l_addrno
TABLES
adsmtp = it_adsmtp
EXCEPTIONS
parameter_error = 1
address_not_exist = 2
internal_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.
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flg_nouse = 'X'.
IF sy-subrc = 0.
LOOP AT it_adsmtp INTO wa_adsmtp WHERE flg_nouse = 'X'.
CALL METHOD cl_cam_address_bcs=>create_internet_address
EXPORTING
i_address_string = wa_adsmtp-smtp_addr
RECEIVING
result = recipient.
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
ENDLOOP.
ELSE.
READ TABLE it_adsmtp INTO wa_adsmtp WITH KEY flgdefault = 'X'.
IF sy-subrc = 0.
CALL METHOD cl_cam_address_bcs=>create_internet_address
EXPORTING
i_address_string = wa_adsmtp-smtp_addr
RECEIVING
result = recipient.
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
ENDIF.
ENDIF.
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = l_sent_to_all ).
CATCH cx_bcs INTO bcs_exception.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), bcs_exception->error_type.
EXIT.
ENDTRY.
ENDIF.
Maybe you are looking for
-
How can I change the apple id on my iPhone 4
Please help - I am going insane!!! I have an apple id on both my mac and icloud (and laptop), but a different one on my phone. The phone won't allow me to change to the new one, and the old one won't let me access app store/icloud either as I have
-
Apache URL rewriting not working while "AllowOverride All"
Hello, I have a small website hosted at my ISP. The sources are in Subversion and I wanted to use my personal Sites folder as a testbed. Edited /private/etc/apache2/users/ringods.conf to <Directory "/Users/ringods/Sites/"> Options FollowSymLinks Inde
-
I recently got a new computer and installed itunes from which had been saved onto an external drive - all music shows up in the library, however when I click on a song I receive this message "the song "abc" could not be used because the original file
-
How to determine line count in single multiline textbox
I have data that comes out of a sql db text field that already has line breaks and paragraph breaks. I would like to determine how many lines this will be (w/ line wrapping on) so that I can say if over 20 lines font = 12 pt. etc. How do you determ
-
SBS 2003 - Usage Server Report
Hello, We use the SBS 2003 server (+Exchange server 2003). We use Outlook Web Access. Unfortunately in the "usage report server" does not show the statistics about the activity of OWA. Could you advise How to solve this problem. Thank you in advance