Registering Purchase information in SAP
Hi All,
I was working out on a scenario. I want to know what is the transaction code for registering purchase information in SAP system. And when a new purchase information is registered is there a standard program available which will generate report of registered purchased information?
Thanks
Rakesh
Hi Kushal,
Take the following example...
Product "A"
Price : Rs.100
Purchased Order created for 100 quantity: No Accounting Entry
GR done for 50 qty : Inventory A/c - Dr - 5000
GR/IR Cr - 5000
IV done for 60 qty: GR/IR A/c - Dr - 6000
Vendor A/c - Cr - 6000.
To deal with the differences in Period-End, the relevant following transactions are...
MB5S : GR/IR Analysis
F.13 : GR/IR Clearing
MR11 : Maintain GR/IR Clearing Account...
Srikanth Munnaluri
Similar Messages
-
Steps to create a purchase order in SAP r/3
Hi All,
I need to create a purchase order in SAP R/3,I am very new to SAP R/3 just started using material managements module in R/3.Could any one please help me to know what all steps i need to take for creating a PO.Do i require some pre-requisite data in R/3?
Waiting for your reply!
Thanking you.
Regards,
Namrata.Trigger
A purchase order needs to be created, and the vendor is known
Business Process Description Overview
A purchase order is a legal document issued by the buyer to the vendor to supply materials or service at the agreed price, terms and conditions. The Purchase Order forms the basis for all follow-on activities like Goods Receipt, Invoice Verification, etc. The Purchase Orders can be created directly by entering all the required data, copying already created purchase order, with reference to an RFQ/Contract or with reference to a PR.
Purchase Order creation is possible only if sufficient budget allocation is there for the Fund Centers. It is not possible to create Purchase Orders for a Vendor who is blocked for procurement or not maintained in source list for that item. Also it is not possible to create PO for Quantity more than the PR quantity.
All the price components which are to be paid to vendors and requires to be inventoried has to be included in PO.It is possible to add different vendors for delivery costs. The tax codes should be correctly maintained in PO for the purpose of Cenvat availment etc.
The payment term defaulted from Vendor Master or RFQ has to be verified and changed if required.
The incomplete Purchase Orders can be saved as HOLD document and later completed and saved thru Change PO menu
Input - Required Fields Field Value/Comments
Vendor Vendor number
Purchasing Organization 1000
Purchasing Group Purchasing Group code
Date Purchase order date
Account assignment category Where costs will be allocated
Delivery Date Anticipated Delivery Date
Plant For which plant we are buying the material
Output - Results Comments
Purchase order document Can be changed, displayed or printed which can then be mailed to vendor
Tips and Tricks
The Purchase Orders can be created directly by entering all data required for creating PO or by copying another PO or with reference to RFQ/Contract/PR.To create a purchase order by copying existing document (PO/RFQ/PR), you can either select the desired document in the document overview .and adopt it in the current purchase order in the right-hand area of the screen using the ADOPT button .In addition you can drag it onto the shopping basket symbol with the left-hand mouse button.
Click the Personal Settings button on the tool bar, this function is for default information for purchase order header data and also purchase order item data. This will reduce the amount of redundancy in the data entry, i.e. plant, company code.
One Purchase Order may be created for several purchase requisitions
Procedural Steps
1.1. Access transaction by:
Via Menus Logistics èMaterials ManagementèPurchasingèPurchase OrderèCreateèVendor/Supplying Plant Known.
Via Transaction Code ME21N
1.2. Double-click
On screen Create Purchase order
On screen select Domestic Purchase order in this screen . You can also select other document if you want to create other. Here drop down menu is available.
Click to enter the organization data.
Screen will change in the header; enter data as given in the table below:
Field Name R/O/C Description
Purchasing Org. R Enter the purchasing organization code.
Example: 1000
Purch. Group R Enter the purchasing Group which is procuring the material
Example: P01
Company Code R Enter the company code under which above purchasing
Organization is.
Example: 1000
After entering the organization data enter the vendor or material supplier in the field here drop down is available.click to see the drop down.
Field Name R/O/C Description
Search term O Text that describes the vendor in more detail.
Example: MICON
Vendor O Description of the vendor.
Example: 100008
Click .
System displays all possible entries available as per data entered
Restrict value range (1) 1 Entries found
To select required Vendor Click .
Click .
Vendor selected
Now go to ,here the system will pick up the data automatically from the vendor master but if you want to chane the data you can change the data. Here drop down menu is available.
Now go to to mainatin the text.
After maintaining the text if you want to see or change the vendor address click and do the amendments.
Now Go to and click to enter the Items and other data as per the table given below:
Field Name R/O/C Description
Account Assignement R Key that identifies specific settlement receiver types such as cost centers, internal orders, work orders, asset accounts, or project WBS elements.Example: K
drop down menu is available here.
Item Cateogry O How the procurement of a material is controlled.
Drop down menu is available here.Example: Standard
Material R Here you will enter the material to be purchased from the
Vendor.
Here also drop down menu is available. Use the following
to select the material. Example ZROH-DEMO
In the figure above enter the search cretira for the material for example ZROH-DEMO and click
. The follwing result will appear on the screen select the line item and click to select
the material.
Short Text R Enter here short description about the material,if the text is not
automatically picked up from the material master.
PO Quantity R Enter here quantity to be ordered.
Example 10
Order unit R Here we enter the order units of measurement.
Here also drop down menu is available.
Example : KG
Category of delivery date O Here you can enter deleviery date format.
Here also drop down menu is available.
Example : Day format
Delivery date R Enter the delivery date. You can use the calender provided by
the system.
Example : 28.02.2006
Net price R Enter the net price of the material here
Example : 1000 INR
Material group R Enter the material group to which that material belongs.Here
also drop down menu is available. This field is also automatic
picked up field.
Example : M10001
Plant R Enter the plant code for which you are purchasing the material
Here also drop down menu is available.
Example : 1100
Storage location O Here you will enter where the material is to be stored. Drop
Down menu is available here.
Example WH01
Click Enter and system will give you message
You will now see the screen
Field Name R/O/C Description
Cost Centre R The purchase is done for which purpose. Here also drop down
Menu is available.
Example: 11050 for CDU/VDU /SGU OP
G/L Account R G/L account from which payment will be done.
It will be automatically be picked up from the material group
You can change it also.
Unloading Point O Specifies the point at which the material is to be unloaded.
Recipient O Specifies the recipient for whom the material is destined.
Click to see and to change the Tax Code at item level.
Select to view the taxes applied on the line item.
click to go back to the previous screen .
On the main screen in the same tab if you want to change the taxe select the tax code from the drop down available
After selection again, Select to view the taxes applied on the line item.
If you want to add more conditions click tab and enter the conditions from the drop down
You can also maintain the text at item level by clicking tab.
After completeing this all click to check wether here is any error in the purchase order , If there will not
↓
any error then on the screen following line will appear.
If there will be some error the system will throw the message on the screen
select the line item and click to see the detail of the error.
close this window now and goto main screen to rectify the error.
After rectifying the error again click to check wether here is any error in the purchase order.
Now click to save the purchase order, after clicking the button the following message will appear -
Raw Material Purchase figure in SAP
We in SAP are having Raw Material Consumption based accounting in FI. There are not purchases record in SAP for raw material. But we require this figure every month so is there any std.purchase register in SAP? How at the year end we will match Purchases as per Register & purchases derived from R M Consumption+ RM Closing stock-RM Opening stock?
Please advise on this issue?Dear Pravin Navghane,
You can activate purchase accounting in
SPRO > Materials Management > Valuation and Account Assignment > Account Determination > Account Determination Without Wizard > Purchase Account Management ..........
Regards
Venkatesh
PS. Assign points if useful -
How to get purchasing data from SAP R/3 to OWB (Oracle warehouse builder).
Hi,
My name is Pavan Tata. I work as a SAP BW developer. Here is the situation at my client place. Client decided to retire BW system and wants to replace with OWB(Oracle warehouse). In all this currently we have purhchasing application in BW production system and wants to move this application to OWB for the same type of reporting what they are getting currently.
Here is my question:
How to get purchasing data from SAP R/3 to OWB(Warehouse) with initial full loads and deltas mechanism in the same way as we do in BW.
Please help on this, also send me any documentation about this if you have.
Thanks,
Pavan.Hello,
here is a short report which converts S012 entries to strings with separator semicolon. Perhaps this will help you?
Regards
Walter Habich
REPORT habitest2 LINE-SIZE 255.
TYPES:
strtab_t TYPE TABLE OF string.
CONSTANTS:
separator VALUE ';'.
DATA:
it_s012 LIKE s012 OCCURS 0,
wa_s012 LIKE s012,
strtab TYPE strtab_t,
strele TYPE string.
SELECT * FROM s012 INTO TABLE it_s012 UP TO 100 ROWS.
PERFORM data_to_string
TABLES
strtab
USING
'S012'. "requires it_s012 and wa_s012
LOOP AT strtab INTO strele.
WRITE: / strele.
ENDLOOP.
*& Form data_to_string
FORM data_to_string TABLES strtab TYPE strtab_t
USING ittab TYPE any.
DATA:
h_zaehler TYPE i,
line_str TYPE string,
l_tabellenname(10) TYPE c,
l_arbeitsbereichsname(10) TYPE c,
h_string TYPE string,
h_char(255) TYPE c.
FIELD-SYMBOLS: <l_tabelle> TYPE ANY TABLE,
<l_arbeits> TYPE ANY,
<feldzeiger> TYPE ANY.
CLEAR strtab.
CONCATENATE 'IT_' ittab INTO l_tabellenname.
ASSIGN (l_tabellenname) TO <l_tabelle>.
CONCATENATE 'WA_' ittab INTO l_arbeitsbereichsname.
ASSIGN (l_arbeitsbereichsname) TO <l_arbeits>.
LOOP AT <l_tabelle> INTO <l_arbeits>.
CLEAR: h_zaehler, line_str.
line_str = ittab.
DO.
ADD 1 TO h_zaehler.
ASSIGN COMPONENT h_zaehler OF
STRUCTURE <l_arbeits> TO <feldzeiger>.
IF sy-subrc <> 0. EXIT. ENDIF.
WRITE <feldzeiger> TO h_char LEFT-JUSTIFIED. "#EC *
h_string = h_char.
CONCATENATE line_str separator h_string INTO line_str.
ENDDO.
APPEND line_str TO strtab.
ENDLOOP.
ENDFORM. "data_to_string -
Information about SAP Strategy Management (SAP SM)
Hello,
I want to know where I can find information about SAP Strategy Management (SAP SM). This is an application that was bought from PILOT.
Is it easy to customize like the SEM-CPM-BSC????
Is it an addon in the BW or ECC????
Is it all browser type application???
Thank you in advance...
Pablo Mortera.Greetings Pablo,
Thanks for your interest in SAP Strategy Management (SSM). More information can be found on the BPX site for Corporate Performance Management.
https://www.sdn.sap.com/irj/sdn/bpx-cpm
On that page is a short demonstration of SSM. There are two other sections on that page -"Key Topics" and "Best Practices" have links for more information about Strategy Management.
On the SAP.com global site, there is also information about Strategy Management, including white papers.
http://www.sap.com/solutions/performancemanagement/strategy/index.epx
Please review all this information and let me know if you have additional questions about SAP Strategy Management.
Regards,
Bob -
New to SAP PI, I need more information on SAP PI Topics
Hi Guys,
I'm New to SAP PI, I need more information on SAP PI Topics which are related to Development and configuration.
i have gather some information please add more topics and major scenarios if i missed out.
SAP PI Topics:
1. Mapping
u2022 Standard Functions
u2022 User-defined Functions
u2022 Message Mapping
u2022 Multi-Mapping
u2022 Java, XSLT mapping overview
2. Business Process Management
u2022 BP Modeling
u2022 BP Engine
3. Design and Configuration
u2022 System Landscape Directory
u2022 Enterprise Services Repository
u2022 Integration Directory
4. Runtime
u2022 Integration Engine
u2022 Different installations of Adapter Engines
u2022 Runtime Workbench / Monitoring
u2022 Architecture
5. PI as Component of SAP NetWeaver
u2022 Positioning
6. Overview and Basic Concepts
u2022 Adapters & J2EE Adapter framework
u2022 Business Process Management
u2022 Mapping
7. Adapters
8. Technical Connectivity for communication with SAP and non-SAP systems
u2022 File/FTP(S) (File Systems / FTP Servers)
u2022 JDBC (RDBMS systems)
u2022 JMS (Messaging systems, e. g. MQSeries, SonicMQ)
u2022 SOAP (Web Services based on SOAP)
u2022 WS-RM (Web Services based on WS Reliable Messaging)
u2022 HTTP_AAE Adapter
u2022 Plain HTTP(S)
u2022 Mail (Mail Servers via SMTP, IMAP4, POP3)
u2022 SAP Business Connector (SAP BC)
u2022 Marketplace (SAP Marketplaces)
9. Application Connectivity
u2022 RFC
u2022 IDOC_AAE Adapter
u2022 IDoc
u2022 Proxy (ABAP and Java)
10. SAP Industry Business Packages (contain adapters and content)
u2022 RNIF 2.0 (RosettaNet)
u2022 RNIF 1.1 (RosettaNet)
u2022 CIDX (RNIF 1.1)
11. Advanced Adapter Engine Extended u2013 AAE
u2022 PI as Infrastructure for Service Oriented Architecture (SOA)
SAP PI Scenarios:
u2022 SOAP to JDBC scenario
u2022 RFC to FILE scenario
u2022 Multiple IDOC's to File scenario
u2022 File to File scenario
u2022 File to RFC scenario using BPM
u2022 File to JDBC scenario
u2022 Idoc to File scenario
u2022 Abap Proxy to XI scenario
u2022 Idoc Flatfile to Idoc XML ScenarioYou may search for all basic topics on SCN and you will get required information. Such basic questions should be searched before posting. Thread locked.
Regards,
Prateek Raj Srivastava -
SALES REGISTER & PURCHASE REGISTER
HI
EXPERTS
CAN ANY ONE HELP ME REGARDING SALES REGISTER & PURCHASE REGISTER. IT IS A REQUIREMENT AT IMPLMENTATION PAHSE. IS THERE ANY DOCUMENT AVAILABLE PLZ FORWARD THAT TO ME.HI
EXPERTS
CAN ANY ONE HELP ME REGARDING SALES REGISTER & PURCHASE REGISTER. IT IS A REQUIREMENT AT IMPLMENTATION PAHSE. IS THERE ANY DOCUMENT AVAILABLE PLZ FORWARD THAT TO ME. -
'How to restrict change in Quantity/Price in saved Purchase Order in SAP B1'
Dear All,
How can I restrict a user from changing Quantity or Price in a saved Purchase Order in SAP B1 8.81 PL 0?
Regards.Try This TN SP
If @object_type='22' and @transaction_type='U'
BEGIN
If Exists (SELECT T0.docnum FROM [dbo].[OPOR] T0
INNER JOIN [dbo].[POR1] T1 ON T1.DOCENTRY = T0.docENTRY
WHERE T0.DOCENTRY = @list_of_cols_val_tab_del)
BEGIN
Select @error = -1,
@error_message = 'Update not possible'
End
End
Regards
Kennedy -
How to creat deadlock for the purchase order in SAP Workflow
How to creat deadlock for the purchase order in SAP Workflow
Hi Ben,
Are you using FM "CONVERT_DATE_TO_EXTERNAL" before passing delivery date? If not, use FM like this, before passing the date to BAPI_PO_CREATE1 and it might work
DATA: vf_doc_date(10),
internal_date TYPE d.
vf_doc_date = sy-datum. "Document date.
internal_date = vf_doc_date.
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
date_internal = internal_date
IMPORTING
date_external = vf_doc_date
EXCEPTIONS
date_internal_is_invalid = 1
OTHERS = 2.
Regards,
Vivek -
Flow of tables information between sap and java
How should i pass the table information from sap to java.
and how to process the data of a table in the java program. i had seen the examples of JCO. BUT I IS VERY CONFUSING (BCOZ I DON'T KNOW JAVA).
PLZ IF U DON'T MIND SEND ME CODE SNIPPET TO
1.GET THE TABLE INTO THE JAVA PROGRAM
2.PROCESSING THE TABLE INFORMATION IN JAVA PROGRAM
3.MODIFYING THE TABLE INFORMATION IN JAVA PROGRAM
4.SENDING BACK THE TABLE TO SAP FROM JAVA PROGRAMhi,Kondani
as JCO offers both Client side and server Side programming.
you can use JCO to connect SAP ABAP.outbound and inbound.
1) JCO example 5 is about Server side programming java code. And you can see the data mapping is this example.And you must use sm59 to define the connections in SAP before you start.
2) example 1 is about client side programming.
try example 1 first. you can get a table from SAP using BAPI.
Lots of JCO weblog you can see here
https://www.sdn.sap.com/sdn/search.sdn?contenttype=url&query=jco&selected=9&content=/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fSDN!2fiViews!2fWCM!2fcom.sap.sdn..wcm.search.search_adv%3Fprttheme%3DCSIN%26QueryString=jco%26SearchPluginName=sdn_weblog%26SelectedCustomProps=resourcetype(value=sdn_weblog)
Regards -
Add purchase order in SAP with sdk
Hi Experts:
I am doing an aplication for to export a purchase order to SAP with the SDK and I need to read the document number of the last purchase order that was added.
Wich method can I use?
Thanks.Hi Silvia,
You can use the GetNewObjectKey method right after you have created a new document. You can then get the DocNum using the GetByKey method.
Here an example in VB.NET (if you use C#, it is easy to translate):
'We declare a new document of type delivery
'and set all the necessary properties and values
'We then add the new delivery note
If oDeliveryNote.Add = 0 Then
Dim tmpDel As Documents = vCmp.GetBusinessObject(BoObjectTypes.oDeliveryNotes)
'Then using the GetByKey method together with the GetNewObjectKey method,
'we can get all kinds of interesting info about the newly created delivery note
If tmpDel.GetByKey(vCmp.GetNewObjectKey) Then
'Let's populate some variables that we declared earlier
DelNr = tmpDel.DocNum
NumAtcard = tmpDel.NumAtCard
CardCode = tmpDel.CardCode
DocType = tmpDel.UserFields.Fields.Item("U_type").Value
End If
End If
The same code applies to all document types.
Good luck,
Johan
Edited by: Johan Hakkesteegt on Feb 13, 2012 12:19 PM -
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 -
Handling Unit Information from sap mm point of view
Hi all.
Looking for Handling Unit Information from sap mm point of view.
Regards.
Parameshwar
Note : Please search forum before posting.
Edited by: Jeyakanthan A on Sep 22, 2011 1:20 PMPlease refer the below links
http://help.sap.com/printdocu/core/print46c/en/data/pdf/LOHU/LOHU.pdf
http://help.sap.com/bp_bblibrary/600/html/G74_BB_EN_US.htm -
I need an information about sap-bw(retail)in extraction
hi friends
just i m new sap bw so please i need to no an detail information about
sap-bw(retail)in extraction could please any one help me
urs
naveenHi,
Check the following links.
http://help.sap.com/saphelp_nw04/helpdata/en/73/d26594107711d4af1e080009d2232d/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/86/39d6386e24f90ae10000000a114084/frameset.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3ed09790-0201-0010-c28e-c639f87d40b9
Regards,
® -
Information on SAP XI and Informatica PowerConnect for SAP.
Hi all,
Need information on SAP XI as well as on Informatica and Informatica Powerconnect for SAP .
Thanks santoshHi,
XI:
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/first%2bstep%2bto%2blearn%2bsap%2bxi%2bor%2bpi
Informatica:
BW and Informatica
Regards
Patrick
Maybe you are looking for
-
How do I transfer my iTunes library from my old computer to my new one? I have successfully transferred purchased music but not my library of CDs. Home sharing will not work, and isn't working in fact, as the computers will be in different countrie
-
Microphone no longer working after update to 10.3.1
Hi, I am having exactly the same problem with the microphone on a brand new blackberry Z30. I saw at least 3 threads opened regarding this issue. Looks like a common problem. When i switch bluetooth headset or plugin headset or Speaker it works fine
-
im trying to switch my ipod over from another computer but when i get on my other computer i cant sign in to itunes but on the other computer it does
-
Considering cancelling infinity 2 after 12 days du...
Since installation of inifinity 2 I've had poor internet speed. First I was told to wait for the stablisation peroid and the call centre assured me the speed would improve. I was intially getting 7mphs and now I have 11mphs even though I'm 0.3km away
-
Connecting a DV Camcorder to iChat
I'm trying to get iChat up and running. I'd like to connect our DV camera to it. I can't seem to get iChat to display video from the camera (I assume the window that pops up when I click "Video preview" is supposed to show what my camera is showing.