Sales document flow
hi sap
hw can i write a logic to relate vbak,likp,mkpf,vttk,vbrk to view document flow for sales order.
in display i need sales order number, delivery document,invoice doc,shipment doc, pgi doc.
pls help in step by step of start of selection.
\[removed by moderator\]
thanx in advance.
Edited by: Jan Stallkamp on Aug 6, 2008 2:26 PM
Hi Sapna,
You can check this code... this will be helpful
Sales life cycle.
REPORT Z_SD_LC_REPS_S NO STANDARD PAGE HEADING
LINE-SIZE 130
LINE-COUNT 26(3).
TABLES :
VBAK,
VBAP,
VBEP,
LIKP,
LIPS,
MARA,
MVKE,
VBRK,
TVLKT.
DATA : BEGIN OF I_SDLC OCCURS 0,
VBELN LIKE VBAK-VBELN,
AUDAT LIKE VBAK-AUDAT,
VGBEL LIKE VBAK-VGBEL,
VGBEL1 LIKE VBAK-VGBEL,
MATNR LIKE VBAP-MATNR,
BMENG LIKE VBEP-BMENG,
NETPR LIKE VBAP-NETPR,
LFDAT LIKE LIKP-LFDAT,
FKDAT LIKE VBRK-FKDAT,
AUART LIKE VBAK-AUART,
END OF I_SDLC.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-TAT.
SELECT-OPTIONS: S_AUDAT FOR VBAK-AUDAT,
S_VKORG FOR VBAK-VKORG,
S_VTWEG FOR VBAK-VTWEG,
S_SPART FOR VBAK-SPART.
SELECTION-SCREEN END OF BLOCK B1.
TOP-OF-PAGE.
WRITE : /20 ' REPORT ON COMPLETE SALES LIFE CYCLE IN A PARTICULAR SALES
AREA ' COLOR COL_HEADING.
ULINE.
WRITE: /5 'VBELN' ,
15 'AUDAT' ,
26 'MATNR' ,
45 'BMENG' ,
64 'NETPR' ,
81 'LFDAT',
92 'FKDAT' ,
103 'AUART' ,
108 'VGBEL',
119 'VGBEL1'.
ULINE.
START-OF-SELECTION.
SELECT A~VBELN
A~AUDAT
A~AUART
A~VGBEL
B~MATNR
B~NETPR
C~BMENG
* D~LFDAT
* E~FKDAT
INTO CORRESPONDING FIELDS OF TABLE I_SDLC FROM
( ( VBAK AS A
INNER JOIN VBAP AS B ON B~VBELN = A~VBELN )
INNER JOIN VBEP AS C ON C~VBELN = A~VBELN AND B~POSNR = C~POSNR )
* INNER JOIN LIKP AS D ON D~VBELN = A~VBELN )
* INNER JOIN VBRK AS E ON E~VBELN = A~VBELN )
WHERE A~VBELN IN S_VBELN AND
A~AUDAT IN S_AUDAT AND
A~VKORG IN S_VKORG AND
A~VTWEG IN S_VTWEG AND
A~SPART IN S_SPART AND
A~AUART = 'ZZOR'.
LOOP AT I_SDLC.
SELECT LFDAT INTO CORRESPONDING FIELDS OF I_SDLC
FROM LIKP WHERE VBELN = I_SDLC-VBELN.
SELECT FKDAT INTO CORRESPONDING FIELDS OF I_SDLC
FROM VBRK WHERE VBELN = I_SDLC-VBELN.
MODIFY I_SDLC INDEX SY-TABIX.
ENDSELECT.
ENDSELECT.
SELECT VGBEL INTO I_SDLC-VGBEL1 FROM VBAK
WHERE VBELN = I_SDLC-VGBEL.
"AND AUART = 'QT'.
MODIFY I_SDLC INDEX SY-TABIX.
ENDSELECT.
ENDLOOP.
END-OF-SELECTION.
LOOP AT I_SDLC.
AT NEW VBELN.
WRITE : /5 I_SDLC-VBELN.
ENDAT.
WRITE :/15 I_SDLC-AUDAT ,
26 I_SDLC-MATNR ,
45 I_SDLC-BMENG LEFT-JUSTIFIED,
64 I_SDLC-NETPR LEFT-JUSTIFIED,
81 I_SDLC-LFDAT ,
92 I_SDLC-FKDAT ,
103 I_SDLC-AUART,
108 I_SDLC-VGBEL,
119 I_SDLC-VGBEL1.
ENDLOOP.
END-OF-PAGE.
WRITE: /75 'PAGE:', SY-PAGNO.
regards
padma
Similar Messages
-
Hi Guys,
We have a process where we proccure few parts externally. When a sales order is created in our system based on the item category config we are able to create a purchase requition automatically. This Preq is further used to create a PO based on which the purchasing group proccures the part from the vendor.
We are trying to identify if there is a way to find out a way if we can relate the PO number created in the sales document flow? Currently we are not able to view the PO number in the sales document flow. We are trying to identify if this is possible and if yes what needs to ne configuered to enable PO number linking in sales document flow?
Any pointers?
Cheers
VJHi Bikash,
The PO field which u r referring to on the VA01 screen is the PO number against which a SO is created. This PO number is the customers PO number. My requirement is i need to store the Intercompany PO number which is the PO number created to procure the part externally from the vendor. So its the vendor PO number and not the customer PO number.
Secondly if i try to misuse any other field to store this PO number it dosent make sense as it would not show up in the document flow screen so it would be of no use to us. We want to enable it the std way and i am sure SAP has provided some way to do it.
I check the OSS notes and found some interesting tips working on that hopefully should be able to resolve it.
Cheers
VJ -
Sales document flow(vbfa) entries are deleted
Hi Guys,
I am facing a problem with VBFA table. Actually for some delivery i am able to get Sales order number from VBFA table but for some delivery there is no records exists in VBFA table. So just want to know is there any program or Funtion module which delete entries from VBFA table if not then is there any functional configuration which not allowed to enter data in VBFA table. In my system i searched for all the programs and function module but no luck.
I can saw the Sales document flow in VL03N but no entries in VBFA table.
thanks,
BaidyaHi Guys,
Thanks for the replies.
But this is true for some delivery there is no entries in VBFA table but entries are exist in LIKP and LIPS. We are using userexit in sales order program for creating delivery. The Function module which creates delivery inside the USER-EXIT is : BAPI_OUTB_DELIVERY_CREATE_SLS.
If anyone face this type of problem please reply..
Thanks,
Baidya -
Sales document flow table VBFA
Hi All,
What exactly the meaning of sales document flow how the data in table VBFA is filled I mean from which Tcodes this table data will be filled?
I am calculating the open quantity of a particular sales document which the data (quantity delivered vbfa-rfmng ) I have to take from table VBFA and subtract this from the order quantity(vbap-kwmeng).
Thanks&Regards
MaheshUse SE16 see the fields of VBFA.
Normally the sales document flow is SALES ORDER -> DELIVERY-> INVOICE.
For a particular case it can be
SO -> Del -> PGI -> Inv -> SO (Return) -> PGR -> Inv (RE-Type) and so on.
If we know the document no of any one of them thru VBFA we can get the precceding and the following document.
Thanks,
Ashish -
Sales Document Flow - Ref. Value not showing correct currency
I have a question about document flow currency in ECC6.0. We recented upgraded to ECC6.0 from 4.7 and noticed the changes to document flow. We are a US based company with sales offices in Europe. Our European offices are finding that that document flow in ECC6.0 shows in base currency of USD. Even thought the sales order was entered in EUR euros. Is this intended to be this way; since it is causing our offices in Europe some confusion? I searched forums an SAP notes and did not find any references. Has anyone see this in ECC6.0
Example Document Flow: Line Level (I do not see Ref Value at header level)
Note Sales Document was entered in EUR euros.
Document Quantity Unit Ref. Value Currency
Standard Order 0025082768 / 10 12 EA 5,207.54 USD
...Delivery 0080211725 / 10 12 EA
.....Picking request 20100423 / 10 12 EA
.....Handling unit 0001221687 / 1 12 EA
.....GD goods issue:delvy 4901261948 / 1 12 EA 1,690.08 GBP
...Invoice 0092006736 / 10 12 EA 5,207.55 USD
Accounting document 0092006736 12 EA
If I highlight top line in document flow, I see the following in lower part of screen. This is the currency entered on the sales order.
0025082768 10 12 EA 3,847.80 EURSmile,
Thanks for pointing those configuration points out. I checked my system and found the following. I do not see any change documents for the configuration points, so they have been set this way since our implemenation in 2005.
XD02 is customer master change, the customer on my order is set to EUR in sales in distribution tabs.
OX02 - Company Code
1000 Middleton USD...ok
2000 London GBP ok
2100 Munich EUR...ok
2210 Amsterdam EUR...ok
4000 Hong Kong USD...ok
I think OVX5 is not set correctly, should be same as OX02. If I change them, do I need to run an update in the system for old data? Or is it as simple as changing the value here? I'm hesitant to change this not knowing how this will affect the system. Do you know?
OVX5 - Sales Org
1000 Middleton USD...ok
2000 London USD should be GBP
2100 Munich USD should be EUR
2210 Amsterdam USD...should be EUR
4000 Hong Kong USD...ok
Thanks,
Tony Romain -
A FM for the Sales Document Flow ...?
Hi Friends;
I know that the Sales and Distribution Flow is kept in table VBFA .? But is there a ready function module that gives me the shipment note number and invoice number taking reversals into consideration and giving the actual and final flow of sales order item ?
for example : input SALES Document : SD001 item 10
output shipment Notice : 8000001 item 10
output invoice number : 9000001 item 10
Kind regards.
Erkan VAROL.Hi,
look for example to BAPI_SALESORDER_GETLIST
CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
Please check table VBFA. It contains all the information about document flow in SD.
Check the example program below, it is not a function call, it is a dialog call.
(Or)
report zrich_0001.
data: xvbco6 type vbco6.
data: xvbak type vbak.
parameters: p_vbeln type vbak-vbeln.
clear xvbco6. clear xvbak.
select single * from vbak into xvbak
where vbeln = p_vbeln.
move-corresponding xvbak to xvbco6.
call dialog 'RV_DOCUMENT_FLOW'
exporting
vbco6 from xvbco6
ivkorg from xvbak-vkorg
ivtweg from xvbak-vtweg.
Regards -
Restrict sales document flow on va03/vl02n/and any sd tcodes
hi experts,
Is there a way to disable or restrict the document flow button found on SD transactions such as va03 and vf03? We would provide a separate report for the docflow, a custom one.
Thank you in advance!Used exit for document flow LV05CFZZ
-
Standard programme for sales document flow
hi
Can any one tell me what is the standard report for complete slaes document flow
Thanks
AlkaHi,
There is a standard FM:
CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
EXPORTING
COMWA = comwa
TABLES
VBFA_TAB = VBFA_TAB
EXCEPTIONS
NO_VBFA = 1
NO_VBUK_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Get PGI Document
clear w_pgi_document.
loop at vbfa_tab where vbtyp_n = 'R'.
w_pgi_document = vbfa_tab-vbeln.
Endloop.
* Get INV Document
clear w_inv_document.
loop at vbfa_tab where vbtyp_n = 'M'.
w_inv_document = vbfa_tab-vbeln.
Endloop.
* Get a/c Document
clear w_ac_document.
loop at vbfa_tab where vbtyp_n = '+'.
w_ac_document = vbfa_tab-vbeln.
Endloop.
I hope this helps,
Regards
Raju Chitale
Edited by: Matt on Dec 12, 2008 8:35 AM - Please use tags around your code. See how much better it looks! -
How to retrieve delivered quantity in MSA sales document flow.
Hi gurus,
we're trying to retrieve the R/3 delivered quantity (for a sales order item) from the BDoc segment SALESDOCFLOW_OBJECT during the download to MSA.
The point is that we have in that segment different rows with document type R, but only some of these are the relevant.
In other words we want to read the delivered quantity information in MSA.
Do you have any suggestion?
Thanks in advance and best regards,
Fabriziosolved on my own.
-
Archiving Objects for sales docuements in document flow
i want to be able to from the sales document flow ,i.e sales order, billling document be able to find the arciving objects? were do i need to look to find the archving objects?
cheersHi,
Try with report S3VBAKAU. You can check it in tcode AOBJ for object SD_VBAK.
Regards,
Eduardo -
Need no document flow update for sales order create with reference
Dear All.
We would like to have the ability to create a sales order with reference to another sales order, and have the document flow of the sales order not updated.
Unlike the case of a standard create with reference where the documents are linked, in this case there is no relationship between the documents. The first document is just acting like a template for the remaining documents, to save time during order entry.
We have turned off update of document flow at the line item level.
But I don't see a way for us to turn this off at the header (document level). So wondering if there's another way to turn this off, or possibly through user-exit or VOFM requirement?
Has anyone else done this?
I think that CRM has this functionality, but we're still entering orders through ERP-SD.
Many Thanks!Hello Colleague;
The issue you have reported is SAP standard. The checkbox "Update Document Flow" (V_TVCPAAP-UPFLU) controls document flow at item level. If this checkbox is set to blank, there will be no document flow at item level.
However, the document flow cannot be completely turned off - if the 'update document flow' indicator is blank, you will still see an entry in the document flow, but there will be no update to table VBFA (Sales Document Flow) and the document flow of the predecessor will not be updated at item level (no record in VBFA at item level).
The reason is that the system checks VBAP (Sales Document: Item Data) for fields VGBEL (Document number of the reference document) and VGPOS (Item number of the reference item) for values. You will always have document flow information on header and item level in the successor because it stores this information in table VBAP.
Related with this issue, you can find a Note 53383 for your review.
I hope it can clarify the case.
Regards
Ruy Castro -
"Document Flow cannot be updated" warning msg in GR for STO
Hi All,
I get a warning when I try to do GR for a STO (Oub Deliver created for this STO and PGI done...and stock is in Stock in Transit).
What does this warning mean?
Thanks in advance!
Edited by: Duke Dukester on Oct 9, 2008 2:44 AMHi,
I think you are trying Goods Receipt in receiving plant w.r.t. Stock Transport Order instead of Outbound Delivery.
As per SAP recommendation, GR in receiving plant should be done w.r.t. Outbound delivery not STPO so that it will update Sales Document Flow also along with PO History.
In MIGO, try Goods Receipt --> Outbound Delivery instead of Purchase Order and then check. -
Link between Purchase Orders - Sales Documents
Hi all,
How can I find the link between a Purchase Order and a Delivery? I searched in table VBFA (Sales Document Flow) but I can't find anything. When I look into this table I only can see WMS Transfers Order and Shipment numbers. Does anybody have a clue where I can find the link?
Thx in advance!
CarlHi
in <b>EKKN</b> table you have sales order and Item fields (VBELN and POSNR)
using these fields search for the deliveries in LIPS table
EKKN-VBELN = LIPS-VGBEL and
EKKN-POSNR = LIPS-VGPOS
<b>Reward points for useful Answers</b>
Regards
Anji -
Excise document number update in Document flow.
Is there any configuration for update the excise document in Sales order document flow.
Ex : Like. - > SO-> Delivery-> Billing -> Excise invoice no
Ramesh BHi Ramesh & Nikhil,
At present There is no provision to update excise invoice number in Sales document flow.
There are no appends defined for table VBFA . With the help of Abap developer u can try for an append structure.
But in that case development will include changes in excise invoice program, to update the table.
Do the anaylsis carefully before any development.
There is one alternative available , u can develop a sales register which will contain both excise and commercial invoice along with sales order number.Generate lay out for suitable search.
Regards
Mandar
Edited by: Mandar Deshpande on Sep 21, 2009 9:16 AM -
Updating Sales document with new sub sequent sales document
Hello All,
I am creating one sales contract from one sales document through some user exits and batch jobs.
After creating this new sales contract i want to update this doc number in Old Referenced sales document flow.
Is there any standard function module for this.. i tried some function modules containing FLOW..But no use..
Thanks&Regards,
Krishna.It is resolved..
as I am using FM SD_SALESDOCUMENT_CREATE to create this contract i just updated the Reference document number in header structure...
Maybe you are looking for
-
Hi, SAP PI 7.10 SP7. Since we have applied SP7 we have the following error on the Central Adapter Engine in the RWB. "HTTP request failed. Error code: "500". Error message: "Internal Server Error [http://host Name:port/AdapterFramework/rtc]" " Howeve
-
Hi, - Company Code Currency and GL currency is INR - for EBS (auto BRS) we created 3 GL account for each bank a/c (Main account, Incoming A/c and Outgoing A/c). all maintained in INR. - posted an entry in above outfoing GL account - 1000 USD @ 49.6
-
Importing Excel or CSV fields into PDF
Is it possible to import fields from excel files or CSV files? I would like to have the answers and questions from my old PDF forms re-created with the new PDF 11 forms. Please help.
-
Is it possible to have a navigation menu to switch between different portals(dashboards) to have different iviews appearing for different departments in a company? The dashboard has different departments, so for example, the director would need to sw
-
Problem with 10.7.2 update!
HELP! My MacBook Pro is not starting anymore since i tried to update to 10.7.2!! It is just starting until this "update bar" appears but after maybe 20% it shuts down! I tried it many times, help!