Create objects using functions?
I tried turning the following object (clear sake) into the product of a function (see below),
however, my attempts to display any kind of output produces "undefined".
------------ old code ----------------
drink = new Object();
drink.原酒 = new Object();
drink.原酒.nm = "原酒";
drink.原酒.dis = ???; //display price;
drink.原酒.prc = 40; //actual price;
drink.原酒.cal = 980; //whole bottle
drink.原酒.alc = 156; //alcohol: % alcohol * calories;
trace(drink.原酒.nm);
//works
------------ new code ----------------
drink = new Object();
function booze(mc, a, b, c, d, e){
mc = new Object();
mc.nm = a; mc.dis = b; mc.prc = c; mc.cal = d; mc.alc = e;
booze(drink.原酒, "原酒", "???", 40, 980, 156);
trace(drink.原酒.nm);
//fails
It'd be nice if there is a book that has all the tricks of the trade nicely presented, but I don't own it if there is... I don't care for books. Syntax is something that I've just come to understand thru years of losing hair trying to solve things.
That bit with the brackets, which I call bracket notation, and others call array notation, comes in very handy when you want to use a string to target an object. When you learn how to use them you end up finding that the syntax is just like what you would use for an array. In your case, there was the string b variable, which you were using to name an object within the drink object (I assumed it was the same set of characters as those for the object you were naming).
So when I was using mc[a], the program was translating it as mc.原酒, which in turn became drink.原酒
The brackets cause the program to interpret whatever string is inside them as an object's name (or variable, or property... some named entity). As far as the syntax goes, it is just like using an array index specification, wherein there is no "." before the brackets, but there is after if there is more to the object being targeted...
for(i=0; i<10; i++){
someMC["childMC"+i]._visible = false;
In that example, I'm turning 10 child movieclips within someMC invisible. Their instance names are childMC0, childMC1, childMC2,etc.... Notice that there is no decimal point ahead of the brackets, but there is after to connect the _visible property. I don't know why it's like that, but it's memorized that way after years of using it.
Similar Messages
-
Problem creating TO using Function Module L_TO_CREATE_DN
Hi Gurus,
I am trying to create TO using the Function Module L_TO_CREATE_DN. Its creating TO for deliveries for materials which are not batch split, however when I am taking delivery consisting of Batch Split material, its not creating and throwing a error with sy-subrc = 15. The error which I am experiencing is Item not handled in batches and batch split item cannot be edited. How to overcome this issue and create the TO.
Regards,
Avik
Edited by: avik2005uitbu on Dec 15, 2011 8:10 PMHi,
Please check the WM config for the Warehouse / Movement type(Tx. OMLX) . There we have option to give as immediate confirmation. This may be the reason for TO getting confirmed when created.
U can this by creating a transfer order for the same movement type manually in TX. LT03. After you save if the To is confirmed then its a config setup @ Warehouse / Movement type.
Regards,
Bhargava -
Creating Attachment using Function Module
Hi experts,
My problem here is, I need know the Function Module that is used to Create Attachement in Generic Object Services.
Currently, i only found this function module: SO_OBJECT_UPLOAD. But i do not really know how to use it.
Can anyone here advise?
Thanks
LawrenceThis blog: [/people/sergey.breslavets/blog/2007/06/29/create-and-handle-attachments-from-a-bsp-application ] describes how this works for a BSP app. If you scroll down to Method: handleupload and look at item (2) and (3), the describe the basic ABAP parts in this. The functions used here are the same ones used by the Generic Object Services.
-
Creating objects using reflection
Hi,
I need to construct a new instance using reflection and passing parameters. If the parameters are of primitive type ex. int, how can I pass them in the Class[] type of objectInteger.TYPE, etc. are Class objects that represent the types of the primitives.
-
Cannot Create Object 'SAP.Functions'
Hi All -
I know this is a simple issue. I have a SQL server that retrieves info from SAP via SSIS. using sap.functions. somehow I dont have the AX controls installed properly. Can someone give me some guidance?
I am not really very familiar with the ins and outs of SAP but I had this setup on another server and it works ok. SQL is running on Win2K3.
I installed the entire 4.6d gui, but I had to install it in non standard directories. can someone tell me what I need to make this work?
I have seen some notes where people say make sure you have wdtfuncs.ocx wdtlog.ocx and librfc32.dll registered.
I figured the full install of the gui would do that but maybe not. I registered each one manually but when I got to librfs32.dll i got an '80004005' errorHello Kelly
The SAP GUI 4.6d which you are using is very old. There has been quite many fixes that had gone in wdtlog.ocx, wdtfuncs.ocx binaries. So it is always better to use either 6.40 or 7.10 latest SAP GUI patch.
Regards,
Dinesh -
Creating Object using Class.forName vs new
Hello,
Is there any difference between:
Class c = Class.forName("Foo");
Foo foo = (Foo) c.newInstance();
and
Foo foo = new Foo();
Thanks.Simple search brings this:
http://forum.java.sun.com/thread.jspa?forumID=31&threadID=614699 -
Dynamic Creation of Objects using Tree Control
I am able to Create Dynamic Objets using List control in
flex,but not able to create objects using TreeControl,currently iam
using switch case to do that iam embedding source code please help
me how to do that
<?xml version="1.0" encoding="utf-8"?>
<!--This Application Deals With How to Create Objects
Dynamically -->
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:XML id="treeDP">
<node label="Controls">
<node label="Button"/>
<node label="ComboBox"/>
<node label="ColorPicker"/>
<node label="Hslider"/>
<node label="Vslider"/>
<node label="Checkbox"/>
</node>
</mx:XML>
<mx:Script>
<![CDATA[
import mx.core.UIComponentGlobals;
import mx.containers.HBox;
import mx.controls.*;
import mx.controls.VSlider;
import mx.controls.Button;
import mx.controls.Alert;
import mx.core.UIComponent;
import mx.controls.Image;
import mx.managers.DragManager;
import mx.events.DragEvent;
import mx.controls.Tree;
import mx.core.DragSource
import mx.core.IFlexDisplayObject;
/*This function accepts the item as on when it is dragged
from tree Component */
private function ondragEnter(event:DragEvent) : void
if (event.dragSource.hasFormat("treeItems"))
DragManager.acceptDragDrop(Canvas(event.currentTarget));
DragManager.showFeedback(DragManager.COPY);
return;
else{
DragManager.acceptDragDrop(Canvas(event.currentTarget));
return;
/*This Function creates objects as the items are Dragged
from the TreeComponent
And Creates Objects as and When They Are Dropped on the
Container */
private function ondragDrop(event:DragEvent) : void
if (event.dragSource.hasFormat("treeItems"))
var items:Array =event.dragSource.dataForFormat("treeItems")
as Array;
for (var i:int = items.length - 1; i >= 0; i--)
switch(items
[email protected]())
case "Button":
var b:Button=new Button();
b.x = event.localX;
b.y = event.localY;
b.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
myCanvas.addChild(b);
break;
case "ComboBox":
var cb:ComboBox=new ComboBox();
myCanvas.addChild(cb);
cb.x = event.localX;
cb.y = event.localY;
cb.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
break;
case "ColorPicker":
var cp:ColorPicker=new ColorPicker();
myCanvas.addChild(cp);
cp.x = event.localX;
cp.y = event.localY;
cp.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
break;
case "Vslider":
var vs:VSlider=new VSlider();
myCanvas.addChild(vs);
vs.x = event.localX;
vs.y = event.localY;
vs.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
break;
case "Hslider":
var hs:HSlider=new HSlider();
myCanvas.addChild(hs);
hs.x = event.localX;
hs.y = event.localY;
hs.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
break;
case "Checkbox":
var check:CheckBox=new CheckBox();
myCanvas.addChild(check);
check.x = event.localX;
check.y = event.localY;
check.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
break;
else {
var Component:UIComponent =
event.dragSource.dataForFormat("items") as UIComponent ;
Component.x = event.localX;
Component.y = event.localY;
Component.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
myCanvas.addChild(Component);
/*How to move the Objects within the Container */
public function mouseMoveHandler(event:MouseEvent):void{
var
dragInitiator:UIComponent=UIComponent(event.currentTarget);
var ds:DragSource = new DragSource();
ds.addData(dragInitiator,"items")
DragManager.doDrag(dragInitiator, ds, event);
]]>
</mx:Script>
<mx:Tree dataProvider="{treeDP}" labelField="@label"
dragEnabled="true" width="313" left="0" bottom="-193" top="0"/>
<mx:Canvas id="myCanvas" dragEnter="ondragEnter(event)"
dragDrop="ondragDrop(event)" backgroundColor="#DDDDDD"
borderStyle="solid" left="321" right="-452" top="0"
bottom="-194"/>
</mx:Application>
iwant to optimize the code in the place of switch case
TextTextAssuming your objects are known and what you need are simply
variable names created by the program, try using objects as
associative arrays:
var asArray:Object = new Object();
for (var n:int = 0; n < 10; n++) {
asArray["obj" + n] = new WHAT_EVER(); -
How to create ST using BAPI_SLSTRANSACT_CREATEMULTI
Hi Friends,
I'm trying to create NEW SalesTransaction(ST) using fm 'BAPI_SLSTRANSACT_CREATEMULTI' in an another new RFC function module. The header is creating but not Partner,Item,product and all. I need to create ST using this BAPI.
The input i'm passing is partner,pro`duct,product description,net price,net value,quantity,PO number,Order number,Quantity,ATP quntity,Date,Address including email and phone.
The problem i'm facing is <b>HOW TO FILL THESE INPUT VALUES IN THE EXACT FILEDS IN THE TABLES OF BAPI.</b>
I'm getting these errors.
<b>1)W CRM_ORDER 004 Referenced object type (PARTNER) not allowed
2)W CRM_ORDER 004 Referenced object type (SALES) not allowed
3)E CRM_ORDERADM_I 006 Item was not found.
4)E CRM_ORDER 005 Incomplete interface data - No reference specified
5)S CRM_MESSAGES 005 A log has been generated for single document </b>
The code i did is:
TYPES: TYP_HEADER TYPE BAPIBUS20001_HEADER_INS,
TYP_ITEM TYPE BAPIBUS20001_ITEM,
TYP_SALES TYPE BAPIBUS20001_SALES,
TYP_PARTNER TYPE BAPIBUS20001_PARTNER_INS,
TYP_SCHEDULELINE TYPE BAPIBUS20001_SCHEDLIN,
TYP_CREATED_PROCESS TYPE BAPIBUS20001_HEADER_INS,
TYP_SAVED_PROCESS TYPE BAPIBUS20001_OBJECT_ID,
TYP_INPUT_FIELDS TYPE BAPIBUS20001_INPUT_FIELDS.
DATA: IT_HEADER TYPE TYP_HEADER OCCURS 10
WITH HEADER LINE,
IT_ITEM TYPE TYP_ITEM OCCURS 10
WITH HEADER LINE,
IT_SALES TYPE TYP_SALES OCCURS 10
WITH HEADER LINE,
IT_PARTNER TYPE TYP_PARTNER OCCURS 10
WITH HEADER LINE,
IT_SCHEDULELINE TYPE TYP_SCHEDULELINE OCCURS 10
WITH HEADER LINE,
IT_CREATED_PROCESS TYPE TYP_CREATED_PROCESS OCCURS 10
WITH HEADER LINE,
IT_SAVED_PROCESS TYPE TYP_SAVED_PROCESS OCCURS 10
WITH HEADER LINE,
IT_INPUT_FIELDS TYPE TYP_INPUT_FIELDS OCCURS 10
WITH HEADER LINE,
V_ORDER_DATE(15) TYPE C,
V_GUID_H TYPE BBP_GUID_32,
V_GUID_I TYPE BBP_GUID_32,
V_GUID_P TYPE BBP_GUID_32,
V_GUID_SA TYPE BBP_GUID_32,
V_GUID_SC TYPE BBP_GUID_32.
PERFORM GET_GUID CHANGING V_GUID_H.
PERFORM GET_GUID CHANGING V_GUID_I.
PERFORM GET_GUID CHANGING V_GUID_P.
PERFORM GET_GUID CHANGING V_GUID_SA.
PERFORM GET_GUID CHANGING V_GUID_SC.
* Header
IT_HEADER-GUID = V_GUID_H.
IT_HEADER-PROCESS_TYPE = PROCESS_TYPE(INPUT).
IT_HEADER-DESCRIPTION = DESCRIPTION(INPUT).
APPEND IT_HEADER.
* Item
IT_ITEM-GUID = V_GUID_I.
IT_ITEM-HEADER = V_GUID_H.
IT_ITEM-ORDERED_PROD = PRODUCT(INPUT).
IT_ITEM-DESCRIPTION = PRODUCT_DESCRIPTION(INPUT).
IT_ITEM-ITM_TYPE = ITEM_TYPE(INPUT).
IT_ITEM-MODE = 'A'.
APPEND IT_ITEM.
* Sales
IT_SALES-REF_GUID = V_GUID_SA.
IT_SALES-PO_NUMBER_SOLD = PO_NUMBER(INPUT).
APPEND IT_SALES.
* Partner
IT_PARTNER-REF_GUID = V_GUID_H.
IT_PARTNER-PARTNER_FCT = '00000001'.
IT_PARTNER-REF_KIND = 'A'.
IT_PARTNER-REF_PARTNER_HANDLE = '0001'.
IT_PARTNER-KIND_OF_ENTRY = 'A'.
IT_PARTNER-NO_TYPE = 'BP'.
IT_PARTNER-DISPLAY_TYPE = 'BP'.
IT_PARTNER-PARTNER_NO = CUSTOMER(INPUT).
IT_PARTNER-NAME = NAME(INPUT).
IT_PARTNER-HOUSE_NO = HOUSE_NO(INPUT).
IT_PARTNER-CITY = CITY(INPUT).
IT_PARTNER-STREET = STREET(INPUT).
IT_PARTNER-COUNTRY = COUNTRY(INPUT).
IT_PARTNER-E_MAIL = EMAIL(INPUT).
IT_PARTNER-TEL1_NUMBR = PHONE(INPUT).
APPEND IT_PARTNER.
* Schedule line
IT_SCHEDULELINE-ITEM_GUID = V_GUID_SC.
IT_SCHEDULELINE-QUANTITY = ATP_QUANTITY(INPUT).
APPEND IT_SCHEDULELINE.
* Input fields
IT_INPUT_FIELDS-REF_GUID = V_GUID_H.
IT_INPUT_FIELDS-OBJECTNAME = 'ORDERADM_H'.
IT_INPUT_FIELDS-LOGICAL_KEY = '1'.
APPEND IT_INPUT_FIELDS.
IT_INPUT_FIELDS-REF_GUID = V_GUID_I.
IT_INPUT_FIELDS-OBJECTNAME = 'ORDERADM_I'.
IT_INPUT_FIELDS-LOGICAL_KEY = '1'.
APPEND IT_INPUT_FIELDS.
IT_INPUT_FIELDS-REF_GUID = V_GUID_H.
IT_INPUT_FIELDS-OBJECTNAME = 'PARTNER'.
IT_INPUT_FIELDS-LOGICAL_KEY = '1'.
APPEND IT_INPUT_FIELDS.
IT_INPUT_FIELDS-REF_GUID = V_GUID_SA.
IT_INPUT_FIELDS-OBJECTNAME = 'SALES'.
IT_INPUT_FIELDS-LOGICAL_KEY = '1'.
APPEND IT_INPUT_FIELDS.
IT_INPUT_FIELDS-REF_GUID = V_GUID_SC.
IT_INPUT_FIELDS-OBJECTNAME = 'SCHEDLIN'.
IT_INPUT_FIELDS-LOGICAL_KEY = '1'.
APPEND IT_INPUT_FIELDS.
CALL FUNCTION 'BAPI_SLSTRANSACT_CREATEMULTI'
* EXPORTING
* TESTRUN =
TABLES
HEADER = IT_HEADER
ITEM = IT_ITEM
RETURN = RETURN
SALES = IT_SALES
PARTNER = IT_PARTNER
* ORGANISATION =
* SHIPPING =
* APPOINTMENT =
* TEXT =
* STATUS =
INPUT_FIELDS = IT_INPUT_FIELDS
* PRODUCT =
SCHEDULELINE = IT_SCHEDULELINE
* CUSTOMER_HEAD =
* CUSTOMER_ITEM =
* PRICING =
* PRICING_ITEM =
* CONDITION_CREATE =
* BILLING =
* CONFIG_CFG =
* CONFIG_BLB =
* CONFIG_INS =
* CONFIG_PRT =
* CONFIG_VAL =
* CONFIG_VK =
* CONFIG_REF =
* ADDRESS =
* BILLPLAN =
* BILLPLAN_DATE =
CREATED_PROCESS = IT_CREATED_PROCESS
SAVED_PROCESS = IT_SAVED_PROCESS
* DOC_FLOW =
* PAYPLAN =
* PAYPLAN_DATE =
COMMIT WORK.
READ TABLE RETURN WITH KEY TYPE = 'E'.
IF SY-SUBRC NE 0.
DATA: V_RETURN LIKE BAPIRET2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
RETURN = V_RETURN.
CHECK NOT IT_SAVED_PROCESS[] IS INITIAL.
READ TABLE IT_SAVED_PROCESS INDEX 1.
CHECK SY-SUBRC EQ 0.
SALES_PROCESS = IT_SAVED_PROCESS-OBJECT_ID.
ENDIF.
ENDFUNCTION.
FORM GET_GUID CHANGING P_GUID TYPE GUID_32.
CALL FUNCTION 'GUID_CREATE'
IMPORTING
EV_GUID_32 = P_GUID.
ENDFORM.
Can any one help me in this.Hey Varda,
I generated a sales order in CRM with BAPI_SLSTRANSACT_CREATEMULTI for a single line item...that is it accepts a single product and generates a sales order...but in real time there can be any number of line items for a sales order...
*1) Now i need to make this code generic such that it can accept any number of materials...line items?
How can i make the code generic ....such that it works for any number of line items.*
*2) Also the CRM is currently configured in such a way that , there is a provision to assign ship to party at item level for each material.
How can i programatically replicate this? I need to assign a diiferent ship to party for each material in the sales order.*
how can i programatically replicate this?...
this is my code for cresating a sales order in CRM for a single line item or single material
*************include constants
include crm_direct.
************// GUIDs
data: lv_guid_h type GUID_32, "HEADER GUIDE
lv_guid_i type GUID_32, "ITEM GUIDE
lv_guid_sl type GUID_32, "SCHEDULE LINE GUIDE
lv_guid_p type GUID_32. "PARTNER GUIDE
***********// Handles
data: lv_current_handle type crmt_handle, "CURRENT HANDLE
lv_handle_h type crmt_handle, "HEADER HANDLE
lv_handle_i type crmt_handle, "ITEM HANDLE
lv_handle_sl type crmt_handle, "SCHEDULE LINE HANDLE
lv_handle_p type crmt_handle. "PARTNER HANDLE
***********// Administration header + item + etc
data: lt_salesorder_header type table of bapibus20001_header_ins, "LT_SALESORDER_HEADER
ls_salesorder_header type bapibus20001_header_ins, "LS_SALESORDER_HEADER
lt_salesorder_item type table of bapibus20001_item, "LT_SALESORDER_ITEM
ls_salesorder_item type bapibus20001_item, "LS_SALESORDER_ITEM
lt_scheduleline type table of BAPIBUS20001_SCHEDLIN, "LT_SCHEDULELINE
ls_scheduleline type BAPIBUS20001_SCHEDLIN, "LS_SCHEDULELINE
lt_partner type table of BAPIBUS20001_PARTNER_INS, "LT_PARTNER
ls_partner type BAPIBUS20001_PARTNER_INS, "LS_PARTNER
ls_logical_key TYPE crmt_partner_logic_partner_key, "LS_LOGICAL_KEY
lt_organisation type table of BAPIBUS20001_ORGMAN_INS, "LT_ORGANISATION
ls_organisation type BAPIBUS20001_ORGMAN_INS. "LS_ORGANISATION
*********// Saved sales orders
data: lt_saved_process type table of bapibus20001_object_id, "LT_SAVED_PROCESS
data:
ls_saved_process type bapibus20001_object_id, "LS_SAVED_PROCESS
ls_salesorder type CRMT_RETURN_OBJECTS_STRUC. "LS_SALESORDER
data: lt_input_fields type table of bapibus20001_input_fields, "LT_INPUT_FIELDS
ls_input_fields type bapibus20001_input_fields, "LS_INPUT_FIELDS
ls_return type bapiret2. "LS_RETURN
data: lt_return type table of bapiret2. "LT_RETURN
***********// Macro definition to populate structure and input field This, called as
*_set_field ls_salesorder_header GUID lv_guid_h
*is exploded as
ls_salesorder_header-GUID = lv_guid_h.
ls_input_fields-fieldname = 'GUID'.
append ls_input_fields to lt_input_fields.
*Note 1: &2 (field name) MUST be uppercase
*Note 2: for the salesorder header, Macro has not been used to show how the code should look like.
*except for that the macro has been used everywhere else.
define setfield.
&1-&2 = &3.
ls_input_fields-fieldname = '&2'.
append ls_input_fields to lt_input_fields.
end-of-definition.
*****// end of macro definition
******// fill order administration header
perform get_guid changing lv_guid_h.
add 1 to lv_handle_h.
ls_salesorder_header-guid = lv_guid_h.
ls_salesorder_header-handle = lv_handle_h.
ls_salesorder_header-process_type = 'ZWEB'.
clear ls_input_fields.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_guid = lv_guid_h.
*ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-orderadm_h.
ls_input_fields-fieldname = 'GUID'.
append ls_input_fields to lt_input_fields.
ls_input_fields-fieldname = 'HANDLE'.
append ls_input_fields to lt_input_fields.
ls_input_fields-fieldname = 'PROCESS_TYPE'.
append ls_input_fields to lt_input_fields.
append ls_salesorder_header to lt_salesorder_header.
**********// fill organisation data (Interface needs this, some times may rely on sales org determination instead...
clear ls_input_fields.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_guid = lv_guid_h.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-orgman.
setfield ls_organisation REF_GUID lv_guid_h.
setfield ls_organisation REF_HANDLE lv_handle_h.
setfield ls_organisation REF_KIND gc_object_ref_kind-orderadm_h.
setfield ls_organisation SALES_ORG_RESP SO_RESP . "(input).
setfield ls_organisation SALES_ORG SALES_ORG. "(input).
setfield ls_organisation DIS_CHANNEL DIS_CHNL. "(input).
setfield ls_organisation DIVISION DIVISION. "(input).
append ls_organisation to lt_organisation.
**********// fill order administration item
perform get_guid changing lv_guid_i.
lv_handle_i = lv_handle_h.
add 1 to lv_handle_i.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_i.
ls_input_fields-ref_handle = lv_handle_i.
*ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_i.
ls_input_fields-objectname = gc_object_name-orderadm_i.
setfield ls_salesorder_item GUID lv_guid_i.
setfield ls_salesorder_item HEADER lv_guid_h.
setfield ls_salesorder_item HANDLE lv_handle_i.
setfield ls_salesorder_item HEADER_HANDLE lv_handle_h.
setfield ls_salesorder_item ORDERED_PROD PRODUCT . "(input).
setfield ls_salesorder_item ITM_TYPE 'ZTAN'.
setfield ls_salesorder_item MODE 'A'.
*adjustment taken from standard include LCMS_MAPPERF04
*(see where-used-list for BAPI_SLSTRANSACT_CREATEMULTI, program LCMS_MAPPERU11)
delete lt_input_fields where fieldname = 'HANDLE'
OR
fieldname = 'HEADER_HANDLE'.
append ls_salesorder_item to lt_salesorder_item.
********// fill schedule line for item
perform get_guid changing lv_guid_sl.
add 1 to lv_handle_sl.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_i.
ls_input_fields-ref_handle = lv_handle_i.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_i.
ls_input_fields-objectname = gc_object_name-schedlin.
setfield ls_scheduleline ITEM_GUID lv_guid_i.
setfield ls_scheduleline GUID lv_guid_sl.
setfield ls_scheduleline HANDLE lv_handle_sl.
setfield ls_scheduleline ITEM_HANDLE lv_handle_i.
setfield ls_scheduleline QUANTITY quantity. "(input).
append ls_scheduleline to lt_scheduleline.
********// fill partner line
*perform get_guid changing lv_guid_p.
*the partner use the logical key as well
ls_logical_key-ref_partner_handle = '0001'.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_h.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-partner.
ls_input_fields-logical_key = ls_logical_key.
setfield ls_partner REF_GUID lv_guid_h.
setfield ls_partner REF_HANDLE lv_handle_h.
setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
setfield ls_partner REF_PARTNER_HANDLE '0001'.
setfield ls_partner KIND_OF_ENTRY 'C'.
setfield ls_partner PARTNER_FCT '00000001'.
setfield ls_partner PARTNER_NO SOLD_TO. "(input).
setfield ls_partner NO_TYPE 'BP'.
setfield ls_partner DISPLAY_TYPE 'BP'.
move-corresponding ls_partner to ls_logical_key.
append ls_partner to lt_partner.
ls_logical_key-ref_partner_handle = '0002'.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_h.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-partner.
ls_input_fields-logical_key = ls_logical_key.
setfield ls_partner REF_GUID lv_guid_h.
setfield ls_partner REF_HANDLE lv_handle_h.
setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
setfield ls_partner REF_PARTNER_HANDLE '0002'.
setfield ls_partner KIND_OF_ENTRY 'C'.
setfield ls_partner PARTNER_FCT '00000002'.
setfield ls_partner PARTNER_NO SHIP_TO . "(input).
setfield ls_partner NO_TYPE 'BP'.
setfield ls_partner DISPLAY_TYPE 'BP'.
move-corresponding ls_partner to ls_logical_key.
append ls_partner to lt_partner.
ls_logical_key-ref_partner_handle = '0003'.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_h.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-partner.
ls_input_fields-logical_key = ls_logical_key.
setfield ls_partner REF_GUID lv_guid_h.
setfield ls_partner REF_HANDLE lv_handle_h.
setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
setfield ls_partner REF_PARTNER_HANDLE '0003'.
setfield ls_partner KIND_OF_ENTRY 'C'.
setfield ls_partner PARTNER_FCT '00000003'.
setfield ls_partner PARTNER_NO BILL_TO ."(input).
setfield ls_partner NO_TYPE 'BP'.
setfield ls_partner DISPLAY_TYPE 'BP'.
move-corresponding ls_partner to ls_logical_key.
append ls_partner to lt_partner.
ls_logical_key-ref_partner_handle = '0004'.
clear ls_input_fields.
ls_input_fields-ref_guid = lv_guid_h.
ls_input_fields-ref_handle = lv_handle_h.
ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
ls_input_fields-objectname = gc_object_name-partner.
ls_input_fields-logical_key = ls_logical_key.
setfield ls_partner REF_GUID lv_guid_h.
setfield ls_partner REF_HANDLE lv_handle_h.
setfield ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
setfield ls_partner REF_PARTNER_HANDLE '0004'.
setfield ls_partner KIND_OF_ENTRY 'C'.
setfield ls_partner PARTNER_FCT '00000004'.
setfield ls_partner PARTNER_NO PAYER ."(input).
setfield ls_partner NO_TYPE 'BP'.
setfield ls_partner DISPLAY_TYPE 'BP'.
move-corresponding ls_partner to ls_logical_key.
append ls_partner to lt_partner.
*******// example of a second partner function (custom) with data override
*ls_logical_key-ref_partner_handle = '0002'.
*clear ls_input_fields.
*ls_input_fields-ref_guid = lv_guid_h.
*ls_input_fields-ref_handle = lv_handle_h.
*ls_input_fields-ref_kind = gc_object_ref_kind-orderadm_h.
*ls_input_fields-objectname = gc_object_name-partner.
*ls_input_fields-logical_key = ls_logical_key.
*_set_field ls_partner REF_GUID lv_guid_h.
*_set_field ls_partner REF_HANDLE lv_handle_h.
*_set_field ls_partner REF_KIND gc_object_ref_kind-orderadm_h.
*_set_field ls_partner REF_PARTNER_HANDLE '0002'.
*_set_field ls_partner KIND_OF_ENTRY 'B'. "manual entry...
*_set_field ls_partner PARTNER_FCT customFct(input).
*_set_field ls_partner PARTNER_NO bpNumber(input).
*_set_field ls_partner NO_TYPE 'BP'.
*_set_field ls_partner DISPLAY_TYPE 'BP'.
*_set_field ls_partner TITLE 'Mr.'.
*_set_field ls_partner FIRSTNAME 'John'.
*_set_field ls_partner LASTNAME 'Smith'.
*_set_field ls_partner STR_SUPPL1 'John Smith and Co'.
*_set_field ls_partner STREET 'Street1'.
*_set_field ls_partner STR_SUPPL3 'Street4'.
*_set_field ls_partner HOUSE_NO '42'.
*_set_field ls_partner CITY 'Townville'.
*_set_field ls_partner DISTRICT 'Districtshire'.
*_set_field ls_partner POSTL_COD1 'AA1 2BB'.
*note now ...
*adjustment taken from standard include LCMS_MAPPERF04
*(see where-used-list for BAPI_SLSTRANSACT_CREATEMULTI, program LCMS_MAPPERU11)
*I don't use macro because name of the field in input_table is different
*_set_field ls_partner COUNTRYISO 'GB'.
*instead
ls_partner-COUNTRYISO = 'GB'.
ls_input_fields-fieldname = 'COUNTRY'.
append ls_input_fields to lt_input_fields.
*_set_field ls_partner LANGU_ISO 'EN'.
ls_partner-LANGU_ISO = 'EN'.
ls_input_fields-fieldname = 'LANGU'.
append ls_input_fields to lt_input_fields.
move-corresponding ls_partner to ls_logical_key.
append ls_partner to lt_partner.
*Create sales orders *
call function 'BAPI_SLSTRANSACT_CREATEMULTI'
EXPORTING
testrun = false
TABLES
header = lt_salesorder_header[]
item = lt_salesorder_item[]
partner = lt_partner[]
organisation = lt_organisation[]
input_fields = lt_input_fields[]
scheduleline = lt_scheduleline[]
saved_process = lt_saved_process[]
return = lt_return[].
*************// get the GUID of the created object
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = lt_return1.
INCLUDE ZZGVBAPISALESORDER_GET_GUIDF01. -
R/3 Master Data Extraction Using Function Module
Hi Experts,
Could you please let me know why & How (Detail procedure) to extract R/3 master data using function module.
My team manager asked me to extract master data from R/3 for 3 more attributes of info object '0material' which is already defined as data target.
I would like to know why they are extracting data using function module
ThanksThe steps for creating extractor using Function Module. I
1. Create new Function group (if you have already not done so) in Se80
2. Copy Function module "RSAX_BIW_GET_DATA_SIMPLE" with suitable name.
3. Change the code that populate data.
Following table may give you the guideline for parameters.
Parameter Description
I_REQUNR (import) BW provides this request identifier. It is a system-generated identifier in the form REQU_XXXXXX. BW uses this same identifier in all function module calls that relate to a single load.
I_DSOURCE (import) The name of the generic extractor
I_MAXSIZE (import) The maximum number of records that BW expects to be in each data packet
I_INITFLAG (import) A Boolean flag that indicates if this is the initialization (first) call to the function module
I_READ_ONLY (import) A test flag not needed in most extraction scenarios
I_T_SELECT (table) This table holds any selections from the BW InfoPackage. The function module should examine these selections and only return data that matches the selections.
I_T_FIELD (table) This table holds the fields that BW requests
E_T_DATA (table) The function module fills this table with data records. These records then return to BW as data packets. This table has the same structure as the extract structure defined in the generic DataSource.
NO_MORE_DATA (exception) The function module raises this exception when no more data is available
ERROR_PASSED_TO_MESS_HANDLER (exception) The function module raises this exception if an error occurred during the extraction. It alerts BW to check for error logs.
Change following code to put the selection fields
Select ranges
RANGES: L_R_CARRID FOR SFLIGHT-CARRID,
L_R_CONNID FOR SFLIGHT-CONNID.
Change following to populate data
OPEN CURSOR WITH HOLD S_CURSOR FOR
SELECT (S_S_IF-T_FIELDS) FROM SFLIGHT
WHERE CARRID IN L_R_CARRID AND
CONNID IN L_R_CONNID.
ENDIF. "First data package ?
Fetch records into interface table.
named E_T_'Name of extract structure'.
FETCH NEXT CURSOR S_CURSOR
APPENDING CORRESPONDING FIELDS
OF TABLE E_T_DATA
PACKAGE SIZE S_S_IF-MAXSIZE.
below links
Re: functionmodule
Re: FM for G. extractor
***Assign points if it helps.**
Regards
CSM Reddy -
Hello:
I was install oracle 8.0.5 under linux, the documentation talk
about you must
create objects in one session different of the initial oracle
installation.
I installed oracle successfully, but now when i try to create
objects in other
orainst session appear one error:
oraview... file_not_found.
What can i do?
nullJohn Sanabria (guest) wrote:
: Hello:
: I was install oracle 8.0.5 under linux, the documentation talk
: about you must
: create objects in one session different of the initial oracle
: installation.
: I installed oracle successfully, but now when i try to create
: objects in other
: orainst session appear one error:
: oraview... file_not_found.
: What can i do?
Don't quite get your point but the usual way to create data
objects is: log into the oracle as an ordinary user and then
create object using the usual commands such as :CREATE TABLE
.....blah blah. If I didn't quite catch your meaning can you
specify your question a bit concrete.
John
null -
Use Granfeldts Create Object to create dynamic groups
Trying to use Sorens Granfeldts, Create Object WF activity to create dynamic groups.
In a standard function evaluator activity I generate the Filter as [//WorkflowData/Filter]
The "string" I set it to is:
<Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[ObjectID
= /*[ObjectID = '8dfcb5e8-ff01-400c-8ca7-2a0002d2d2d4']/ComputedMember]</Filter>
In the CreateObject activity I then just have [//WorkflowData/Filter],Filter among the initial values.
The creation works if I remove this attribute so the rest of the attributes seems to be working.
The creation fails however end I get the error below in the Forefront Identity Manager event log.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.ResourceManagement.WFActivities.Resolver.GetDisplayStringFromGuid(Guid id, String[] expansionAttributes)
at Microsoft.ResourceManagement.WFActivities.Resolver.ReplaceGuidWithTemplatedString(Match m)
at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
at Microsoft.ResourceManagement.WFActivities.Resolver.GetStringAttributeValue(Object attribute)
at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorWithoutAntiXSS(String match, ResolverOptions resolveOptions)
at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorForWithAntiXSS(String match, ResolverOptions resolveOptions)
at Microsoft.ResourceManagement.WFActivities.Resolver.ReplaceMatches(String input, Boolean useAntiXssEncoding, ResolverOptions resolveOptions)
at Microsoft.ResourceManagement.Workflow.Hosting.ResolverEvaluationServiceImpl.ResolveLookupGrammar(Guid requestId, Guid targetId, Guid actorId, Dictionary`2 workflowDictionary, Boolean encodeForHTML, String expression)
at Microsoft.ResourceManagement.Workflow.Activities.ResolveGrammarActivity.Execute(ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
at System.Workflow.Runtime.Scheduler.Run()
Have anyone used this WF activity to create dynamic groups and can tell how to set the Filter?Hey Kent!
I did the same thing, with Søren`s Create Object WF. I did it like this on the filter part:
<Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter
The whole thing looks like this:
(I use Function evaluator to generate a AccountName for groups based on a clean version of DisplayName).
[//Target/DisplayName],DisplayName
SEC_[//WorkFlowData/CleanAccountName],AccountName
[//Target/Manager],Owner
Security,Type
DOMAIN_STRING,Domain
Universal,Scope
[//Target/DisplayName]_SecGroup,Description
[//Target/Manager],DisplayedOwner
None,MembershipAddWorkflow
True,MembershipLocked
[//Target/CleanAccountName],MailNickname
<Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter
Regards, Remi www.iamblogg.com -
Hi,
When i use function module KKPI_BDC_ADD_ON_COSTS_CREATE to create additive costs it shows an error. The error is 'THE OBJECT IS LOCKED BY THE USER SARKARD' the transaction it uses is CK74 for creating.
I have also read about KKP4_ADD_ON_COSTS_CREATE. But i dont know the usage of it..
I think it will be helpful if u can clarify with first FM.
Kindly suggest.
Thank you.
HarshaHi Harsha,
I have a similar requirement, but the issue that I am facing is that I can not find any parameter in the FM - KKPI_BDC_ADD_ON_COSTS_CREATE for Valuation Date which is a mandatory field in CK74. How did you overcome that issue, can you please share ? -
Specific function modules to create objects of type SC, D, CG CE?
Hi Experts,
I need to create objects
SC (Program of study)
D (Event Type)
CG (Module Group)
CE (Assessment)
using function modules. Up to the present, we have beeing using function module
HRIQ_OBJECT_CREATE
as an all purpose FM for all these object types.
However, now, I have the requirement to replace these FM with specific FM for that particular object type. For object type SM, I found
HRIQ_RFC_MODULE_CREATE
Now, I am asking you if there are such FM for the other objects in question as well??
THANKS,
JohannesDear Johannes,
Hereby some FM's that may help you out:
- HRIQ_CREATE_ANY_OBJECT --> create any objject
- HRIQ_SUBJECT_CREATE --> create SU
- HRIQ_TRANSCRIPT_CREATE --> create EQ
- HRIQ_STUDY_OBJECT_CREATE --> create CS
- HRIQ_RULECONTAINER_CREATE --. create RC
- HRIQ_AW_ACWORK_CREATE --> create CW
br
Rob -
Creating an own object-relational function.
Hi
I'd like to create a new function on a object-relational datatype. Where can I find information about comparable methods like SDO_AREA and how to build an own.
Thanks
ChrisYou can use PL/SQL to write such functions.
I have written many functions that operates on SDO_Geometry objects.
This exampla calculates the minimal bounding rectangle of a sdo_geometry:
FUNCTION Calc_mbr( Geo Mdsys.Sdo_geometry )
RETURN VARCHAR2 IS
Resultat VARCHAR2( 100 );
Antelem NUMBER;
Antord NUMBER;
X1 NUMBER;
Y1 NUMBER;
X2 NUMBER;
Y2 NUMBER;
X NUMBER;
Y NUMBER;
E NUMBER;
C NUMBER;
Startingoffset NUMBER;
Startingoffsetnext NUMBER;
Etype NUMBER;
Interpretation NUMBER;
BEGIN
Resultat := NULL;
IF NOT Geo.Sdo_point IS NULL THEN
Resultat :=
TO_CHAR( Geo.Sdo_point.Y ) || ';' || TO_CHAR( Geo.Sdo_point.X ) || ';' ||
TO_CHAR( Geo.Sdo_point.Y ) ||
';' ||
TO_CHAR( Geo.Sdo_point.X ) ||
RETURN Resultat;
END IF;
IF Geo IS NOT NULL THEN
Antelem := Geo.Sdo_elem_info.COUNT( );
Antord := Geo.Sdo_ordinates.COUNT( );
E := 1;
WHILE E < Antelem LOOP
Startingoffset := Geo.Sdo_elem_info( E );
Etype := Geo.Sdo_elem_info( E + 1 );
Interpretation := Geo.Sdo_elem_info( E + 2 );
IF ( Antelem > E * 3 ) THEN
Startingoffsetnext := Geo.Sdo_elem_info( E + 3 );
--Start of ordinates for next element
ELSE
Startingoffsetnext := Antord + 1;
END IF;
IF Etype > 0 THEN
IF ( E = 1 ) THEN -- initalization .
X1 := Geo.Sdo_ordinates( 1 );
X2 := X1;
Y1 := Geo.Sdo_ordinates( 2 );
Y2 := Y1;
END IF;
C := Startingoffset;
WHILE C < Startingoffsetnext LOOP
X := Geo.Sdo_ordinates( C );
Y := Geo.Sdo_ordinates( C + 1 );
IF X < X1 THEN
X1 := X;
ELSIF X > X2 THEN
X2 := X;
END IF;
IF Y < Y1 THEN
Y1 := Y;
ELSIF Y > Y2 THEN
Y2 := Y;
END IF;
C := C + 4; -- x,y,z,m
END LOOP;
END IF;
E := E + 3; -- Elements are always triplets.
END LOOP;
Resultat :=
TO_CHAR( Y1 ) || ';' || TO_CHAR( X1 ) || ';' || TO_CHAR( Y2 ) || ';' ||
TO_CHAR( X2 ) ||
ELSE
Resultat := NULL;
END IF;
RETURN Resultat;
END; -
Creating Report using EPM Functions with Dynamic Filters
Hi All,
I am new to BPC, In BPC 7.5 i seen like we can generate EPM report using EVDRE function very quickly and easy too. Is the same feature is existing in BPC 10.0 ? if no how can we create EPM reports using EPM Functions with Dynamic Filters on the Members of the dimension like in BPC 7.5.
And i searched in SDN, there is no suitable blogs or documents which are related to generation of Reports using EPM Functions. All are described just in simple syntax way. It is not going to be understand for the beginners.
Would you please specify in detail step by step.
Thanks in Advance.
Siva NagarajuSiva,
These functions are not used to create reports per se but rather assist in building reports. For ex, you want to make use of certain property to derive any of the dimension members in one of your axes, you will use EPMMemberProperty. Similary, if you want to override members in any axis, you will make use of EPMDimensionOverride.
Also, EvDRE is not replacement of EPM functions. Rather, you simply create reports using report editor (drag and drop) and then make use of EPM functions to build your report. Forget EvDRE for now.
You can protect your report to not allow users to have that Edit Report enabled for them.
As Vadim rightly pointed out, start building some reports and then ask specific questions.
Hope it clears your doubts.
Maybe you are looking for
-
Hey guys, I have a question regarding ISE Authorization Policy. In my test lab, I don't have any wired station, and what I have is a wireless lapotp. I have configured to allow only EAP-TLS authentication. Now, my problem is I keep getting "15039 Rej
-
Business Process Template not show in costing result
Hi expert, I add a template in environment 001 use function tree - Materials to get 'MaterialNetWeight' , but nothing show in the costing result. I have maintained KTPF to Assign Templates for Cost Objects and Costing. Can anybody tell me how to conf
-
I like to collect old Macs for future use as antiques. Where are some good places to find them? I know people recycle them all the time, but I don't know how to get to them before they're demolished. I have gotten only 5 of them from recycle bins.
-
i have a table with one column which is of varchar. the column may contain any of this value: 12, 234.22, +443.67, -343.999, -45 or the string 'this is not a value. value error found.' i am new at regular expression so i was not able to do this even
-
Hi, I have a client running final cut pro 7 and capturing to an AFP share, I'm getting the message 'dropped frames' when capturing to AFP. I tested with another switch but still getting same error. Does anyone capture to an AFP share. Thanks