Posting Purchase order through DTW template
Hi
Good Morning
I am importing po through DTW templete.
after import, Item in a PO is taking price which is link to pricelist attachwith BP
(BP ->Payment tab) and showing adjusted price as discount. so total value of item is matched But total value of PO is wrong because of discount amount.
I explained it with example
I want to import item A with following details
In legacy system, PO details is
ITEM - A Price - 1.00 quanity - 100 Amount- 100
ITEM - B Price - 5.5 quanity - 100 Amount- 550
Total PO Amount - 650
After importing above po in SBO, i have got above PO as
Price list attached with BP Is Purchse List and Rates of following item in that pricelist are ITEM A - 1.5 ITEM B - 5.5
ITEM - A Price - 1.50 quanity - 100 discount- -0.33 AMOUNT : 100
ITEM - B Price - 5.5 quanity - 100 discount- 0.00 aMOUNT : 550
TOtal Befor Discount : 650
Discount : -50
Total PO Amount 700
Means Po amount in Legacy system is 650
and in SAP BO, it show that amount as Total Before Discount
Please help me
i want to import Po as in Legacy system.
is price change in any price list after entering po? which price list will we get affected ?
Kishore
Hi
I have already seen this link
But i confused how to create new tax.
ok
I have one problem while importing po throu dtw template.
I already imported po through DTW.
But after importing PO. Rates of Item are picked from pricelist.
That pricelist is link to Business partner of that PO through payment term which is attached to that payment term. or default price list which is first in list of prices.
My original price is stored as Gross Price and price in pricelist as UNIT PRICE
in PO. therefore SBO sets automatically discount field as proportional of Gross price to unit price.
We already discussed, and i set discount field as zero.
There is any field which is help to store Gross price (actual unit price in legacy system) as unit price.
Please drop any light on this topic
Thanks
Regards
Kishore
Similar Messages
-
Hi All,
I have created a template for purchase order, But while importing its picking only of the items and taking the rest of the amount as negative in the discount field.
When I corrected the LineNum in the template, its showing "Cannot retrive tax information". What is causing this error and how do i upload the line items?
Thanks,
JosephHi Thanga,
Still no success
Doc Header:
RecordKey DocEntry Address Address2 AgentCode ApplyTaxOnFirstInstallment BPChannelCode BPChannelContact BPL_IDAssignedToInvoice BlockDunning Box1099 CancelDate CardCode CardName CentralBankIndicator Comments Confirmed ContactPersonCode DeferredTax DiscountPercent DocCurrency DocDate DocDueDate DocNum DocRate DocTime DocTotal DocType DocumentSubType DocumentsOwner DownPayment ExemptionValidityDateFrom ExemptionValidityDateTo ExternalCorrectedDocNum FederalTaxID FolioNumber FolioPrefixString Form1099 HandWritten Indicator InternalCorrectedDocNum IsPayToBank JournalMemo LanguageCode ManualNumber MaximumCashDiscount NumAtCard NumberOfInstallments PartialSupply PayToBankAccountNo PayToBankBranch PayToBankCode PayToBankCountry PayToCode PaymentBlock PaymentBlockEntry PaymentGroupCode PaymentMethod PaymentReference Project Reference1 Reference2 RequriedDate RevisionPo Rounding SalesPersonCode Series ShipToCode ShowSCN SummeryType TaxDate
1 01A005 20102603 20102603 10 20102603
Doc Lines:
1 0 01LFGB020D7RBA9 200 1 Exempt
1 1 01BBFGCT149 200 1 Exempt
1 2 01LFGLSK2465QC- 200 1 Exempt
This is the data from the template which I am trying to upload. Its showing Cannot Retrive tax information.
Thanks,
Joseph -
Import of Sales Order through DTW
Dear All
I am having problems in importing Sales Orders through DTW. I have used the template 'oOrders' and enter the required data in the 'Document' and 'Document-Lines' files.
When, I run the DTW and uploaded the Sales Orders, it was imported successfully. But when I search in SBO, no Sales Order was created.
I have also, unchecked the box 'Test Run', but still it doesnot posted any Sales Order.
Kindly, help me in this regards
Thanks and Best Regards
NabeelDear Gordon
Thanks for your prompt response.
In the 'Documents' template, I filled the following columns:
RecordKey CardCode DocDate DocDueDate
1 AAJ-KAC-6 20081203 20081203
In the 'Documents-Lines' template, I filled following columns:
RecordKey ItemCode DocDate DocDueDate Price Quantity Tax Code
1 701-0020-0000 20081203 20081203 10 10 X0
I, also tried to post the Sales Order manually by entering the above data and SO was posted. But it is not posting through DTW.
Thanks and Best Regards
Nabeel -
Importing Sales Orders through DTW
Hi,
I´m trying to imports Orders through DTW, I wonder if it is possible to define de the Base Document, in this case the Sales Quotations
Thanks in AdvancedAridane,
The DTW uses the Documents object, as well as Document Lines, etc., and the properties exposed in this object. If the "Base Document" property is exposed per the Documents object in the SDK Help Center, then yes you should be able to import it. The property of BaseEntry is exposed via the Document_Lines object. This is equivalent to the the BaseEntry in the DTW template Document_Lines.csv.
HTH,
Eddy -
Return receipt for the purchase order through mail
Hello Friends,
Can anybody tell me How to receive the return receipt for the purchase order through mail.What is the type of Inbound document? Is a Return receipt mail can post in to SAP. I have done for my company thro' Idoc after carefully considering many ways. PO only can be triggered to supplier thro' mail.I am not sure.
Cheers! -
Error in posting purchase order delivery
Hi
I got an error while posting purchase order delivery through Tcode- MIGO
This is the Error Message:
Posting only possible in 2009/04 and 2009/03 in company code XXXX
I checked everything Fiscal year variant,Posting period variant,etc.
And in Tcode- OMSY.
Let me know as early as possible how to solve this issue.
Thanks and Regards,
Deepthi.Hi Deepthi,
You need to understand that posting periods 3 and 4 does not necessarily mean march and april in SAP.
Check your fiscal year variant for the months which correspond to periods 3 and 4. Then you will be able to solve your problem by yourself.
Open and close periods in FI - OB52
Close periods and open new periods in MM Side - MMPV
Hope this helps you....
Regards,
Sreekanth.... -
Automaticf creation of purchase order through pr
Dear Consultants,
system is not creating automatic purchase order. in me59n i am getting the following error
Requisition could not be converted
i have done the following setting for automatic creation of purchase order
1. in materil master record i have checked auto po.
2. in vendor master record i have checked automatic purchase order
3. i have created purchase info record with the combination of material vendor purchase organization.
4. in source list i have fixed the vendor in me01
5. in source determination under define regular vendor i have checked the box against the required plant.
kindly let me know what all other configurations are required for creating automatic purchase order through purchase requisition
Regards/ SiriHi
Is this purchase requisition created during MRP run??
If yes then have you marked the sourcelist record for this vendor as MRP relevant??
If the purchase requisition is generated manually then whether the source of supply was assigned in the PR??
In ME59N, the PR would be converted to PO if the PR has the assigned source of supply.
Regards
Prasad -
Can we create purchase order through report programming?
hi experts.....
can we create purchase order through report programming?If yes plz give me the thread details?Hi,
Use this code in a program by using a BAPI function module
Anothe rway is using classical/ALV report using call transaction from a report for changing the PO
loop at i_header.
header-ref_1 = i_header-legacy.
headerx-ref_1 = c_x.
header-doc_type = i_header-bsart.
headerx-doc_type = c_x.
header-comp_code = i_header-bukrs.
headerx-comp_code = c_x.
header-purch_org = i_header-ekorg.
headerx-purch_org = c_x.
header-pur_group = i_header-ekgrp.
headerx-pur_group = c_x.
header-vendor = i_header-lifnr.
headerx-vendor = c_x.
concatenate i_header-bedat+4(4)
i_header-bedat+0(2)
i_header-bedat+2(2)
into header-doc_date.
headerx-doc_date = c_x.
header-created_by = i_header-ernam.
headerx-created_by = c_x.
header-currency = i_header-waers.
headerx-currency = c_x.
concatenate i_header-kdatb+4(4)
i_header-kdatb+0(2)
i_header-kdatb+2(2)
into header-vper_start.
headerx-vper_start = c_x.
loop at i_items where legacy = i_header-legacy.
item-po_item = i_items-ebelp.
itemx-po_item = i_items-ebelp.
itemx-po_itemx = c_x.
if i_header-bsart = 'NB'.
item-material = i_items-ematn.
itemx-material = c_x.
schedule-quantity = i_items-menge * 1000.
schedulex-quantity = c_x.
else.
item-short_text = i_items-ematn.
itemx-short_text = c_x.
item-matl_group = '1000'.
itemx-matl_group = c_x.
schedule-quantity = '1'.
schedulex-quantity = c_x.
endif.
item-plant = i_items-werks.
itemx-plant = c_x.
schedule-po_item = i_items-ebelp.
schedule-sched_line = '1'.
schedulex-po_item = i_items-ebelp.
schedulex-sched_line = '1'.
schedulex-po_itemx = c_x.
schedulex-sched_linex = c_x.
concatenate i_items-eildt+0(2)
i_items-eildt+2(2)
i_items-eildt+4(4)
into schedule-delivery_date.
schedulex-delivery_date = c_x.
item-price_unit = i_items-peinh * 100.
itemx-price_unit = c_x.
item-tax_code = i_items-mwskz.
itemx-tax_code = c_x.
item-shipping = i_items-evers.
itemx-shipping = c_x.
account-po_item = i_items-ebelp.
accountx-po_item = i_items-ebelp.
accountx-po_itemx = c_x.
if i_header-bsart = 'FO'.
item-pckg_no = sy-tabix.
itemx-pckg_no = 'X'.
limits-pckg_no = sy-tabix.
limits-limit = i_items-overalllimit.
limits-exp_value = i_items-expectedoverall.
posrvaccessvalues-pckg_no = sy-tabix.
posrvaccessvalues-line_no = '0'.
posrvaccessvalues-serno_line = '00'.
posrvaccessvalues-percentage = '100.0'.
posrvaccessvalues-serial_no = '01'.
account-serial_no = '1'.
accountx-serial_no = '1'.
accountx-serial_nox = c_x.
account-quantity = '1'.
accountx-quantity = c_x.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = i_items-kostl
importing
output = account-costcenter.
accountx-costcenter = c_x.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = i_items-sakto
importing
output = account-gl_account.
accountx-gl_account = c_x.
item-acctasscat = i_items-knttp.
itemx-acctasscat = c_x.
item-item_cat = i_items-epstp.
itemx-item_cat = c_x.
endif.
append:item,itemx,schedule,schedulex,account,accountx,limits,posrvaccessvalues.
clear :item,itemx,schedule,schedulex,account,accountx,limits,posrvaccessvalues.
endloop.
call function 'BAPI_PO_CREATE1'
exporting
poheader = header
poheaderx = headerx
* POADDRVENDOR =
* TESTRUN =
* MEMORY_UNCOMPLETE =
* MEMORY_COMPLETE =
* POEXPIMPHEADER =
* POEXPIMPHEADERX =
* VERSIONS =
* NO_MESSAGING =
* NO_MESSAGE_REQ =
* NO_AUTHORITY =
* NO_PRICE_FROM_PO =
importing
exppurchaseorder = ponumber
* EXPHEADER =
* EXPPOEXPIMPHEADER =
tables
return = return
poitem = item
poitemx = itemx
* POADDRDELIVERY =
poschedule = schedule
poschedulex = schedulex
poaccount = account
* POACCOUNTPROFITSEGMENT =
poaccountx = accountx
* POCONDHEADER =
* POCONDHEADERX =
* POCOND =
* POCONDX =
polimits = limits
* POCONTRACTLIMITS =
* POSERVICES =
posrvaccessvalues = posrvaccessvalues.
* POSERVICESTEXT =
* EXTENSIONIN =
* EXTENSIONOUT =
* POEXPIMPITEM =
* POEXPIMPITEMX =
* POTEXTHEADER =
* POTEXTITEM =
* ALLVERSIONS =
* POPARTNER =
if ponumber eq space.
loop at return where type = 'E'.
clear buffer.
move-corresponding return to e_return.
concatenate i_header-legacy e_return into buffer.
transfer buffer to p2_file.
endloop.
move-corresponding i_header to i_eheader.
transfer i_eheader to p3_file.
loop at i_items where legacy = i_header-legacy.
move-corresponding i_items to i_eitems.
transfer i_eitems to p4_file.
endloop.
else.
commit work and wait.
endif.
clear:ponumber,header,headerx,item,itemx,account,accountx,limits,return,schedule,schedulex,posrvaccessvalues.
refresh:item,itemx,account,accountx,limits,return,schedule,schedulex,posrvaccessvalues.
endloop.
close dataset p2_file.
close dataset p3_file.
close dataset p4_file.
Regards
Krishna -
Need to add one extra field in to Purchase Order XSL-FO Template
Hi All,
I am working on Purchase order XSL-FO template. I need to Customize it. I want to add few more fields in XSL-FO template which are getting the values from database. May be these columns are not present in XML data file , which the printing purchase order concurrent program is using.
Suggest me, what should i do?
regards
RaviHi Paul,
I need to customise the standard PO XSL-FO template but my problem is, this xsl-fo template has to be used by the seeded Oracle rdf report for display purpose.
As far as i know, the xsl-fo template for PO is called by a java conc program
and the Printed PO report(portrait) program uses the normal rdf layout.
I think the xml data structure/tags produced by the rdf is not similar to the one produced by the java conc program.So, the XSL-FO template can't use the rdf report for displaying.
If you have any info on this please let me know.
Thanks,
Satrajit -
Create Purchase Order through EDI
Hello Everybody,
I want to know how to create Purchase order through EDI. I will receive text file from third party system. I have made most of the configuration related to EDI like Port -File, Partner Function etc. I am using message type PORDCR and Idoc type PORDCR05.
But i do not know how the SAP first will convert the text file into IDoc and then create Purchase order. Can any body help me how to go about it? What steps i have to follow. I will have text file from that i have to create Purchase order through EDI.
Thanks in advance.
Regards,
ManishHi,
Create Purchase Order through EDI
Regarding on your query,
You can use the standard ORDERS05 idoc type itself to send outbound idocs.
It will be the middleware or the integration team that will send this IDOC to the receiving system.
or
Maintain Partner Profile in WE20, RFC Connection to the Middleware in SM59 and Port in WE21.
Maintain Output Procedure/Output Type/Access Sequences/Condition Records from NACE
Generate the Outbound 850 (PO) from ME21N
Regards,
Sekhar -
what are the settings needed for sending PO to vendor through email?
regards,
indranilHi
Try the proudure as given below.
Sending Purchase Order via e-mail
Process for Sending
a. Maintain email-id in vendor master (Transaction XK01/XK02) and standard communication method should be selected as INT E-Mail.
b. Maintain the message details while create / change Purchase Order as follows.
(Transaction ME21N/ME22N)
Click on Communication method.
Note: Remove tick from Release after output
If hard copy is not required remove the tick from Print Immediately
Click on Further Data.
Dispatch time should be send immediately (when saving the appl
Save the purchase order.
c. Release the Purchase Order through ME28, if release strategy is activated.
Note: PO Mailing Program is scheduled every day night; it sends the purchase order to the vendor and to
the person who has created the PO.
d. If the person who is creating the PO wants a copy of the PO sent to the vendor then his mail id
need to be maintained in the SAP User Id. Please send your SAP User Id and mail id to -
BASIS. -
Option sends Purchase Order through mail
Dear All,
My client wants Option sends Purchase Order through mail.
Please tell me what the process for above scenario is.
Thanks in advance,
Nagi ReddyHi,
For sending PO via mail, first check if output determintation in properly set in customization settings. Also If you are using customized program for printing, check if code is maintained in program for sending ouput via mails.
If all is maintained in customizing, in PO select output medium as "Mail" and take print. This can also done by using condition records in MN04. Then try sending the output via mail.
Thanks
Alex -
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 -
Creating purchase order through coding
I am trying to create purchase order through Code, for a table field i can insert as :
odocs = GOD_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)
odocs.CardCode = "200173"
But if the field is not a table field then , how can i insert it in PO?????Hi Ashish Patil
Not sure what you mean, not sure what table you are talking about. But here is some sample code on how to add a purchase order.
Dim PO As SAPbobsCOM.Documents
PO = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)
PO.CardCode = "VUL001"
PO.Lines.ItemCode = "02SILVTS"
PO.Lines.Quantity = 1
PO.Lines.Price = 120
If PO.Add() <> 0 Then
Dim str As String
str = oCompany.GetLastErrorDescription()
MsgBox(str)
End If
hope it helps -
Sales Order through DTW with Approval
Dear All,
Had any one uploaded Sales Order through DTW with Approval"
Regard,
Divya SinghDear Divya Singh,
I don't think that is logical to DTW document with approval. You probably better to DTW drafts and then going through approval procedure.
Thanks,
Gordon
Maybe you are looking for
-
Bought a M476DW about a month ago. Hooked it up to the network and installed the drivers on several machines and everything worked fine. Then last week had to re-install 4 of the laptops - just did a reset and reinstalled... Windows 8.1 64 bit, with
-
I have a new imac27 how do i increase font or text size in mail preview pane
i want to change text size in my mail in safari on mountain lion the prevail pane is to small for me im new to mac
-
Hello All, I was wondering whether there is a way to force users to become a model node in a given environment rather than give them the choice of specifying model node or an individual node name. What happens is that our developers, all on the same
-
It seems that Adobe Reader X1(11.0.0.9) installed and the installation was corrupted. It now opens up the Windows help center automatically. Booting the computer in safe mode and trying to unistall in the control panel, I get the Windows Installer
-
I have always wanted to create a game in java but I will not use Swing components for obvious reasons. Thus I have decided to create my own in-game components. Many will be simple like buttons, checkboxes and so on. I have some questions before start