EXPLAIN LEAD SELECTION WITH AN EXAMPLE? WHY IT IS IMPORTANT?
HI ALL,
please explian me lead selection with an example? what is the significance of lead selection?
This is something that is not well explained anywhere, and it probably won't be well explained by me, either, but maybe when the clever people finish correcting me, we will have a good story.
Lead selection is a mechanism that WDA uses to define a default row in a multi-element (e.g. table) node in the context.
For example, lets say you display a list of flights in a table in WDA.
You put them into an internal table and bind them to a context node.
If the user selects one (by clicking the button beside the row of the table) then your program would like to know which row was selected. You could loop over the whole table looking for some indicator, but that is tedious and time consuming.
Because of the lead selection mechanism, you can call GET_STATIC_ATTRIBUTES which gets the values for a single row of the table. Which row? Well, the row selected by the user, which is called the lead selection. I think it is called 'lead selection' because if you select a range of rows, then the first or leading row is set as the lead selection and that is the one you will get if you ask for a single row.
Of course, nodes don't have rows, they have elements, but if you promise not to say it out loud, you can think of them as rows.
So lead selection is all about providing easy access to the selected element of a multi-element node If you ask the table for just one row, it will give you the selected row.
With lead selection, asking a table for one row without saying which one would probably be an error, but with lead selection, it makes sense. There are many node functions that work on a element that use lead selection to choose the element when you call them for a node with cardinality > 1.
There are a bunch of methods in IF_WD_CONTEXT_NODE that allow you to set and get the lead selection, and use it to do various things. This is useful, because with a big list of data, the thing you are probably interested in is the one the user has clicked.
For example you can write a program that displays spfli and a button that calls lr_node->GET_STATIC_ATTRIBUTES and displays the selected row's carrid and connid in a message. You can then select a row of the table and your button will always know which one you have chosen. It might be psychic, but it is probably really lead selection at work.
Or you can have an input field where you enter a row number and click a button. If you call
. lr_node = wd_context->get_child_node( 'SPFLI' ).
. lr_element = lr_node->get_element( index i ).
. lr_element->set_lead_selection( )
in the button action method you will see the button for that row suck into the screen as if you had clicked it.
I hope this does more good than harm.
Edited by: Russell Day on Feb 16, 2008 1:47 PM
Similar Messages
-
Explain SD PROCESS WITH AN EXAMPLE
HI
PLEASE TELL ME THE SD PROCESS WITH AN EXAMPLES
ADV. THANKS TO ALLHi
SD Process Flow:
Sales Order --> Delivery (Create Delivery, Picking, packing & PGI) --> Billing
Normal Sales Order Configuration Cycle:-
Step 1: Sales Document Type
IMG > Sales and Distribution > Sales > Sales Documents >
Sales Document Header:
1. Sales Document Type:The sales document types represent the different business transactions, such as Inquiry, Quotation, Sales Order, etc. To create new sales order type, always copy as with reference to similar sales order. If possible use standard sales order.
2. Define Number Ranges For Sales Documents: Maintain number range with discussion with core team.
3. Assign Sales Area To Sales Document Types:
A. Combine sales organizations / Combine distribution channels / Combine divisions: Ensure to maintain these, else Sales Order creation will give error.
B. Assign sales order types permitted for sales areas: Assign only required Sales Order Types to required Sales Area. This will minimize selection of Sales Order Type as per sales area.
Sales Document Item:
1. Define Item Categories: If possible use Standard Item Category. Incase if required to create new, copy as from standard & maintain New.
2. Assign Item Categories: If possible, use standard. Formula for deriving item category: Sales Document Type + Item Category Group + Usage + Higher Level Item Category = Item Category
Schedule Line:
1. Define Schedule Line Categories: If possible use Standard Schedule Lines. Incase if required to create new, copy as from standard & maintain New.
2. Assign Schedule Line Categories: If possible, use standard. Formula for deriving Schedule Line: Item Category + MRP Type / No MRP Type.
Step 2:
IMG > Logistic Execution > Shipping > Deliveries >
1. Define Delivery Types: If possible use Standard Delivery Type. Incase if required to create new, copy as from standard & maintain New.
2. Define Item Categories for Deliveries: If possible use Standard Item Categories for Delivery Type. Incase if required to create new, copy as from standard & maintain New.
3. Define Number Ranges for Deliveries: Ensure to maintain number range.
Step 3:
IMG > Sales and Distribution > Billing >
1. Define Billing Types: If possible use Standard Billing Type. Incase if required to create new, copy as from standard & maintain New.
2. Define Number Range For Billing Documents: Ensure to maintain number range.
3. Maintain Copying Control For Billing Documents: Maintain relevant copy controls such as Sales Order to Billing, Deliver to Billing, etc.
Note: Ensure that Copy Control settings are done
Sales Order to Sales Order (QT --> OR): VTAA
Sales Order to Delivery (OR --> LF): VTLA
Sales Order to Billing (OR --> F1): VTFA
Delivery to Billing(LF --> F2): VTFL
Billing to Sales Order (F2 --> RE): VTAF
The configuration differs from scenario to scenario & requirement of the client.
http://www.erpgenie.com/abap/tables_sd.htm
Check the above link for tables and their relationship.
http://www.easymarketplace.de/online-pdfs.php
This one would help you in understanding the basic of SD
<b>Reward if useful</b> -
Table.setRowSelectionInterval(a,a)select with yellow color why
Hi
table.setRowSelectionInterval(a,a);
Why duos this method selects around the cell
With a yellow color not blue like when I mouse click
Thanksmaybe resetting the colour to another one and then revert back to original if it works...
Hope this helps.
Best wishes
Shirley -
Lead selection with a tree-based table.
I've created a recursive context node to display contents of a KM folder. The structure has been mapped to a table, which works just fine. I can expand nodes of the tree and display the contents of sub-folders. Great. However, I need to know which backing KM object has been selected via the table. Since this is a recursive structure, using
wdContext.currentXXXX()
does not work, since that's the top of the tree. Parameter mapping will only give you the column and/or row of the item selected in the table, not the object itself.
I'm missing something obvious here, but I can't figure out how to get the context element behind the selected row in a table which is displaying a recursive structure.
I can do this with a Tree structure, since you can map the 'path' parameter to the actual context object. However, the Table UI doesn't offset that information (a severe oversight, at least in my mind).
Suggestions?Thanks Armin, that works great.
Had I finished reading this page:
http://help.sap.com/saphelp_nw70/helpdata/en/60/1f1f056f057d4d962375efd3c92ed0/frameset.htm
I would have found the correct documentation. -
Table: show the line of lead selection
Hello,
I have a table with 691 lines, showing 20 lines per page. Is it possible to change the lead selection for example to line 60 and also jump to line 60. So that the table automatically shows the 3rd page with the line 60 - 80.
I can change the lead selection with:
node_trefferliste->set_lead_selection_index( index = 60 ).
Lead selection is set correctly to 60 but the table still shows the lines 1- 20.
best regards
StefanHi Stefan,
What ever you have done is correct. One thing you need to change is whenever you change the lead selection for you table you need to scroll ALV also. For that get the lead selected entry and set it as frst_visible_row for you ALV table. Please do this coding in the respective view controller method WDDOMODIFYVIEW(). so that you will get exact result what you are expecting.
I hope i make you clear.
Warm Regards,
Vijay -
Problem with table cell editors - Dropdown by Index, getting lead selection
Hi experts,
I have a table editor with 5 columns
1st column is a Drop Down byIndex.
My contex looks like this
AS_DATA(Parent Node cardinality 1.1, selection 0-1)
HEADER (NODE)
DETAILS(NODE cardinality 0..n, selection 0-1)
ACTIVITY_TYPES (NODE cardinality 0..n selection 0-1 ) "node for drop down
description - attribute
unit
quantity
i have bound details node to table data source.
i have a tool bar button 'Add Line item' which will add a new line item to the table.
(i am adding a blank line to the table that is bound to table )
Its working fine. but when ever i add more than one row, the selection made in the previous rows drop down is lost.
its initializing. where could be the problem.
My code
data LO_ND_INV_TYPE type ref to IF_WD_CONTEXT_NODE.
data LO_EL_INV_TYPE type ref to IF_WD_CONTEXT_ELEMENT.
data LS_INV_TYPE type WD_THIS->ELEMENT_INV_TYPE.
data LV_INV_TYPE type WD_THIS->ELEMENT_INV_TYPE-INV_TYPE.
data LO_ND_DETAILS type ref to IF_WD_CONTEXT_NODE.
data LT_DETAILS type WD_THIS->ELEMENTS_DETAILS.
data LS_DETAILS like line of LT_DETAILS.
data: WD_NODE type ref to IF_WD_CONTEXT_NODE,
LR_ELEMENT type ref to IF_WD_CONTEXT_ELEMENT.
data LO_ND_INV_PATTERN type ref to IF_WD_CONTEXT_NODE.
data LO_EL_INV_PATTERN type ref to IF_WD_CONTEXT_ELEMENT.
data LS_INV_PATTERN type WD_THIS->ELEMENT_INV_PATTERN.
data LV_INV_PAT type WD_THIS->ELEMENT_INV_PATTERN-INV_TYPE.
data LO_ND_ACTIVITY_TYPES type ref to IF_WD_CONTEXT_NODE.
data LT_ACTIVITY_TYPES type WD_THIS->ELEMENTS_ACTIVITY_TYPES.
data LW_ACTIVITY_TYPES type WD_THIS->ELEMENT_ACTIVITY_TYPES.
data LO_EL_ACTIVITY_TYPES type ref to IF_WD_CONTEXT_ELEMENT.
* navigate from <CONTEXT> to <DETAILS> via lead selection
LO_ND_DETAILS = WD_CONTEXT->PATH_GET_NODE( PATH = `AS_DATA.DETAILS` ).
LO_ND_DETAILS->GET_STATIC_ATTRIBUTES_TABLE(
importing TABLE = LT_DETAILS ).
* Append an empty row to lt_details
append LS_DETAILS to LT_DETAILS.
LO_ND_DETAILS->BIND_TABLE(
NEW_ITEMS = LT_DETAILS ).
* Get values for dropdown
call method WD_ASSIST->GET_ACTIVITY_TYPE
exporting
I_INV_CAT_ID = LV_INV_PAT
importing
ET_ACTIVITY_TYPE = LT_ACTIVITY_TYPES.
LW_ACTIVITY_TYPES-ID = 'Select a Activity type'.
LW_ACTIVITY_TYPES-TEXT = 'Select a Activity type'.
insert LW_ACTIVITY_TYPES into LT_ACTIVITY_TYPES index 1.
loop at LT_DETAILS into LS_DETAILS.
LV_TABIX = SY-TABIX.
LR_ELEMENT = LO_ND_DETAILS->GET_ELEMENT( LV_TABIX ).
WD_NODE = LR_ELEMENT->GET_CHILD_NODE( 'ACTIVITY_TYPES' ).
*lv_index = wd_node->get_lead_selection_index( ). " it is dumping at this statement when i try to get lead selection
WD_NODE->BIND_TABLE( NEW_ITEMS = LT_ACTIVITY_TYPES ). " data for dropdown
endloop.
any clue on what am i missing will be appreciated.
I am getting dump when i try to get the lead selection
AjayYou only have only one option in the DDI to display in the example. when you have multiple values
i assume that by adding an empty row like this will lose the SELECTION MADE in DDI. (Correct me If i am wrong)
somehow i believe that we need to bind the DD values using SET LEAD SELECTION INDEX METHOD FOR THE DDI when they are already selected and trying to BIND.
*LO_ND_DETAILS->GET_STATIC_ATTRIBUTES_TABLE(*
*importing TABLE = LT_DETAILS ).*
** Append an empty row to lt_details*
*append LS_DETAILS to LT_DETAILS.*
*LO_ND_DETAILS->BIND_TABLE(*
*NEW_ITEMS = LT_DETAILS ).*
even though the above code will have the selected value, the SELECTIONS MADE will be initialize.
you need to bind it explicitly.
you have to create an element and bind the DDI values for adding an row as SARAVANAN said.
or i guess you can continue with you code but need to use SET LEAD to display the correct SELECTIONS MADE
loop at LT_DETAILS into LS_DETAILS.
LV_TABIX = SY-TABIX.
LR_ELEMENT = LO_ND_DETAILS->GET_ELEMENT( LV_TABIX ).
WD_NODE = LR_ELEMENT->GET_CHILD_NODE( 'ACTIVITY_TYPES' ).
WD_NODE->BIND_TABLE( NEW_ITEMS = LT_ACTIVITY_TYPES ). " data for dropdown
*" try to set the desired value in the DDI when you have multiple values using SET LEAD*
endloop. -
In Data Quality transform please explain Associate transform with the help of any example.
In Data Quality transform please explain Associate transform with the help of any example.
Hi Neha,
If we are using multiple match transforms and consolidate the final output we will use associate transform .
Let me explain with one example based on data quality blue prints for USA .
We have customer/vendor data . We need to find the duplicates .
1. First we will find the duplicates on Name and Address
2. Second we will find the duplicates on Name and Email
3. Third we will find the duplicates on Name and Phone
Here why we need to find the duplicates in multiple stages . If we are finding the duplicates on combination of Name, Address, Email and Phone we may not get proper duplicates as we are finding the potential duplicates . That's why we are finding the duplicates on different combinations .
In this case we will get the different group numbers for each match combination . Each combination name is there .
We want to consolidate and give the group number to the whole set of duplicates . We will pass these 3 match groups to associative transform and generate the consolidated match group for the input data.
I hope you understand the concept .
Thanks & Regards,
Ramana. -
Hi experts,could any one explain with an example of images
hi SAP experts,could any one explain with an example of images Reverse image,update image,Delete image and Add image.
Hi,
Go thru below thread it has already discussed
Re: selection from scratch: full VS (intialize delta + delta) update bi 7.0
Assign points if it helps you
thanks -
Whenever I select something, for example, I cannot see the marching ants selection until I either scroll up or down or zoom in or out. This occurs whenever I paste an image as well--nothing shows on screen until I scroll up or down or zoom in or out. Why is this?
Ap_Compsci_student_13 wrote:
ok sorry but doesn't sscce say to post the whole code?the first S is Short, and yes, it needs to be all the code needed to illustrate the problem and let use reproduce it. If you were developing a new Web framework, your example might be short, but for a student game it's very long. -
Can anyone explain A2A & B2B AND BPM & ccBPM with an example..
Hi All..
Can anyone explain me <b>A2A & B2B</b>
and <b>BPM & ccBPM</b> with an example....
<b>NOTE: i dont need definitions but examples..</b>
i am bit confused with this stuff....
Thanks in advance....
Cheers,
raghaveshHi ,
<i>A2A & B2B</i>
This thread explains you the difference between A2A and B2B.
Re: A2A Vs B2B
<i>BPM & ccBPM</i> both are same....
BPM is used to implement work-flow spanning across multiple application system against embedding the parts of work-flow in application system. Apart from this it also help achive other scenarios like, bridging synch and asynch systems, alert mechanism, multi mapping etc. Check the BPM overview document in SDN download section.
Check out the use cases discussed at http://help.sap.com/saphelp_nw04s/helpdata/en/de/766840bf0cbf49e10000000a1550b0/content.htm
BPM is mainly used in senarios where extra functionalities are to be done with the source message which cannot be done using the normal mapping and user-defined functions, like
-->Collecting of messages till a certain count or for a specific criteria.
-->Merging messages
-->Spliting messages
-->Processing of error files and sending to specific location and sending alerts.
-->Parallel processing of two criterias at the same time can also be done using BPM.
some weblogs on BPM...
/people/udo.martens/blog/2005/09/30/one-logical-system-name-for-serveral-bpm-acknowledgements
/people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
/people/kannan.kailas/blog/2005/12/07/posting-multiple-idocs-with-acknowledgement
/people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm
/people/michal.krawczyk2/blog/2005/06/11/xi-how-to-retrieve-messageid-from-a-bpm
/people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
Sekhar -
Explain User exit concept with simple example
Hi friends
I am new member of this forum & i am learning ABAP.
Kindly send me user exit concept with simple example to my mail ID so i can able to use it.
mail ID [email protected]
thanks in advance
Thanks & RegardsCode SE18 is used to Identify the BADI available.
Look for the string 'CL_EXITHANDLER' in the standard program. This is a class which has a method 'GET_INSTANCE' which is used to trigger BADI's from the Standard Program. The interface parameter for this static method 'EXIT_NAME' is used to pass the BADI to the method.
Open Standard Program and do a global search 'CL_EXITHANDLER'.
SE18 > give the BADI name found through above search.
CUSTOMER_ADD_DATA > which has a method SAVE_DATA.
T.Code SE19 is used to Implement BADI.
SE19 > give the implementation name > Give the Definition name as CUSTOMER_ADD_DATA and the Short Text.
Intro.....
http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
Check these links for info about badi..
BADI's
http://support.sas.com/rnd/papers/sugi30/SAP.ppt
BADI's
http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
http://support.sas.com/rnd/papers/sugi30/SAP.ppt
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
http://members.aol.com/_ht_a/skarkada/sap/
http://www.ct-software.com/reportpool_frame.htm
http://www.saphelp.com/SAP_Technical.htm
http://www.kabai.com/abaps/q.htm
http://www.guidancetech.com/people/holland/sap/abap/
http://www.planetsap.com/download_abap_programs.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
/people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
/people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
http://www.esnips.com/web/BAdI
http://www.allsaplinks.com/badi.html
New to Badi
check any fo the below links. this will def help u.
http://www.allsaplinks.com/badi.html
And also download this file....
http://www.savefile.com/files.php?fid=8913854
There are other tutorials on this site...
http://sapbrain.com/Tutorials/tuto_download.html
What are BAdIs?
-> is an anticipated point of extension these points act like sockets and exist in the original source code
-> based on ABAP Objects. BAdI defines an interface that can be implemented by BAdI-implementations that are transport objects of their own
->Important! There are 2 roles: Enhancement Option-provider & Implementer.
-> In the above context, Enhancement Implementation can be done only if option (hook) is provided by the Option-provider. In simple words there are no implicit BAdIs.
Note: In the following slides, Definitions are created so as to understand the method of BAdI definition & for example purpose. As stated above this is the role of Enhancement Option-Provider.
Classic BAdIs already exist since SAP Release 4.6
BAdIs have been Re-implemented in ECC7.0 under the new Enhancement Framework & Switch Framework
Classic BAdIs
To understand what a powerful pattern a BAdI is, we will now define & then implement a BAdI
BADI Class is created automatically.
The various options are described below in detail:
1. Enhanceable: Enhanceability of filter types can only be specified for filter-dependent BADI definitions under very special conditions. For example, the domain belonging to the filter type must be linked with a value table that is of the type E or G. A BADI implementation can then be created in one step by creating a new filter value that is automatically entered into the value table at save and also copied into the transport order of the BADI implementation. In addition, it is also possible to create a new filter value and, at the same time, a BADI implementation with the same name. Naturally, you can also specify existing filter values.
You should select this feature if there is a prerequisite that a new filter value is created together with a new BADI implementation - that is, that BADI implementations are not created solely with existing filter values, although this, too, is possible.
2. Multiple-Use
3. Filter-Dependent
Instance Methods can access all of the attributes of a class and can trigger all events of a class. Static Methods can only access static attributes and static events.
Exceptions:
Events:
Events can be defined in classes or in interfaces. Corresponding methods can trigger these events with the RAISE EVENT statement. Each class (or interface) that is going to handle the corresponding event must implement a relevant handler method, and register it using the SET HANDLER statement. When an event occurs, the system calls all of the handler methods registered for that event.
Like method definitions, events have a parameter interface. The only difference is that events may only have EXPORTING parameters.
BADI : Businees Add IN's
Business Add-Ins are SAP enhancement technique based on ABAP Objects.
Where the SAP standard program is not going to fullfill the client requirement , we are going to add our own program to SAP standard program, without changing the standard prog.
Each Business Add-In has
at least one Business Add-In definition
a Business Add-In interface
a Business Add-In class that implements the interface
Each BADI has two different Views.
1.Definition view
2.Implementation view
T.C for BADI Definition is SE18.
T.C for BADI Implementation is SE19.
There are multiple ways of searching for BADI.
Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
Finding BADI Using SQL Trace (TCODE-ST05).
Finding BADI Using Repository Information System (TCODE- SE84).
1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for CL_EXITHANDLER=>GET_INSTANCE.
Make sure the radio button In main program is checked. A list of all the programs with call to the BADIs will be listed.
The export parameter EXIT_NAME for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter INSTANCE will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
2. Start transaction ST05 (Performance Analysis).
Set flag field "Buffer trace"
Remark: We need to trace also the buffer calls, because BADI database tables are buffered. (Especially view V_EXT_IMP and V_EXT_ACT)
Push the button "Activate Trace". Start transaction VA02 in a new GUI session. Go back to the Performance trace session.
Push the button "Deactivate Trace".
Push the button "Display Trace".
The popup screen "Set Restrictions for Displaying Trace" appears.
Now, filter the trace on Objects:
V_EXT_IMP
V_EXT_ACT
Push button "Multiple selections" button behind field Objects
Fill: V_EXT_IMP and V_EXT_ACT
All the interface class names of view V_EXT_IMP start with IF_EX_. This is the standard SAP prefix for BADI class interfaces. The BADI name is after the IF_EX_.
So the BADI name of IF_EX_CUSTOMER_ADD_DATA is CUSTOMER_ADD_DATA
3. Go to Maintain Transaction (TCODE- SE93).
Enter the Transaction VD02 for which you want to find BADI.
Click on the Display push buttons.
Get the Package Name. (Package VS in this case)
Go to TCode: SE84->Enhancements->Business Add-inns->Definition
Enter the Package Name and Execute.
Here you get a list of all the Enhancement BADIs for the given package MB.
Have a look at http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
http://support.sas.com/rnd/papers/sugi30/SAP.ppt
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
http://members.aol.com/_ht_a/skarkada/sap/
http://www.ct-software.com/reportpool_frame.htm
http://www.saphelp.com/SAP_Technical.htm
http://www.kabai.com/abaps/q.htm
http://www.guidancetech.com/people/holland/sap/abap/
http://www.planetsap.com/download_abap_programs.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
/people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
/people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
How to develop BADI
Rewards if useful. -
.can anybody explain the bdc with help of an example
i am new to bdc .can anybody explain the bdc with help of an example
Hi,
BDC is method to transfer legacy data into R3 system.
Data transfer can be done in any one method below:
BDC
LSMW
Direct Input method
BAPI
Of these BDC is subdivided into 2 types,
Call Transaction and Session method (TCode: SM35)
Let me give the sample prg for Call Transaction method.
tables ZMATMASTER.
DATA : itab like TABLE OF ZMATMASTER WITH KEY DESCRIPTION with header line.
DATA : IT_BDC LIKE TABLE OF BDCDATA WITH HEADER LINE.
DATA : IT_MSG LIKE TABLE OF BDCMSGCOLL WITH HEADER LINE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Material.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = '#'
TABLES
DATA_TAB = itab.
LOOP AT ITAB.
PERFORM BDC_HEADER USING 'ZFILE_DOWNLOAD' 9001.
PERFORM BDC_DATA USING 'BDC_OKCODE' 'SAVE'.
PERFORM BDC_DATA USING 'ZMATMASTER-MNO' ITAB-MNO.
PERFORM BDC_DATA USING 'ZMATMASTER-DESCRIPTION' ITAB-DESCRIPTION.
PERFORM BDC_DATA USING 'ZMATMASTER-PLANT' ITAB-PLANT.
PERFORM BDC_DATA USING 'ZMATMASTER-SLOC' ITAB-SLOC.
PERFORM BDC_DATA USING 'ZMATMASTER-ROL' ITAB-ROL.
PERFORM BDC_DATA USING 'ZMATMASTER-UOM' ITAB-UOM.
PERFORM BDC_DATA USING 'ZMATMASTER-PRICE' ITAB-PRICE.
PERFORM BDC_DATA USING 'ZMATMASTER-DDAYS' ITAB-DDAYS.
PERFORM BDC_DATA USING 'ZMATMASTER-FLOT' ITAB-FLOT.
ENDLOOP.
CALL TRANSACTION 'ZTRANSCODES'
USING IT_BDC
MODE 'A'
UPDATE 'S'
MESSAGES INTO IT_MSG.
FORM BDC_HEADER USING PROGRAMNAME SCREENNO.
IT_BDC-PROGRAM = PROGRAMNAME.
IT_BDC-DYNPRO = SCREENNO.
IT_BDC-DYNBEGIN = 'X'.
APPEND IT_BDC.
ENDFORM.
FORM BDC_DATA USING FNAME FVALUE.
CLEAR IT_BDC.
IT_BDC-FNAM = FNAME.
IT_BDC-FVAL = FVALUE.
APPEND IT_BDC.
ENDFORM.
In session method, log file can be viewed.
Foll. is the example for session method.
REPORT ZBDC_BATCH1 .
TABLES: ZEMPREC.
DATA : BEGIN OF STR1,
EMPNO(3),
EMPNAME(15),
SALARY(9),
DOJ(10),
END OF STR1.
DATA: FNAME(100) TYPE C VALUE 'C:\EMPLOYEE.TXT.,
DATA : BDCITAB LIKE TABLE OF BDCDATA WITH HEADER LINE,
MSGITAB LIKE TABLE OF BDCMSGCOLL WITH HEADER LINE.
OPEN DATASET: FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
perform open_group.
DO .
READ DATASET FNAME INTO STR1.
IF SY-SUBRC <> 0 .
EXIT.
ENDIF.
perform bdc_dynpro using 'ZBDC_BATCH' '9000'.
perform bdc_field using 'ZEMPREC-EMPNO'
STR1-EMPNO.
perform bdc_field using 'ZEMPREC-EMPNAME'
STR1-EMPNAME.
perform bdc_field using 'ZEMPREC-SALARY'
STR1-SALARY.
perform bdc_field using 'ZEMPREC-DOJ'
STR1-DOJ.
ENDDO.
CLOSE DATASET FNAME.
perform bdc_transaction using 'ZTCODE'.
perform close_group.
CLOSE DATASET FNAME1.
CALL TRANSACTION 'SM35'.
FORM open_group
FORM open_group .
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'sample'
HOLDDATE = SY-DATUM
KEEP = 'X'
USER = SY-UNAME.
ENDFORM. "open_group
FORM bdc_transaction
--> TCODE
form bdc_transaction USING TCODE.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'ZTCODE'
TABLES
DYNPROTAB = BDCITAB.
ENDFORM. "bdc_transaction
FORM close_group
FORM close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
ENDFORM. "close_group
FORM BDC_DYNPRO
--> PROGRAM
--> SCREEN
FORM BDC_DYNPRO USING PROGRAM SCREEN.
CLEAR BDCITAB.
BDCITAB-PROGRAM = PROGRAM.
BDCITAB-DYNPRO = SCREEN.
BDCITAB-DYNBEGIN = 'X'.
APPEND BDCITAB.
ENDFORM. "BDC_DYNPRO
FORM BDC_FIELD
--> FNAM
--> FVAL
FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDCITAB.
BDCITAB-FNAM = FNAM.
BDCITAB-FVAL = FVAL.
APPEND BDCITAB.
ENDFORM. "BDC_FIELD
Hope now u get an idea abt BDC.
Regards,
Router -
Explain with this example abt cenvat details?
can u plz explain with this example
Purchase Order (P.O) (We give Vendor No, Rate, Material, Tax Code)
***Basic Amount 100.00***
***Excise Duty @ 16% 16.00***
o
+ 116.00***
***VAT@ 4% 5.00***
***(On Basic + Excise) 121.00***
Sale Order: (SO): (We give Customer No, Qty, Rate, Material, Tax Code (Manually/Automatically)
Basic Amount 300.00
Excise Duty @ 16% 48.00
348.00*
VAT@ 4% 1300
(On Basic + Excise) 361.00
what will happenning in rg23a,rg23c, rg23d & pla ?
explain the utilization alsoHi,
When you capture excise invoice against GR, Excise gets Credited to your account RG23A or RG23C accounts. When you generate sales excise invoice, you can utilize the credit available.
With above process RG23 registers will be updated.
RG23D will be updated when there is Depot receipt (J1IG) and Issue(J1IJ) transaction. -
I loop over all elements of a context node, and change some attributes.
The code looks like this:
LOOP AT lt_element_list INTO lo_el_element.
lo_el_element->get_static_attributes( IMPORTING static_attributes = ls_element ).
ls_element-created_by_name = get_user_name( iv_user_id = ls_element-created_by ).
ls_element-changed_by_name = get_user_name( iv_user_id = ls_element-changed_by ).
lo_el_element->set_static_attributes( EXPORTING static_attributes = ls_element ).
ENDLOOP.
This coding seems to change the the lead selection of the context node, which leads to problems somewhere else.
Why does it change the lead selection and how can I prevent it?hi daniel.....
i dont think there is a need for looping in this manner.
you just get all the values of a node into an internal table.
and then loop the internal table an make changes in it.
then clear the node and pass this currently changed internal table into the node.
the lead selection changes because you are setting the attribute and it might be stored in index 1 or the to the index where the lead selection is referred to. this might be your problem.
---regards,
alex b justin -
Explain Cardinality,Singleton Property & Lead selection
Hi All,
Please explain me in detail the concepts of Cardinality,Singleton Property & Lead selection.
I had already gone through enough documents and have very vague idea.
Regards,
Venkat.Hi Venkat,
Please check the [document|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a048387a-0901-0010-13ac-87f9eb649381?quicklink=index&overridelayout=true]
Hope that will helps you.
Thanks
Arun
Maybe you are looking for
-
N-series headsets not compatible to 6280
why does N-series headset is not compatible to nokia6280? AD-41 and AD-46 audio adaptor can someone tell me why???
-
Problem solved: i just set some apps to 'hide' and then again 'unhide'. All my apps suddenly were back :-)
-
Disk utility not recognizing HD
Hi, I have a G4 PowerMac with two 80 GB hard drives. When I boot up the computer, it boots up from the primary drive and runs fine. At this time, both my primary and my secondary drives are accessible and visible. However, when I boot up the computer
-
Had to un-install JRE, again. "AWT-EventQueue-13" exception.
Hello every body readers, and a Happy Christmas from me in Sweden. I installed latest JRE "jre1.5.0_01". Had to uninstall and use Microsoft java instead, AGAIN. Those who said to me in past: "Use IE Java. Works better" was probably right. As now Sun
-
Help needed to upload or download
I know the client's path of a file I want to upload this files to the server machine with jsp/applet/servlet/network socket or other way help me please with code soon. And also download in the reverse way. please help me.