Send Link of Display Purchase order in notification mail(Urgent)
Hi Friends,
When ever a PO is Approved, a notification mail is supposed to be send & in that mail ...the link of Display PO is to be added..
Please help out in detail .....
Thanks,
Kartikey Rawat.
Hi,
If you are using Send Mail step associated with SELFITEM.SENDTASKDESCRIPTION to send mail from your workflow, to send attachments you need to do the following bindings to your send mail step.
<your attachment object> -> &_Attach_Objects&
<your attachment object> -> &Attachments&
However, before this you should have your attachment as SOFM Object instance.
Similar Messages
-
How can I send purchase order through SAP mail ?
How can I send purchase order through SAP mail ? Can any one explain whts the NACE settings?
just do it as <b>Anji reddy</b> said to you ...or else ... in the purchase order trascation ...print it ... so that it will generate the spool request for that purchase order ....
so the the belwo program is for sending <b>the Spool Request data as Email to any Email id ...</b>
The code below demonstrates how to retrieve a spool request and email it as a PDF document. Please note for the below program to process a spool request the program must be executed in background otherwise no spool request will be created. Once you have had a look at this there is an modified version of the program which works in both background and foreground. Also see transaction SCOT for SAPConnect administration.
*& Report ZSPOOLTOPDF *
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on *
*& screen *
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
* Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
* Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
* Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
* Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
* Write statement to represent report output. Spool request is created
* if write statement is executed in background. This could also be an
* ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
*** Alternative way could be to submit another program and store spool
*** id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
* to sap-spool
* spool parameters %_print
* archive parameters %_print
* without spool dynpro
* and return.
* Get spool id from program called above
* IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
* FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
* FORM get_job_details *
FORM get_job_details.
* Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
* FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
* Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
* FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
* perform send_email using p_email2.
ENDFORM.
* FORM send_email *
* --> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
* Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
* CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
* If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
* Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
* FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
* Send email
FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
* Fill the document data.
w_doc_data-doc_size = 1.
* Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
* Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
* Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
* Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
* Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_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.
* Populate zerror return code
ld_error = sy-subrc.
* Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
Girish -
Displaying Purchase order in report
Hi Expert
I am modifing a report for Mangement , They want to display purchase order in the report .....So I did the following modification but when I run the report all the fields are displaying and purchase order is showing empty, though I have added the po in the table and if you see my coding for adding po
data: vbkd-bstkd.
clear po_number.
select single bstkd into po_number
from vbkd
where vbeln = s903-vgbel.
call function 'RSAQRT_TEXTFIELD_CONTEXT'
exporting name = 'S903'
struc = S903.
call function 'RSAQRT_TEXTFIELD_CALL'
exporting struc = S903
name = 'S903'
fname = 'MATNR'
importing text = TEXT_S903_MATNR.
Can anyone help me please ....................it is very urgent
include /1BCDWB/IQ000000000226DAT
*{ INSERT 2
constants:
begin of %iqid,"type aqliqid
workspace type aql_wsid value ' ',
usergroup type aql_ugroup value 'SALES',
query type aql_query value 'BILL_DEL',
lid type aql_lid value 'G00',
struct type aql_tname value '/1BCDWB/IQ000000000226',
infoset type aql_iset value 'S903',
end of %iqid.
data %runmode type aqlimode.
data %seloptions type table of rsparams with header line.
field-symbols <%selopt> type rsparams_tt.
data TEXT_S903_FKART like TVFKT-VTEXT.
data TEXT_S903_FKSTO like DD07D-DDTEXT.
data TEXT_S903_GEWEI like T006A-MSEHL.
data TEXT_S903_KDKG1 like TVKGGT-VTEXT.
data TEXT_S903_KDKG2 like TVKGGT-VTEXT.
data TEXT_S903_KDKG3 like TVKGGT-VTEXT.
data TEXT_S903_MATNR like MAKT-MAKTX.
data TEXT_S903_MATNR_01 like MAKT-MAKTX.
data TEXT_S903_PERIV like T009T-LTEXT.
data TEXT_S903_PKUNAG like KNA1-NAME1.
data TEXT_S903_PKUNAG_07 like KNA1-NAME1.
data TEXT_S903_PKUNWE_01 like KNA1-NAME1.
data TEXT_S903_PMATN like MAKT-MAKTX.
data TEXT_S903_SPART like TSPAT-VTEXT.
data TEXT_S903_VKBUR like TVKBT-BEZEI.
data TEXT_S903_VKBUR_05 like TVKBT-BEZEI.
data TEXT_S903_VKORG like TVKOT-VTEXT.
data TEXT_S903_VKORG_03 like TVKOT-VTEXT.
data TEXT_S903_VOLEH like T006A-MSEHL.
data TEXT_S903_VRKME like T006A-MSEHL.
data TEXT_S903_VSTEL like TVSTT-VTEXT.
data TEXT_S903_VTWEG like TVTWT-VTEXT.
data TEXT_S903_VTWEG_04 like TVTWT-VTEXT.
data TEXT_S903_WAERK like TCURT-LTEXT.
data TEXT_S903_WERKS like T001W-NAME1.
data TEXT_S903_WERKS_01 like T001W-NAME1.
data TEXT_S903_ZZ_MGN like DD07D-DDTEXT.
data SP_ADD like VBPA-ADRNR.
data CUST_NAME like KNA1-NAME1.
data SHADD like VBPA-ADRNR.
data SHNAME like KNA1-NAME1.
data ADDRS like ADRC-STREET.
data MANDCK like LIKP-BOLNR.
data CMDDOC like LIKP-XABLN.
data EXT_DEL like LIKP-LIFEX.
*****ADD BY PIROZ
data PO_NUMBER like VBKD-BSTKD.
*data TEXT_S903_MATNR like MAKT-MAKTX.
TOTAL
data %Z_0001 like S903-NETWR.
CON_MARG
data %Z_0004 like %Z_0001.
CON_MRG_PC
data %Z_0005 like %Z_0001.
tables S903.
Function----
FUNCTION /1BCDWB/IQ000000000226EXTR.
""Local interface:
*" TABLES
*" %SELOPT STRUCTURE RSPARAMS
*" %DTAB STRUCTURE /1BCDWB/IQ000000000226
*" CHANGING
*" VALUE(%RTMODE) TYPE AQLIMODE
*" EXCEPTIONS
*" NO_DATA
*" NO_AUTHORIZATION
*" ILLEGAL_PACKAGE
*" CURSOR_NOT_OPEN
call function 'RSAQRT_SET_IDENTIFICATION'
exporting iqid = %iqid
sscr_report = sy-repid
changing rtmode = %rtmode.
if %rtmode-pack_on = space or %rtmode-first_call = 'X'.
call function 'RSAQRT_FILL_SELECTIONS'
tables selopt = %selopt
changing rtmode = %rtmode.
endif.
call function 'RSAQRT_INIT_TEXTHANDLING'
exporting class = 'CL_TEXT_IDENTIFIER'
wsid = ' '
infoset = 'S903'.
if %rtmode-no_authchk = space
and ( %rtmode-pack_on = space or %rtmode-first_call = 'X' ).
refresh %auth_tabs.
append 'S903' to %auth_tabs.
call function 'RSAQRT_AUTHORITY_CHECK'
exporting
auth_tabs = %auth_tabs
changing
rtmode = %rtmode
exceptions
NO_AUTHORIZATION = 1.
if sy-subrc = 1.
raise no_authorization.
endif.
endif.
data: %l_no_further_fetch type flag, " stop fetching
%l_hits_cnt type i. " cnt for %dbtab entries
if %rtmode-pack_abort = 'X'.
if not %dbcursor is initial.
close cursor %dbcursor.
endif.
exit.
endif.
if %rtmode-pack_on = space or %rtmode-first_call = 'X'.
if not %dbcursor is initial.
close cursor %dbcursor.
endif.
open cursor with hold %dbcursor for
select FKDAT VBELN FKART VKORG PKUNAG PKUNWE_01 MATNR VKBUR FKIMG VRKME FKSTO WERKS NETWR WAERK MWSBP VGBEL VGPOS ERNAM POSNR
VSTEL AUBEL KZWI1 KZWI2 ZZ_CART ZZ_MINCAR ZZ_WKND ZZ_FUEL UMSMNG KZWI4 KZWI3 ZZ_MGN WAVWR SPTAG
from S903
where SPTAG in SP$00001
and ERNAM in SP$00012
and WERKS in SP$00008
and MATNR in SP$00006
and PKUNAG in SP$00004
and VKORG in SP$00005
and FKART in SP$00007
and VBELN in SP$00002
and FKDAT in SP$00003.
endif.
if %dbcursor is initial.
raise cursor_not_open.
endif.
while %l_no_further_fetch = space.
fetch next cursor %dbcursor
into corresponding fields of S903.
if ( ( %rtmode-acc_check = 'X' and
sy-dbcnt > %rtmode-acc_number )
or sy-subrc <> 0 ).
%l_no_further_fetch = 'X'.
else.
call function 'RSAQRT_TEXTFIELD_REFRESH'.
additional coding:
data: vbpa-kunnr,
vbpa-parvw,
vbpa-adrnr.
clear sP_add.
select single adrnr into SP_ADD
from vbpa
where vbeln = s903-vbeln and
kunnr = s903-pkunag and
parvw = 'AG'.
additional coding:
select single name1 into cust_name
from adrc
where addrnumber = sp_add.
additional coding:
data: adrc-name1,
adrc-addrnumber.
clear shadd.
select single adrnr into SHADD
from vbpa
where vbeln = s903-vbeln and
kunnr = s903-pkunwe_01 and
parvw = 'WE'.
additional coding:
clear shname.
select single name1 into shname
from adrc
where addrnumber = shadd.
additional coding:
*{ REPLACE 1
\ data: adrc-street.
\ select single street into addrs
\ from adrc
\ where addrnumber = shadd.
data: adrc-street.
select single street into addrs
from adrc
where addrnumber = shadd.
*} REPLACE
additional coding:
data: likp-bolnr.
clear mandck.
if s903-vgbel ne space.
select single bolnr into mandck
from likp
where vbeln = s903-vgbel.
endif.
check SP$00009.
additional coding:
data: likp-xabln.
clear cmddoc.
select single xabln into cmddoc
from likp
where vbeln = s903-vgbel.
check SP$00010.
additional coding:
data: likp-lifex.
clear ext_del.
select single lifex into ext_del
from likp
where vbeln = s903-vgbel.
check SP$00011.
additional coding:
data: vbkd-bstkd.
clear po_number.
select single bstkd into po_number
from vbkd
where vbeln = s903-vgbel.
call function 'RSAQRT_TEXTFIELD_CONTEXT'
exporting name = 'S903'
struc = S903.
call function 'RSAQRT_TEXTFIELD_CALL'
exporting struc = S903
name = 'S903'
fname = 'MATNR'
importing text = TEXT_S903_MATNR.
additional coding:
%Z_0001 = S903-NETWR + S903-MWSBP .
%dtab-FKDAT = S903-FKDAT .
%dtab-VBELN = S903-VBELN .
%dtab-FKART = S903-FKART .
%dtab-VKORG = S903-VKORG .
%dtab-PKUNAG = S903-PKUNAG .
%dtab-CUST_NAME = CUST_NAME .
%dtab-PKUNWE_01 = S903-PKUNWE_01 .
%dtab-SHNAME = SHNAME .
%dtab-ADDRS = ADDRS .
%dtab-MATNR = S903-MATNR .
%dtab-TEXT_S903_MATNR = TEXT_S903_MATNR .
%dtab-VKBUR = S903-VKBUR .
%dtab-FKIMG = S903-FKIMG .
%dtab-VRKME = S903-VRKME .
%dtab-FKSTO = S903-FKSTO .
%dtab-WERKS = S903-WERKS .
%dtab-NETWR = S903-NETWR .
%dtab-WAERK = S903-WAERK .
%dtab-MWSBP = S903-MWSBP .
%dtab-WAERK001 = S903-WAERK .
%dtab-VGBEL = S903-VGBEL .
%dtab-VGPOS = S903-VGPOS .
%dtab-MANDCK = MANDCK .
%dtab-CMDDOC = CMDDOC .
%dtab-EXT_DEL = EXT_DEL .
%dtab-ERNAM = S903-ERNAM .
%dtab-%Z_0001 = %Z_0001 .
%dtab-WAERK002 = S903-WAERK .
%dtab-POSNR = S903-POSNR .
%dtab-VSTEL = S903-VSTEL .
%dtab-AUBEL = S903-AUBEL .
%dtab-KZWI1 = S903-KZWI1 .
%dtab-WAERK003 = S903-WAERK .
%dtab-KZWI2 = S903-KZWI2 .
%dtab-WAERK004 = S903-WAERK .
%dtab-ZZ_CART = S903-ZZ_CART .
%dtab-WAERK005 = S903-WAERK .
%dtab-ZZ_MINCAR = S903-ZZ_MINCAR .
%dtab-WAERK006 = S903-WAERK .
%dtab-ZZ_WKND = S903-ZZ_WKND .
%dtab-WAERK007 = S903-WAERK .
%dtab-ZZ_FUEL = S903-ZZ_FUEL .
%dtab-WAERK008 = S903-WAERK .
%dtab-UMSMNG = S903-UMSMNG .
%dtab-VRKME001 = S903-VRKME .
%dtab-KZWI4 = S903-KZWI4 .
%dtab-WAERK009 = S903-WAERK .
%dtab-KZWI3 = S903-KZWI3 .
%dtab-WAERK010 = S903-WAERK .
%dtab-ZZ_MGN = S903-ZZ_MGN .
%dtab-WAVWR = S903-WAVWR .
%dtab-WAERK011 = S903-WAERK .
%dtab-PO_NUMBER = PO_NUMBER .
append %dtab.
%l_hits_cnt = %l_hits_cnt + 1.
if %rtmode-pack_on = 'X'
and %l_hits_cnt >= %rtmode-pack_size.
%l_no_further_fetch = 'X'.
endif.
endif.
endwhile.
if %l_hits_cnt = 0.
if not %dbcursor is initial.
close cursor %dbcursor.
endif.
raise no_data.
endif.
if %rtmode-pack_on <> 'X'.
close cursor %dbcursor.
endif.
read table %dtab index 1 transporting no fields.
if sy-subrc ne 0.
raise no_data.
endif.
endfunction.I had Done Like this All comments are as they are i.e. this code gives error (for endselect there is no select) so i commented the endselect statement.
read below code and plz do some improvement in it.
SELECT ekkoebeln ekkobedat ekpo~werks into CORRESPONDING FIELDS OF TABLE it_so FROM EKKO
INNER JOIN EKPO ON EKKOEBELN = EKPOEBELN
WHERE ekko~EBELN IN S_EBELN
AND BEDAT IN S_BEDAT
AND WERKS IN S_WERKS.
"SELECT hEBELN hMATNR hWERKS e FROM EKPO INTO CORRESPONDING FIELDS OF TABLE it_so
" WHERE EBELN IN S_EBELN
" AND WERKS IN S_WERKS.
MOVE EKKO-EBELN TO TNAME.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'F02'
LANGUAGE = 'E'
NAME = TNAME
OBJECT = 'EKKO'
ARCHIVE_HANDLE = 0
"IMPORTING
" HEADER = HTEXT
TABLES
LINES = LTEXT
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
LOOP AT LTEXT.
IF LTEXT-TDLINE NE ''.
MOVE LTEXT-TDLINE TO IT_SO-TDLINE. " Header Note Selected.
MOVE EKKO-EBELN TO IT_SO-EBELN.
APPEND IT_SO.
endif.
ENDLOOP.
clear it_so.
"ENDSELECT. -
hello all,
i have an ALV report requirement like this,
on the initial screen i have displayed(for a given agreement number like in ME33K )
in the selection screen i have taken agreement number as EKPO-EBELN.
purchase document number item number short text target quantity net price
5400000019 1 xxx 1.000 304300.00
2 xxxx 1.000 500000.00
the above fields i have taken from EKPO table.....
and on double clicking the item number i have displayed
line number service number short text quantity units gross price quantity released
1 swr10 xxxx 2.00 kg 500 2
2 swr11 xxxx 5.00 EA 500 2
the above fields i have taken from ESLL (esll-extrow, esll-srvpos, esll-ktext1 , esll-menge etc......)
this i have done by passing EBELN to ESLH and getting PACKNO and passed this PACKNO to ESLL.
now my question is i need to display Purchase order, PO Item , Order Number ,entry sheet quantity ,entry sheet price ,invoice quantity, invoice price
against each line number above.....
from which table do i need to take these fields.....
please guide me....
thankq....Thanks Andra,
The problem is the multiple invoices is for non goods receipt item so there will be no delivery.At the time of creating a PO the GR is not checked so there will be no delivery .
Also this setting is for invoices which are comming from Vendors.But if we are genrating the invoices manually it is not blocking those invoices.Also i there is nowhere mentioned in Incomming invoice to set tolerence for incomming invoice.Are you talking about Vendor tolerences?
Thanks in advance
Edited by: Metroid01 on May 14, 2009 6:52 PM -
Display Purchase Order in SRM 7.0 -workflow error
Hi SRM Gurus,
Hi Masa ,
Please check this thread,
I am having the same error
We are upgrading from SRM 3.0 to SRM 7.0.
while displaying purchase order
Cannot get process info; function BBP_PDH_WFL_APPROVAL_SIMULATE throws exception Workflow Not Found
PDO Layer error
PDO Layer error
No approval Workflow Found. Inform System Administrator.
I have configured the Workflow as Application controlled workflow only.(client wants to use the same workflow used in SRM 3.0). I got message Business object BUS 2203 modified
How to resolve this
Please give your inputs
Regards
G.Ganesh KumarHi Ganesh,
I also encounter this error for purchase orders. How did you check the errors you encounter in business object BUS2201?
Please refer to below thread.
[SRM 7.0 Error in Display of Approval in Purchase Orders|SRM 7.0 Error in Display of Approval in Purchase Orders]
Would really appreciate your help.
Thank you. -
How to Display 'purchase order text' in MM03 using report program
Hi Friends,
Can anybody suggest me how to display 'purchase order text' in MM03 using report program.
'Purchase order text' tab displays purchase long text of particular material .
I coded as:
SET PARAMETER ID 'MXX' FIELD 'E'.
SET PARAMETER ID 'MAT' FIELD k_final-matnr.
SET PARAMETER ID 'WRK' FIELD k_final-werks.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
It displays Purchasing tab other than Purchase Order Text tab of MM03.
Please suggest me how can i solve this.
Is there any parameter id to set values for Purchase Order text tab>
Madhu Mano Chitra wrote:
> I want how to navigate to MM03 'Purchase Order text' tab/ view using ABAP code.
> could any suggest me
You can call a transaction and pass it a BDC table that tells it where you want it to go. You have to work out for yourself what to put into the BDC table. The code below works for tcode CATSSHOW.
DATA: bdcdata_wa TYPE bdcdata,
bdcdata_tab TYPE TABLE OF bdcdata.
DATA opt TYPE ctu_params.
CLEAR bdcdata_wa.
bdcdata_wa-program = 'CATSSHOW'.
bdcdata_wa-dynpro = '1000'.
bdcdata_wa-dynbegin = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'SO_STATU-LOW'.
bdcdata_wa-fval = '20'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'ANDZEIT'.
bdcdata_wa-fval = SPACE.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'PAST'.
bdcdata_wa-fval = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.
IF p_selscr = SPACE.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_OKCODE'.
bdcdata_wa-fval = '=ONLI'.
APPEND bdcdata_wa TO bdcdata_tab.
ENDIF.
opt-dismode = 'E'.
opt-defsize = 'X'.
CALL TRANSACTION 'CAPP' USING bdcdata_tab OPTIONS FROM opt. -
Display Purchase Order Approval after Goods Receipt
Hi,
I would like to know if there is a way to view/display purchase order even though it was already received (Goods Receipt)? I would like to know who are the approvals of that particular purchase order, the units/quantities and the amount.
Thank you.Hi Reno,
But if the PO was already received in full it will not be anymore available in the Approval Status Report.
Is the Approval Decision report available to Logistic personnel?
Regards,
Hi Demarillas,
If the document is approved and u want to check the details of who approved the PO and when, you can make use of the Approval Decision Report, located in Administration --> Approval Procedure --> Approval Decision Report . Also there is another report to check with the status of the documents sent for approval which is Approval Status Report .
Hope this helps.
Regards
Reno -
How to link asset with purchase order and PO Item.
Hello,
I have to generate a report which contains columns
Asset No , po no(ebeln) ,PO Item(ebelp),Material no etc
My query is how to link asset with purchase order and PO Item.
I am selecting asset and po no. from anla but how to get
po item no(ebelp)?
po line item is important in this report because every line item has differrent asset and material no.
i tried to match asset no in mseg table but i am not getting asset no in mseg .
how should i proceed ?Thanks Thomas & Srimanta for the quick response.
When I checked EKKN table by entering PO there is no asset no. in anln1 field.
Also I would like to add that, In me23n for a PO, account assignment category we are entering 'F' for internal order settlement.
Where can i find the link between asset and po no(ebeln) and po item(ebelp)?
Regards,
Rachel
Edited by: Rachel on Aug 11, 2008 7:23 AM -
How to send purchase order via e-mail.
Please could someone let me know how to send purchase order via e-mail.
I am an BC.
e-mailing is functionning however I am not very familiar in settings for MMNo, you do not need to touch ME_PRINT_PO. You need to put code before and after ME_PRINT_PO in the print program.
Step 1 - Copy the standard print program SAPFM06P to make a Z version, lets call it ZSAPFM06P
Step 2 - Copy include FM06PE02 to make a Z version, lets call that ZFM06PE02.
Step 3 - ZSAPFM06P change the statement "Include FM06PE02" to read "Include ZFM06PE02".
Step 4 - In include ZFM06PE02 you will find a subroutine called "ENTRY_NEU". In this subroutine you will see it first calls ME_READ_PO_FOR_PRINTING then calls ME_PRINT_PO. Before it calls ME_PRINT_PO just put:
l_nast-nacha = 1.
CLEAR l_nast-dimme.
This means that ME_PRINT_PO will not e-mail, it will create a spool request.
Step 5 - Still in ZFM06PE02, after ME_PRINT_PO has been called, add new code. First check that ent_retco EQ 0. If it does not then exit.
Step 6 - Get the spool ID created by ME_PRINT_PO by either moving sy-msgv1 to a variable or select from NAST.
Step 7 - Call function CONVERT_OTFSPOOLJOB_2_PDF using the spool ID from step 6, and put the result from table PDF into an internal table you can use later. ALso store the export variable pdf_bytecount, you will need it later.
Step 8 - Call function SX_TABLE_LINE_WIDTH_CHANGE using the table from step 7 as content_in and put the results from content_out into a new internal table.
Step 9 - Add some text into a internal table of type solisti1, this will be the body text of the e-mail.
Step 10 - Add whatever receivers you want into an internal table of type somlreci1. If you just want it to go to the address that the PO would have gone to anyway, select the e-mail address from ADR6 where the address number = l_doc-xekko-adrnr, that is the data from the PO.
Step 11 - Populate an internal table of type sopcklsti1 with data relevant to your PDF table from step 8 and the text table from step 9. You will have to put the size of the PDF from step 7 (pdf_bytecount) on the PDF line and the size of the text will be the number of lines of text * 255.
Step 12 - Add info to a structure of type sodocchgi1. You can add the e-mail title in here, field obj_descr. Also add the size of the PDF and the size of the text from step 12 into doc_size, and give the doc a name in field obj_name. This can be anything, ZPDFPO for example.
Step 13 - Call SO_DOCUMENT_SEND_API1 using the tables from steps 8, 9, 10 and 11 and the structure from step 12. You can amend the sending e-mail also. Set commit_work to space.
Step 14 - That is all you need, but I actually call function RSPO_R_RDELETE_SPOOLREQ to delete the spool request created in step 4, then call NAST_PROTOCOL_UPDATE to add some more messages to the processing log of the PO.
That is all. -
Purchase Order Approval Notifications and Multiple Currencies
All,
If I have a user who creates a requisition in EUR and then submits the requisition for approval to someone who has a default currency of USD, the workflow notification will show the value of the requisition in both EUR and USD. This is because the ICX: Preferred Currency profile option has been set at the user level.
However, this does not work for purchase order approval notifications, just requisitions. This makes my management unhappy. Oracle Support indicates this is an enhancement request. However, I have a difficult time believing there is not something in the Oracle apps that allows this functionality in the PO Notification. We are on 11.5.10.2.
Many thanks,
JeremyIs this what you are looking for?
http://help.sap.com/saphelp_47x200/helpdata/en/75/ee14a355c811d189900000e8322d00/frameset.htm -
Show OrderType along with name in Display purchase order
Hi All,
When we display purchase order via transaction ME23N, first field on the top left hand corner shows description "Purchase order", "Production order" etc..... Here I would like to see order type (ZB,ZR,ZV etc) along with description.
There is some way to do that settings. Could someone please let me know step by step process how to set that??
Thanks.............Hi
In me21n screen in the tool bar the icon called customised local layout.
In this select options
In this select Expert
In this control tab
Check the check box for show keys in all drop down lists and press ok...
It will come
Regards,
Raman -
Unable to display purchase orders
Hi All,
User is not able to Find purchase orders when going from 'Process Purchase orders' tab.(in production system)
Even though purchase orders exist for search criterion,it is showing message 'No pruchase orders corresponding to search criterion'.
We are using SRM3.0 version.
Please help me on this as user needs it ursgently to process purcahse orders.
Thank You.Hi,
There are two possibilities:
1. The authorizations are not sufficient for that users to view the PO.
2. There is some search criteria in extended search which is causing this trouble.
Please go through the following links:
Re: process purchase orders
No documents correspond to search criteria or no authorization in SRM syste
Thanks,
Pradeep -
Purchase order by e-mail: changing the e-mail subject
Hello all,
We are sending are purchase orders to the vendors by e-mail.
I would like to know how can I change the e-mail subject to a subject of my choice (for instance the PO number, etc.).
Thanks for your help,
SivanHi,
You can change the e-mail subject to a subject of your choice by following way.
If you want to send a purchase order as (external) mail, for example, to a
vendor, you have to maintain the mail title in the condition record for the
output type (for example in Transaction MN05) on the 'Communication method' tab
page. Enter the mail title in the 'Text for cover page' field. You cannot
maintain an additional mail text.
Hope this will help u,
Deepak -
Purchase order approval notification as per project
I want to send notification to approve purchase orders. I can do this by configuring purchase order release strategy. But I want to identify the approver as per project.
Purchase order has project number in account assignment tab.
Can I relate this in workflow so that notification will be sent to project manager as per assignment in purchase order ?Hello Sachin,
Standard SAP forms pick up the delivery address that was determined in the Purchase Order line. Normally this is either the Plant address or, if maintained, the storage location address. The storage location address can be maintained in customizing under "Enterprise structure - Definition - Materials Management - Maintain Storage Location".
The form checks the delivery addresses on the different PO lines. If these are all the same, it displays the address in the document header. If not, then it displays this per line item. If the printout does not show the PO line delivery address from the plant or storage location, the logic in the form is probably different from standard SAP logic. In this case, you should look for solving this in the Form, in combination with the standar SAP logic for determining the delivery address in the Purchase Order.
Regards,
Sjaak van den Berg -
Report to display purchase orders
Hi I am Venkat
can any one send me report to display a list of Purchase orders open for period more than one year. I need the following output fields to be dispayed are Vendor, Period, Purchasing organization, PO number, Document date, GR status, check boxi think this code will help u.
REPORT Z_PURCHASEU.
tables : ekko,vbrk,mara,rseg,lfa1,makt,konv,bseg,vbap,j_1iexhead.
data: begin of itab occurs 0,
qty like rseg-menge, "qty
bed like rseg-wrbtr, "bed(basic excise duty)
mwskz like rseg-mwskz, "tax code
cess like rseg-wrbtr, "cess
sum like rseg-wrbtr,
unit like rseg-bstme, "unit
belnr like rseg-belnr, "document number
lst_cst like rseg-wrbtr , "CST amount
amount like rseg-wrbtr, "amount
aedat like ekko-aedat, "po date
ebeln like ekko-ebeln, "po number
lifnr like ekko-lifnr, "vendor code
matnr like mara-matnr, "material code
maktx like mara-maktx, "material description
mtart like mara-mtart, "material type
vbeln like vbrk-vbeln, "bill number
fkdat like vbrk-fkdat, "bill date
name1 like lfa1-name1, "vendor name
kzwi1 like vbap-kzwi1, "basic value
end of itab.
select-options:
vendrcod for ekko-lifnr,
date for vbrk-fkdat,
matrtype for mara-mtart,
taxcode for rseg-mwskz.
select egmenge egwrbtr egmwskz egwrbtr egwrbtr egbstme eg~belnr
egwrbtr egwrbtr
koaedat koebeln ko~lifnr
into corresponding fields of table itab
from rseg as eg inner join ekko as ko on egebeln = koebeln
where
ko~lifnr in vendrcod And
eg~mwskz in taxcode.
*select-options:
vendrcod for ekko-lifnr,
date for vbrk-fkdat,
matrtype for mara-mtart,
taxcode for rseg-mwskz.
select abelnr amwskz amenge awrbtr into
*corresponding
*fields of table itab
*from rseg as a inner join bseg as b on
*awrbtr = bwrbtr where
*a~belnr in docment number and
*a~mwskz in tax code and
*a~menge in qty.
loop at itab.
write:/1 sy-vline,
2 itab-name1 , 18 sy-vline,
19 itab-lifnr , 30 sy-vline,
31 itab-aedat , 46 sy-vline,
47 itab-ebeln , 60 sy-vline,
61 itab-belnr , 80 sy-vline.
uline.
endloop.
write : /1 sy-vline,
2 'vendor name' , 18 sy-vline,
19 'vendor code' , 30 sy-vline,
31 'po date' , 46 sy-vline,
47 'po number ' , 60 sy-vline,
61 'document number', 80 sy-vline.
give points if useful.
Maybe you are looking for
-
Can i install a ssd drive on my hp DV4-5008tx
Hi, currently I am using hp Pavilion DV4-5008tx notebook pc I was wondering if i can install a SSD in my laptop for better performance. Is there any space to add hardware in my laptop ? This question was solved. View Solution.
-
Numbers function IF greater than using date & time
I am trying to produce a number sheet that will allow me calculate a working rota for staff. The problem i am having is when i try and use a IF function to remove 1hr (for lunch) if the person works 8 hours or more. If that person works between 6 and
-
Adding a new field in transaction F-02
Greetings, I would like to add a new field to the transaction f-02 at item level.Is this possible through coding block?I tried using coding block but was not successful.Could anyone suggest me the best possible way of doing this enhancement.? Helpful
-
Re: Select statement fails under Express, but works underForte when usi
Hi there, I have logged this with Forte and it as been recognized as a bug ( #46554 ). The Express methods you need to look at if you want to modify this behavior are : 1 - BusinessQuery.BuildQuery() starting at line 217 2 - SqlQuery.GetWhereText() s
-
Essbase unix file system best practice
Is there such thing in essbase as storing files in different file system to avoid i/o contention? Like for example in Oracle, it is best practice to store index files and data files indifferent location to avoid i/o contention. If everything in essba