ISA 50 - B2C Open orders search, extending generic-searchbackend-config.xml
Hello Experts,
I have several B2C sites and webshops, and B2C self-created accounts are common to all sites. The problem is that all open orders and completed orders (from all sites) appear in the open orders / completed orders in My Account. I'd like to separate the display of orders for each site.
Each of my site corresponds to a sales organisation in CRM / R3. In the GenericSearchDynamicContent class, which is used in the standard generic-searchbackend-config.xml to generate dynamic values in filters, I found a method addSalesOrg(). I tried to add this in the customer/generic-searchbackend-config.xml :
<configs isa:extends="../configs[@id='crmdefault']">
<config id="javabasket_javatemplate_forCRM">
<property-group name="SearchCriteria_B2C_Sales">
<property name="SALES_ORG"
entityType="CL_CRM_REPORT_SET_ORGMAN"
tokenType="RAN"
type="dark">
<allowedValue content="dynamic"
contentCreateClass="com.sap.isa.isacore.GenericSearchDynamicContent"
contentCreateMethod="addSalesOrg" />
</property>
</property-group>
</config>
</configs>
But it doesn't work, all orders are displayed. If I don't set the entityType and RAN, ABAP returns an error and doesn't take in account the property SALES_ORG, but I don't know if these are the good values (I found these values by debbuging abap ...)
I haven't found any documentation on the parameters I could add and the corresponding types etc., the Dev and Ext guide (and tuts) shows an example on how to add a search parameter in the selection screen and add a column in the result screen, but no detailed list of fields we could add...
Please let me know if you have a solution to add sales organisation to the search parameters, and links to documentation.
Thank you by advance
Julien
Hello and thank you for your answer
I finally found the solution by myself :
in crmtcweb~appbase/WEB-INF/xcm/customer/modification/generic-searchbackend-config.xml :
<configs isa:extends="../configs[@id='crmdefault']">
<config id="javabasket_javatemplate_forCRM">
<property-group name="SearchCriteria_B2C_Sales">
<property name="SALES_ORG"
entityType="CL_CRM_REPORT_SET_ORGMAN"
tokenType="RAN"
type="dark">
<allowedValue content="dynamic"
contentCreateClass="com.sap.isa.isacore.Z_GenericSearchDynamicContent"
contentCreateMethod="addSalesOrg" />
</property>
</property-group>
</config>
</configs>
in Z_GenericSearchDynamicContent :
public void addSalesOrg() {
selOpt.addSelectOptionLine(
new GenericSearchSelectOptionLine(
handle,
pty.getName(),
pty.getEntityType(),
pty.getTokenType(),
"I",
"EQ",
bom.getShop().getSalesOrganisation(),
And it works Now only the orders with the same salesOrg as the webshop are displayed.
Hope this could help somewone else.
Julien
Similar Messages
-
Which generic-searchbackend-config.xml file to be used..?
Hi,
I need to make some changes to generic-searchbackend-config.xml.
There are 2 generic-searchbackend-config.xml files available.
1. sap.com\crm\isa\web\b2b\_comp\*webContent*\WEB-INF\xcm\sap\modification\generic-searchbackend-config.xml
2. sap.com\crm\isa\web\b2b\_comp\WEB-INF\xcm\sap\modification\generic-searchbackend-config.xml
I already made some changes in File No 1 and they were reflecting perfectly.
My Basis team restarted the server today and I noticed that none of these changes I made in file no 1 are working now.
Later I tried making some changes to file NO 2 and surprisingly they are reflecting.
My question(s):
1.which is the correct file to be used?
2.what is the diff between the two
3.why are my changes in file 1 not reflecting now even though code changes are present?
Thanks,
PatActually neither of them.
You need to have a "customer" version of the XML which contains the changes you do specific to your application. The path of this file would be something like
crmtcwebappbasesap.com/src/packages/WEB-INF/xcm/customer/modification/generic-searchbackend-config.xml
Inside that one, you include the standard like this:
<xi:include href="$/modification/generic-searchbackend-config.xml#xpointer(backendobject/*)"/>
Then you put in your changes like the example below:
<configs isa:extends="../configs[@id='crmdefault']">
<config id="javabasket_javatemplate_forCRM">
<property-group name="salesdoc_resultlist_B2C">
<property name="STATUS"
columnTitle="b2c.orderlist.order.status"
cssClassName="showfiguresright"/>
<property name="STATUS_SYSTEM"
columnTitle="b2c.orderlist.order.status_system"
cssClassName="showfiguresright"/>
<property name="PROCESS_TYPE" type="hidden"/>
</property-group>
</config>
</configs>
Pradeep -
Call custom generic-searchbackend-config.xml by a specified scenario
Hi Everyone,
this is a continue of Re: limit options for Search For dropdown list on Transaction tab:
I need to add a specified scenario condition for limiting Search For dropdown list. Can anyone advise me how to?
Thanks, JinHi Jin,
To choose generic-searchbackend-config.xml Base on your XCM scenario is difficult to implement. But there is a easy way you can select which value should come in drop down box of Document Type base on your scenario.
Do as follow.
Import UsersessionData and ConfigContainer in genericsearch.jsp file.
<%@ page import="com.sap.isa.core.xcm.*" %>
<%@ page import="com.sap.isa.core.UserSessionData" %>
Now get current scenario name by adding Java Code.
UserSessionData userData = UserSessionData.getUserSessionData(request.getSession());
ConfigContainer configcontainer = (ConfigContainer)(userData.getCurrentConfigContainer());
String sName = configcontainer.getScenarioName();
Now suppose in generic-searchbackend-config.xml file your Search option SearchCriteria_B2B_Sales has below allowed value in Drop Down box.
<allowedValue value="ORDER" description="b2b.status.shuffler.key1val2" resultlistName="order_resultlist_B2B" default="true"/>
<!-- allowedValue value="BACKORDER" description="gs.attr.doc.type.backorder" resultlistName="order_resultlist_B2B" maxHitsToSelect="0"/ -->
<allowedValue value="QUOTATION" description="b2b.status.shuffler.key1val1" resultlistName="quot_resultlist_B2B"/>
<allowedValue value="ORDERTMP" description="b2b.status.shuffler.key1val3" resultlistName="ordertmp_resultlist_B2B"/>
<allowedValue value="CONTRACT" description="b2b.status.shuffler.key1val4" resultlistName="contract_resultlist_B2B"/>
<allowedValue value="INVOICE" description="b2b.status.shuffler.key1val5" />
<allowedValue value="CREDITMEMO" description="b2b.status.shuffler.key1val6" />
<allowedValue value="DOWNPAYMENT" description="b2b.status.shuffler.key1val7" />
<allowedValue value="AUCTION" description="b2b.status.shuffler.key1val9" maxHitsToSelect="0"/>
</property>
Now suppose you have 2 XCM scenario CUSTOMER and SALES.
For CUSTOMER xcm scenario you want to display only ORDER and INVOICE and for SALES xcm scenario you want to display INVOICE then add below line to your code in genericsearch.jsp
Find below line under <form name="GENERICSEARCH" id="gensearch" action="dummy" > You can find these line between line#495 to line#505
<td class="label"><%= ui.writeSearchElementLabel("left", screlm)%></td>
<td class="input"><%= ui.writeSearchElementLabel("top", screlm)%> -
Create New Property Group in generic-searchbackend-config.xml
Hi all,
My requirement is to add a new property group.
I have added the below code(bold):
<property-group>SearchCriteria_B2B_Sales</property-group>
<property-group>SearchCriteria_B2B_Custom</property-group>
And I have also made the entry..
<property-group name="SearchCriteria_B2B_Delivery"
useSearchRequestMemory="true"
bodyInclTop="/b2b/order/GScommon_header.inc.jsp".......
My question is where do I define the mapping for the property group name and property group..?
Thanks,
Pat
Edited by: Patravi on Feb 13, 2012 6:05 PMHi Patracvi,
I think the mapping is there in generic-searchbackend-config.xml.
Basically, SAP has different architechture for standard and custom search criteria or property group.
If any customer wants to extend or create search criteria, they usually do in crm~isaweb~b2b ->WEBINF -> XCM -> Customer
While the standard definition is provided in crm~isaweb~b2b ->WEBINF -> XCM -> SAP
So, if you are looking for mapping of any search criteria which are not extended or custom one, it will in SAP folder.
Hope this will help you to understand what you are looking for.
regards
Prashil -
Purchase order replication – extended classic scenario using XML proxy via PI
Hi Experts
Question:
In case of extended classic deployment is it possible to use XML proxy to
transfer SRM purchase orders to ECC? As we know as of SRM 7.01 its via RFC
whether SRM 7.02 onwards does SAP support XML for ECS too?
Has
anyone read about this in any of the SAP forums?
Background: In our project, client have invested
heavily on XI and XI monitoring and troubleshooting, integrated to SAP SOLMAN.
And would like to opt for XML mode of transfer and reuse existing solution.
This is the main reason we would like to be very clear in our understanding
before we go back to client.
We appreciate your time and support.
Regards
PrashanthDear Rahul,
Thanks for you input
Let me give you an example of the behaviour:
in PPOMA_BBP TOG assigned to user has : DQ with $1000 and upper percentage 5%.
User orders a PO with quantity=1000, price $100;
No additional tolerances assigned in the PO itself
User tries to enter confirmation with quantity 1001 (so qty variance converted to currency amount results in $100 over delivery) So the confirmation is under both the 5% and the $1000 limit.
In that case I donu2019t receive an error message from the SRM, but the error message u201CBackend Purchase Order quantity exceeded by 1 EAu201D from ECC still prevents me from posting the Confirmation. And this is the problem I havenu2019t been able to solve so far.
So I want the TOG tolerance to be used. And I am also happy with the absolute limit always having priority over percentage limit...
But I am trying to find a way to get rid of the back end message (with assigning a tolerance to the PO itself as the will get rid of the absolute limit see my previous post.)
Cheers
Ulrike -
Hi there
In B2B senario when searching for orders I have added this property filtering out only orders of the type "ZOR"
Modifying generic-searchbackend-config.xml:
<property name="DOCUMENT_TYPE"
type="dark"
tokenType="RAN">
<depending propertyName="document_types" value="ORDER" />
<allowedValue content="dynamic"
contentCreateClass="com.rockwool.backend.r3.z_GenericSearchDynamicContent"
contentCreateMethod="addOrderType" />
</property>
</property-group>
and extendidng the class GenericSearchDynamicContent with this:
public class z_GenericSearchDynamicContent
extends GenericSearchDynamicContent {
Add Order Type
public void addOrderType() {
String OrdTy = bom.getShop().getProcessType(); // SHop definition = "ZOR"
selOpt.addSelectOptionLine(
new GenericSearchSelectOptionLine(
handle,
pty.getName(),
OrdTy,
And it works perfekt - when searching for orders.
My problem is now:
When customers choose to search for contracts instead none are found because contracts are searched for with same filter!
What or where am I doing wrong?
PS: above is roughly like the example in the extension guide but somewhere I'm doing something wrong =(
Best regards
Lars Henrik AndersenHi Prashil
Cant find any of the classes.
(We are running ERP and not CRM.
But if I have a look at the log from the ISA it says that this fm is called.ERP_ISA_GEN_DOCUMENT_SEL
The FM isa also called correct and I dont think it is here the bug is.
I'm more suspecious about the XML file where I'm am making the Depending:
<depending propertyName="document_types" value="ORDER" />
Fore som reason this depending properti is ignored because the GenericSearchDynamicContent is called under also when searching for "CONTRACT"
I'm more conserned about the syntax in the XML - is this correct?
Or maybe have I added the the whole property at the wrong place - but in that case, it shouldent work at all, I think.
best regards
Lars Henrik Andersen -
Hi,
I am new to flex. I am trying to use the xmp sdk to create custom file info panels in photoshop.
I am going through the example show in the adobe documentation 'Building a panel with Flex SDK'
I got any running and I got all the files setup in the proper folders but I cannot for the life of me figure out why I keep getting this error.
Buildfile: /Volumes/three/2011/XMP/test project/build.xml
clean:
buildPanel:
[echo] --> Panel 'Test2'
[compc] Adobe Compc (Flex Component Compiler)
[compc] Version 4.5.1 build 21328
[compc] Copyright (c) 2004-2011 Adobe Systems, Inc. All rights reserved.
[compc] command line: Error: unable to open '/Applications/flex_sdk_4.5\frameworks\flex-config.xml'
[compc] Use 'compc -help' for information about using the command line.
BUILD FAILED
/Volumes/three/2011/XMP/test project/build.xml:20: compc task failed
Total time: 616 milliseconds
thanks,
digitalkylecan you tell us where your services-config.xml file is
located. can you make sure it is right under the "src" folder of
the Flex Builder project.
Hope this helps. -
ISA, Sales Order Search, Search by extra fields
In the standard ISA, customer can search based on Reference Number, Transaction Number, and Purchase Order Number. The options exist in a drop down menu. I want to add extra fields in the menu and search with new criteria. How do we add functionality to search for other criteria?
What is the best procedure to modify the Internet Sales Application?
Thanks,
Sunil
Message was edited by: sunil kumarPlease refer to SAP Note 685545. An example is explained there how to search for an extra field.
There are three areas where you have to customize.
-Changes to the UI -> JSP
-Extend the standard Java order search class
-Create a Z_BAPI to search using the new parameter.
Peter -
Wanted R/3 ISA B2C with example.
Hello All,
I am new in this field and would like to have document about creating Step by step an ISA project with NWDS for B2C scenario and B2B scenario NOT on CRM but on R/3 edition.
Please send it to me on my email address [email protected]
I really appreciate any one help in this matter and also pl. tell me if there are other helpful site on which I can read about how to start programming in r/3 ISA B2C with example.
Thanks in Advance.
RajeshHi Rajesh
I'm working with Rapidigm-Fujitsu Consulting Co. in pune..
Now I've successfully deployed and configured the ISA..
I've also created the users in the CRM and assign
respective roles to them ..
Below is the procedure to deploying and configuring
the CRM ISA B2B Application :
Before starting I assume that you have following
compoonents with you.
1.) SAP J2EE Engine 6.2
2.) ISA WAC SP03
3.) MSSQL SERVER 2000 (Optional, If u need to use
JavaBasket in ur application)
Procedure :
1.) Extract ISAWACSP03.sar file using command sapcar.exe
2.) You will get following archive files :
a.) Novell_LDAP.sda
b.) SAPPortalsUMRefrence.sda
c.) useradmin.ear
d.) webcatadmin.ear
e.) shopadmin.ear
f.) b2b.ear
g.) b2c.ear
h.) and many other files..
3.) Also download the latest JBasis Library from service.sap.com..
4.)Open the SDM tool integrated with SAP J2EE ..
5.)Deploy the JBasis_<LatestVersion>.sda using SDM.
6.)Deploy Novell_LDAP.sda using SDM
7.)Deploy SAPPortalsUMReference.sda using SDM
8.)Deploy Useradmin.ear using SDM .
Note before deploying the useradmin you have to specify the path of the xcm, always take it in the another directory eg. : C:\usr\sap\rp0945\java\xcm\useradmin
also give the other parameters before deploying the application
9.) Follow the above procedure for shopadmin.ear and webcatadmin.ear and deploy the application.
the xcm path
->for shopadmin: C:\usr\sap\rp0945\java\xcm\shopadmin
->for webcatadmin: C:\usr\sap\rp0945\java\xcm\webcatadmin
10.) To deploy the b2b.ear I'll suggest you to first build
the application using BuildTool(For more info on
Buildtool see the sapnotes on service.sap.com)
11.) After building deploy the application (b2b_<NameGiven>.ear eg. b2b_client.ear ) in the
"project_ear" folder of your buildtool directory.
Note: Before deploying b2b application you have to
provide certain paramters (like xcm path etc.) in the
lower left frame of the SDM window.
If the parameter option are denoted with red icon then there are certain parameters left for deployment..
The parameter icon should be green to successfully deploying the application ...
12.) Now test the application by opening the url
http://localhost:50000/b2b_client/b2b/init.do
13.) You will get the b2b index page on your Web Browser.
14.) Till now we have completed the deployment procedure of B2B, Now some configuration part is left to
successfully running the application ...
CONFIGURING THE ISA ..
There are 2 types of configuration involved in the ISA :
1.) At the CRM Server level
2.) At the Application level
1.) CRM Server level Configuration :
This configuration includes the creation of Users
and assigning the roles to the Users..
We have to create 2 type of users :
a.) Service User (RFC Enabled users)
b.) Dialouge User
a.) Service User :
1.) Open the transaction SU01 and give the username="WEBCONNECT"
2.) Assign the type of user = "Service"
Maintain a valid email address
3.) In the roles tab, add a user role = "SAP_CRM_ISA_ITS"
Give the alias name of the user : "WEBCONNECT"
4.) Click on "SAVE"
5.) Create another user namely "WEBCONNECT1" and assign
the same role to it.
Maintain a valid email address and give the alias
name : "WEBCONNECT1"
6.) Click on "SAVE"
b.) Dialog User
1.) Open transaction SU01
2.) Create another user namely "WEBADMIN"
3.) Maintain the email address for this user
4.) Assign the following roles to it :
-> SAP_CRM_INTERNET_CUSTOMER
-> SAP_CRM_ISA_UA_SUPERUSER
-> SAP_CRM_ISA_WEBSHOP_MANAGER
5.) Click on "Save"
6.) Close the CRM Gui client and login with this user
(WEBADMIN) and then change the password.
2.) Application Level configuration using XCM
a.) open url :
http://localhost:50000/useradmin/admin/xcm/init.do
Login with Username : Administrator
Password : <blank>
b.) Now in the Menu Components->Customers->jco
create ur own jco configuration for eg: I've created
with configuration name "jco_myconfig"
c.) Provide the Following Parameters
Base Configuration : SERVER_CONNECT
ashost : crmserver.company.com
client : 100
lang : en
maxcon : 100
passwd : <your WEBCONNECT password>
sysnr : 00
user : WEBCONNECT
d.) save the configuration and click on "run test"
e.) If you get the green screen then
"connection succeeded" else you will get a Red
Screen if the connection failed.
f.) Now in the Menu
Start->ApplicationConfiguration->Customer
Create your own configuration and assign ur jco
configuration to it ("jco_myconfig" in my case)
g.) Follow the same procedure for shopadmin,
webcatadmin .
h.) You can follow the above procedure for b2b but
with diffrent username and password (In my case
"WEBCONNECT1" )
RESTART THE J2EE ENGINE...
i.) open the url :
http://localhost:50000/useradmin/useradmin/init.do
provide the login Username : WEBADMIN
Password : <whatever u have provided>
j.) Create a user using this web application and
assign the roles according to it .(Remember now
you are creating a B2B User,so assign the roles
as needed).
k.) Save that user and open url :
http://localhost:50000/b2b_client/b2b/init.do
l.) Thats all ...
You can now run your b2b scenario application
online and can create online Sales Order and much more
I hope you will find this tutorial helpfull...
For any further queries mail me at
[email protected]
Cheers !!
Thanks & Regards
Sandeep -
How to get the open order quantity for a material
Hi All,
We need to get the open order quantity for materials. At present we are using the following logic...
SELECT VBAKVBELN VBAPPOSNR VBAP~KWMENG
INTO TABLE IT_VBAP
FROM VBAP
INNER JOIN VBAK ON VBAKVBELN = VBAPVBELN
INNER JOIN VAPMA ON VAPMAVBELN = VBAPVBELN
AND VAPMAPOSNR = VBAPPOSNR
INNER JOIN VBUP ON VBUPVBELN = VBAPVBELN
AND VBUPPOSNR = VBAPPOSNR
WHERE VAPMA~MATNR = IT_OUTPUT-MATNR
AND VAPMA~WERKS = IT_OUTPUT-WERKS
AND VBAK~AUART IN S_AUART
AND VBUP~GBSTA NE 'C'.
But the Query takes quite a long time as it does a full range scan on all the tables. Is there any way the query can be improved, may be by creating an index etc? Or is there anyother way by which i can get the required data?
Any input is appreciated.
Regards
Brain.This could help.
*& Report: zsdvr055 date written: 03/24/00 *
*& Author: Brian Huntley last update: 03/24/00 *
*& Program Title: Open Order Report *
*& Description: This report will create a list of sales documents *
*& that are open (contain at least one item that is not shipped). *
*& The report will sort by ship-to customer name and by sales *
*& document number. *
*& Tables: *
*& Files: *
*& Transactions: *
*& Changes: *
REPORT ZSDVR055 LINE-SIZE 255.
TABLES: VBPA,
VBAP,
VBUP,
VBAK,
VBKD,
KNA1,
VBEP,
VBFA,
LIKP,
LIPS,
EKET,
T171T.
define hashed table for selected ship-to and sold-to SO's
TYPES: BEGIN OF TVBPA_TYPE,
VBELN LIKE VBPA-VBELN, "sales document
POSNR LIKE VBPA-POSNR, "item number
PARVW LIKE VBPA-PARVW, "partner function
KUNNR LIKE VBPA-KUNNR, "customer number
END OF TVBPA_TYPE.
DATA: TVBPA TYPE HASHED TABLE OF TVBPA_TYPE
WITH UNIQUE KEY VBELN POSNR PARVW WITH HEADER LINE.
define internal table for all selected SO's
DATA: BEGIN OF ITAB0 OCCURS 0,
VBELN LIKE VBPA-VBELN, "sales document
END OF ITAB0.
define internal table for all selected SO items
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAP-VBELN, "document number
POSNR LIKE VBAP-POSNR, "item number
MATNR LIKE VBAP-MATNR, "material
ARKTX LIKE VBAP-ARKTX, "description
PSTYV LIKE VBAP-PSTYV, "item category
KDMAT LIKE VBAP-KDMAT, "customer material
NETWR LIKE VBAP-NETWR, "net value
WAERK LIKE VBAP-WAERK, "currency
KWMENG LIKE VBAP-KWMENG, "quantity
ERDAT LIKE VBAP-ERDAT, "entry date
NETPR LIKE VBAP-NETPR, "net price
KPEIN LIKE VBAP-KPEIN, "pricing unit
PRCTR LIKE VBAP-PRCTR, "profit center
ERNAM LIKE VBAK-ERNAM, "entered by
AUART LIKE VBAK-AUART, "order type
VKORG LIKE VBAK-VKORG, "sales organization
VTWEG LIKE VBAK-VTWEG, "distribution channel
VDATU LIKE VBAK-VDATU, "requested date (header)
BNAME LIKE VBAK-BNAME, "name of orderer
KUNNR LIKE VBAK-KUNNR, "sold-to customer
BZIRK LIKE VBKD-BZIRK, "sales district
KURSK LIKE VBKD-KURSK, "conversion rate
BSTKD LIKE VBKD-BSTKD, "customer PO
LFGSA LIKE VBUP-LFGSA, "overall delivery status
FKSAA LIKE VBUP-FKSAA, "overall billing status
KUNWE LIKE VBPA-KUNNR, "ship-to customer
NAME1 LIKE KNA1-NAME1, "ship-to customer name
ORT01 LIKE KNA1-ORT01, "ship-to address
REGIO LIKE KNA1-REGIO, "ship-to region (state)
LAND1 LIKE KNA1-LAND1, "ship-to country
END OF ITAB.
create internal table for open orders
DATA: BEGIN OF ITAB1 OCCURS 0,
KUNNR LIKE VBAK-KUNNR, "sold-to customer
KUNWE LIKE VBPA-KUNNR, "ship-to customer
VBELN LIKE VBAP-VBELN, "document number
POSNR LIKE VBAP-POSNR, "item number
ZDATE1 LIKE VBEP-EDATU, "requested date
ZDATE2 LIKE VBEP-EDATU, "scheduled date (confirm)
ZDATE3 LIKE VBEP-EDATU, "committed date
ZQTY1 LIKE VBAP-KWMENG, "qty ordered
ZQTY2 LIKE VBEP-BMENG, "backlog qty
ZEXTD LIKE VBAP-NETWR, "backlog net value
ZDESC(30) TYPE C, "backlog description
END OF ITAB1.
define internal table for SO schedule lines
DATA: BEGIN OF ITAB2A OCCURS 0,
WADAT LIKE VBEP-WADAT, "planned goods issue date
VBELN LIKE VBAP-VBELN, "document number
POSNR LIKE VBAP-POSNR, "item number
WMENG LIKE VBEP-WMENG, "qty ordered
BMENG LIKE VBEP-BMENG, "qty confirmed
END OF ITAB2A.
define internal table for SO item request dates
DATA: BEGIN OF ITAB2B OCCURS 0,
EDATU LIKE VBEP-EDATU, "delivery date
VBELN LIKE VBAP-VBELN, "document number
POSNR LIKE VBAP-POSNR, "item number
WMENG LIKE VBEP-WMENG, "qty ordered
END OF ITAB2B.
define internal table for SO item commit dates
DATA: BEGIN OF ITAB2C OCCURS 0,
EDATU LIKE VBEP-EDATU, "delivery date
VBELN LIKE VBAP-VBELN, "document number
POSNR LIKE VBAP-POSNR, "item number
ROMS1 LIKE VBEP-WMENG, "committed qty
END OF ITAB2C.
define internal table for SO item deliveries
DATA: BEGIN OF ITAB3 OCCURS 0,
VGBEL LIKE LIPS-VGBEL, "sales document
VGPOS LIKE LIPS-VGPOS, "sales document item
VBELN LIKE LIKP-VBELN, "delivery number
POSNR LIKE LIPS-POSNR, "delivery item number
WADAT LIKE LIKP-WADAT, "planned GI date
WADAT_IST LIKE LIKP-WADAT_IST, "actual GI date
LFIMG LIKE LIPS-LFIMG, "actual qty delivered
ERDAT LIKE LIKP-ERDAT, "date created
ERZET LIKE LIKP-ERZET, "time created
END OF ITAB3.
define internal table for SO item / delivery cross reference
DATA: BEGIN OF ITAB4 OCCURS 0,
VBELV LIKE VBFA-VBELV, "sales document
POSNV LIKE VBFA-POSNV, "sales document item
VBELN LIKE VBFA-VBELN, "delivery number
POSNN LIKE VBFA-POSNN, "delivery item
VBTYP_N LIKE VBFA-VBTYP_N, "document category
RFMNG LIKE VBFA-RFMNG, "qty delivered
PLMIN LIKE VBFA-PLMIN, "plus/minus flag
END OF ITAB4.
define local variables
DATA: ORDR_QTY LIKE VBEP-WMENG, "order qty
CONF_QTY LIKE VBEP-BMENG, "confirmed qty
NOCONF_QTY LIKE VBEP-BMENG, "qty not confirmed
DELV_QTY LIKE VBEP-WMENG, "qty delivered
NODELV_QTY LIKE VBEP-WMENG, "qty not delivered
REMAIN_QTY LIKE VBEP-WMENG, "qty remain to get conf date
REQ_DATE LIKE VBEP-EDATU, "request date
COM_DATE LIKE VBEP-EDATU, "committed date
DELV_QTY1 LIKE VBEP-WMENG, "preceding delivery qty
REMAIN_QTY1 LIKE VBEP-WMENG, "qty remain to get reqest date
REMAIN_QTY2 LIKE VBEP-WMENG, "qty remain to get commit date
THIRD_QTY LIKE VBEP-WMENG, "3rd party no PO qty
SO_STOCK LIKE MSKA-KALAB, "sales order stock
ZPRICE LIKE VBAP-NETPR, "unit price USD
ADRS1(40) TYPE C, "concatenated city and region
ADRS2(45) TYPE C, "city, region and country
ADRS3(80) TYPE C, "name, city, rgn, ctry
ZCNTR TYPE I. "counter
define select options
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VKORG FOR VBAK-VKORG DEFAULT '1000',
S_VTWEG FOR VBAK-VTWEG DEFAULT '10' NO-DISPLAY,
S_SPART FOR VBAK-SPART DEFAULT '00' NO-DISPLAY,
S_KUNNR FOR VBPA-KUNNR MATCHCODE OBJECT DEBI,
S_KUNWE FOR VBPA-KUNNR MATCHCODE OBJECT DEBI.
SELECTION-SCREEN SKIP.
SELECT-OPTIONS:
S_BZIRK FOR VBKD-BZIRK,
S_PRCTR FOR VBAP-PRCTR,
S_MATNR FOR VBAP-MATNR MATCHCODE OBJECT MAT1,
S_ERNAM FOR VBAK-ERNAM,
S_ERDAT FOR VBAP-ERDAT.
SELECTION-SCREEN END OF BLOCK BLK1.
AT SELECTION-SCREEN.
IF S_KUNNR IS INITIAL AND S_KUNWE IS INITIAL.
MESSAGE E005(ZM) WITH TEXT-100.
ENDIF.
MAIN PROGRAM
INITIALIZATION.
INCLUDE ZSYHEADR.
START-OF-SELECTION.
PERFORM 100_GET_SO_ITEMS.
PERFORM 200_GET_NO_DELIVERY.
PERFORM 300_GET_NO_GOODS_ISSUE.
PERFORM 400_GET_PARTIAL_DELIVERY.
PERFORM 500_GET_THIRD_PARTY.
PERFORM 900_CREATE_LIST.
FORM 100_GET_SO_ITEMS
FORM 100_GET_SO_ITEMS.
get SO's for selected ship-to and sold-to customers
REFRESH TVBPA.
IF NOT S_KUNNR IS INITIAL.
SELECT VBELN POSNR PARVW KUNNR
FROM VBPA INTO TABLE TVBPA
WHERE KUNNR IN S_KUNNR AND PARVW = 'AG' AND VBELN < '0080000000'.
ENDIF.
IF NOT S_KUNWE IS INITIAL.
SELECT VBELN POSNR PARVW KUNNR
FROM VBPA APPENDING TABLE TVBPA
WHERE KUNNR IN S_KUNWE AND PARVW = 'WE' AND VBELN < '0080000000'.
ENDIF.
DESCRIBE TABLE TVBPA LINES ZCNTR.
IF ZCNTR = 0.
WRITE: /1 'No data found for selection'.
STOP.
ENDIF.
eliminate duplicate SO's
LOOP AT TVBPA.
CLEAR ITAB0.
MOVE TVBPA-VBELN TO ITAB0-VBELN.
APPEND ITAB0.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM ITAB0.
get SO detail
SELECT VBAP~VBELN VBAP~POSNR VBAP~MATNR VBAP~ARKTX VBAP~PSTYV
VBAP~KDMAT VBAP~NETWR VBAP~WAERK VBAP~KWMENG VBAP~ERDAT
VBAP~NETPR VBAP~KPEIN VBAP~PRCTR VBAK~ERNAM VBAK~AUART
VBAK~VKORG VBAK~VTWEG VBAK~VDATU VBAK~BNAME VBAK~KUNNR
VBKD~BZIRK VBKD~KURSK VBKD~BSTKD VBUP~LFGSA VBUP~FKSAA
FROM VBAP INNER JOIN VBUP ON VBUP~VBELN = VBAP~VBELN AND
VBUP~POSNR = VBAP~POSNR
INNER JOIN VBKD ON VBKD~VBELN = VBAP~VBELN AND
VBKD~POSNR = VBAP~POSNR
INNER JOIN VBAK ON VBAK~VBELN = VBAP~VBELN
INTO TABLE ITAB FOR ALL ENTRIES IN ITAB0
WHERE VBAP~VBELN = ITAB0-VBELN AND VBAP~MATNR IN S_MATNR AND
VBAP~ERDAT IN S_ERDAT AND VBAP~PRCTR IN S_PRCTR AND
VBAP~ABGRU = SPACE AND VBKD~BZIRK IN S_BZIRK AND
VBAK~VKORG IN S_VKORG AND VBAK~VTWEG IN S_VTWEG AND
VBAK~SPART IN S_SPART AND VBAK~KUNNR IN S_KUNNR AND
VBAK~ERNAM IN S_ERNAM.
IF SY-SUBRC <> 0.
WRITE: /1 'No data found for selection'.
STOP.
ENDIF.
loop thru SO items
LOOP AT ITAB.
get ship-to customer
IF NOT S_KUNWE IS INITIAL.
CLEAR TVBPA.
READ TABLE TVBPA WITH TABLE KEY VBELN = ITAB-VBELN
POSNR = ITAB-POSNR PARVW = 'WE'.
IF SY-SUBRC <> 0.
READ TABLE TVBPA WITH TABLE KEY VBELN = ITAB-VBELN
POSNR = '000000' PARVW = 'WE'.
ENDIF.
MOVE TVBPA-KUNNR TO ITAB-KUNWE.
ELSE.
CLEAR ITAB-KUNWE.
SELECT SINGLE KUNNR FROM VBPA INTO ITAB-KUNWE
WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
PARVW = 'WE'.
IF SY-SUBRC <> 0.
SELECT SINGLE KUNNR FROM VBPA INTO ITAB-KUNWE
WHERE VBELN = ITAB-VBELN AND POSNR = '000000' AND
PARVW = 'WE'.
ENDIF.
ENDIF.
IF NOT ITAB-KUNWE IN S_KUNWE.
DELETE ITAB.
CONTINUE.
ENDIF.
get ship-to customer address info
SELECT SINGLE NAME1 ORT01 REGIO LAND1 FROM KNA1
INTO (ITAB-NAME1, ITAB-ORT01, ITAB-REGIO, ITAB-LAND1)
WHERE KUNNR = ITAB-KUNWE.
MODIFY ITAB.
ENDLOOP.
SORT ITAB BY VBELN POSNR.
ENDFORM.
FORM 200_GET_NO_DELIVERY
get detail for SO items w/ no deliveries for order document types
(ZZOR, ZZC1, ZZCO, ZZRP, ZZRW, KE, KR, ZCHP, ZPSO, ZZNC)
FORM 200_GET_NO_DELIVERY.
LOOP AT ITAB WHERE AUART = 'ZZOR' OR AUART = 'ZZC1' OR
AUART = 'ZZCO' OR AUART = 'ZZRP' OR AUART = 'ZZRW' OR
AUART = 'KE' OR AUART = 'KR' OR AUART = 'ZCHP' OR
AUART = 'ZPSO' OR AUART = 'ZZNC'.
select if delivery status = A (not delivered)
IF ITAB-LFGSA = 'A'.
assign values to detail fields
CLEAR ITAB1.
ITAB1-KUNNR = ITAB-KUNNR.
ITAB1-KUNWE = ITAB-KUNWE.
ITAB1-VBELN = ITAB-VBELN.
ITAB1-POSNR = ITAB-POSNR.
IF ITAB-KURSK = 0.
ITAB-KURSK = 1.
ENDIF.
IF ITAB-KPEIN = 0.
ITAB-KPEIN = 1.
ENDIF.
select schedule lines for SO item and write to internal table itab2a
SELECT WADAT VBELN POSNR WMENG BMENG
FROM VBEP INTO TABLE ITAB2A
WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR.
select sched lines w/request date and write to internal table itab2b
SELECT EDATU VBELN POSNR WMENG
FROM VBEP INTO TABLE ITAB2B
WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
WMENG <> 0.
select sched lines w/commit date and write to internal table itab2c
SELECT EDATU VBELN POSNR ROMS1
FROM VBEP INTO TABLE ITAB2C
WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
ROMS1 <> 0.
SORT ITAB2A BY WADAT.
SORT ITAB2B BY EDATU.
SORT ITAB2C BY EDATU.
ORDR_QTY = 0.
CONF_QTY = 0.
NOCONF_QTY = 0.
calculate the unconfirmed qty for a SO item
LOOP AT ITAB2A.
CONF_QTY = CONF_QTY + ITAB2A-BMENG.
ORDR_QTY = ORDR_QTY + ITAB2A-WMENG.
ENDLOOP.
NOCONF_QTY = ORDR_QTY - CONF_QTY.
LOOP AT ITAB2A WHERE BMENG <> 0.
PERFORM GET_REQUEST_DATE TABLES ITAB2B
USING ITAB2A-BMENG REQ_DATE.
PERFORM GET_COMMIT_DATE TABLES ITAB2C
USING ITAB2A-BMENG COM_DATE.
ITAB1-ZDATE1 = REQ_DATE.
ITAB1-ZDATE2 = ITAB2A-WADAT.
ITAB1-ZDATE3 = COM_DATE.
ITAB1-ZQTY1 = ITAB-KWMENG.
ITAB1-ZQTY2 = ITAB2A-BMENG.
ITAB1-ZDESC = 'no delivery, confirmed'.
calculate net value for backlog qty
ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
if order type is consignment return (KR), reverse sign
IF ITAB-AUART = 'KR'.
ITAB1-ZQTY1 = ITAB1-ZQTY1 * -1.
ITAB1-ZQTY2 = ITAB1-ZQTY2 * -1.
ITAB1-ZEXTD = ITAB1-ZEXTD * -1.
ENDIF.
APPEND ITAB1.
ENDLOOP.
get request date for SO item
IF NOCONF_QTY <> 0.
PERFORM GET_REQUEST_DATE TABLES ITAB2B
USING NOCONF_QTY REQ_DATE.
PERFORM GET_COMMIT_DATE TABLES ITAB2C
USING NOCONF_QTY COM_DATE.
ITAB1-ZDATE1 = REQ_DATE.
ITAB1-ZDATE2 = '99991231'.
ITAB1-ZDATE3 = COM_DATE.
ITAB1-ZQTY1 = ITAB-KWMENG.
ITAB1-ZQTY2 = NOCONF_QTY.
ITAB1-ZDESC = 'no delivery, not confirmed'.
calculate net value for backlog qty
ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
if order type is consignment return (KR), reverse sign
IF ITAB-AUART = 'KR'.
ITAB1-ZQTY1 = ITAB1-ZQTY1 * -1.
ITAB1-ZQTY2 = ITAB1-ZQTY2 * -1.
ITAB1-ZEXTD = ITAB1-ZEXTD * -1.
ENDIF.
APPEND ITAB1.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
FORM 300_GET_NO_GOODS_ISSUE
get detail for SO items w/deliveries and no goods issue for
doc types (ZZOR, ZZC1, ZZCO, ZZRP, ZZRW, KE, KR, ZCHP, ZPSO, ZZNC)
FORM 300_GET_NO_GOODS_ISSUE.
get detail for deliveries w/no goods issue
SELECT VBELN WADAT WADAT_IST ERDAT ERZET
FROM LIKP INTO (LIKP-VBELN, LIKP-WADAT, LIKP-WADAT_IST,
LIKP-ERDAT, LIKP-ERZET)
WHERE WADAT_IST = 0.
select if actual qty delivered <> 0
CLEAR LIPS.
SELECT POSNR VGBEL VGPOS LFIMG
FROM LIPS INTO (LIPS-POSNR, LIPS-VGBEL, LIPS-VGPOS, LIPS-LFIMG)
WHERE VBELN = LIKP-VBELN AND LFIMG <> 0.
select if goods movement status on delivery = A (no goods issue)
CLEAR VBUP.
SELECT SINGLE WBSTA FROM VBUP INTO VBUP-WBSTA
WHERE VBELN = LIKP-VBELN AND POSNR = LIPS-POSNR.
IF VBUP-WBSTA = 'A'.
CLEAR ITAB3.
ITAB3-VGBEL = LIPS-VGBEL.
ITAB3-VGPOS = LIPS-VGPOS.
ITAB3-VBELN = LIKP-VBELN.
ITAB3-POSNR = LIPS-POSNR.
ITAB3-WADAT = LIKP-WADAT.
ITAB3-WADAT_IST = LIKP-WADAT_IST.
ITAB3-LFIMG = LIPS-LFIMG.
ITAB3-ERDAT = LIKP-ERDAT.
ITAB3-ERZET = LIKP-ERZET.
APPEND ITAB3.
ENDIF.
ENDSELECT.
ENDSELECT.
SORT ITAB3 BY VGBEL VGPOS VBELN POSNR.
loop thru deliveries w/no goods issue and get SO item detail
LOOP AT ITAB3.
CLEAR ITAB.
READ TABLE ITAB WITH KEY VBELN = ITAB3-VGBEL POSNR = ITAB3-VGPOS.
IF SY-SUBRC <> 0.
IF ITAB-AUART = 'ZZOR' OR ITAB-AUART = 'ZZC1' OR
ITAB-AUART = 'ZZCO' OR ITAB-AUART = 'ZZRP' OR
ITAB-AUART = 'ZZRW' OR ITAB-AUART = 'KE' OR
ITAB-AUART = 'KR' OR ITAB-AUART = 'ZCHP' OR
ITAB-AUART = 'ZPSO' OR ITAB-AUART = 'ZZNC'.
assign values to detail fields
CLEAR ITAB1.
ITAB1-KUNNR = ITAB-KUNNR.
ITAB1-KUNWE = ITAB-KUNWE.
ITAB1-VBELN = ITAB-VBELN.
ITAB1-POSNR = ITAB-POSNR.
IF ITAB-KURSK = 0.
ITAB-KURSK = 1.
ENDIF.
IF ITAB-KPEIN = 0.
ITAB-KPEIN = 1.
ENDIF.
select delivery qty for SO item and write to internal table
SELECT VBELV POSNV VBELN POSNN VBTYP_N RFMNG PLMIN
FROM VBFA INTO TABLE ITAB4
WHERE VBELV = ITAB-VBELN AND POSNV = ITAB-POSNR AND
( VBTYP_N = 'J' OR VBTYP_N = 'T' ).
calculate total delivery qty for SO item
DELV_QTY = 0.
DELV_QTY1 = 0.
LOOP AT ITAB4.
IF ITAB4-VBTYP_N = 'J' OR ( ITAB4-VBTYP_N = 'T' AND
ITAB-AUART = 'KR').
IF ITAB4-PLMIN = '-'.
ITAB4-RFMNG = ITAB4-RFMNG * -1.
ENDIF.
determine if delivery for SO item precedes delivery w/no goods
issue (to determine request date and qty)
CLEAR LIKP.
SELECT SINGLE ERDAT ERZET
FROM LIKP INTO (LIKP-ERDAT, LIKP-ERZET)
WHERE VBELN = ITAB4-VBELN.
IF LIKP-ERDAT < ITAB3-ERDAT OR ( LIKP-ERDAT = ITAB3-ERDAT
AND LIKP-ERZET < ITAB3-ERZET ).
DELV_QTY1 = DELV_QTY1 + ITAB4-RFMNG.
ENDIF.
DELV_QTY = DELV_QTY + ITAB4-RFMNG.
ENDIF.
ENDLOOP.
get request dates for SO item
REFRESH ITAB2B.
SELECT EDATU VBELN POSNR WMENG
FROM VBEP INTO TABLE ITAB2B
WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
WMENG <> 0.
select sched lines w/commit date and write to itab2c
REFRESH ITAB2C.
SELECT EDATU VBELN POSNR ROMS1
FROM VBEP INTO TABLE ITAB2C
WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
ROMS1 <> 0.
SORT ITAB2B BY EDATU.
SORT ITAB2C BY EDATU.
loop thru request dates and delete request date entries for
quantity(s) for preceding deliveries
REMAIN_QTY1 = DELV_QTY1.
LOOP AT ITAB2B.
IF ITAB2B-WMENG > REMAIN_QTY1.
ITAB2B-WMENG = ITAB2B-WMENG - REMAIN_QTY1.
MODIFY ITAB2B.
EXIT.
ELSEIF ITAB2B-WMENG = REMAIN_QTY1.
DELETE ITAB2B.
EXIT.
ELSE.
REMAIN_QTY1 = REMAIN_QTY1 - ITAB2B-WMENG.
DELETE ITAB2B.
ENDIF.
ENDLOOP.
loop thru commit dates and delete commit date entries for
quantity(s) for preceding deliveries
REMAIN_QTY2 = DELV_QTY1.
LOOP AT ITAB2C.
IF ITAB2C-ROMS1 > REMAIN_QTY2.
ITAB2C-ROMS1 = ITAB2C-ROMS1 - REMAIN_QTY2.
MODIFY ITAB2C.
EXIT.
ELSEIF ITAB2C-ROMS1 = REMAIN_QTY2.
DELETE ITAB2C.
EXIT.
ELSE.
REMAIN_QTY2 = REMAIN_QTY2 - ITAB2C-ROMS1.
DELETE ITAB2C.
ENDIF.
ENDLOOP.
if planned goods issue date is 0, put qty in non-confirmed
get request date for SO item
IF ITAB3-WADAT <> 0.
PERFORM GET_REQUEST_DATE TABLES ITAB2B
USING ITAB3-LFIMG REQ_DATE.
PERFORM GET_COMMIT_DATE TABLES ITAB2C
USING ITAB3-LFIMG COM_DATE.
ITAB1-ZDATE1 = REQ_DATE.
ITAB1-ZDATE2 = ITAB3-WADAT.
ITAB1-ZDATE3 = COM_DATE.
ITAB1-ZQTY1 = ITAB-KWMENG.
ITAB1-ZQTY2 = ITAB3-LFIMG.
ITAB1-ZDESC = 'delivery, no goods issue'.
ELSE.
PERFORM GET_REQUEST_DATE TABLES ITAB2B
USING ITAB3-LFIMG REQ_DATE.
PERFORM GET_COMMIT_DATE TABLES ITAB2C
USING ITAB3-LFIMG COM_DATE.
ITAB1-ZDATE1 = REQ_DATE.
ITAB1-ZDATE2 = '99991231'.
ITAB1-ZDATE3 = COM_DATE.
ITAB1-ZQTY1 = ITAB-KWMENG.
ITAB1-ZQTY2 = ITAB3-LFIMG.
ITAB1-ZDESC = 'delivery, no goods issue date'.
ENDIF.
calculate net value for backlog qty
ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
if order type is consignment return (KR), reverse sign
IF ITAB-AUART = 'KR'.
ITAB1-ZQTY1 = ITAB1-ZQTY1 * -1.
ITAB1-ZQTY2 = ITAB1-ZQTY2 * -1.
ITAB1-ZEXTD = ITAB1-ZEXTD * -1.
ENDIF.
APPEND ITAB1.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
FORM 400_GET_PARTIAL_DELIVERY
get detail for SO items w/partial deliveries for document types
(ZZOR, ZZC1, ZZCO, ZZRP, ZZRW, KE, KR, ZCHP, ZPSO, ZZNC)
FORM 400_GET_PARTIAL_DELIVERY.
process SO items for selected order types
LOOP AT ITAB WHERE AUART = 'ZZOR' OR AUART = 'ZZC1' OR
AUART = 'ZZCO' OR AUART = 'ZZRP' OR AUART = 'ZZRW' OR
AUART = 'KE' OR AUART = 'KR' OR AUART = 'ZCHP' OR
AUART = 'ZPSO' OR AUART = 'ZZNC'.
select if delivery status = B (partially delivered)
IF ITAB-LFGSA = 'B'.
assign values to detail fields
CLEAR ITAB1.
ITAB1-KUNNR = ITAB-KUNNR.
ITAB1-KUNWE = ITAB-KUNWE.
ITAB1-VBELN = ITAB-VBELN.
ITAB1-POSNR = ITAB-POSNR.
IF ITAB-KURSK = 0.
ITAB-KURSK = 1.
ENDIF.
IF ITAB-KPEIN = 0.
ITAB-KPEIN = 1.
ENDIF.
select delivery qty for SO item and write to internal table
SELECT VBELV POSNV VBELN POSNN VBTYP_N RFMNG PLMIN
FROM VBFA INTO TABLE ITAB4
WHERE VBELV = ITAB-VBELN AND POSNV = ITAB-POSNR AND
( VBTYP_N = 'J' OR VBTYP_N = 'T' ).
calculate total delivery qty for SO item
DELV_QTY = 0.
LOOP AT ITAB4.
IF ITAB4-VBTYP_N = 'J' OR ( ITAB4-VBTYP_N = 'T' AND
ITAB-AUART = 'KR').
IF ITAB4-PLMIN = '-'.
ITAB4-RFMNG = ITAB4-RFMNG * -1.
ENDIF.
DELV_QTY = DELV_QTY + ITAB4-RFMNG.
ENDIF.
ENDLOOP.
select schedule lines for SO item and write to internal table
REFRESH ITAB2A.
SELECT WADAT VBELN POSNR WMENG BMENG
FROM VBEP INTO TABLE ITAB2A
WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR.
get request dates from schedule line table
REFRESH ITAB2B.
SELECT EDATU VBELN POSNR WMENG
FROM VBEP INTO TABLE ITAB2B
WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
WMENG <> 0.
get commit dates from schedule line table
REFRESH ITAB2C.
SELECT EDATU VBELN POSNR ROMS1
FROM VBEP INTO TABLE ITAB2C
WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
ROMS1 <> 0.
SORT ITAB2B BY EDATU.
SORT ITAB2C BY EDATU.
SORT ITAB2A BY WADAT.
loop thru request dates and delete request date entries for
quantity(s) already delivered
REMAIN_QTY1 = DELV_QTY.
LOOP AT ITAB2B.
IF ITAB2B-WMENG > REMAIN_QTY1.
ITAB2B-WMENG = ITAB2B-WMENG - REMAIN_QTY1.
MODIFY ITAB2B.
EXIT.
ELSEIF ITAB2B-WMENG = REMAIN_QTY1.
DELETE ITAB2B.
EXIT.
ELSE.
REMAIN_QTY1 = REMAIN_QTY1 - ITAB2B-WMENG.
DELETE ITAB2B.
ENDIF.
ENDLOOP.
loop thru commit dates and delete request date entries for
quantity(s) already delivered
REMAIN_QTY2 = DELV_QTY.
LOOP AT ITAB2C.
IF ITAB2C-ROMS1 > REMAIN_QTY2.
ITAB2C-ROMS1 = ITAB2C-ROMS1 - REMAIN_QTY2.
MODIFY ITAB2C.
EXIT.
ELSEIF ITAB2C-ROMS1 = REMAIN_QTY2.
DELETE ITAB2C.
EXIT.
ELSE.
REMAIN_QTY2 = REMAIN_QTY2 - ITAB2C-ROMS1.
DELETE ITAB2C.
ENDIF.
ENDLOOP.
ORDR_QTY = 0.
CONF_QTY = 0.
NOCONF_QTY = 0.
calculate the unconfirmed qty for SO item
LOOP AT ITAB2A.
ORDR_QTY = ORDR_QTY + ITAB2A-WMENG.
CONF_QTY = CONF_QTY + ITAB2A-BMENG.
ENDLOOP.
NOCONF_QTY = ORDR_QTY - CONF_QTY.
NODELV_QTY = ORDR_QTY - DELV_QTY.
loop thru schedule lines and process entries with no related
delivery(s)
REMAIN_QTY = DELV_QTY.
LOOP AT ITAB2A.
IF ITAB2A-BMENG <> 0.
IF ITAB2A-BMENG <= REMAIN_QTY.
REMAIN_QTY = REMAIN_QTY - ITAB2A-BMENG.
ELSE.
ITAB2A-BMENG = ITAB2A-BMENG - REMAIN_QTY.
PERFORM GET_REQUEST_DATE TABLES ITAB2B
USING ITAB2A-BMENG REQ_DATE.
PERFORM GET_COMMIT_DATE TABLES ITAB2C
USING ITAB2A-BMENG COM_DATE.
ITAB1-ZDATE1 = REQ_DATE.
ITAB1-ZDATE2 = ITAB2A-WADAT.
ITAB1-ZDATE3 = COM_DATE.
ITAB1-ZQTY1 = ITAB-KWMENG.
ITAB1-ZQTY2 = ITAB2A-BMENG.
ITAB1-ZDESC = 'partial delivery'.
calculate net value for backlog qty
ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
if order type is consignment return (KR), reverse sign
IF ITAB-AUART = 'KR'.
ITAB1-ZQTY1 = ITAB1-ZQTY1 * -1.
ITAB1-ZQTY2 = ITAB1-ZQTY2 * -1.
ITAB1-ZEXTD = ITAB1-ZEXTD * -1.
ENDIF.
APPEND ITAB1.
REMAIN_QTY = 0.
ENDIF.
ENDIF.
ENDLOOP.
if total unconfirmed >= total not delivered, qty is unconfirmed
IF NOCONF_QTY >= NODELV_QTY.
PERFORM GET_REQUEST_DATE TABLES ITAB2B
USING NODELV_QTY REQ_DATE.
PERFORM GET_COMMIT_DATE TABLES ITAB2C
USING NODELV_QTY COM_DATE.
ITAB1-ZDATE1 = REQ_DATE.
ITAB1-ZDATE2 = '99991231'.
ITAB1-ZDATE3 = COM_DATE.
ITAB1-ZQTY1 = ITAB-KWMENG.
ITAB1-ZQTY2 = NODELV_QTY.
ITAB1-ZDESC = 'partial delv, not confirmed'.
calculate net value for backlog qty
ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
if order type is consignment return (KR), reverse sign
IF ITAB-AUART = 'KR'.
ITAB1-ZQTY1 = ITAB1-ZQTY1 * -1.
ITAB1-ZQTY2 = ITAB1-ZQTY2 * -1.
ITAB1-ZEXTD = ITAB1-ZEXTD * -1.
ENDIF.
APPEND ITAB1.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
FORM 500_GET_THIRD_PARTY
get detail for third party SO items
FORM 500_GET_THIRD_PARTY.
process SO items for selected order types
LOOP AT ITAB WHERE PSTYV = 'TAS' AND ( AUART = 'ZZOR' OR
AUART = 'ZZC1' OR AUART = 'ZZCO' OR AUART = 'ZZRP' OR
AUART = 'ZZRW' OR AUART = 'KE' OR AUART = 'KR' OR
AUART = 'ZCHP' OR AUART = 'ZPSO' OR AUART = 'ZZNC' ).
select if billing status <> C (billed)
IF ITAB-FKSAA <> 'C'.
assign values to detail fields
CLEAR ITAB1.
ITAB1-KUNNR = ITAB-KUNNR.
ITAB1-KUNWE = ITAB-KUNWE.
ITAB1-VBELN = ITAB-VBELN.
ITAB1-POSNR = ITAB-POSNR.
IF ITAB-KURSK = 0.
ITAB-KURSK = 1.
ENDIF.
IF ITAB-KPEIN = 0.
ITAB-KPEIN = 1.
ENDIF.
get request dates from schedule line table
REFRESH ITAB2B.
SELECT EDATU VBELN POSNR WMENG
FROM VBEP INTO TABLE ITAB2B
WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
WMENG <> 0.
get commit dates from schedule line table
REFRESH ITAB2C.
SELECT EDATU VBELN POSNR ROMS1
FROM VBEP INTO TABLE ITAB2C
WHERE VBELN = ITAB-VBELN AND POSNR = ITAB-POSNR AND
ROMS1 <> 0.
SORT ITAB2B BY EDATU.
SORT ITAB2C BY EDATU.
get PO number(s) for SO item and write to internal table
REFRESH ITAB4.
SELECT VBELV POSNV VBELN POSNN VBTYP_N RFMNG PLMIN
FROM VBFA INTO TABLE ITAB4
WHERE VBELV = ITAB-VBELN AND POSNV = ITAB-POSNR AND
VBTYP_N = 'V' AND RFMNG <> 0.
calculate total delivery qty for PO item
DELV_QTY = 0.
LOOP AT ITAB4.
IF ITAB4-PLMIN = '-'.
ITAB4-RFMNG = ITAB4-RFMNG * -1.
ENDIF.
DELV_QTY = DELV_QTY + ITAB4-RFMNG.
ENDLOOP.
loop thru PO's for SO item
LOOP AT ITAB4.
select delivery lines for PO item
SELECT EINDT EBELN EBELP MENGE FROM EKET
INTO (EKET-EINDT, EKET-EBELN, EKET-EBELP, EKET-MENGE)
WHERE EBELN = ITAB4-VBELN AND EBELP = ITAB4-POSNN.
PERFORM GET_REQUEST_DATE TABLES ITAB2B
USING EKET-MENGE REQ_DATE.
PERFORM GET_COMMIT_DATE TABLES ITAB2C
USING EKET-MENGE COM_DATE.
ITAB1-ZDATE1 = REQ_DATE.
ITAB1-ZDATE2 = EKET-EINDT.
ITAB1-ZDATE3 = COM_DATE.
ITAB1-ZQTY1 = ITAB-KWMENG.
ITAB1-ZQTY2 = EKET-MENGE.
ITAB1-ZDESC = '3rd party item'.
calculate net value for backlog qty
ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
APPEND ITAB1.
ENDSELECT.
ENDLOOP.
if total delivery qty < order qty, put remaining in non-confirmed
IF DELV_QTY < ITAB-KWMENG.
THIRD_QTY = ITAB-KWMENG - DELV_QTY.
PERFORM GET_REQUEST_DATE TABLES ITAB2B
USING THIRD_QTY REQ_DATE.
PERFORM GET_COMMIT_DATE TABLES ITAB2C
USING THIRD_QTY COM_DATE.
ITAB1-ZDATE1 = REQ_DATE.
ITAB1-ZDATE2 = '99991231'.
ITAB1-ZDATE2 = COM_DATE.
ITAB1-ZQTY1 = ITAB-KWMENG.
ITAB1-ZQTY2 = THIRD_QTY.
ITAB1-ZDESC = '3rd party item, no PO'.
calculate net value for backlog qty
ZPRICE = ( ITAB-NETPR / ITAB-KPEIN ) * ITAB-KURSK.
ITAB1-ZEXTD = ITAB1-ZQTY2 * ZPRICE.
APPEND ITAB1.
CONTINUE.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
FORM 900_CREATE_LIST
process open business detail and create list
FORM 900_CREATE_LIST.
if internal table is empty, write message and exit
DESCRIBE TABLE ITAB1 LINES ZCNTR.
IF ZCNTR = 0.
WRITE: / 'No Data Found for Selection'.
STOP.
ENDIF.
SORT ITAB1 BY KUNNR KUNWE VBELN POSNR.
loop thru sorted table and create list
LOOP AT ITAB1.
IF ITAB1-ZDATE1 = SPACE.
ITAB1-ZDATE1 = '99991231'.
ENDIF.
IF ITAB1-ZDATE3 = SPACE.
ITAB1-ZDATE3 = '99991231'.
ENDIF.
get SO item detail
CLEAR ITAB.
READ TABLE ITAB WITH KEY VBELN = ITAB1-VBELN
POSNR = ITAB1-POSNR BINARY SEARCH.
print sold-to and ship-to customer header info
AT NEW KUNWE.
CLEAR KNA1.
SELECT SINGLE NAME1 FROM KNA1 INTO KNA1-NAME1
WHERE KUNNR = ITAB1-KUNNR.
CONCATENATE ITAB-ORT01 ITAB-REGIO INTO ADRS1 SEPARATED BY ', '.
CONCATENATE ADRS1 ITAB-LAND1 INTO ADRS2 SEPARATED BY ' '.
CONCATENATE ITAB-NAME1 ADRS2 INTO ADRS3 SEPARATED BY ' '.
FORMAT COLOR 1 INTENSIFIED OFF.
WRITE: /1 'Sold-to:', 10 ITAB1-KUNNR, 18 KNA1-NAME1,
56 'Ship-to:', 65 ITAB1-KUNWE, 73 ADRS3.
FORMAT RESET.
SKIP.
ENDAT.
print out backlog detail
CLEAR T171T.
SELECT SINGLE BZTXT FROM T171T INTO T171T-BZTXT
WHERE SPRAS = SY-LANGU AND BZIRK = ITAB-BZIRK.
WRITE: /1 ITAB1-VBELN,
13(6) ITAB1-POSNR NO-ZERO,
21 ITAB-MATNR,
41 ITAB-ARKTX,
83 ITAB1-ZDATE1,
95 ITAB1-ZDATE3,
107 ITAB1-ZDATE2,
119 ITAB-ERNAM,
129 ITAB-BZIRK, 135 T171T-BZTXT,
157(20) ITAB-BSTKD,
179(12) ITAB1-ZQTY1 DECIMALS 0,
193(12) ITAB1-ZQTY2 DECIMALS 0,
207(16) ITAB1-ZEXTD DECIMALS 2,
225 ITAB1-ZDESC.
AT END OF VBELN.
SKIP.
ENDAT.
print footing at ship-to customer
AT END OF KUNWE.
SUM.
ULINE: /193(12), 207(16).
FORMAT COLOR 1 INTENSIFIED OFF.
WRITE: /1 'Total: Sold-to:', 18 ITAB1-KUNNR,
25 '/', 27 'Ship-to:', 36 ITAB1-KUNWE,
193(12) ITAB1-ZQTY2 DECIMALS 0,
207(16) ITAB1-ZEXTD DECIMALS 2.
FORMAT RESET.
SKIP 2.
ENDAT.
AT LAST.
SUM.
ULINE: /193(12), 207(16).
FORMAT COLOR 1 INTENSIFIED ON.
WRITE: /1 'Report Total:',
193(12) ITAB1-ZQTY2 DECIMALS 0,
207(16) ITAB1-ZEXTD DECIMALS 2.
FORMAT RESET.
ENDAT.
ENDLOOP.
ENDFORM.
FORM GET_REQUEST_DATE
subroutine to get request date for SO item
FORM GET_REQUEST_DATE TABLES FTAB STRUCTURE ITAB2B
USING CONF_QTY REQ_DATE.
DATA: REMAIN LIKE VBEP-WMENG, "qty remaining
CNTR TYPE I, "loop counter
TAB_INDEX TYPE I. "table index
initialize
REMAIN = 0.
REQ_DATE = SPACE.
get first request date from table
TAB_INDEX = 1.
READ TABLE FTAB INDEX TAB_INDEX.
if request date not found, set request date to blank
IF SY-SUBRC <> 0.
REQ_DATE = SPACE.
EXIT.
ELSE.
REQ_DATE = FTAB-EDATU.
ENDIF.
calculate quantity remaining for request date
REMAIN = FTAB-WMENG - CONF_QTY.
if qty remaining > 0, update request date with qty remaining
IF REMAIN > 0.
FTAB-WMENG = REMAIN.
MODIFY FTAB INDEX TAB_INDEX.
if qty remaining = 0, delete request date (so next request
date will be used for next confirmed qty)
ELSEIF REMAIN = 0.
DELETE FTAB INDEX TAB_INDEX.
if qty remaining < 0, find next request date and update
ELSE.
CNTR = 0.
WHILE REMAIN < 0 OR CNTR < 10.
DELETE FTAB INDEX TAB_INDEX.
TAB_INDEX = TAB_INDEX + 1.
READ TABLE FTAB INDEX TAB_INDEX.
REMAIN = REMAIN + FTAB-WMENG.
CNTR = CNTR + 1.
ENDWHILE.
IF REMAIN = 0.
DELETE FTAB INDEX TAB_INDEX.
ELSEIF REMAIN > 0.
FTAB-WMENG = REMAIN.
MODIFY FTAB INDEX TAB_INDEX.
ENDIF.
ENDIF.
ENDFORM.
FORM GET_COMMIT_DATE
subroutine to get commit date for SO item
FORM GET_COMMIT_DATE TABLES CTAB STRUCTURE ITAB2C
USING CONF_QTY COM_DATE.
DATA: REMAIN LIKE VBEP-WMENG, "qty remaining
CNTR TYPE I, "loop counter
TAB_INDEX TYPE I. "table index
initialize
REMAIN = 0.
COM_DATE = SPACE.
get first commit date from table
TAB_INDEX = 1.
READ TABLE CTAB INDEX TAB_INDEX.
if request date not found, set request date to blank
IF SY-SUBRC <> 0.
COM_DATE = SPACE.
EXIT.
ELSE.
COM_DATE = CTAB-EDATU.
ENDIF.
calculate quantity remaining for request date
REMAIN = CTAB-ROMS1 - CONF_QTY.
if qty remaining > 0, update request date with qty remaining
IF REMAIN > 0.
CTAB-ROMS1 = REMAIN.
MODIFY CTAB INDEX TAB_INDEX.
if qty remaining = 0, delete request date (so next request
date will be used for next confirmed qty)
ELSEIF REMAIN = 0.
DELETE CTAB INDEX TAB_INDEX.
if qty remaining < 0, find next request date and update
ELSE.
CNTR = 0.
WHILE REMAIN < 0 OR CNTR < 10.
DELETE CTAB INDEX TAB_INDEX.
TAB_INDEX = TAB_INDEX + 1.
READ TABLE CTAB INDEX TAB_INDEX.
REMAIN = REMAIN + CTAB-ROMS1.
CNTR = CNTR + 1.
ENDWHILE.
IF REMAIN = 0.
DELETE CTAB INDEX TAB_INDEX.
ELSEIF REMAIN > 0.
CTAB-ROMS1 = REMAIN.
MODIFY CTAB INDEX TAB_INDEX.
ENDIF.
ENDIF.
ENDFORM.
END-OF-REPORT. -
Open Orders - Extractor 2LIS_11_VASTI
We are trying to develop an Open Orders report that would include items that are delivered (delivery related) and those that are dropped ship from a 3rd party (order related). We need to show open quantity and value.
The standard BI Content that we are currently using only shows open items that are delivered through SAP. We need the other 3rd party items as well. We believe that a solution would most likely require the order header and order line item status data (data from tables VBUK and VBUP in SAP).
Has anyone else had to develop a solution like this? Did you use the standard extractors? Is there a standard SAP solution for this in BW or did you have to create something custom?
Thank you for your help.Hi Ann,
I have a solution for you, which you can try...
create a table level generic data source on the table/view of VBBE which would
contains all your required data Hopefully..
Hope it helps..
assign points if useful..
Cheers,
Pattan. -
Data reconciliation for Open Orders
Hi,
Can any one give me the step by step approach for data reconciliation for open orders in Sales Infocube. I understand that the Open Orders which are dynamic Key figures and the data reconciliation in this case is not straight forward using "Generic View data sources" and we need to program our own generic data source with a funciton module. I would like to know if any one has dealt with this specific case and give me the proceudure to do the same.
Regds
tanuHi
Refer this
Data Reconciliation
You can compare periodic R/3 reports relevant to open orders with values in the cube and reports
Regards
N Ganesh -
Open order value not cleared Message: ORB 015
Hi All,
I have checked and searched for solution before poting this discussion, but not found anything relelvant to my problem.
While closing Project in CJ20N, I am getting an error message as -
Open order value not cleared
Message: ORB 015
It seems issue with incoming orders (sales orders), so I have run CJA1, and in output it is showing Processed object count as 1 but no detail log available for this.
Also in Settlement nothing is appearing to settle.
One thing I observed that one of the sales order linked with Project is rejected.
Can somebody assist me in resolving this issue?
Thank You,
Swapnil KharulHi Swapnil,
There are 2 things you can check here..
1) Is this the first time you are trying to settle incoming orders for the said Project/WBS? I mean did you ever run CJA1/CJA2 and CJ88 post that for this project? You can check this in KE24 report. Check if you find any entries for record type I. If there are any it means settlement of incoming orders is being done.
2) For the said WBS hit Ctrl+F3 and check if there is a settlement rule maintained for Incoming Orders. On the settlement rule screen you will see a button "Incoming Orders". Click on that see if a rule is maintained.
Regards,
Gokul -
Reg. Open Order with Status
HI,
can anyone let me know about Open Order with Status normally that we have to create Generic Extractors to extract that data.
thanx in advance
peter bHi peter,
Normally for Open Order with Status, you need to create a generic data source
on the database table 'VBBE', this table contains the Open Orders along with
the open quantities, then coming to the status, it is the business process to
determine since how long the sale order is Open, and the status of the Order..
I would suggest you to create a table level data souce on VBBE and try to
build the logic in the extractor if at all needed..
Hope it would give U an idea to begin..if you can achive any this with this do not
forget to assign point..
for any further questions revert..
Cheers..
Pattan. -
List of open orders quantity size wise
HI Experts,
Is there any report or table to see the list of open orders quantity size wise .....please help me..
Regards
VishnuDear Reddy,
The size which you are telling is that having different material codes?
If so means enter the material code and plant combination and select the status for which you want to search.(Select the proper
list in COOIS).
Cehck and revert
Regards
S Mangalraj
Maybe you are looking for
-
Project Management and Resource Management Reporting Views
I am wondering if anyone would have and is willing to share some documentation they may have put together around reporting views related to Project Management and Resource Management modules. We are installing the projects suite and I have never done
-
How do I shut down Microsoft Database Daemon SyncServicesAgent - Installer wants it shut down in order to proceed with the installation of Microsoft MAC Office 2011.
-
Using TimeMachine with one Mac and two HDD
Hi I was wondering if the following can be done with out loosing data and with out confusing TimeMachine: Using one mac and with time machine going back and forth between 2 external HDD ? in order to have 2 TimeMachine HDD (one at home and one on the
-
I am having problem importing photographs
Every time I try to import photos I get a message saying "Could not copy a file to the requested location". How can I help this situation?
-
How can I make more room on external drive for Time Machine?
I now have Time Machine installed and in use on my external drive, which also still has my previous backup on it which used a different system (Dejavu). The external drive's capacity is 74 GB; 58.22GB are used, my iMac hard drive (backed up with TIme