How can I use loop in graphical message mapping
The source input XML is like:
<bookstore>
<book>
<item1>xxx</item1>
<item2>yyy</item2>
</book>
<book>
<item1>zzz</item1>
<item2>www</item2>
</book>
</bookstore>
I want to create an output XML like
<output>
<item>
<item1>xxx</item1>
<item2>yyy</item2>
</item>
<item>
<item1>xxx</item1>
<item2>www</item2>
</item>
<item>
<item1>zzz</item1>
<item2>www</item2>
</item>
<item>
<item1>xxx</item1>
<item2>yyy</item2>
</item>
</output>
That means I want to do permutation and combination for all <item1> <item2> under <book>.
Of course I can write a customer function to do it, but I want to basically use the buildin functions to do the graphical message mapping for this.
Any idea? thank you.
well, I'm not very clear of those 2 English words
What I want is to list all possible combination of item1 and item2 (and in fact, we have item3, item4, ....etc).
example
input:
<item>
<item1> 111 </item1>
<item2> 222 </item2>
<item3> 333 </item3>
</item>
<item>
<item1> aaa </item1>
<item2> bbb </item2>
<item3> ccc </item3>
</item>
I want to get
<item><Item1>111>/item1> <item2>222</item2> <item3>333</item3> </item>
<item><Item1>111>/item1> <item2>222</item2> <item3>ccc</item3> </item>
<item><Item1>111>/item1> <item2>bbb</item2> <item3>333</item3> </item>
<item><Item1>111>/item1> <item2>bbb</item2> <item3>ccc</item3> </item>
<item><Item1>aaa>/item1> <item2>222</item2> <item3>333</item3> </item>
<item><Item1>aaa>/item1> <item2>222</item2> <item3>ccc</item3> </item>
<item><Item1>aaa>/item1> <item2>bbb</item2> <item3>333</item3> </item>
<item><Item1>aaa>/item1> <item2>bbb</item2> <item3>ccc</item3> </item>
Similar Messages
-
How can i using datasource in toplink's map file
In the TopLink map :
<toplink:login xsi:type="toplink:database-login">
<toplink:platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</toplink:platform-class>
<toplink:user-name>test</toplink:user-name> <toplink:password>C23487CFA591952D44310804F3D591CB</toplink:password>
<toplink:sequencing>
<toplink:default-sequence xsi:type="toplink:native-sequence">
<toplink:preallocation-size>1</toplink:preallocation-size>
</toplink:default-sequence>
</toplink:sequencing>
<toplink:driver-class>oracle.jdbc.driver.OracleDriver</toplink:driver-class>
<toplink:connection-url>jdbc:oracle:thin:@192.168.0.1:1521:testdb</toplink:connection-url>
<toplink:bind-all-parameters>true</toplink:bind-all-parameters>
</toplink:login>
How can i modify it using datasource?The login information stored in the map file is good for direct connection and design time login information.
For your runtime login information I would use the sessions configuration (sessions.xml). It provides complete deployment configuration:
<session>
<name>my-session</name>
<!-- This references the ORM map XML file -->
<project-xml>META-INF/employee-basic.xml</project-xml>
<session-type>
<server-session/>
</session-type>
<login>
<datasource>jdbc/TopLinkDS</datasource>
<uses-external-connection-pool>true</uses-external-connection-pool>
<uses-external-transaction-controller>true</uses-external-transaction-controller>
</login>
<external-transaction-controller-class>oracle.toplink.essentials.transaction.oc4j.Oc4jTransactionController</external-transaction-controller-class>
<enable-logging>true</enable-logging>
<logging-options>
<log-exceptions>true</log-exceptions>
<print-thread>false</print-thread>
<print-date>false</print-date>
</logging-options>
</session>Doug -
How can I use Anquet or similar mountain mapping software on my iMac?
As a keen hillwalker I would like to be able to use Anquet or similar maps - at present I use well-worn OS 1:50,000 maps but would like to print out relevant maps for whatever hill I'm doing, and possibly also get into using a GPS.
According to the Anquet website their software doesn't work on Macs. I don't want to switch to PC but might have to. Any way round the problem without costing too much?you could try looking at this-
http://ipod.about.com/od/ipad/qt/sync-photos-to-ipad.htm
Basically
>open itunes
>go to ipad device screen
>photos tab
>you should get the option to sync folders containing pictures from your mac
>select the folders you wish to sync
>hit sync button -
how can i use i message
In Settings > Messages, make sure "iMessage" is switched on, and in "Receive At..." in the same menu, make sure you are signed into your Apple ID.
Now, whenever you text someone who is using an iPhone, iPad, or iPod Touch running iOS 5 or later, or a Mac running Mountain Lion, you will be sending it to them through iMessage. You know it is iMessage when the little bubbles are blue instead of green. -
Graphical message mapping examples for JDBC and RFC lookup
hi, can any body provide me graphical message mapping examples for the "JDBC Lookup" function and "RFC Lookup" function?
I'm now studying the graphical message mapping and want to try those 2 functions. thank you.
I expect the examples to be simple enoung, not need to set up much.>
Madhu_1980 wrote:
> can u check this link:
>
> PI 7.0 & 7.1 Mapping - Blogs,Articles,Wiki,Code Samples and Videos Collections https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=79955426
>
> it contains a link : SAP PI 7.1 Mapping Enhancements Series: Graphical Support for JDBC and RFC Lookups /people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-support-for-jdbc-and-rfc-lookups
May be I'm too foolish to follow those links, I got issues of each links.
What I really want is an example from step0
Swarup:
Refer the Lookup document - Easy Lookup in Process Integration 7.1
https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/20befc9a-aa72-2b10-ae9b-b0988791d457
The first step is "Create an RFC Enabled Function Module for look up", but where can I create the function module? Should I use ESB, IB? or use transaction 'SE11' ?
Kulkarni:
Very good links for RFC lookup with 7.0/3.0
https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/70d90a91-3cf4-2a10-d189-bfd37d9c3231&overridelayout=true
At page6 "PI Development/Configuration", it saies "You are on the design maintenance screen in the Integration Builder.Expand the subnodes for the software component version for which you want to import interfaces".
What is "design maintenance screen" ? My IB version is: Service Pack:08 Release:NW07_08_REL.
When I open IB, it display a screen titled with "Configuration: Intergation Builder", I did not find "software component version" node on the left tree.
Madhu_1980 :
it contains a link : SAP PI 7.1 Mapping Enhancements Series: Graphical Support for JDBC and RFC Lookups /people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-support-for-jdbc-and-rfc-lookups
The Prerequisites state:
The JDBC channel to be used for the lookup must be configured and activated in the Integration Directory.
The definition of the table used for the lookup must already be imported into the ES Repository as an external definition
But I don't know how to create a JDBC channel and define the table. -
How can i use the same cursor in a loop fro multipletimes.
I am using two cursors.One to fetch sites and the other to fetch participants under each site.I am performing some job with that participants data.Now the problem is i am using the 2nd cursor in a loop.So it fetches the data of participants falling under one state.But when it comes to the second state,as the second cursor is already open it is unable to fetch the records.Please help me .How can i use the same cursor in a loop fro multipletimes.
I am sending the code which i have written in When-Button-Pressed-Trigger...
declare
sid number;
pid number;
cursor csid is select distinct(site_id) from cyber_ppt;
cursor cpid is select pc_id,st_dt,ed_dt from cyber_ppt where site_id = sid;
stdt varchar2(10);
eddt varchar2(10);
nom number;
stmonth varchar2(10);
edmonth varchar2(10);
cjan number:=0;
cfeb number:=0;
cmar number:=0;
capr number:=0;
cmay number:=0;
cjun number:=0;
cjul number:=0;
caug number:=0;
csep number:=0;
coct number:=0;
cnov number:=0;
cdec number:=0;
i number:=1;
begin
open csid ;
loop
fetch csid into sid;
exit when csid %notfound;
message(sid);
open cpid;
loop
fetch cpid into pid,stdt,eddt ;
exit when cpid %notfound;
message(sid||'-'||pid);
stmonth:=substr(stdt,4,3);
edmonth:=substr(eddt,4,3);
nom:= months_between(eddt,stdt);
while i <= round(nom)
loop
stmonth:=substr(stdt,4,3);
if stmonth='JAN' then
cjan:=cjan+1;
elsif stmonth='FEB' then
cfeb:=cfeb+1;
elsif stmonth='MAR' then
cmar:=cmar+1;
elsif stmonth='APR' then
capr:=capr+1;
elsif stmonth='MAY' then
cmay:=cmay+1;
elsif stmonth='JUN' then
cjun:=cjun+1;
elsif stmonth ='JUL' then
cjul:=cjul+1;
elsif stmonth ='AUG' then
caug:=caug+1;
elsif stmonth ='SEP' then
csep:=csep+1;
elsif stmonth ='OCT' then
coct:=coct+1;
elsif stmonth ='NOV' then
cnov:=cnov+1;
elsif stmonth ='DEC' then
cdec:=cdec+1;
end if;
stdt:=add_months(stdt,1);
i:=i+1;
end loop;
end loop;
end loop;
end;
try this /* untested */
DECLARE
sid NUMBER;
pid NUMBER;
CURSOR csid IS SELECT DISTINCT(site_id) FROM cyber_ppt;
CURSOR cpid(nSid NUMBER) is SELECT pc_id,st_dt,ed_dt FROM cyber_ppt WHERE site_id = nSid;
stdt VARCHAR2(10);
eddt VARCHAR2(10);
nom NUMBER;
stmonth VARCHAR2(10);
edmonth VARCHAR2(10);
cjan NUMBER:=0;
cfeb NUMBER:=0;
cmar NUMBER:=0;
capr NUMBER:=0;
cmay NUMBER:=0;
cjun NUMBER:=0;
cjul NUMBER:=0;
caug NUMBER:=0;
csep NUMBER:=0;
coct NUMBER:=0;
cnov NUMBER:=0;
cdec NUMBER:=0;
i NUMBER:=1;
BEGIN
FOR rec IN csid
LOOP
sid := rec.csid;
FOR cRec IN cpid(sid)
LOOP
pid := cRec.pc_id;
stdt := cRec.st_dt;
eddt := cRec.ed_dt;
stmonth:= SUBSTR(stdt,4,3);
edmonth:= SUBSTR(eddt,4,3);
nom:= months_between(eddt,stdt);
WHILE i <= round(nom)
LOOP
stmonth := SUBSTR(stdt,4,3);
IF stmonth='JAN'
THEN
cjan:=cjan+1;
ELSIF stmonth='FEB' THEN
cfeb:=cfeb+1;
ELSIF stmonth='MAR' THEN
cmar:=cmar+1;
ELSIF stmonth='APR' THEN
capr:=capr+1;
ELSIF stmonth='MAY' THEN
cmay:=cmay+1;
ELSIF stmonth='JUN' THEN
cjun:=cjun+1;
ELSIF stmonth ='JUL' THEN
cjul:=cjul+1;
ELSIF stmonth ='AUG' THEN
caug:=caug+1;
ELSIF stmonth ='SEP' THEN
csep:=csep+1;
ELSIF stmonth ='OCT' THEN
coct:=coct+1;
ELSIF stmonth ='NOV' THEN
cnov:=cnov+1;
ELSIF stmonth ='DEC' THEN
cdec:=cdec+1;
END IF;
stdt:=add_months(stdt,1);
i:=i+1;
END LOOP;
END LOOP;
END LOOP;
END; -
How can i use messages on windows
im trying to use my imessage on my laptop is there like a software that doesnt require jailbreak to send messages on the laptop?
ryan10132 wrote:
how can I use messages on windows
You can't. -
How can I use an Airport Extreme to act as a Range Extender for an Alcatel One Touch Y800Z WiFi modem/router? As we live in a rural area and our landline broadband speeds are awful, I have moved on to a 3G provider in the UK (EE/Orange) and set up the wireless modem which is working very well with an iMac. I have an Airport Extreme base station which was previously connected with an Ethernet cable to the landline router, and two Airport Express stations as Range Extenders. I would now like to use the Airport Extreme and the two Express stations to extend the range of the Alcatel WiFi device. I have tried automatic and manual set up with the Airport Utility but at the crucial step for selecting a network to extend, although the WiFi device is recognised, I get a message saying it cannot be extended.
Thank you for any help you can provide.
ArupThis is a problem with a lot of cheap end wifi hotspot like devices.. sometimes you can just swap the sim out to a real 3G wireless router.. that is a better approach IMHO than wireless repeater ever will be.
In the meantime..
Have a go with the suggestion.. place the express as wireless bridge. With a computer connected to the wifi from alcatel unit.. (I am amazed Alcatel still are in domestic market.. I thought they sold out). Set the express to join the wifi.. you do this in the airport utility.. old one is easy.. but in v6 you have to trust to luck so to speak and hope the auto setup works.. tell us if you have trouble.
With the Express bridging.. you can then plug it by ethernet into the TC.. which will be in router bridge..
ie
You can then run the connection from wireless or ethernet on the TC.. and it will relay back to the alcatel for internet.. all a bit dodgy but who knows.. it may give you what you need.
Wireless repeater is never particularly reliable in my experience. I would avoid it if possible. -
After having payed fo an account for one year for Photoshop CC and Lightroom 5 i keep getting the message ,that I am using a trial version of Photoshop CC.
Lightroom on the other hand is not functioning in a trial version !
Could anyone tell me how I can start working with Photoshop CC while not in trial mode ?
PeterI Don’t know how I di dit, but when I started Photoshop this mornig all of a sudden it worked.
I am happy now and thank you for your efforts.
Regards
Peter Hordijk
Van: Rajshree
Verzonden: woensdag 21 mei 2014 19:04
Aan: Peter Hordijk
Onderwerp: How can I get rid of the message that I am using a trial version of Photoshop CC even after becoming a paying member for Photoshop CC and Lightroom ?
How can I get rid of the message that I am using a trial version of Photoshop CC even after becoming a paying member for Photoshop CC and Lightroom ?
created by Rajshree <https://forums.adobe.com/people/Rajshree> in Adobe Creative Cloud - View the full discussion <https://forums.adobe.com/message/6398343#6398343> -
How to insert delay without using loops, and how can I use variable to store data in labview
Hi all,
I am new to Labview and I realized that quite often I am in condition to require a delay beween two functions or elements.. how can we insert a delay in such cases?
I know how to use delays in a loop. but don't know how to inser some time delay between two elements.
I have one more question, I know its a bad practice to post 2 questions in 1 thread.
How can I use a temporary variable to store data, So far I am storing it in an indicator by making it invisible in front panel and making local variable of that indicator, is it the right way to do it ?
Thanks in advance.Generally, LV doesn't have variables in the same sense that most languages do. You can use indicators to perform the same function as variables, but as Adnan pointed out, you run the risk of having race condition and it creates data copies, which is a problem if you have a lot of data. In most cases, you should use wires to perform the function of variables, which is to store data and make it available to the different functions in your code. Instead of thinking about variables, you need to think about data (something like "I have the data coming out of this function. Where does it need to go?").
Try to take over the world! -
How can I use ichat on my macbook pro to send messages to my iPod 5
How can I use ichat on my Macbook Pro to send messages to my iPod 5 ?
If ipod 5 means ipod touch or iphone 5, simply create a AIM account and download the AIM iphone app. iChat and iMessage aren't compatible.
-
Just upgraded to Lion, how can I use my microsoft office especially excel. I'm getting messages that it's no longer supported. This is a BIG problem. Help, please.
Apple has made a serious error not advising people when the Lion upgrade occurs that their present software may/will not be compatible and advise the user of such before and allow a opt out.
All you can do (besides upgrading all your software) is backup your data off the machine (not to TimeMachine) and disconnect all drives.
Hold c boot off the 10.6 disk and erase your makers hard drive on the far left, (that's the entire drive of everything)
Partition tab: Option: GUID, format OS X extended and click apply so you get a new GUID (replacing the Lion one or trouble occurs later)
Quit and install 10.6, then go through setup and use the same name as before, then update to 10.6.8
Then c boot off the 10.6 disk again and use Disk Utility to Repair the disk the 10.6.8 update messed up.
Then install all your programs again from fresh sources and lastly your user files in the same main user folders as before (music, pictures, documents etc.)
Done as described will get you back just like it was before as close as possible, make SURE to use the same username or else your iTunes and other files get all messed up. Password and drive name can be different though if you wish.
Note: if you've upgraded from 10.5 to 10.6, then you don't get the free iLife as it's not on the 10.6.3 white disks, only on the disks that came with your machine. So that will have to be purchased and reinstalled or use Pacifist to extract it from the 10.5 disks.
This handy site can advise you what software doesn't work with the Lion.
http://roaringapps.com/apps:table -
[pavilion g7-2116sr] How can I use amd driver with only integrated graphic?
Radeon hd 7670m is disabled coz it's broken. Amd driver don't work. Windows use vgasave driver. How can i use amd driver with radeon hd7660g?
P.S. Sorry, my english isn't good(Hi @Leys
I see you are stilll unsuccessful installing the drivers as you get the blue screen.
Here is a link to Computer Does not Start (Windows 7, Vista, XP) that may help.
Here is a link to Testing for Hardware Failures (Windows 7, Vista) to determine if your graphic card is defective.
If the graphic card fails, here is a link to the HP Pavilion g7 Notebook PC Maintenance and Service Guide. Please note page 9 or chapter 1 page 9 for a list of recommended replacement graphic cards.
If the graphic card passes you may wish to consider doing a restore back to a known good time or a full recovery back to factory.
Using Microsoft System Restore (Windows 7)
Performing an HP system recovery (Windows 7)
During the recovery process there is an option to backup your personal files to prevent data loss. If you have not done one yet I suggest you do one now.
Restoring Files that were Backed Up Using HP Recovery Manager (Windows 7)
At any time you may wish to contact HP support for assistance.
Please call our technical support at 800 474 6836. If you live outside the US/Canada Region, please click the link below to get a support number for your region.
World Wide Phone Support
Good Luck!
Sparkles1
I work on behalf of HP
Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping! -
How can I use "write to spreadsheet" during the data is taking but not the end of all the loops
Hi,
I have to run an experiment on Labview 6 or 5. I don't have Labview 7 on that computer for some reason. My experiment is talking about 1000 hours, and I have a probelm on storing the data. Right now I am using "Write to spread sheet" and I set the "append" to false. And the data is installed at the end of the experiment, that means after 1000 hours. In the mean time if somthing oges wrong like power cut or what, I will lose all the data. So what I want to do is to save the data evertime when the data is took. I tired to set the "append" to true, but it does not let me to choose the "file path"--- when I choose this and select write on new or excisting file, it said" you may not be able to save on a exciting file" and it does not let me create a new file either. If anyone have the lidea like how can I use the "wrtie to spreadsheet" function and at the same time can install the data everytime inside the look, please let me know. Thanks alot.
KLKL,
It sounds like you want to periodically save your data so it is in smaller files. (great idea) For this operation you will not want to append the data...if something happens to your system while the file is open it could become corrupt and ruin all the data. You need to write the new block of data to a new file every time. Now...this depends on how big your data is...if you only have like 500k of data to write in a block you should probably write several blocks before starting a new file. I don't know enough about how much data you are acquiring. In either case...the write to spreadsheet file.vi will need a different name each time it is called and you will not want to append. Append = false.
-Brett -
How can we use TABLE CONTROL in BDC and WORK FLOW of ABAP.
how can we use TABLE CONTROL in BDC and WORK FLOW of ABAP.?
please explain the important questions.How to deal with table control / step loop in BDC
Steploop and table contol is inevitable in certain transactions. When we run BDC for such transactions, we will face the situation: how many visible lines of steploop/tablecontrol are on the screen? Although we can always find certain method to deal with it, such as function code 'NP', 'POPO', considering some extreme situation: there is only one line visible one the screen, our BDC program should display an error message. (See transaction 'ME21', we you resize your screen to let only one row visible, you can not enter mutiple lines on this screen even you use 'NP')
Now with the help of Poonam on sapfans.com developement forum, I find a method with which we can determine the number of visible lines on Transaction Screen from our Calling BDC program. Maybe it is useless to you, but I think it will give your some idea.
Demo ABAP code has two purposes:
1. how to determine number of visible lines and how to calculte page number;
(the 'calpage' routine has been modify to meet general purpose usage)
2. using field symbol in BDC program, please pay special attention to the difference in Static ASSIGN and Dynamic ASSIGN.
Now I begin to describe the step to implement my method:
(I use transaction 'ME21', screen 121 for sample,
the method using is Call Transation Using..)
Step1: go to screen painter to display the screen 121, then we can count the fixed line on this screen, there is 7 lines above the steploop and 2 lines below the steploop, so there are total 9 fixed lines on this screen. This means except these 9 lines, all the other line is for step loop. Then have a look at steploop itselp, one entry of it will occupy two lines.
(Be careful, for table control, the head and the bottom scroll bar will possess another two fixed lines, and there is a maximum number for table line)
Now we have : FixedLine = 9
LoopLine = 2(for table control, LoopLine is always equal to 1)
Step2: go to transaction itself(ME21) to see how it roll page, in ME21, the first line of new page is always occupied by the last line of last page, so it begin with index '02', but in some other case, fisrt line is empty and ready for input.
Now we have: FirstLine = 0
or FirstLine = 1 ( in our case, FirstLine is 1 because the first line of new page is fulfilled)
Step3: write a subroutine calcalculating number of pages
(here, the name of actual parameter is the same as formal parameter)
global data: FixedLine type i, " number of fixed line on a certain screen
LoopLine type i, " the number of lines occupied by one steploop item
FirstLine type i, " possbile value 0 or 1, 0 stand for the first line of new " scrolling screen is empty, otherwise is 1
Dataline type i, " number of items you will use in BDC, using DESCRIBE to get
pageno type i, " you need to scroll screen how many times.
line type i, " number of lines appears on the screen.
index(2) type N, " the screen index for certain item
begin type i, " from parameter of loop
end type i. " to parameter of loop
*in code sample, the DataTable-linindex stands for the table index number of this line
form calpage using FixedLine type i (see step 1)
LoopLine type i (see step 1)
FirstLine type i (see step 2)
DataLine type i ( this is the item number you will enter in transaction)
changing pageno type i (return the number of page, depends on run-time visible line in table control/ Step Loop)
changing line type i.(visible lines one the screen)
data: midd type i,
vline type i, "visible lines
if DataLine eq 0.
Message eXXX.
endif.
vline = ( sy-srows - FixedLine ) div LoopLine.
*for table control, you should compare vline with maximum line of
*table control, then take the small one that is min(vline, maximum)
*here only illustrate step loop
if FirstLine eq 0.
pageno = DataLine div vline.
if pageno eq 0.
pageno = pageno + 1.
endif.
elseif FirstLine eq 1.
pageno = ( DataLine - 1 ) div ( vline - 1 ) + 1.
midd = ( DataLine - 1 ) mod ( vline - 1).
if midd = 0 and DataLine gt 1.
pageno = pageno - 1.
endif.
endif.
line = vline.
endform.
Step4 write a subroutine to calculate the line index for each item.
form calindex using Line type i (visible lines on the screen)
FirstLine type i(see step 2)
LineIndex type i(item index)
changing Index type n. (index on the screen)
if FirstLine = 0.
index = LineIndex mod Line.
if index = '00'.
index = Line.
endif.
elseif FirstLine = 1.
index = LineIndex mod ( Line - 1 ).
if ( index between 1 and 0 ) and LineIndex gt 1.
index = index + Line - 1.
endif.
if Line = 2.
index = index + Line - 1.
endif.
endif.
endform.
Step5 write a subroutine to calculate the loop range.
form calrange using Line type i ( visible lines on the screen)
DataLine type i
FirstLine type i
loopindex like sy-index
changing begin type i
end type i.
If FirstLine = 0.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loopindex gt 1.
begin = Line * ( loopindex - 1 ) + 1.
end = Line * loopindex.
if end gt DataLine.
end = DataLine.
endif.
endif.
elseif FirstLine = 1.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loop index gt 1.
begin = ( Line - 1 ) * ( loopindex - 1 ) + 2.
end = ( Line - 1 ) * ( loopindex - 1 ) + Line.
if end gt DataLine.
end = DataLine.
endif.
endif.
endif.
endform.
Step6 using field sysbol in your BDC, for example: in ME21, but you should calculate each item will correponding to which index in steploop/Table Control
form creat_bdc.
field-symbols: <material>, <quan>, <indicator>.
data: name1(14) value 'EKPO-EMATN(XX)',
name2(14) value 'EKPO-MENGE(XX)',
name3(15) value 'RM06E-SELKZ(XX)'.
assign: name1 to <material>,
name2 to <quan>,
name3 to <indicator>.
do pageno times.
if sy-index gt 1
*insert scroll page ok_code"
endif.
perform calrange using Line DataLine FirstLine sy-index
changing begin end.
loop at DataTable from begin to end.
perform calindex using Line FirstLine DataTable-LineIndex changing Index.
name1+11(2) = Index.
name2+11(2) = Index.
name3+12(2) = Index.
perform bdcfield using <material> DataTable-matnr.
perform bdcfield using <quan> DataTable-menge.
perform bdcfield using <indicator> DataTable-indicator.
endloop.
enddo.
An example abap program of handling Table Control during bdc programming.
REPORT zmm_bdcp_purchaseorderkb02
NO STANDARD PAGE HEADING LINE-SIZE 255.
Declaring internal tables *
*-----Declaring line structure
DATA : BEGIN OF it_dummy OCCURS 0,
dummy(255) TYPE c,
END OF it_dummy.
*-----Internal table for line items
DATA : BEGIN OF it_idata OCCURS 0,
ematn(18), "Material Number.
menge(13), "Qyantity.
netpr(11), "Net Price.
werks(4), "Plant.
ebelp(5), "Item Number.
END OF it_idata.
*-----Deep structure for header data and line items
DATA : BEGIN OF it_me21 OCCURS 0,
lifnr(10), "Vendor A/c No.
bsart(4), "A/c Type.
bedat(8), "Date of creation of PO.
ekorg(4), "Purchasing Organisation.
ekgrp(3), "Purchasing Group.
x_data LIKE TABLE OF it_idata,
END OF it_me21.
DATA : x_idata LIKE LINE OF it_idata.
DATA : v_delimit VALUE ','.
DATA : v_indx(3) TYPE n.
DATA : v_fnam(30) TYPE c.
DATA : v_count TYPE n.
DATA : v_ne TYPE i.
DATA : v_ns TYPE i.
*include bdcrecx1.
INCLUDE zmm_incl_purchaseorderkb01.
Search help for file *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
START-OF-SELECTION.
To upload the data into line structure *
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = it_dummy.
Processing the data from line structure to internal tables *
REFRESH:it_me21.
CLEAR :it_me21.
LOOP AT it_dummy.
IF it_dummy-dummy+0(01) = 'H'.
v_indx = v_indx + 1.
CLEAR it_idata.
REFRESH it_idata.
CLEAR it_me21-x_data.
REFRESH it_me21-x_data.
SHIFT it_dummy.
SPLIT it_dummy AT v_delimit INTO it_me21-lifnr
it_me21-bsart
it_me21-bedat
it_me21-ekorg
it_me21-ekgrp.
APPEND it_me21.
ELSEIF it_dummy-dummy+0(01) = 'L'.
SHIFT it_dummy.
SPLIT it_dummy AT v_delimit INTO it_idata-ematn
it_idata-menge
it_idata-netpr
it_idata-werks
it_idata-ebelp.
APPEND it_idata TO it_me21-x_data.
MODIFY it_me21 INDEX v_indx.
ENDIF.
ENDLOOP.
To open the group *
PERFORM open_group.
To populate the bdcdata table for header data *
LOOP AT it_me21.
v_count = v_count + 1.
REFRESH it_bdcdata.
PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0100',
' ' 'BDC_CURSOR' 'EKKO-LIFNR',
' ' 'BDC_OKCODE' '/00',
' ' 'EKKO-LIFNR' it_me21-lifnr,
' ' 'RM06E-BSART' it_me21-bsart,
' ' 'RM06E-BEDAT' it_me21-bedat,
' ' 'EKKO-EKORG' it_me21-ekorg,
' ' 'EKKO-EKGRP' it_me21-ekgrp,
' ' 'RM06E-LPEIN' 'T'.
PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0120',
' ' 'BDC_CURSOR' 'RM06E-EBELP',
' ' 'BDC_OKCODE' '/00'.
MOVE 1 TO v_indx.
*-----To populate the bdcdata table for line item data
LOOP AT it_me21-x_data INTO x_idata.
CONCATENATE 'EKPO-EMATN(' v_indx ')' INTO v_fnam.
PERFORM subr_bdc_table USING ' ' v_fnam x_idata-ematn.
CONCATENATE 'EKPO-MENGE(' v_indx ')' INTO v_fnam.
PERFORM subr_bdc_table USING ' ' v_fnam x_idata-menge.
CONCATENATE 'EKPO-NETPR(' v_indx ')' INTO v_fnam.
PERFORM subr_bdc_table USING ' ' v_fnam x_idata-netpr.
CONCATENATE 'EKPO-WERKS(' v_indx ')' INTO v_fnam.
PERFORM subr_bdc_table USING ' ' v_fnam x_idata-werks.
v_indx = v_indx + 1.
PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0120',
' ' 'BDC_CURSOR' 'RM06E-EBELP',
' ' 'BDC_OKCODE' '/00'.
ENDLOOP.
PERFORM subr_bdc_table USING: 'X' 'SAPMM06E' '0120',
' ' 'BDC_CURSOR' 'RM06E-EBELP',
' ' 'BDC_OKCODE' '=BU'.
PERFORM bdc_transaction USING 'ME21'.
ENDLOOP.
PERFORM close_group.
End of selection event *
END-OF-SELECTION.
IF session NE 'X'.
*-----To display the successful records
WRITE :/10 text-001. "Sucess records
WRITE :/10 SY-ULINE(20).
SKIP.
IF it_sucess IS INITIAL.
WRITE :/ text-002.
ELSE.
WRITE :/ text-008, "Total number of Succesful records
35 v_ns.
SKIP.
WRITE:/ text-003, "Vendor Number
17 text-004, "Record number
30 text-005. "Message
ENDIF.
LOOP AT it_sucess.
WRITE:/4 it_sucess-lifnr,
17 it_sucess-tabix CENTERED,
30 it_sucess-sucess_rec.
ENDLOOP.
SKIP.
*-----To display the erroneous records
WRITE:/10 text-006. "Error Records
WRITE:/10 SY-ULINE(17).
SKIP.
IF it_error IS INITIAL.
WRITE:/ text-007. "No error records
ELSE.
WRITE:/ text-009, "Total number of erroneous records
35 v_ne.
SKIP.
WRITE:/ text-003, "Vendor Number
17 text-004, "Record number
30 text-005. "Message
ENDIF.
LOOP AT it_error.
WRITE:/4 it_error-lifnr,
17 it_error-tabix CENTERED,
30 it_error-error_rec.
ENDLOOP.
REFRESH it_sucess.
REFRESH it_error.
ENDIF.
CODE IN INCLUDE.
Include ZMM_INCL_PURCHASEORDERKB01
DATA: it_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA: it_MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA: E_GROUP_OPENED.
*-----Internal table to store sucess records
DATA:BEGIN OF it_sucess OCCURS 0,
msgtyp(1) TYPE c,
lifnr LIKE ekko-lifnr,
tabix LIKE sy-tabix,
sucess_rec(125),
END OF it_sucess.
DATA: g_mess(125) type c.
*-----Internal table to store error records
DATA:BEGIN OF it_error OCCURS 0,
msgtyp(1) TYPE c,
lifnr LIKE ekko-lifnr,
tabix LIKE sy-tabix,
error_rec(125),
END OF it_error.
Selection screen
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS session RADIOBUTTON GROUP ctu. "create session
SELECTION-SCREEN COMMENT 3(20) text-s07 FOR FIELD session.
SELECTION-SCREEN POSITION 45.
PARAMETERS ctu RADIOBUTTON GROUP ctu. "call transaction
SELECTION-SCREEN COMMENT 48(20) text-s08 FOR FIELD ctu.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(20) text-s01 FOR FIELD group.
SELECTION-SCREEN POSITION 25.
PARAMETERS group(12). "group name of session
SELECTION-SCREEN COMMENT 48(20) text-s05 FOR FIELD ctumode.
SELECTION-SCREEN POSITION 70.
PARAMETERS ctumode LIKE ctu_params-dismode DEFAULT 'N'.
"A: show all dynpros
"E: show dynpro on error only
"N: do not display dynpro
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 48(20) text-s06 FOR FIELD cupdate.
SELECTION-SCREEN POSITION 70.
PARAMETERS cupdate LIKE ctu_params-updmode DEFAULT 'L'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 3(20) text-s03 FOR FIELD keep.
SELECTION-SCREEN POSITION 25.
PARAMETERS: keep AS CHECKBOX. "' ' = delete session if finished
"'X' = keep session if finished
SELECTION-SCREEN COMMENT 48(20) text-s09 FOR FIELD e_group.
SELECTION-SCREEN POSITION 70.
PARAMETERS e_group(12). "group name of error-session
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 51(17) text-s03 FOR FIELD e_keep.
SELECTION-SCREEN POSITION 70.
PARAMETERS: e_keep AS CHECKBOX. "' ' = delete session if finished
"'X' = keep session if finished
SELECTION-SCREEN END OF LINE.
PARAMETERS:p_file LIKE rlgrap-filename.
at selection screen *
AT SELECTION-SCREEN.
group and user must be filled for create session
IF SESSION = 'X' AND
GROUP = SPACE. "OR USER = SPACE.
MESSAGE E613(MS).
ENDIF.
create batchinput session *
FORM OPEN_GROUP.
IF SESSION = 'X'.
SKIP.
WRITE: /(20) 'Create group'(I01), GROUP.
SKIP.
*----open batchinput group
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = GROUP
USER = sy-uname.
WRITE:/(30) 'BDC_OPEN_GROUP'(I02),
(12) 'returncode:'(I05),
SY-SUBRC.
ENDIF.
ENDFORM. "OPEN_GROUP
end batchinput session *
FORM CLOSE_GROUP.
IF SESSION = 'X'.
*------close batchinput group
CALL FUNCTION 'BDC_CLOSE_GROUP'.
WRITE: /(30) 'BDC_CLOSE_GROUP'(I04),
(12) 'returncode:'(I05),
SY-SUBRC.
ELSE.
IF E_GROUP_OPENED = 'X'.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
WRITE: /.
WRITE: /(30) 'Fehlermappe wurde erzeugt'(I06).
ENDIF.
ENDIF.
ENDFORM. "CLOSE_GROUP
Start new transaction according to parameters *
FORM BDC_TRANSACTION USING TCODE TYPE ANY.
DATA: L_SUBRC LIKE SY-SUBRC.
*------batch input session
IF SESSION = 'X'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = TCODE
TABLES
DYNPROTAB = it_BDCDATA.
WRITE: / 'BDC_INSERT'(I03),
TCODE,
'returncode:'(I05),
SY-SUBRC,
'RECORD:',
SY-INDEX.
ELSE.
REFRESH it_MESSTAB.
CALL TRANSACTION TCODE USING it_BDCDATA
MODE CTUMODE
UPDATE CUPDATE
MESSAGES INTO it_MESSTAB.
L_SUBRC = SY-SUBRC.
WRITE: / 'CALL_TRANSACTION',
TCODE,
'returncode:'(I05),
L_SUBRC,
'RECORD:',
SY-INDEX.
ENDIF.
Message handling for Call Transaction *
perform subr_mess_hand using g_mess.
*-----Erzeugen fehlermappe
IF L_SUBRC <> 0 AND E_GROUP <> SPACE.
IF E_GROUP_OPENED = ' '.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = E_GROUP
USER = sy-uname
KEEP = E_KEEP.
E_GROUP_OPENED = 'X'.
ENDIF.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = TCODE
TABLES
DYNPROTAB = it_BDCDATA.
ENDIF.
REFRESH it_BDCDATA.
ENDFORM. "BDC_TRANSACTION
Form subr_bdc_table *
text
-->P_0220 text *
-->P_0221 text *
-->P_0222 text *
FORM subr_bdc_table USING VALUE(P_0220) TYPE ANY
VALUE(P_0221) TYPE ANY
VALUE(P_0222) TYPE ANY.
CLEAR it_bdcdata.
IF P_0220 = ' '.
CLEAR it_bdcdata.
it_bdcdata-fnam = P_0221.
it_bdcdata-fval = P_0222.
APPEND it_bdcdata.
ELSE.
it_bdcdata-dynbegin = P_0220.
it_bdcdata-program = P_0221.
it_bdcdata-dynpro = P_0222.
APPEND it_bdcdata.
ENDIF.
ENDFORM. " subr_bdc_table
Form subr_mess_hand *
text *
-->P_G_MESS text *
FORM subr_mess_hand USING P_G_MESS TYPE ANY.
LOOP AT IT_MESSTAB.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = it_messtab-msgid
LANG = it_messtab-msgspra
NO = it_messtab-msgnr
v1 = it_messtab-msgv1
v2 = it_messtab-msgv2
IMPORTING
MSG = P_G_MESS
EXCEPTIONS
OTHERS = 0.
CASE it_messtab-msgtyp.
when 'E'.
it_error-error_rec = P_G_MESS.
it_error-lifnr = it_me21-lifnr.
it_error-tabix = v_count.
APPEND IT_ERROR.
when 'S'.
it_sucess-sucess_rec = P_G_MESS.
it_sucess-lifnr = it_me21-lifnr.
it_sucess-tabix = v_count.
APPEND IT_SUCESS.
endcase.
ENDLOOP.
Describe table it_sucess lines v_ns.
Describe table it_error lines v_ne.
ENDFORM. " subr_mess_hand
Also refer
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bdc-table-control-668404
and
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Regards,
srinivas
<b>*reward for useful answers*</b>
Maybe you are looking for
-
How can I use Mac OS 10.4.11 and 10.5.5 back and forth?
I installed Mac OS 10.5.5 onto my G4 Sawtooth, which is running on an upgrade processor at 1.3 GHz and 2 GB RAM. The machine also has been running with Mac OS 10.4.11. I love both Mac OSs. But it is cumbersome to restart the machine back and forth. I
-
How to install tata photon in macbook pro.
plz help me out.
-
MSDAORA,IIS,ORA-12154: TNS:could not resolve service name
Hi All, I have a Web Service that coded in VS2008, using ORACLE DB(9i). At a time the application working fine and I can access and do everything with database. Some other time database server is down for scheduled maintenance. If I try to run the ap
-
Hello forum, Can I use InDesign as a web design tool or should I subscribe to Muse? I would prefer to use the software I've already got. I need to build a simple, clean and attractive site that includes a photo album. Thank you.
-
Beginning Objective-C 2.0
I am new to software development and I would like to beginning programming in Cocoa. I have downloaded Apple's Objective-C 2.0 Tutorial from the Developer Connection website, and I plan to read it before I begin reading a Cocoa tutorial written by Aa