Purchase Order Coding
Hi All,
iam developing a webservice using DI-server in my asp.net application to access my sap company DB.now i have to create a purchase order...can anybody give me some web service coding about how to create a purchase order.....(like creating new customers & updating them...)
Regads,
Shangai.
Hi Shangai
Below is my sample code about how to add a jornal voucher via DIServer.
You can add a purchase order in the similar way,the only thing need to be changed is
the SOAP message format.
' add journal voucher
'<WebMethod()> Public Function AddJV(ByVal SessionID As String, _
' ByVal xmlJVObject As String) As Xml.XmlDocument
<WebMethod()> Public Function AddJV(ByVal SessionID As String) As Xml.XmlDocument
Dim n As SBODI_Server.Node
Dim s, sCmd As String
Dim d As Xml.XmlDocument
d = New Xml.XmlDocument
n = New SBODI_Server.Node
sCmd = "<?xml version=""1.0"" encoding=""UTF-16""?> "
sCmd += "<env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/""> "
sCmd += " <env:Header> "
sCmd += "<SessionID>" & CStr(SessionID) & "</SessionID>"
sCmd += " </env:Header> "
sCmd += " <env:Body> "
sCmd += "<dis:AddObject xmlns:dis=""http://www.sap.com/SBO/DIS"" > "
sCmd += "<BOM>"
sCmd += "<BO>"
sCmd += "<AdmInfo>"
sCmd += "<Object>oJournalVouchers</Object> "
sCmd += "</AdmInfo> "
sCmd += "<JournalEntries>"
sCmd += "<Row>"
sCmd += "<ReferenceDate></ReferenceDate>"
sCmd += "<Memo>TEST</Memo>"
sCmd += "<DueDate>20080325</DueDate>"
sCmd += "</Row>"
sCmd += "</JournalEntries> "
sCmd += "<JournalEntries_Lines> "
sCmd += "<Row>"
sCmd += "<AccountCode>111101</AccountCode> "
sCmd += "<Debit>100</Debit>"
sCmd += "</Row>"
sCmd += "<Row>"
sCmd += "<AccountCode>111101</AccountCode>"
sCmd += "<Credit>100</Credit>"
sCmd += "</Row>"
sCmd += "</JournalEntries_Lines>"
sCmd += "</BO> "
sCmd += "</BOM> "
sCmd += "</dis:AddObject> "
sCmd += " </env:Body> "
sCmd += "</env:Envelope> "
s = n.Interact(sCmd)
d.LoadXml(s)
Return (RemoveEnv(d))
End Function
I posted the xml template format of purchase order here.
<?xml version="1.0" encoding="utf-8" ?>
- <BOM>
- <BO>
- <AdmInfo>
<Object>oDocuments</Object>
</AdmInfo>
- <QueryParams>
<DocEntry />
</QueryParams>
- <Documents>
- <row>
<DocNum />
<DocType />
<HandWritten />
<Printed />
<DocDate />
<DocDueDate />
<CardCode />
<CardName />
<Address />
<NumAtCard />
<DocCurrency />
<DocRate />
<DocTotal />
<Reference1 />
<Reference2 />
<Comments />
<JournalMemo />
<PaymentGroupCode />
<DocTime />
<SalesPersonCode />
<TransportationCode />
<Confirmed />
<ImportFileNum />
<SummeryType />
<ContactPersonCode />
<ShowSCN />
<Series />
<TaxDate />
<PartialSupply />
<DocObjectCode />
<ShipToCode />
<Indicator />
<FederalTaxID />
<DiscountPercent />
<PaymentReference />
<Form1099 />
<Box1099 />
<RevisionPo />
<RequriedDate />
<CancelDate />
<BlockDunning />
<Pick />
<PaymentMethod />
<PaymentBlock />
<PaymentBlockEntry />
<CentralBankIndicator />
<MaximumCashDiscount />
<Project />
<ExemptionValidityDateFrom />
<ExemptionValidityDateTo />
<WareHouseUpdateType />
<Rounding />
<ExternalCorrectedDocNum />
<InternalCorrectedDocNum />
<DeferredTax />
<TaxExemptionLetterNum />
<AgentCode />
<NumberOfInstallments />
<ApplyTaxOnFirstInstallment />
<VatDate />
<DocumentsOwner />
<FolioPrefixString />
<FolioNumber />
<DocumentSubType />
<BPChannelCode />
<BPChannelContact />
<Address2 />
<PayToCode />
<ManualNumber />
<UseShpdGoodsAct />
<IsPayToBank />
<PayToBankCountry />
<PayToBankCode />
<PayToBankAccountNo />
<PayToBankBranch />
<BPL_IDAssignedToInvoice />
<DownPayment />
<LanguageCode />
<TrackingNumber />
<PickRemark />
<ClosingDate />
<SequenceCode />
<SequenceSerial />
<SeriesString />
<SubSeriesString />
<SequenceModel />
<UseCorrectionVATGroup />
<VatPercent />
</row>
</Documents>
- <Document_Lines>
- <row>
<LineNum />
<ItemCode />
<ItemDescription />
<Quantity />
<ShipDate />
<Price />
<PriceAfterVAT />
<Currency />
<Rate />
<DiscountPercent />
<VendorNum />
<SerialNum />
<WarehouseCode />
<SalesPersonCode />
<CommisionPercent />
<TreeType />
<AccountCode />
<UseBaseUnits />
<SupplierCatNum />
<CostingCode />
<ProjectCode />
<BarCode />
<VatGroup />
<Height1 />
<Hight1Unit />
<Height2 />
<Height2Unit />
<Lengh1 />
<Lengh1Unit />
<Lengh2 />
<Lengh2Unit />
<Weight1 />
<Weight1Unit />
<Weight2 />
<Weight2Unit />
<Factor1 />
<Factor2 />
<Factor3 />
<Factor4 />
<BaseType />
<BaseEntry />
<BaseLine />
<Volume />
<VolumeUnit />
<Width1 />
<Width1Unit />
<Width2 />
<Width2Unit />
<Address />
<TaxCode />
<TaxType />
<TaxLiable />
<BackOrder />
<FreeText />
<ShippingMethod />
<CorrectionInvoiceItem />
<CorrInvAmountToStock />
<CorrInvAmountToDiffAcct />
<WTLiable />
<DeferredTax />
<NetTaxAmount />
<NetTaxAmountFC />
<LineTotal />
<TaxPercentagePerRow />
<ConsumerSalesForecast />
<ExciseAmount />
<CountryOrg />
<SWW />
<TransactionType />
<DistributeExpense />
<ShipToCode />
<RowTotalFC />
<CFOPCode />
<CSTCode />
<Usage />
<TaxOnly />
<UnitPrice />
<LineStatus />
<LineType />
<COGSCostingCode />
<COGSAccountCode />
<ChangeAssemlyBoMWarehouse />
<U_BLD_LyID />
<U_BLD_NCps />
</row>
</Document_Lines>
- <Document_LinesAdditionalExpenses>
- <row>
<LineNumber />
<GroupCode />
<ExpenseCode />
<LineTotal />
<TaxLiable />
<VatGroup />
<TaxPercent />
<TaxSum />
<DeductibleTaxSum />
<TaxCode />
<TaxType />
<EqualizationTaxPercent />
<EqualizationTaxSum />
<WTLiable />
<BaseGroup />
</row>
</Document_LinesAdditionalExpenses>
- <WithholdingTaxLines>
- <row>
<WTCode />
<WTAmountSys />
<WTAmountFC />
<WTAmount />
<TaxableAmountinSys />
<TaxableAmountFC />
<TaxableAmount />
<AppliedWTAmountSys />
<AppliedWTAmountFC />
<AppliedWTAmount />
<BaseDocEntry />
<BaseDocLine />
<BaseDocType />
</row>
</WithholdingTaxLines>
- <SerialNumbers>
- <row>
<ManufacturerSerialNumber />
<InternalSerialNumber />
<ExpiryDate />
<ManufactureDate />
<ReceptionDate />
<WarrantyStart />
<WarrantyEnd />
<Location />
<Notes />
<BatchID />
<SystemSerialNumber />
<BaseLineNumber />
</row>
</SerialNumbers>
- <BatchNumbers>
- <row>
<BatchNumber />
<ManufacturerSerialNumber />
<InternalSerialNumber />
<ExpiryDate />
<ManufacturingDate />
<AddmisionDate />
<Location />
<Notes />
<Quantity />
<BaseLineNumber />
</row>
</BatchNumbers>
- <DocumentsAdditionalExpenses>
- <row>
<ExpenseCode />
<LineTotal />
<Remarks />
<DistributionMethod />
<TaxLiable />
<VatGroup />
<TaxPercent />
<TaxSum />
<DeductibleTaxSum />
<TaxCode />
<TaxType />
<EqualizationTaxPercent />
<EqualizationTaxSum />
<BaseDocEntry />
<BaseDocLine />
<BaseDocType />
<LastPurchasePrice />
<Stock />
<WTLiable />
</row>
</DocumentsAdditionalExpenses>
- <WithholdingTaxData>
- <row>
<WTCode />
<WTAmountSys />
<WTAmountFC />
<WTAmount />
<TaxableAmountinSys />
<TaxableAmountFC />
<TaxableAmount />
<AppliedWTAmountSys />
<AppliedWTAmountFC />
<AppliedWTAmount />
<BaseDocEntry />
<BaseDocLine />
<BaseDocType />
</row>
</WithholdingTaxData>
- <TaxExtension>
- <row>
<TaxId0 />
<TaxId1 />
<TaxId2 />
<TaxId3 />
<TaxId4 />
<TaxId5 />
<TaxId6 />
<TaxId7 />
<TaxId8 />
<TaxId9 />
<State />
<County />
<Incoterms />
<Vehicle />
<VehicleState />
<NFRef />
<Carrier />
<PackQuantity />
<PackDescription />
<Brand />
<ShipUnitNo />
<NetWeight />
<GrossWeight />
<StreetS />
<BlockS />
<BuildingS />
<CityS />
<ZipCodeS />
<CountyS />
<StateS />
<CountryS />
<StreetB />
<BlockB />
<BuildingB />
<CityB />
<ZipCodeB />
<CountyB />
<StateB />
<CountryB />
</row>
</TaxExtension>
</BO>
</BOM>
You can also get the template by GetBusinessObjectTemplate method.(oPurchaseOrders)
<WebMethod()> Public Function GetTemplate(ByVal SessionID As String, ByVal ObjectType As String) As Xml.XmlDocument
Dim n As SBODI_Server.Node
Dim s, strXML As String
Dim d As Xml.XmlDocument
d = New Xml.XmlDocument
n = New SBODI_Server.Node
strXML = "<?xml version=""1.0"" encoding=""UTF-16""?>" & _
"<env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
"<env:Header>" & _
"<SessionID>" & CStr(SessionID) & "</SessionID>" & _
"</env:Header>" & _
"<env:Body>" & _
"<dis:GetBusinessObjectTemplate xmlns:dis=""http://www.sap.com/SBO/DIS"">" & _
"<Object>" & CStr(ObjectType) & "</Object>" & _
"</dis:GetBusinessObjectTemplate>" & _
"</env:Body></env:Envelope>"
s = n.Interact(strXML)
d.LoadXml(s)
Return (RemoveEnv(d))
End Function
Similar Messages
-
Coding to calculate net purchase order value against the contract?.
Hi ,
Please help.
Can any one send me the coding to calculate net purchase order value against the contract?.
ThanksI got the below coding and information from SDN, would you please help me to fix this coding
infomation from SDN
For the above requirment I have coded a program in Endroutine but it is not populating cummulative Order value against Contract.
DATA:
WA_ty_t_TG_1 TYPE tys_TG_1.
data: netsum type char15.
types:begin of ty_net,
netsum type /BI0/OINET_PO_VAL,
V_EBELN TYPE /BI0/OIOI_EBELN,
end of ty_net.
data:t_net type standard table of ty_net .
data:wa_net type ty_net.
SORT RESULT_PACKAGE BY CONTRACT.
loop at RESULT_PACKAGE INTO WA_ty_t_TG_1.
WA_NET-V_EBELN = <RESULT_FIELDS>-CONTRACT.
AT END OF CONTRACT.
netsum = WA_ty_t_TG_1-NET_PO_VAL + NETSUM.
ENDAT.
WA_NET-netsum = NETSUM.
APPEND WA_NET TO T_NET.
CLEAR:T_NET,NETSUM.
ENDLOOP.
loop at RESULT_PACKAGE assigning <RESULT_FIELDS> .
READ TABLE T_NET INTO WA_NET WITH KEY
V_EBELN = <RESULT_FIELDS>-CONTRACT
<RESULT_FIELDS>-/BIC/YNET_VAL = NETSUM.
CLEAR: WA_NET-NETSUM.
endloop.
<RESULT_FIELDS>-/BIC/YNET_VAL = netsum.
CLEAR:NETSUM,<RESULT_FIELDS>-/BIC/YNET_VAL.
ENDLOOP.
I have coded above one..let me know what mistake I have done.in the bolded loop I have given INTO instead of Assigning, because I need all records which assigns to WorkArea, but while executing DTP its leading to shortdump.if I replace Assigning statement,its working fine. but zero values in output( I think wrong in logic part)
Let me know the brief coding part if I am wrongly coded. -
Attachments coding - Purchase order
i am trying to find out all the purchase order ( header) which does not have a attachment to it?
Query
select segment1 from apps.po_headers_all pha
where type_lookup_code = 'BLANKET'
AND ORG_ID = 87
AND pha.po_header_id NOT in
( select distinct pk1_value
FROM apps.fnd_attached_documents fad,
apps.fnd_documents fd,
apps.fnd_document_categories_tl fdc,
apps.fnd_document_datatypes fdd,
apps.fnd_documents_tl fdl
where entity_name ='PO_HEAD'
AND fad.document_id = fd.document_id
AND fdc.category_id = fd.category_id
AND fdd.datatype_id = fd.datatype_id
AND fdl.document_id = fd.document_id
AND fdl.LANGUAGE = 'US'
AND fdd.LANGUAGE ='US'
and fdc.language ='US'
But this query is returning the purchase order with attachments. can some one correct this code.?
I have attachements in PDF, XLS etc...Hi,
What I can see from your query is that you have hard coded the entity_name as 'PO_HEAD'.
Some BPAs might have different values for entity_name.
I think it should work if you do not restrict the entity_name field.
Plz. check and let me know if it works.
Thanks,
Ram. -
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 -
Not able to save purchase order
hi
i am a super user i have related the PO with the SO when i am saving the purchase order i am getting the error message " you cannot open rows in document [purchase order-rows-row status][line:0][message 131-194]
Regards
Manishhi the proble is resolved actually i had to disable the coding done in transitional notification and was able to save the purchase order
Regards,
Manish -
Is there anyway to view the purchase order information foreach transaction
hi sap techies
Currently the FAGLB03 does not display the vendor related information for transactions coming through as a goods receipts (transactions processed by receiving dept) and/or related to purchase orders. Is there anyway to view the purchase order information for each transaction? For example, we cannot see vendor code/name, po #, etc.HEllo,
FAGLL03 displays information from the line items of the accounting documents. If the information you want to display exists in tables you can display. But if the information you want comes from other tables you cannot display.
As a workaround you can check the SAP note 1034354 which tells you how to add the offsetting accounting information and then you cna display some of the information you want. To do so you can create your own coding into a BADI implementation.
REgards,
REnan -
Hi All,
I have created a purchase order report in R12,in the test instance the report is running perfectly for all the operating units but when i moved the rdf to the LIVE instance the report is running for only one operating unit(nothing is hard coded in the rdf) and the report says completed normar but after clicking on view output i am getting a msg as the output is not generated for the concurrent request.
After clicking on the view log i am getting an error msg as
Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
American_America.US7ASCII
Enter Password:
REP-0004: Warning: Unable to open user preference file.
Report Builder: Release 10.1.2.2.0 - Production on Tue Aug 19 16:41:18 2008
Help me in fixing this issue.
Thanks in advanceSomu,
chk note:
https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=210795.1 -
Idea/Suggestion for Report on Open Purchase Orders
Note: coding is not necesary
give me an idea /suggestions how to develop a report which lists all open purchase orders not acknowledged for different vendors plz if u give me step by step procedure it will help me in developing
Title edited by: Alvaro Tejada Galindo on Jun 5, 2008 11:23 AMHi kumar,
DEFINITION :A standing/open order is a Purchase order which has been issued to a vendor, against which specified purchases may be made for a specified period of time. When repeated purchases of the same type of supply items are expected, multiple purchase requisitions may be eliminated by submitting one purchase requisition to establish a standing/open order. This request must be accompanied by a justification memorandum. Standing purchase orders are issued for supply type items and services only.
JUSTIFICATION : Request for standing/open orders are approved by the Director of Purchasing, provided they are sufficiently justified. Purchases made by the standing/open order method are often more expensive, and should be considered carefully.
LOGIC: Open purchase orders meanse,the purchase order not realse due to some reasons.
The purchase order table EKPO (or) EKKO.
You find the both tables
fields: LOEKZ = Deletion Indicator.
ELIKZ = Delivery completion.
You checks above fields NOTEQUAl to SPACE
example: LOEKZ NE ' '
ELIKZ NE ' '
above fields equal to space that orders realsed.
example: select * from ekpo
into itab
where ebeln = pametervalue
and loekz ne ' '
and elikz ne ' '.
Above statment excutes dipalys the open purchase orders.
Thaks,
sreddy. -
Report for Open Purchase Orders
how to develop a report which lists all open purchase orders for given period & plant ? plz idoint want coding .. but give me guidlines & suggestions to develop my own plz tell where could i nstart & end for this report help me sdn
Edited by: Alvaro Tejada Galindo on Jun 5, 2008 11:32 AMEither you can use ME2N with selection parameter WE101 & Scope of list BEST
or
Go to SE16
Use Table EKPO
Use Filed name ELIKZ
If you give X list of all the delivery completed items.
If you leave blank list of all Open PO items will display.
Report showing the open Purchase orders
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Jun 5, 2008 11:32 AM -
How to find import and local purchase order for report
Dear Friends,
Please help me in coding this report, =below is the functional requirement.
1. To find the list of Import or Local Purchase Orders(purchase orders to be procured from another country).
2.Once the import purchase order is selected .The report sould display the PO number ,Currency , Value , po Date , Planned recipt date ,
BUy from vendor , ship from vendor , Origin Country, Destination country, and Status of the PO.
I am clear about the PO number Currency ,value and po date but could not get how do i fetch the details like:--Planned recipt date ,
BUy from vendor , ship from vendor , Origin Country, Destination country, and Status .
Your help is greatly appreciated.Hi,
Buy from vendor is the real vendor who is supplying the items while Ship from vendor is the vendor who just arrange for the transport. This should be maintained in the pruchase order, just consult with your MM consultant to get where they are storing those details
Regards
Karthik D -
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. -
Goods Receipts for Purchase Order using BAPI_GOODSMVT_CREAT
Hi experts,
I am working on the a program where am generating Goods Receipts for Purchase Order. the BAPI_GOODSMVT_CREAT returns an error saying "Material 6003022 not maintained in plant 1001"
Can any one assist? is there a field I may be missing?
Here is a sample code.
DATA: gm_header TYPE bapi2017_gm_head_01.
DATA: gm_code TYPE bapi2017_gm_code.
DATA: gm_headret TYPE bapi2017_gm_head_ret.
DATA: gm_item TYPE TABLE OF bapi2017_gm_item_create WITH HEADER LINE.
DATA: gm_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: gm_retmtd TYPE bapi2017_gm_head_ret-mat_doc.
CLEAR: gm_return, gm_retmtd.
REFRESH gm_return.
Setup BAPI header
"data
gm_header-pstng_date = sy-datum.
gm_header-doc_date = sy-datum.
gm_code-gm_code = '02'.
" MB1A * Write 971 movement to table CLEAR GM_ITEM.
MOVE '101' TO gm_item-move_type .
" MOVE 'Q' TO GM_ITEM-SPEC_STOCK.
MOVE '6003022' TO gm_item-material.
MOVE '10' TO gm_item-entry_qnt.
MOVE 'EA' TO gm_item-entry_uom.
MOVE '1001' TO gm_item-plant.
MOVE '' TO gm_item-stge_loc.
MOVE '0901' TO gm_item-move_reas.
" MOVE '4500006877' TO GM_ITEM-WBS_ELEM.
" MOVE '0020' TO GM_ITEM-VAL_WBS_ELEM.
MOVE '0020' TO gm_item-deliv_numb.
MOVE '4500006881' TO gm_item-po_number.
MOVE '0010' TO gm_item-po_item.
APPEND gm_item.
Call goods movement BAPI
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = gm_header
goodsmvt_code = gm_code
IMPORTING
goodsmvt_headret = gm_headret
materialdocument = gm_retmtd
TABLES
goodsmvt_item = gm_item
return = gm_return.
IF NOT gm_retmtd IS INITIAL.
COMMIT WORK AND WAIT.
CALL FUNCTION 'DEQUEUE_ALL'.
ELSE.
COMMIT WORK AND WAIT.
CALL FUNCTION 'DEQUEUE_ALL'.
ENDIF.>
Spark842 wrote:
> Hi experts,
> I am working on the a program where am generating Goods Receipts for Purchase Order. the BAPI_GOODSMVT_CREAT returns an error saying "Material 6003022 not maintained in plant 1001"
> Can any one assist? is there a field I may be missing?
>
> Here is a sample code.
>
> DATA: gm_header TYPE bapi2017_gm_head_01.
> DATA: gm_code TYPE bapi2017_gm_code.
> DATA: gm_headret TYPE bapi2017_gm_head_ret.
> DATA: gm_item TYPE TABLE OF bapi2017_gm_item_create WITH HEADER LINE.
> DATA: gm_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE.
> DATA: gm_retmtd TYPE bapi2017_gm_head_ret-mat_doc.
> CLEAR: gm_return, gm_retmtd.
> REFRESH gm_return.
> * Setup BAPI header
> "data
> gm_header-pstng_date = sy-datum.
> gm_header-doc_date = sy-datum.
> gm_code-gm_code = '02'.
>
>
> " MB1A * Write 971 movement to table CLEAR GM_ITEM.
> MOVE '101' TO gm_item-move_type .
> " MOVE 'Q' TO GM_ITEM-SPEC_STOCK.
> MOVE '6003022' TO gm_item-material.
> MOVE '10' TO gm_item-entry_qnt.
> MOVE 'EA' TO gm_item-entry_uom.
> MOVE '1001' TO gm_item-plant.
> MOVE '' TO gm_item-stge_loc.
> MOVE '0901' TO gm_item-move_reas.
> " MOVE '4500006877' TO GM_ITEM-WBS_ELEM.
> " MOVE '0020' TO GM_ITEM-VAL_WBS_ELEM.
> MOVE '0020' TO gm_item-deliv_numb.
> MOVE '4500006881' TO gm_item-po_number.
> MOVE '0010' TO gm_item-po_item.
> APPEND gm_item.
>
> * Call goods movement BAPI
>
> CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
> EXPORTING
> goodsmvt_header = gm_header
> goodsmvt_code = gm_code
> IMPORTING
> goodsmvt_headret = gm_headret
> materialdocument = gm_retmtd
> TABLES
> goodsmvt_item = gm_item
> return = gm_return.
>
> IF NOT gm_retmtd IS INITIAL.
>
> COMMIT WORK AND WAIT.
> CALL FUNCTION 'DEQUEUE_ALL'.
> ELSE.
> COMMIT WORK AND WAIT.
>
> CALL FUNCTION 'DEQUEUE_ALL'.
> ENDIF.
My guess, is that this material is not really maintained in the Plant '1001', to be on the safer side, get the exact values from EKPO itself, also check if this material exists in the table MARC for the plant and storage location.
MOVE '1001' TO gm_item-plant. "<< Hard coded
MOVE '' TO gm_item-stge_loc.
Replace the above hardcodes to something like this to get the actual value from EKPO.
select werks lgort into (gm_item-plant, gm_item-stge_loc) from ekpo
where ebeln = gm_item-po_number
and ebelp = gm_item-po_item. -
Goods Receipt Against Purchase Order
Hi All,
I am creating a report for goods receipt tracking against purchase order within in date range . If any material documant has been canceld ( 101 to 102 or 103 to 104 ) then it (101 or 103) should not be calculate receipt goods. if 105 is pending for any 103 still 103 qty should be add in receipt goods. Is there any Function module for do that or any other logic. plz tell.
Thanks in Advance.
JitendraHi
Please take a look at the links for sample coding of the function module - BAPI_GOODSMVT_CREATE.
http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
http://www.4ap.de/abap/bapi_goodsmvt_create.php
<b>Reward points</b>
Regards -
Error on Purchase Order - Document number 45* not within defined interval
Hi All,
PLEASE HELP ME or guide me in the right direction.
I am faced with a somewhat unique case in our enviroment. Some background first.
Back in 2000 when we upgraded from Walker to SAP, a number of Purchase orders had to be migrated, one of them is the order i am struggling with. Back then very little validations were built in, resulting in a Local Order being incorrectly created as a International Order but against a local currency.
Now this ordered is still being reflected as open in our system. When attempting to change the order by activating the 'Delivery Complete indicator", we get an error "use only foreign currency" This is due to the fact that validations against Document Type and Currency was created in 2003 and are in full operation now. It is hard coded thus i can not remove this easily.
Now when attempting to get around this by changing the Document Type to a Local Purchase order or trying to delete a line, we get the error below.
"Document number 45* not within defined interval"
Number ranges do come to mind based on the error description, however, Local Orders have a number range of 45, International Orders have a number range of 47. In this case, the order is created as a International Order BUT the number range is 45*, again, due to a lack of validations/incorrect config back in 2000
Do any of you know a possible solution to such a problem.
Regards,
Jody Ponnusami.The validation of document type and currency is not standard, and if this validation cannot be deactivated, then you will have to resort to making changes in debug mode. Put a breakpoint at the relevant check and force it to accept the current combination.
The second option is to update EKPO table manually using SE16N. Set the delivery completed indicator to X. -
FM / BAPI Inbound delivery creation for a Purchase Order without material
Dear All,
I have a requirement to create a Inbound Delivery for a Purchase order without material number. The Purchase Order has only Material text and no material number. Please let me know a BAPI or FM to create inbound delivery in this case where there is no material defined on PO. I require BAPI / FM since I have to make a web-service for the same.
Thanks in advance!
AbhishekHi I did a coding in one of the userexit. If ekpo-matnr is empty then fill
KOMDLGN-UMVKZ = 1
KOMDLGN-UMVKN = 1
KOMDLGN-MEINS = EKPO-MEINS
This parameters i.e. Qty conversion are necessary and since MATNR does not exists it has to be filled.
Maybe you are looking for
-
Printing several document in a single check
My user printing check from tcode fbz5. there have the option for printing one check for one document number. now their requiremnt is they need the option to print several document no of same vendor should print in one check. So, please help me regar
-
Doubt in Benefit Insurance plan enrollment with respect to Validity periods
HI Experts... i have completed all nodes with respect to Insurance benefit plans.When im trying to enroll insurance palns through HRBEN0001,problem is occuring.In the enrollment screen 2 validaty periods are showing the system (02-01-2000 to 07-08-2
-
Trimming a Multicam sequence (not just switching angles)
I've just started using Premiere 5.5 and I'm trying to see if there's a simpler way to achieve what I need with MultiCam editing. Here's my setup: I have 3 clips, shot simultaneously from 3 different angles, each lasting about 20 minutes. I want to c
-
Datum exception (again!)
Hello, I'm still getting the datum exception that someone mentioned a while back: D:\OracleXSU\sample>java samp1 Exception in thread "main" java.lang.NoClassDefFoundError: oracle/sql/datum at oracle.xml.sql.query.OracleXMLQuery.<init><OracleXMLQuery.
-
Using RemoteApp to limit malware threats on clients
Greetings, I have a proposed setup that I would like to get some feedback on possible security implications on. This is the setting: There are two LAN-segments, divided by a firewall. Lan-segment 1 (lets call it LAN1) has a Windows 2012 server domai