on 06-20-2008 1:26 PM
Hi Friends
I am sending PO smartform thrw Righfax server for Fax , here i have successfully sent FAX ,but problem is in the rightfax server log there is Sending/created user inforamtion(USER INFORAMTION) missing . What i need to pass paramaters for this PO smartform.In COMPOSE_PARAMS---TDFAXUSER has the value and showing at SOST tcode .In the Rightfax log the uesr is missing . Any body have any clue in this .This is urgent please responsd if any body faced this type of issue.
Regards
RK
Hi Friend
The code what is written ok. but i need solution for my PO smartforms what are parameters should i pass to the my smartform function module or in the smartform.
Thanks
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check and test this program, you pass the spool # and fax and it works perfect for rightfax:
REPORT Z_SENDFAX line-size 46 no standard page heading message-id so.
data g_list_content type solix_tab.
data g_text_content type soli_tab.
parameters:spool like sy-spono.
parameters:rec_fax type sadrfd-rec_fax.
parameters:title like sadrfd-rec_title.
parameters:name1 like sadrfd-rec_name1.
parameters:cover type c.
PARAMETERS: Zvbeln LIKE likp-vbeln.
start-of-selection.
perform create_text_content changing g_text_content.
perform create_list_content changing g_list_content.
perform send using g_text_content
g_list_content.
&----
*& Form create_list_content
&----
*
----
form create_list_content changing list_content type solix_tab.
perform get_list_from_spool changing list_content.
endform."create_list_content''
&----
*& Form create_text_content''
&----
*''
----
form create_text_content changing text_content type soli_tab.
data:z_lin(200) type c.
append 'To,' to text_content.
concatenate 'To:' name1 into z_lin separated by space.
append z_lin to text_content.
concatenate 'End of delivery Notice for ' Zvbeln
into z_lin separated by space.
append z_lin to text_content.
convert the content from RAW to TXT''
CALL FUNCTION 'SO_RAW_TO_RTF'
TABLES
objcont_old = text_content
objcont_new = text_content
EXCEPTIONS
others = 0.
endform."create_text_content''
&----
*& Form SEND''
&----
Create the list-document and send it via FAX,and RML''
----
form send using text_content type soli_tab
list_content type solix_tab.
data:z_lin(200) type c.
structures and internal tables for the send data''
data document_data type sodocchgi1.
data packing_list type table of sopcklsti1.
data receivers type table of somlreci1.
data contents_txt type soli_tab.
data contents_hex type solix_tab.
data packlist_wa type sopcklsti1.
data receiver_wa type somlreci1.
data packlist_counter type i.
data sent_to_all type sonv-flag.
data msg_ex(200) type c.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
main document''
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
document data contains information for the whole message''
document_data-obj_descr = 'Miscellaneous Delivery Notice'.
some text for the main document''
append 'Hi,' name1 to contents_txt.
concatenate 'To:' name1 into z_lin separated by space.
append z_lin to contents_txt.
concatenate 'Attached you will find the Delivery Notice for ' Zvbeln
into msg_ex separated by space.
append msg_ex to contents_txt.
append 'Attached you will find the Delivery Notice for ' Zvbeln to contents_txt.
packlist_counter = 1.
perform create_packlist_entry using contents_txt
'RAW'
changing packlist_wa
packlist_counter.
append packlist_wa to packing_list.
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
add a text attachment of type TXT''
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
perform create_packlist_entry using text_content
'TXT'
changing packlist_wa
packlist_counter.
append packlist_wa to packing_list.
append lines of text_content to contents_txt.
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
add the list attachment of type ALI''
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
packlist_counter = 1."because we will fill the hex table now''
perform create_packlist_entry using list_content
'ALI'
changing packlist_wa
packlist_counter.
append packlist_wa to packing_list.
append lines of list_content to contents_hex.
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
fill recipients tables''
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
perform create_fax_recipient changing receiver_wa.
append receiver_wa to receivers.
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
Send the document by calling the API1''
as of 6.10 either the flag 'commit_work' has to be set''
or a commit work statement has to be set somewhere after the call''
Sending won't work without this!''
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = sent_to_all
TABLES
packing_list = packing_list
contents_txt = contents_txt
contents_hex = contents_hex
receivers = receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
case sy-subrc.
when 0.
if sent_to_all is initial.
read table receivers index 1 into receiver_wa.
message i865 with receiver_wa-retrn_code.
else.
message s022.
endif.
when 1.
message i552.
when 2.
message i023 with document_data-obj_descr.
when 4.
message i471.
when others.
message i619.
endcase.
endform." SEND''
&----
*& Form USE_SUBMIT''
&----
<nowiki>* Use "submit <report> exporting list to memory"
----
form use_submit changing contents_hex type solix_tab.
data listobject type table of abaplist.
get the list object by calling the list in another report
F1 on submit gives more information
submit balvsd03 exporting list to memory and return.
import the list from memory and store it in table listobject
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
not_found = 1
others = 2.
if sy-subrc <> 0.
message e105 with 'LIST_FROM_MEMORY'.
endif.
free memory
CALL FUNCTION 'LIST_FREE_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
others = 1.
if sy-subrc <> 0.
message e105 with 'LIST_FREE_MEMORY'.
endif.
it's always necessary to compress the table.
SAPconnect will decompress it
CALL FUNCTION 'TABLE_COMPRESS'
TABLES
in = listobject
out = contents_hex
EXCEPTIONS
compress_error = 1
others = 2.
if sy-subrc <> 0.
message e105 with 'TABLE_COMPRESS'.
endif.
endform." USE_SUBMIT
&----
*& Form WRITE_A_LIST
&----
Create a new list within this report.
----
form write_a_list changing contents_hex type solix_tab.
data listobject type table of abaplist.
perform write_list.
Save the list and store table listobject
CALL FUNCTION 'SAVE_LIST'
EXPORTING
list_index = sy-lsind
TABLES
listobject = listobject
EXCEPTIONS
list_index_invalid = 1.
if sy-subrc = 1.
message e105 with 'SAVE_LIST'.
endif.
It's always necessary to compress the table
SAPconnect will decompress it
CALL FUNCTION 'TABLE_COMPRESS'
TABLES
in = listobject
out = contents_hex
EXCEPTIONS
compress_error = 1
others = 2.
if sy-subrc <> 0.
message e105 with 'TABLE_COMPRESS'.
endif.
endform." WRITE_A_LIST
&----
*& Form GET_LIST_FROM_SPOOL
&----
Get list from spool
----
form get_list_from_spool changing contents_hex type solix_tab.
data spool_number type rspoid.
data contents_bin type soli_tab.
data print_parameters type pri_params.
data valid type c.
write a list into spool
CALL FUNCTION 'GET_PRINT_PARAMETERS'
IMPORTING
out_parameters = print_parameters
valid = valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
if sy-subrc <> 0.
message e105 with 'GET_PRINT_PARAMETERS'.
elseif valid is initial.
return.
endif.
new-page print on parameters print_parameters no dialog.
perform write_list.
new-page print off.
spool_number = spool.
DATA:REAL_TYPE LIKE SOODK-OBJTP.
DATA:BUFFER_PDF LIKE TLINE OCCURS 0 WITH HEADER LINE.
you can also send OTF documents from spool with this function
module. The importing parameter real_type gives you the doc type
that you have to give to the send interface. The parameter is not
used here
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = spool_number
desired_type = 'RAW'
IMPORTING
REAL_TYPE = REAL_TYPE
TABLES
buffer = contents_bin
BUFFER_PDF = BUFFER_PDF
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
others = 8.
*clear contents_bin[].
if sy-subrc <> 0.
message e105 with 'RSPO_RETURN_SPOOLJOB'.
endif.
CALL FUNCTION 'SO_RAW_TO_RTF'
TABLES
objcont_old = contents_bin
objcont_new = contents_bin
EXCEPTIONS
others = 0.
data:TRANSFER_BIN TYPE SX_BOOLEAN." occurs 0.
data:CONTENT_BIN TYPE SOLIX_TAB." occurs 0.
data:OBJHEAD TYPE SOLI_TAB.
data:LEN TYPE SO_OBJ_LEN.
*len = '255'.
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PRT'
EXPORTING
FORMAT_SRC = 'OTF'
FORMAT_DST = 'PRT'
devtype = 'POSTSCPT'
CHANGING
TRANSFER_BIN = TRANSFER_BIN
CONTENT_TXT = contents_bin
CONTENT_BIN = contents_hex
OBJHEAD = OBJHEAD
LEN = len.
*
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
FORMAT_SRC = 'OTF'
FORMAT_DST = 'PDF'
devtype = 'PRINTER'
CHANGING
TRANSFER_BIN = TRANSFER_BIN
CONTENT_TXT = contents_bin
CONTENT_BIN = contents_hex
OBJHEAD = OBJHEAD
LEN = len.
convert to hex table
CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'
EXPORTING
ip_solitab = CONTENT_BIN
IMPORTING
ep_solixtab = contents_hex.
*
endform." GET_LIST_FROM_SPOOL
&----
*& Form WRITE_LIST
&----
Write a list of SAPconnect conversion rules
----
form write_list.
data lt_scarr type table of scarr.
data carr type scarr.
select * from scarr into table lt_scarr.
format color = 1.
uline at /1(46).
write: / sy-vline,
'CARRID', 10 sy-vline,
'CARRNAME', 35 sy-vline,
'CURRCODE', 46 sy-vline.
format color = 2.
uline at /1(46).
loop at lt_scarr into carr.
write: / sy-vline,
carr-carrid, 10 sy-vline,
carr-carrname, 35 sy-vline,
carr-currcode, 46 sy-vline.
endloop.
uline at /1(46).
new-line.
endform." WRITE_LIST
&----
*& Form create_packlist_entry
&----
text
----
form create_packlist_entry using contents type standard table
format type so_obj_tp
changing packlist_wa type sopcklsti1
packlist_counter type i.
data tab_lines type i.
clear packlist_wa.
DATA FORM2 TYPE so_obj_tp.
get the table length of the attachment
describe table contents lines tab_lines.
set binary flag for binary content to mark that this packlist entry
is meant for table contents_hex and not for contents_bin
FORM2 = FORMAT.
if format = 'ALI'.
FORM2 = 'PRT'.
FORM2 = 'PDF'.
packlist_wa-transf_bin = 'X'.
endif.
attchment's description and format
concatenate form2 'Document' into
packlist_wa-obj_descr separated by space.
packlist_wa-doc_type = form2.
describe start and length in contents_txt or contents_hex
which table is meant is decided by the transf_bin flag set above
packlist_wa-body_start = packlist_counter.
packlist_wa-body_num = tab_lines.
increase counter to have the starting line for the next attachment
packlist_counter = packlist_counter + tab_lines.
endform." create_packlist_entry
&----
*& Form create_int_recipient
&----
text
----
*form create_int_recipient changing receiver type somlreci1.
*
field-symbols <receiver> type c.
data recipient_int type sadrud.
*
clear receiver.
*
fill address type specific recipient structure
recipient_int-address = ''.
*
cast structure to generic receiver field
assign recipient_int to <receiver> casting.
receiver-receiver = <receiver>.
set address type for INT
receiver-rec_type = 'U'.
*
*endform."create_int_recipient
&----
*& Form create_fax_recipient
&----
text
----
form create_fax_recipient changing receiver type somlreci1.
field-symbols <receiver> type c.
data recipient_fax type sadrfd.
data name type soud3.
clear receiver.
name-sapnam = sy-uname.
CALL FUNCTION 'SO_NAME_CONVERT'
EXPORTING
name_in = name
IMPORTING
name_out = name
EXCEPTIONS
others = 1.
if sy-subrc <> 0.
name-adrname = sy-uname.
endif.
fill address type specific recipient structure
recipient_fax-rec_fax = rec_fax.
recipient_fax-rec_state = 'US'.
recipient_fax-rec_title = title.
recipient_fax-rec_name1 = name1.
recipient_fax-send_nam = name-adrname.
recipient_fax-send_cover = cover.
recipient_fax-FORM_LANGU = sy-langu.
cast structure to generic receiver field
assign recipient_fax to <receiver> casting.
receiver-receiver = <receiver>.
set address type for FAX
receiver-rec_type = 'F'.
endform."create_fax_recipient
&----
*& Form create_rml_recipient
&----
text
----
form create_rml_recipient changing receiver type somlreci1.
field-symbols <receiver> type c.
data recipient_rml type sadr7d.
clear receiver.
fill address type specific recipient structure
recipient_rml-sdest = 'C11'.
recipient_rml-umand = '001'.
recipient_rml-uname = 'MYUSER'.
cast structure to generic receiver field
assign recipient_rml to <receiver> casting.
receiver-receiver = <receiver>.
set address type for RML
receiver-rec_type = 'R'.
endform."create_rml_recipient
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.