Call transaction inside of call function in back ground task
Hi,
Is it possible to use call transaction statemement inside of call function in back ground task. I am getting error if i use the same. Any help will be highly appreciated.
Hi,
I don't think this is possible. The call goes into error in SM58, what you can try to do is after the function is called, you can submit the program RSARFCEX by setting the user name as sy-uname and other parameters as * and set all the checkboxes.
regards,
Advait
Similar Messages
-
Call function inside of call function in back ground task
Hi Friends,
I am calling one function in back ground task. that is executing after save of the transaction. And inside of that transaction i am calling one more function but in debugging the cursor is not going inside of that function. What could be the reason. Please help me.
Thanks a lot in advance.Hi,
Inside of the first function any way i will come after save
using update task debugging. Once it reach inside of firt function and if i press f5 then second function is coming and if i press f5 there then it is coming out of the function and it is not going inside. The second function is called directly not in back ground.
Thanks.. -
Call transaction inside Update task
<b>Is it possible to use call transaction inside an update function module?</b>
My requirement is like this.
When I execute LB10 storage units will be created..then we have to go to lt09 and then create a TO's there for all these Storage units..
Now, when I try to call a bdc session from an exit, the storage units are not updated there. so the BDC is getting failed..
To resolve this, I kept all the BDC code in to a Zfunction module and made it an update funtion module. I am calling this function module form the exit IN UPDATE TASK.
But the call transaction is not working....
I have tried with L_TO_CREATE_MOVE_SU inside the Z function module..Still no use..
is there any other way that I can solve this?Hi,
Calling a FM in Update Task is one of the bundling techniques used in ABAP to avail functionality provided by SAP Update System. Here all database updates are processed at the end of the SAP LUW in contrast to normal FM call where the database updates are done and commited at the time of call (Database LUW). It is necessary to bundle all your database updates in an SAP LUW e.g. all database updates in a transaction (like VA01) should be bundled. Almost all standard SAP transactions use bundling techniques.
This technique separates the dialog process and update process. The dialog part of the transaction can span more than one screen(one dialog step) and can be processsed by more than one dialog work process. A work process is released when the dialog step changes (screen changes) and the work process sends a database commit (called Implicit Database LUW). So with each screen change there is a database commit and database remains in consistent state.
Now when using bundling technique, when a COMMIT WORK is encountered, system ends the dialog process with a dialog work porcess and starts the update process using an update work process.
The dialog step containing the COMMIT WORK is considerd as the last dialog step of the transaction and all the update function modules are processed now in the last dialog step by the update work process though they were called earlier during the earlier dialog steps.
It is necessary to create update FMs to take advantage of this technique. The update FM is created FM by setting the Update moduleradiobutton in the Attributes tab in SE37.
In a normal FM call, if there are database updates (UPDATE, INSERT, MODIFY, DELETE) than database is commited after the FM processing is over as the FM starts its own Database LUW and ends it too.
<b>Reward Points</b>
Regards -
What is the diffarence between call function in back ground task and call function in update task? Can we do the same functionality by using any one of the above function?
Calling a FM in background task will call FM in background work process as tRFC while calling in update task will call the FM in update work process. The update task will be executed after COMMIT WORK statement. The tRFC FM are will be no. of times (BASIS Settings) till the process executes correctly.
-
How To Finish a back ground task
Hi
I have created a back ground task which mark attendance of specific type in pa30 .what i do is created a bapi and submit that bdc report in it using call transaction. It is working fine . when i see in pa30 after its execution it is marking attendance but in log it shows that step is under process. how can i finish it so that workflow move to next step
Regards
AmmadHi,
when a background task is in process for a long time then probably the method raised a short-dump somewhere.
So investigate this first.
For continuing the flow manually you can use the technical workitem display in the workflow log, put it to change and manually complete that workitem.
Kind regards, Rob Dielemans -
Debugg a back ground task in production
Hi All,
I would like to know what are the different techniques to debugg a back ground task in production? I heard that changing WF_BATCH to dialog user and then dubugg is not a best option since we have limited authorizations in production.
Regards
RKHi Ramakrishna,
IN general the approach what I follow is I create a copy of the work flow which I want to debug and transport it to the PROD system. But the difference would be that in the copied work flow I make all the steps as foreground steps. For this work flow I maintain the agent assignment to user I.e. WF_ADMIN.
Or the person who is holding the role of WF_ADMIN.
The second point here is how do I start the debug work flow instead of main or original work flow. while starting work flow either by using event or directly I would populate a flag into one of container elements.
I check for this flag and if it is true then I raise an event to start test work flow.
This kind of approach can help us in so many ways
1. Without disturbing the original work flow you can change a the steps associated with work flow which is used just for testing and bug fixing.
2. You don't' have to change Work flow customizations , as you mentioned that changing WF-BATCH to some dialogue user. This kind of change can be ignored.
I would recommend that you create a separate package and create a test workflow and move the request to PROD. but make sure you don't trigger test workflow instead of original workflow.
Regards,
Pavan -
Call Transaction not executing in Function Module
Hi,
I am sending an IDoc from non SAP system to SAP system,IDoc calls(Inbound Process Code) Function Module in which i wrote BDC code.i found that it is not calling Call Transaction but when i test the same IDoc from WE19 it executes perfectly and update data in database.
And for this communication i dont have any other option then BDC.
Suggest me what to do
RP1.Check for leading zeros for key fields like material number, vendor number etc .
2. make use of wrappers. check the below link:
https://www.sdn.sap.com/irj/go/km/docs/library/mobile/mobile%20infrastructure/mobile%20development%20kit%202.5/content/appdev/smartsync/bapi_wrapper_types.html -
hi all,
I have a call transaction program for tcode ME55, the probleme is when i execute the program directly via se38 to release the sales documents it work fine, on the other hand when i call the program via SM37 nothing will happen.
thanks,
karimHi,
What exactly do you want to do by calling t.code me55 ? Upload some data in background or display the transaction to a user only ?
If you want to do a call transaction in background, you will have to pass BDC data to it as well. Then transaction will run with the passed data then. To know what data to pass, simply record your transaction in SHDB T.code and create a program for the BDC.
ME55 is a report, so perhaps you can use SUBMIT with the selection parameters in your program to be able run that program in background.
regards,
Advait -
How to get a message from call transaction in RFC call
Hello :
I would like to ask one favor i make a 2 call transaction in a RFC funtion when i make the first CALL TRANSACTION using te next statement.
CALL TRANSACTION 'F-43'
USING bdcdata MESSAGES INTO messtab2 OPTIONS FROM l_fromopt.
I recive the number of the document in the field sy-msgv1 from the message table messtab2 , then i make the second CALL TRANSACTION and i am waiting to get the other number of the document from the table messtab3 using the next statatement.
CALL TRANSACTION 'FIBLFFP'
USING bdcdata MESSAGES INTO messtab3 OPTIONS FROM l_fromopt. but now the table messtab3 don't send the number of document , and i need to get the number of this document for making a REFERENCE.
thanks a lot for you helpFORM bdc_transaction USING tcode TYPE tcode.
DATA: l_mstring(480).
DATA: l_subrc TYPE sy-subrc,
lwa_t100 TYPE t100.
DATA : gv_ctumode TYPE ctu_params-dismode VALUE 'A'.
call transaction using
BREAK-POINT.
REFRESH gt_messtab.
CLEAR gwa_messtab.
gv_ctumode = gc_ctumode.
CALL TRANSACTION tcode USING gi_bdcdata "#EC CI_CALLTA
MODE gv_ctumode
UPDATE gc_cupdate
MESSAGES INTO gt_messtab.
l_subrc = sy-subrc.
IF sy-subrc <> 0.
WRITE: / 'CALL_TRANSACTION',
tcode,
'returncode:',
l_subrc,
'RECORD:',
sy-index.
LOOP AT gt_messtab INTO gwa_messtab.
CLEAR lwa_t100.
SELECT SINGLE * FROM t100 INTO lwa_t100 WHERE sprsl = gwa_messtab-msgspra
AND arbgb = gwa_messtab-msgid
AND msgnr = gwa_messtab-msgnr.
IF sy-subrc = 0.
l_mstring = lwa_t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH gwa_messtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH gwa_messtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH gwa_messtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH gwa_messtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH gwa_messtab-msgv1 INTO l_mstring.
REPLACE '&' WITH gwa_messtab-msgv2 INTO l_mstring.
REPLACE '&' WITH gwa_messtab-msgv3 INTO l_mstring.
REPLACE '&' WITH gwa_messtab-msgv4 INTO l_mstring.
ENDIF.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = gwa_messtab-msgid
lang = sy-langu
no = gwa_messtab-msgnr
v1 = gwa_messtab-msgv1
v2 = gwa_messtab-msgv2
v3 = gwa_messtab-msgv3
v4 = gwa_messtab-msgv4
IMPORTING
msg = l_mstring
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CONDENSE l_mstring.
IF NOT l_mstring IS INITIAL.
WRITE: / gwa_messtab-msgtyp, l_mstring(250).
MESSAGE l_mstring TYPE 'I'.
ENDIF.
ELSE.
WRITE: / gwa_messtab.
ENDIF.
ENDLOOP.
SKIP.
ENDIF. -
How to Call Transaction iView that calls RRMXP from Web Dynpro for ABAP
Dear Experts,,
I'm developing an application in Web Dynpro for ABAP wherein I'm supposed to give a link that should open an SAP Transaction iView that calls tcode = 'RRMXP' and I pass the application parameter as QUERY/WBID = <BI query/Workbook ID>.
I tried calling com.sap.portal.appintegrator.sap.bwc.Transaction iView, but it asks for system/application and GUI type parameters. How to pass through the URL?
Any help would be highly appreciated
Regds,
SriniHi Wolfgang,,
My problem was that I was supposed to call the BeX Web Analyser ( a BI excel based tool - client installation) on click of a button in my WD-ABAP application. I solved it as follows :
In the portal pcd, I cam across a folder content provided by SAP. Here, you'll find standard template iViews that can be used to call applications ( for which you make iViews). I had to call an SAP TCode : RRMXP so as to call a BI Workbook/Query.
So, I called the standard iView template for sap_transaction_iView as follows :
irj/servlet/prt/portal/prtmode/preview/prtroot/'
'pcd!3aportal_content!2fcom.sap.pct!2ftemplates'
'!2fiviews!2fcom.sap.portal.sap_transaction_iview?'
'sap-config-mode=true&System=BWR3System&TCode=RRMXP'
'&GuiType=WinGui&OkCode=y&ApplicationParameter=' <appnm> into url.
l_popup =
l_window_manager->create_external_window( url = url
has_menubar = ' '
has_statusbar = ' '
has_toolbar = ' '
has_location = ' ').
l_popup->open( ).
And , it worked.
Any more help pls feel free to revert.
Regds,
Srini -
Native call crashes inside event call.
When I use this interface without a JFrame, simply calling "goToFilter(5)", it works perfectly. When I call it within the ActionListener, it crashes.
* @author Jason Thomas
* @version 1.0
* Test program for the Java interface to my C++ FilterWheel object.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class FilterWheel
static
System.loadLibrary("filterwheel");
FilterWheel()
FilterInterface.initialize();
final JTextField myField = new JTextField();
JFrame myFrame = new JFrame("Filter Wheel.");
myFrame.setSize(500,500);
myField.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent evt)
String myText = myField.getText();
try
FilterInterface.goToFilter(Integer.parseInt(myText));
catch(NumberFormatException myExtp)
System.err.println("Invalid Numerical value!");
myFrame.getContentPane().add(myField, BorderLayout.SOUTH);
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myFrame.setVisible(true);
FilterInterface.goToFilter(1);
public static void main(String args[])
new FilterWheel();
Exception:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x4C85A87F
Function=(null)+0x4C85A87F
Library=/home/jason/FWheel/Bakup/libfilterwheel.so
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.
Current Java thread:
at FilterInterface.goToFilter(Native Method)
at FilterWheel$1.actionPerformed(FilterWheel.java:32)
at javax.swing.JTextField.fireActionPerformed(JTextField.java:489)
at javax.swing.JTextField.postActionEvent(JTextField.java:670)
at javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:784)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1502)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2422)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2457)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
at java.awt.Component.processEvent(Component.java:4830)
at java.awt.Container.processEvent(Container.java:1525)
at java.awt.Component.dispatchEventImpl(Component.java:3526)
at java.awt.Container.dispatchEventImpl(Container.java:1582)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1700)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:568)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:740)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:673)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:534)
at java.awt.Component.dispatchEventImpl(Component.java:3396)
at java.awt.Container.dispatchEventImpl(Container.java:1582)
at java.awt.Window.dispatchEventImpl(Window.java:1581)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:191)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130) at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
Dynamic libraries:
08048000-0804d000 r-xp 00000000 03:05 659493 /usr/java/j2sdk1.4.0_01/bin/java
0804d000-0804e000 rw-p 00004000 03:05 659493 /usr/java/j2sdk1.4.0_01/bin/java
40000000-40012000 r-xp 00000000 03:05 426018 /lib/ld-2.2.93.so
40012000-40013000 rw-p 00012000 03:05 426018 /lib/ld-2.2.93.so
40013000-4001c000 r-xp 00000000 03:05 53552 /usr/java/j2sdk1.4.0_01/jre/lib/i386/native_threads/libhpi.so
4001c000-4001d000 rw-p 00008000 03:05 53552 /usr/java/j2sdk1.4.0_01/jre/lib/i386/native_threads/libhpi.so
4001d000-4001e000 r--p 00281000 03:05 659901 /usr/lib/locale/locale-archive
4001e000-40027000 r-xp 00000000 03:05 426054 /lib/libnss_files-2.2.93.so
40027000-40028000 rw-p 00008000 03:05 426054 /lib/libnss_files-2.2.93.so
40028000-4002a000 r--s 00000000 03:05 675301 /usr/java/j2sdk1.4.0_01/jre/lib/ext/dnsns.jar
4002c000-40039000 r-xp 00000000 03:05 245766 /lib/i686/libpthread-0.10.so
40039000-4003c000 rw-p 0000d000 03:05 245766 /lib/i686/libpthread-0.10.so
4005d000-4005f000 r-xp 00000000 03:05 429411 /lib/libdl-2.2.93.so
4005f000-40060000 rw-p 00001000 03:05 429411 /lib/libdl-2.2.93.so
40060000-40326000 r-xp 00000000 03:05 545074 /usr/java/j2sdk1.4.0_01/jre/lib/i386/client/libjvm.so
40326000-4048f000 rw-p 002c5000 03:05 545074 /usr/java/j2sdk1.4.0_01/jre/lib/i386/client/libjvm.so
404a3000-404b5000 r-xp 00000000 03:05 429413 /lib/libnsl-2.2.93.so
404b5000-404b6000 rw-p 00012000 03:05 429413 /lib/libnsl-2.2.93.so
404b8000-404ec000 r-xp 00000000 03:05 639250 /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
404ec000-404f8000 rw-p 00033000 03:05 639250 /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
404fa000-4051b000 r-xp 00000000 03:05 245764 /lib/i686/libm-2.2.93.so
4051b000-4051c000 rw-p 00021000 03:05 245764 /lib/i686/libm-2.2.93.so
4051c000-4052d000 r-xp 00000000 03:05 348487 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libverify.so
4052d000-4052f000 rw-p 00010000 03:05 348487 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libverify.so
4052f000-40551000 r-xp 00000000 03:05 348475 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libjava.so
40551000-40553000 rw-p 00021000 03:05 348475 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libjava.so
40555000-40569000 r-xp 00000000 03:05 348488 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libzip.so
40569000-4056c000 rw-p 00013000 03:05 348488 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libzip.so
4056c000-41be9000 r--s 00000000 03:05 675348 /usr/java/j2sdk1.4.0_01/jre/lib/rt.jar
41c2b000-41c42000 r--s 00000000 03:05 675355 /usr/java/j2sdk1.4.0_01/jre/lib/sunrsasign.jar
41c42000-41cb0000 r--s 00000000 03:05 675315 /usr/java/j2sdk1.4.0_01/jre/lib/jsse.jar
41cb0000-41cc3000 r--s 00000000 03:05 675314 /usr/java/j2sdk1.4.0_01/jre/lib/jce.jar
41cc3000-41f44000 r--s 00000000 03:05 675292 /usr/java/j2sdk1.4.0_01/jre/lib/charsets.jar
41fec000-41ffa000 r--s 00000000 03:05 675302 /usr/java/j2sdk1.4.0_01/jre/lib/ext/ldapsec.jar
41ffa000-42000000 r--s 00000000 03:05 983258 /usr/lib/gconv/gconv-modules.cache
42000000-42126000 r-xp 00000000 03:05 245762 /lib/i686/libc-2.2.93.so
42126000-4212b000 rw-p 00126000 03:05 245762 /lib/i686/libc-2.2.93.so
4c333000-4c533000 r--p 00000000 03:05 659901 /usr/lib/locale/locale-archive
4c533000-4c560000 r--p 0024b000 03:05 659901 /usr/lib/locale/locale-archive
4c764000-4c807000 r--s 00000000 03:05 675303 /usr/java/j2sdk1.4.0_01/jre/lib/ext/localedata.jar
4c832000-4c83a000 r--s 00000000 03:05 674028 /usr/java/j2sdk1.4.0_01/jre/lib/ext/comm.jar
4c83a000-4c857000 r--s 00000000 03:05 675304 /usr/java/j2sdk1.4.0_01/jre/lib/ext/sunjce_provider.jar
4c857000-4c85e000 r-xp 00000000 03:05 905031 /home/jason/FWheel/Bakup/libfilterwheel.so
4c85e000-4c860000 rw-p 00006000 03:05 905031 /home/jason/FWheel/Bakup/libfilterwheel.so
4c860000-4c862000 r-xp 00000000 03:05 510719 /usr/X11R6/lib/X11/locale/common/xlcDef.so.2
4c862000-4c863000 rw-p 00001000 03:05 510719 /usr/X11R6/lib/X11/locale/common/xlcDef.so.2
4c879000-4c8f6000 r-xp 00000000 03:05 641516 /usr/lib/libstdc++.so.3
4c8f6000-4c90f000 rw-p 0007c000 03:05 641516 /usr/lib/libstdc++.so.3
4c910000-4c917000 r-xp 00000000 03:05 426049 /lib/libgcc_s-3.2-20020903.so.14c917000-4c918000 rw-p 00007000 03:05 426049 /lib/libgcc_s-3.2-20020903.so.14c918000-4c91a000 r-xp 00000000 03:05 983203 /usr/lib/gconv/ISO8859-1.so
4c91a000-4c91b000 rw-p 00001000 03:05 983203 /usr/lib/gconv/ISO8859-1.so
4c91b000-4cbdc000 r-xp 00000000 03:05 348467 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libawt.so
4cbdc000-4cbf0000 rw-p 002c0000 03:05 348467 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libawt.so
4cc15000-4cc66000 r-xp 00000000 03:05 348483 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libmlib_image.so
4cc66000-4cc67000 rw-p 00050000 03:05 348483 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libmlib_image.so
4cc67000-4cc6e000 r-xp 00000000 03:05 329064 /usr/X11R6/lib/libXp.so.6.2
4cc6e000-4cc6f000 rw-p 00006000 03:05 329064 /usr/X11R6/lib/libXp.so.6.2
4cc6f000-4ccbd000 r-xp 00000000 03:05 328621 /usr/X11R6/lib/libXt.so.6.0
4ccbd000-4ccc1000 rw-p 0004d000 03:05 328621 /usr/X11R6/lib/libXt.so.6.0
4ccc1000-4ccce000 r-xp 00000000 03:05 328605 /usr/X11R6/lib/libXext.so.6.4
4ccce000-4cccf000 rw-p 0000c000 03:05 328605 /usr/X11R6/lib/libXext.so.6.4
4cccf000-4ccd3000 r-xp 00000000 03:05 328623 /usr/X11R6/lib/libXtst.so.6.1
4ccd3000-4ccd4000 rw-p 00004000 03:05 328623 /usr/X11R6/lib/libXtst.so.6.1
4ccd4000-4cdaf000 r-xp 00000000 03:05 328596 /usr/X11R6/lib/libX11.so.6.2
4cdaf000-4cdb2000 rw-p 000da000 03:05 328596 /usr/X11R6/lib/libX11.so.6.2
4cdb2000-4cdba000 r-xp 00000000 03:05 328592 /usr/X11R6/lib/libSM.so.6.0
4cdba000-4cdbb000 rw-p 00007000 03:05 328592 /usr/X11R6/lib/libSM.so.6.0
4cdbb000-4cdcf000 r-xp 00000000 03:05 328550 /usr/X11R6/lib/libICE.so.6.3
4cdcf000-4cdd0000 rw-p 00013000 03:05 328550 /usr/X11R6/lib/libICE.so.6.3
4cdd2000-4ce97000 r-xp 00000000 03:05 348471 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libfontmanager.so
4ce97000-4ceb1000 rw-p 000c4000 03:05 348471 /usr/java/j2sdk1.4.0_01/jre/lib/i386/libfontmanager.so
4cf54000-4cf70000 r-xp 00000000 03:05 510718 /usr/X11R6/lib/X11/locale/common/ximcp.so.2
4cf70000-4cf72000 rw-p 0001b000 03:05 510718 /usr/X11R6/lib/X11/locale/common/ximcp.so.2
Local Time = Thu Feb 13 15:49:51 2003
Elapsed Time = 8
# The exception above was detected in native code outside the VM
# Java VM: Java HotSpot(TM) Client VM (1.4.0_01-b03 mixed mode)
# An error report file has been saved as hs_err_pid2843.log.
# Please refer to the file for further information.
Any help would be greatly appreciated.
-Jason Thomas.Gdb's trace of the cause of all of my problems:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 90124 (LWP 11810)]
0x4c85a89f in outb () from /home/jason/FWheel/libfilterwheel.so
This is what I get from the debugger. I'm using the function outb to write to the parallel port address 0x378, which I've used the function ioperm to permit read/write access to. The program works just fine if I call the "stepFilter" function (that calls outb) outside of the ActionListener's actionPerfomed method. Like if I'm probing for keboard input inside the constructor:
* @author Jason Thomas
* @version 1.0
* Test program for the Java interface to my C++ FilterWheel object.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class FilterWheelTest
static
System.loadLibrary("filterwheel");
FilterWheelTest()
BufferedReader myReader = new BufferedReader(new InputStreamReader(System.in));
String inString;
try
while((inString = myReader.readLine()) != null)
myWheel.goToFilter(Integer.parseInt(inString));
myWheel._delete();
catch(IOException e)
e.printStackTrace();
System.exit(-1);
public static void main(String args[])
new FilterWheelTest();
The program above works fine, the one I posted previously does not. The only difference is that the one I first posted is inside of an ActionListener, and this one is not.
-Jason Thomas. -
Hi All,
Help needed. Im facing a problem in BDC call transaction. Im calling a z screen ie i have developed a modulepool prog. In this I have given a zscreen.
Now by using a call transasction method im calling this screen ie the zscreen and i want to update a z table through a flat file.
the system is able to read the flat file and then im able to read it in my internal table. after this im transfering this internal table content in the BDCtable it is even taking it up but then when im calling the command:
CALL TRANSACTION 'YVTRANS' USING jtab MODE 'A' UPDATE 'S' MESSAGES INTO ktab.
It takes me to the screen connected by the ztcode yvtrans. but no data is coming in the screen . and then vn im inserting the content but nothing happens wat could be the probable error.
This is my code:
*& Report ZBDCCALLTXN1
REPORT zbdccalltxn1.
*& Report ZBDCCALLTXN
*REPORT zbdccalltxn.
PREDEFINED TABLES ***
TABLES:zemp.
INTERNAL TABLE TO UPLOAD FLAT FILE ***
DATA:BEGIN OF itab OCCURS 0,
empno LIKE zemp-empno,
name LIKE zemp-empname,
deptno LIKE zemp-deptid,
deptname LIKE zemp-deptname,
END OF itab.
INTERNAL TABLE FOR MAPPING USING BDCDATA ***
DATA:BEGIN OF jtab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA:END OF jtab.
INTERNAL TABLE FOR ERROR CAPTURING USING BDCMSGCOLL ***
DATA:BEGIN OF ktab OCCURS 0.
INCLUDE STRUCTURE bdcmsgcoll.
DATA:END OF ktab.
FUNCTION MODULE TO UPLAOD FLAT FILE ***
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = 'C:\Documents and Settings\mad13363\Desktop\file.txt'
filetype = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ DATA FROM ITAB ***
LOOP AT itab.
REFRESH jtab.
PERFORM sub USING 'YVTRANS' '0100'.
TRANSFER THE DATA FROM INTERNAL TABLE TO APLLICATION ***
PERFORM sub1.
TO SAVE THE RECORDS IN DB SERVER ***
PERFORM sub1 USING 'BDC_OKCODE' 'INSERT'.
LOGIC TO PROVIDE VALIDATIONS USING BDCDATA, DISPLAY MODE, BDCMSGCOLL ***
CALL TRANSACTION 'YVTRANS' USING jtab MODE 'A' UPDATE 'S' MESSAGES INTO ktab.
LOGIC REQUIRED FOR LOG FILE ***
LOOP AT ktab.
IF ktab-msgtyp = 'I' OR
ktab-msgnr = 000.
WRITE:/1 'VENDOR', 15 itab-empno, 30 'INSERTED'.
ELSEIF ktab-msgtyp = 'E' OR
ktab-msgnr = '001'.
WRITE:/1 'VENDOR', 15 itab-empno, 30 'NOT INSERTED'.
ENDIF.
ENDLOOP.
REFRESH ktab.
ENDLOOP.
FROM TO PASS PRG NAME, SCREEN NUMBER AND FIRST SCREEN ***
FORM sub USING a b.
CLEAR jtab. " CLEAR REFRESHES WORK AREA
jtab-program = a.
jtab-dynpro = b.
jtab-dynbegin = 'X'.
APPEND jtab.
ENDFORM. "SUB
FROM TO PASS FEILD NAME AND FIELD VALUE ***
FORM sub1.
CLEAR jtab.
jtab-fnam = 'zemp-EMPNO'.
jtab-fval = itab-empno.
jtab-program = 'YVTRANS'.
jtab-dynpro = '0100'.
APPEND jtab.CLEAR jtab.
*Passing screen information to BDCDATA
jtab-fnam = 'ZEMP-EMPNAME'.
jtab-fval = itab-name.
jtab-program = 'YVTRANS'.
jtab-dynpro = '0100'.
APPEND jtab.CLEAR jtab.
jtab-fnam = 'ZEMP-DEPTID'.
jtab-fval = itab-deptno.
jtab-program = 'YVTRANS'.
jtab-dynpro = '0100'.
APPEND jtab.CLEAR jtab.
jtab-fnam = 'ZEMP-DEPTNAME'.
jtab-fval = itab-deptname.
jtab-program = 'YVTRANS'.
jtab-dynpro = '0100'.
APPEND jtab.CLEAR jtab.
*Passing BDC_OKCODE to BDCDATA
jtab-fnam = 'BDC_OKCODE'.
jtab-fval = 'INSERT'.
APPEND jtab.CLEAR jtab.
ENDFORM. "sub1
reward for all useful ansHi madhvi,
You are using jtab within the form.. i dont think you can use it directly inside ur FORM sub1 without declaring it or without passing it. and it will give you the syntax error.
and please send me the step by step code you have written in editor so that i can check it and can reply you with proper solution'
Thanks ,
Prasanna -
When do we go for a Call Transaction or Session Method in BDC
Hi All,
Please let me know the scenario when we will go in for
1. Call Transaction
2.Session Method.
What is the main difference between Call Transaction and Session Method
Regardshi,
Use the CALL TRANSACTION USING statement
Summary: With CALL TRANSACTION USING, the system processes the data more quickly than with batch input sessions. Unlike batch input sessions, CALL TRANSACTION USING does not automatically support interactive correction or logging functions.
Your program prepares the data and then calls the corresponding transaction that is then processed immediately.
The most important features of CALL TRANSACTION USING are:
Synchronous processing
Transfer of data from an individual transaction each time the statement CALL TRANSACTION USING is called
You can update the database both synchronously and asynchronously
The program specifies the update type
Separate LUW (logical units of work) for the transaction
The system executes a database commit immediately before and after the CALL TRANSACTION USING statement
No batch input processing log
Create a session on the batch input queue.
Summary: Offers management of sessions, support for playing back and correcting sessions that contain errors, and detailed logging.
Your program prepares the data and stores it in a batch input session. A session is a collection of transaction data for one or more transactions. Batch input sessions are maintained by the system in the batch input queue. You can process batch input sessions in the background processing system.
Your program must open a session in the queue before transferring data to it, and must close it again afterwards. All of these operations are performed by making function module calls from the ABAP program.
The most important aspects of the session interface are:
Asynchronous processing
Transfers data for multiple transactions
Synchronous database update
During processing, no transaction is started until the previous transaction has been written to the database.
A batch input processing log is generated for each session
Sessions cannot be generated in parallel
The batch input program must not open a session until it has closed the preceding session.
<b>Hope this is helpful, DO reward.</b> -
What is the diffreence between call transaction and session method
hi gurus
can any one suggest me
what is the difference between call transaction and session methods
in which cases we have to use teh call transaction and
in which cases we have to use session method.
thank you
regards
kals.CLASSICAL BATCH INPUT (Session Method)
CALL TRANSACTION
BATCH INPUT METHOD:
This method is also called as ‘CLASSICAL METHOD’.
Features:
Asynchronous processing.
Synchronous Processing in database update.
Transfer data for more than one transaction.
Batch input processing log will be generated.
During processing, no transaction is started until the previous transaction has been written to the database.
CALL TRANSACTION METHOD :
This is another method to transfer data from the legacy system.
Features:
Synchronous processing. The system performs a database commit immediately before and after the CALL TRANSACTION USING statement.
Updating the database can be either synchronous or asynchronous. The program specifies the update type.
Transfer data for a single transaction.
Transfers data for a sequence of dialog screens.
No batch input processing log is generated.
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
Among the two methods call transaction is better compared to session bcoz data transfer is faster in it.
Differences between call transaction and session.
Session Method:
1) Data is not updated in the database table until the session is processed.
2) No sy-subrc is returned.
3) Error log is created for error records.
4) Updation is always synchronous.
Call Transaction Method:
1) Immediate updation in the database table.
2) sy-subrc is returned.
3)Error need to be handled explicitly.
4) updation can be synchronous as well as asynchronous.
2) ya u can use using the N mode no screen.
3)u can't handle multiple transaction in call transaction.
4) u can handle multiple transaction in session using the BDC_INSERT fm.
5)When u go to SM35 u can able to see the error records.
Which is best?
That depends on your requirement. Both of them have there advantages.
According to the situation u can choose any one of these.
difference between batch input and call transaction in BDC Session method.
1) synchronous processing.
2) can tranfer large amount of data.
3) processing is slower.
4) error log is created
5) data is not updated until session is processed.
Call transaction.
1) asynchronous processing
2) can transfer small amount of data
3) processing is faster.
4) errors need to be handled explicitly
5) data is updated automatically
For session method,these are the function modules to b used.
BDC_OPEN_GROUP
BDC_INSERT
BDC_CLOSE_GROUP
For call transaction,this is the syntax.
CALL TRANSACTION TCODE USING BDCDATA
MODE A or E or N
UPDATE A or S
MESSAGES INTO MESSTAB.
Take a scenario where we need to post documents in FB01 and the input file has say 2000 records (2000 documents, not line items in FB01 but 2000 records)
In the BDC call transaction method
We call the transaction FB01 2000 times (once for each record posting) and if the processing fails in record no 3 it can be captured and start with reocord 4.
Eg: Loop at itab.
call transaction FB01
capture errors
endloop.
In the session method.
We do not explicity call the transaction 2000 times, but all the records are appeneded into a session and this session is stored. The processinf of the session is done wwhenever the user wants it to be done. Hence the errors cannot be captured in the program itself
Check these link:
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://www.sap-img.com/abap/question-about-bdc-program.htm
http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
http://www.planetsap.com/bdc_main_page.htm
Batch Input Session method is asynchronous as told by others here. But the advantage of this is that you have all the error messages and the data for each transaction held persistantly. You don't have to code anything for processing them or writing the logs.
But at the same time, the same feature can be disadvantageous if you need to react to an error or if there are too many errors to manually correct in a session. Since the session are created in the program and its execution is done seperately, you loose the trackability of such transactions.
With a call transaction, what was a disadvantage above will become an advantage. Call transaction immediately gives you messages back and you can react to it in your program. But the disadvantage is that, if you have several hundreds of transactions to run, running them from within the program can be resource crunching affair. It will hamper the system performance and you cannot really distribute the load. Of course, you have some mechanisms with which you can overcome this, but you will have to code for it. Also, storing the messages and storing the errored transaction data etc will have to be handled by you in the program. Whereas, in batch input session, your program's job is to just create the session, after that everything is standard SAP system's responsibility.
Ideally, you should do a call transaction if the resources are not a problem and if it fails, put the errored transaction into a session.
You can decide based on the data volume that your BDC is processing. If data volume is high go for session else call transaction will do.The call transaction updates will be instantaneous where as session needs to be processed explictly after creation.
Session Method
1) Session method supports both small amount of data aswell as large amount of data
2) data processing is asynchronus and data updation is synchronus.
3) it process multiple apllication while perfomaning validations.
4) in session method data will be updated in data base only after processing session only.
5) system provide by default logfile for handling error records.
6) it supports both foreground aswell as background process
in bdc we use FM ...
bdc_open_group " for creating Session
bdc_insert " adding transaction and bdcdata table for updating database
bdc_close_group " for closing Session
Call Transaction
1) Call transaction exclusively for small amout of data
2) it supports only one apllication while perfoming validations
3) there is no default logfile, We can explicitly provide logic for creating logfile for handling error records.
we can create logfile by using structure....BDCMSGCOLL
4) it doesn't support background processing.
5) data processing is synchronous and Data updation is Synchronous( default), in
this method also supports daya updation in asynchronus process also.
syntax:
Call transaction <transaction-name> using BDCDATA
mode <A/N/E>
update <L/A/S>
messages into BDCMSGCOLL.
BDC:
Batch Data Communication (BDC) is the process of transferring data from one SAP System to another SAP system or from a non-SAP system to SAP System.
Features :
BDC is an automatic procedure.
This method is used to transfer large amount of data that is available in electronic medium.
BDC can be used primarily when installing the SAP system and when transferring data from a legacy system (external system).
BDC uses normal transaction codes to transfer data.
Types of BDC :
CLASSICAL BATCH INPUT (Session Method)
CALL TRANSACTION
BATCH INPUT METHOD:
This method is also called as ‘CLASSICAL METHOD’.
Features:
Asynchronous processing.
Synchronous Processing in database update.
Transfer data for more than one transaction.
Batch input processing log will be generated.
During processing, no transaction is started until the previous transaction has been written to the database.
CALL TRANSACTION METHOD :
This is another method to transfer data from the legacy system.
Features:
Synchronous processing. The system performs a database commit immediately before and after the CALL TRANSACTION USING statement.
Updating the database can be either synchronous or asynchronous. The program specifies the update type.
Transfer data for a single transaction.
Transfers data for a sequence of dialog screens.
No batch input processing log is generated.
For BDC:
http://myweb.dal.ca/hchinni/sap/bdc_home.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
http://www.sap-img.com/abap/learning-bdc-programming.htm
http://www.sapdevelopment.co.uk/bdc/bdchome.htm
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
Check these link:
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://www.sap-img.com/abap/question-about-bdc-program.htm
http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
http://www.planetsap.com/bdc_main_page.htm
call Transaction or session method ?
Check the following links:
http://www.sap-img.com/bdc.htm
See below example code :
Call three FM : BDC_OPEN_GROUP,BDC_INSERT and BDC_CLOSE_GROUP.
Once you execute the program and it creates the session at SM35 Transaction.
Report : ZMPPC011
Type : Data upload
Author : Chetan Shah
Date : 05/05/2005
Transport : DV3K919557
Transaction: ??
Description: This ABAP/4 Program creates new Production Versions
(C223). It accepts tab-delimited spreadsheet input and
creates BDC sessions.
Modification Log
Date Programmer Request # Description
06/10/2005 Chetan Shah DV3K919557 Initial coding
report zmppc011 no standard page heading line-size 120 line-count 55
message-id zz.
pool of form routines
include zmppn001.
Define BDC Table Structure
data: begin of itab_bdc_tab occurs 0.
include structure bdcdata.
data: end of itab_bdc_tab.
Input record layout of Leagcy File
data: begin of itab_xcel occurs 0,
matnr(18) type c,
werks(4) type c,
alnag(2) type c,
verid(4) type c,
text1(40) type c,
bstmi like mkal-bstmi,
bstma like mkal-bstma,
adatu(10) type c,
bdatu(10) type c,
stlal(2) type c,
stlan(1) type c,
serkz(1) type c,
mdv01(8) type c,
elpro(4) type c,
alort(4) type c,
end of itab_xcel.
data: begin of lt_pp04_cache occurs 0,
matnr like itab_xcel-matnr,
werks like itab_xcel-werks,
alnag like itab_xcel-alnag,
plnnr like mapl-plnnr,
arbpl like crhd-arbpl,
ktext like crtx-ktext,
end of lt_pp04_cache.
data: v_ssnnr(4) type n,
v_lines_in_xcel like sy-tabix,
v_ssnname like apqi-groupid,
v_trans_in_ssn type i,
wa_xcel LIKE itab_xcel,
l_tabix like sy-tabix,
v_matnr like rc27m-matnr,
v_plnnr like mapl-plnnr,
v_plnal like mapl-plnal,
v_tcode like sy-tcode value 'C223',
v_plnty like plas-plnty value 'R',
v_objty like crhd-objty value 'A',
v_plpo_steus like plpo-steus value 'PP04',
v_verwe like crhd-verwe value '0007'.
Parameters
selection-screen: skip 3.
selection-screen: begin of block 1 with frame.
parameters: p_name like rlgrap-filename
default 'C:\My Documents\InputFile.txt'
obligatory,
bdc session name prefix
p_bdcpfx(6) default 'ZPVCRT'
obligatory,
number for transction per BDC session
p_trnssn type i
default 2000 obligatory,
retain the BDC session after successfull execution
p_keep like apqi-qerase
default 'X',
user who will be executing BDC session
p_uname like apqi-userid
default sy-uname
obligatory.
selection-screen: end of block 1.
possible entry list (F4 dropdown) for input file name
at selection-screen on value-request for p_name.
*-SELECT FILE FROM USERS LOCAL PC
call function 'WS_FILENAME_GET'
exporting
DEF_FILENAME = ' '
def_path = 'C:\Temp\'
mask = ',.,..'
mode = 'O'
title = 'Select File '(007)
importing
filename = p_name
RC =
exceptions
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
others = 5.
if sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
begin the show
start-of-selection.
read data from input file
perform transfer_xcel_to_itab.
loop at itab_xcel.
hang on to xcel line num
l_tabix = sy-tabix.
each line in the xcel file marks begining of new prod.version defn
if num-of-trnas-in-session = 0, create new BDC session
if v_trans_in_ssn is initial.
perform bdc_session_open.
endif.
begin new bdc script for rtg create trans
fill in bdc-data for prod.version maintenance screens
perform bdc_build_script.
insert the bdc script as a BDC transaction
perform bdc_submit_transaction.
keep track of how many BDC transactions were inserted in the BDC
session
add 1 to v_trans_in_ssn.
if the user-specified num of trans in BDC session is reached OR
if end of input file is reached, close the BDC session
if v_trans_in_ssn = p_trnssn or
l_tabix = v_lines_in_xcel.
perform bdc_session_close.
clear v_trans_in_ssn.
endif.
endloop.
top-of-page.
call function 'Z_HEADER'
EXPORTING
FLEX_TEXT1 =
FLEX_TEXT2 =
FLEX_TEXT3 =
FORM TRANSFER_XCEL_TO_ITAB *
Transfer Xcel Spreadsheet to SAP Internal Table *
form transfer_xcel_to_itab.
Read the tab-delimited file into itab
call function 'WS_UPLOAD'
exporting
filename = p_name
filetype = 'DAT'
IMPORTING
filelength = flength
tables
data_tab = itab_xcel
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
others = 8.
if sy-subrc = 0.
sort the data
sort itab_xcel by matnr werks.
clear v_lines_in_xcel.
if no data in the file - error out
describe table itab_xcel lines v_lines_in_xcel.
if v_lines_in_xcel is initial.
write: / 'No data in input file'.
stop.
endif.
else.
if file upload failed - error out
write: / 'Error reading input file'.
stop.
endif.
endform.
FORM BDC_SESSION_OPEN *
Open BDC Session *
form bdc_session_open.
create bdc session name = prefix-from-selectn-screen + nnnn
add 1 to v_ssnnr.
concatenate p_bdcpfx v_ssnnr into v_ssnname.
open new bdc session
call function 'BDC_OPEN_GROUP'
exporting
client = sy-mandt
group = v_ssnname
keep = p_keep
user = p_uname
exceptions
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
others = 11.
endform.
FORM BDC_BUILD_SCRIPT *
Build BDC *
form bdc_build_script.
data: l_arbpl like crhd-arbpl,
l_text1 like mkal-text1,
l_mdv01 like mkal-mdv01,
l_mapl like mapl.
clear bdc-data itab - begin of new bdc transaction
clear itab_bdc_tab.
refresh itab_bdc_tab.
read material cross reference tables to determine sap part#
clear : v_matnr, v_plnnr, v_plnal.
perform read_matnr_cross_ref using itab_xcel-matnr
itab_xcel-werks
changing v_matnr.
determine the version description to use
if itab_xcel-text1 is initial.
l_text1 = itab_xcel-verid.
else.
l_text1 = itab_xcel-text1.
endif.
determine the routing group# and group ctr# to use
perform read_routing .
determine the production line to use
if itab_xcel-mdv01 is initial.
if not provided in the file then:
prod line = work ctr on the last PP04 op of the rtg determined above
perform read_wc_on_last_pp04 using v_plnnr v_plnal
changing l_mdv01.
NOTE: when executing the above form\routine, if v_plnnr is initial
or v_plnal is initial, THEN l_mdv01 will automatically be
returned blank (ie initial)
else.
l_mdv01 = itab_xcel-mdv01.
endif.
build bdc script
perform bdc_build_script_record
fill in initial screen
using: 'X' 'SAPLCMFV' '1000',
' ' 'BDC_OKCODE' '=ENTE',
' ' 'MKAL-WERKS' itab_xcel-werks,
' ' 'MKAL-MATNR' v_matnr,
' ' 'MKAL_ADMIN-DISPO' space,
' ' 'MKAL-PLNNR' space,
' ' 'MKAL_ADMIN-STTAG' space,
' ' 'MKAL-PLNNG' space,
' ' 'MKAL-MDV01' space,
' ' 'MKAL-PLNNM' space,
click create button on initial screen and go to detail screen
'X' 'SAPLCMFV' '1000',
' ' 'BDC_OKCODE' '=CREA',
fill in the detail screen and go back to initial screen
'X' 'SAPLCMFV' '2000',
' ' 'BDC_OKCODE' '=CLOS',
' ' 'MKAL_EXPAND-MATNR' v_matnr,
' ' 'MKAL_EXPAND-VERID' itab_xcel-verid,
' ' 'MKAL_EXPAND-TEXT1' l_text1,
' ' 'MKAL_EXPAND-BSTMI' itab_xcel-bstmi,
' ' 'MKAL_EXPAND-BSTMA' itab_xcel-bstma,
' ' 'MKAL_EXPAND-ADATU' itab_xcel-adatu,
' ' 'MKAL_EXPAND-BDATU' itab_xcel-bdatu,
' ' 'MKAL_EXPAND-PLTYG' v_plnty,
' ' 'MKAL_EXPAND-PLNNG' v_plnnr,
' ' 'MKAL_EXPAND-ALNAG' v_plnal,
' ' 'MKAL_EXPAND-STLAL' itab_xcel-stlal,
' ' 'MKAL_EXPAND-STLAN' itab_xcel-stlan,
' ' 'MKAL_EXPAND-SERKZ' itab_xcel-serkz,
' ' 'MKAL_EXPAND-MDV01' l_mdv01,
' ' 'MKAL_EXPAND-ELPRO' itab_xcel-elpro,
' ' 'MKAL_EXPAND-ALORT' itab_xcel-alort,
save the production version from initial screen
'X' 'SAPLCMFV' '1000',
' ' 'BDC_OKCODE' '=SAVE'.
endform.
FORM BDC_SUBMIT_TRANSACTION *
Submit BDC Session *
form bdc_submit_transaction.
Load BDC script as a trqansction in BDC session
call function 'BDC_INSERT'
exporting
tcode = v_tcode
tables
dynprotab = itab_bdc_tab
exceptions
internal_error = 01
not_open = 02
queue_error = 03
tcode_invalid = 04.
endform.
FORM BDC_BUILD_SCRIPT_RECORD *
form bdc_build_script_record using dynbegin name value.
clear itab_bdc_tab.
if dynbegin = 'X'.
move: name to itab_bdc_tab-program,
value to itab_bdc_tab-dynpro,
'X' to itab_bdc_tab-dynbegin.
else.
move: name to itab_bdc_tab-fnam,
value to itab_bdc_tab-fval.
shift itab_bdc_tab-fval left deleting leading space.
endif.
append itab_bdc_tab.
endform.
FORM BDC_SESSION_CLOSE *
Close BDC Session *
form bdc_session_close.
close the session
call function 'BDC_CLOSE_GROUP'
exceptions
not_open = 1
queue_error = 2
others = 3.
skip 2.
if sy-subrc ne 0.
write: / 'Error Closing BDC Session ' , 'RETURN CODE: ', sy-subrc.
else.
write : / 'Session created:', v_ssnname,
50 '# of transactions:', v_trans_in_ssn.
endif.
endform.
*& Form read_routing_cache
*FORM read_routing_cache USING pi_matnr
pi_werks
pi_alnag
pi_verid
pi_mdv01.
DATA: BEGIN OF lt_plpo OCCURS 0,
vornr LIKE plpo-vornr,
objty LIKE crhd-objty,
objid LIKE crhd-objid,
arbpl LIKE crhd-arbpl,
END OF lt_plpo,
l_mapl_plnnr LIKE mapl-plnnr.
determine the routing group#
CLEAR lt_pp04_cache.
chk if its in the cache first, if not then get it from MAPL table
and put it in the cache
READ TABLE lt_pp04_cache WITH KEY matnr = pi_matnr
werks = pi_werks
alnag = pi_alnag.
IF sy-subrc = 0.
do nothing - lt_pp04_cache header line has rtg#
ELSE.
get the routing group # from MAPL
SELECT plnnr INTO l_mapl_plnnr
FROM mapl UP TO 1 ROWS
WHERE matnr = pi_matnr AND
werks = pi_werks AND
plnty = 'R' AND
plnal = pi_alnag AND
loekz = space.
ENDSELECT.
put it in the cache internal table
IF NOT l_mapl_plnnr IS INITIAL.
lt_pp04_cache-matnr = pi_matnr.
lt_pp04_cache-werks = pi_werks.
lt_pp04_cache-alnag = pi_alnag.
lt_pp04_cache-plnnr = l_mapl_plnnr.
APPEND lt_pp04_cache.
ENDIF.
ENDIF.
if the rtg# was determined AND
the work center was not determined yet AND
work center was really needed for this line in the input file
then
read the work center from last PP04 operation on the routing
update the cache accordingly
IF NOT lt_pp04_cache-plnnr IS INITIAL AND
lt_pp04_cache-arbpl IS INITIAL AND
( pi_verid IS INITIAL OR
pi_mdv01 IS INITIAL ).
read the last PP04 operation
CLEAR lt_plpo.
REFRESH lt_plpo.
SELECT vornr eobjty eobjid e~arbpl
INTO CORRESPONDING FIELDS OF TABLE lt_plpo
FROM plas AS b
INNER JOIN plpo AS c
ON bplnty = cplnty AND
bplnnr = cplnnr AND
bzaehl = czaehl
INNER JOIN crhd AS e
ON carbid = eobjid
WHERE b~plnty = v_plnty AND
b~plnnr = lt_pp04_cache-plnnr AND
b~plnal = lt_pp04_cache-alnag AND
c~loekz = space AND
c~steus = v_plpo_steus AND
e~objty = v_objty AND
e~werks = lt_pp04_cache-werks AND
e~verwe = v_verwe.
SORT lt_plpo BY vornr DESCENDING.
READ TABLE lt_plpo INDEX 1.
IF NOT lt_plpo-arbpl IS INITIAL.
lt_pp04_cache-arbpl = lt_plpo-arbpl.
read work center description
SELECT SINGLE ktext INTO lt_pp04_cache-ktext
FROM crtx WHERE objty = lt_plpo-objty AND
objid = lt_plpo-objid AND
spras = sy-langu.
the following read will get the index of the correct record to be
updated in the cache
READ TABLE lt_pp04_cache
WITH KEY matnr = pi_matnr
werks = pi_werks
alnag = pi_alnag.
MODIFY lt_pp04_cache
INDEX sy-tabix
TRANSPORTING arbpl ktext.
ENDIF.
ENDIF.
*ENDFORM. " read_last_pp04_operation_cache
*& Form read_routing
form read_routing.
data: begin of lt_mapl occurs 0,
plnnr like mapl-plnnr,
plnal like mapl-plnal,
end of lt_mapl,
l_arbpl like crhd-arbpl.
get all the rtg# and grp ctr# from MAPL
select plnnr plnal
into corresponding fields of table lt_mapl
from mapl
where matnr = v_matnr and
werks = itab_xcel-werks and
plnty = v_plnty and "Rate Routing
loekz = space. "with del flag = OFF
sort lt_mapl by plnal.
if not itab_xcel-verid is initial.
if the verid=0001 then use the 1st good rtg-grp# and grp-ctr#
if itab_xcel-verid = '0001'.
read table lt_mapl index 1.
v_plnnr = lt_mapl-plnnr.
v_plnal = lt_mapl-plnal.
else.
if the verid0001 then use the rtg-grp# and grp-ctr# of the routing
whose work center on the last PP04 operation matches the given verid
loop at lt_mapl.
clear l_arbpl.
get the work center from the last PP04 operation
perform read_wc_on_last_pp04 using lt_mapl-plnnr
lt_mapl-plnal
changing l_arbpl.
if itab_xcel-verid = l_arbpl.
v_plnnr = lt_mapl-plnnr.
v_plnal = lt_mapl-plnal.
exit.
endif.
endloop.
endif.
else.
do nothing
endif.
For version IDs that are other then '0000' or 'ZWIP' :--
if itab_xcel-verid NE '0000' and
itab_xcel-verid NE 'ZWIP'.
if routing group# or group counter was not determined, make the
valid-to date 99/99/9999 so that the BDC, on execution, errors out.
if v_plnnr is initial or
v_plnal is initial.
itab_xcel-bdatu = '99/99/9999'.
endif.
endif.
determine the routing group#
CLEAR lt_pp04_cache.
chk if its in the cache first, if not then get it from MAPL table
and put it in the cache
READ TABLE lt_pp04_cache WITH KEY matnr = pi_matnr
werks = pi_werks
alnag = pi_alnag.
IF sy-subrc = 0.
do nothing - lt_pp04_cache header line has rtg#
ELSE.
get the routing group # from MAPL
put it in the cache internal table
IF NOT l_mapl_plnnr IS INITIAL.
lt_pp04_cache-matnr = pi_matnr.
lt_pp04_cache-werks = pi_werks.
lt_pp04_cache-alnag = pi_alnag.
lt_pp04_cache-plnnr = l_mapl_plnnr.
APPEND lt_pp04_cache.
ENDIF.
ENDIF.
if the rtg# was determined AND
the work center was not determined yet AND
work center was really needed for this line in the input file
then
read the work center from last PP04 operation on the routing
update the cache accordingly
IF NOT lt_pp04_cache-plnnr IS INITIAL AND
lt_pp04_cache-arbpl IS INITIAL AND
( pi_verid IS INITIAL OR
pi_mdv01 IS INITIAL ).
read the last PP04 operation
CLEAR lt_plpo.
REFRESH lt_plpo.
SELECT vornr eobjty eobjid e~arbpl
INTO CORRESPONDING FIELDS OF TABLE lt_plpo
FROM plas AS b
INNER JOIN plpo AS c
ON bplnty = cplnty AND
bplnnr = cplnnr AND
bzaehl = czaehl
INNER JOIN crhd AS e
ON carbid = eobjid
WHERE b~plnty = v_plnty AND
b~plnnr = lt_pp04_cache-plnnr AND
b~plnal = lt_pp04_cache-alnag AND
c~loekz = space AND
c~steus = v_plpo_steus AND
e~objty = v_objty AND
e~werks = lt_pp04_cache-werks AND
e~verwe = v_verwe.
SORT lt_plpo BY vornr DESCENDING.
READ TABLE lt_plpo INDEX 1.
IF NOT lt_plpo-arbpl IS INITIAL.
lt_pp04_cache-arbpl = lt_plpo-arbpl.
read work center description
SELECT SINGLE ktext INTO lt_pp04_cache-ktext
FROM crtx WHERE objty = lt_plpo-objty AND
objid = lt_plpo-objid AND
spras = sy-langu.
the following read will get the index of the correct record to be
updated in the cache
READ TABLE lt_pp04_cache
WITH KEY matnr = pi_matnr
werks = pi_werks
alnag = pi_alnag.
MODIFY lt_pp04_cache
INDEX sy-tabix
TRANSPORTING arbpl ktext.
ENDIF.
ENDIF.
endform. " read_last_pp04_operation_cache
*& Form read_wc_on_last_pp04
form read_wc_on_last_pp04 using pi_plnnr
pi_plnal
changing pe_arbpl.
data: begin of lt_plpo occurs 0,
vornr like plpo-vornr,
objty like crhd-objty,
objid like crhd-objid,
arbpl like crhd-arbpl,
end of lt_plpo.
get all the PP04 operations for the given rtg# & grp-ctr#
select vornr eobjty eobjid e~arbpl
into corresponding fields of table lt_plpo
from plas as b
inner join plpo as c
on bplnty = cplnty and
bplnnr = cplnnr and
bzaehl = czaehl
inner join crhd as e
on carbid = eobjid
where b~plnty = v_plnty and "Rate Routing
b~plnnr = pi_plnnr and
b~plnal = pi_plnal and
c~loekz = space and "Oper Del Flag = OFF
c~steus = v_plpo_steus and "PP04
e~objty = v_objty. "WC Obj Type = 'A'
read the last operation
sort lt_plpo by vornr descending.
read table lt_plpo index 1.
pe_arbpl = lt_plpo-arbpl.
endform. " read_wc_on_last_pp04
Goto LSMW-> Select Direct Input method in 1st step. These are the standard programs for data transfer.
Otherwise goto SPRO->SAP Reference IMG-> Under this you'll find standard data transfer programs module wise.
Regards,
Sunil Kumar Mutyala -
Main diff between call transaction and session method
hi frnds.
my friend went for an interview they asked her whts the diff between call tran adn session?
she told more thn one transaction we can call for an session she told itseems. but he told tht by cal tran also u cn call more thn one tran it seems... so please canu help me out regarding this question? how we hve to tell in interview?
in advance thanks....Hi
Batch Input and CALL TRANSACTION are both data transfer methods. Batch Input usually are used to transfer large amount of data. For example you are implementing a new SAP project, and of course you will need some data transfer from legacy system to SAP system. If there is no standard batch input program, direct input program, you would need to write your own data transfer program and it is going to be batch input program. CALL TRANSACTION methods is real-time method, whenever you run the program CALL TRANSACTION can be triggered. CALL TRANSACTION is used especially for integration actions between two SAP systems or between different modules. Users sometimes wish to do something like that click a button or an item then SAP would inserts or changes data automatically. Here CALL TRANSACTION should be considered. You use CALL TRANSACTION and you do everything automatically, collect necessary data, call transaction and so do database update. If any error occurs, show the user them.
Batch Input
With the Batch Input method, an ABAP program reads the external data that is to be entered in the R/3 System and stores the data in a batch input session. The session records the actions that are required to transfer data into the system using normal SAP transactions.
When the program has generated the session, you can run the session to execute the SAP transactions in it. You can explicitly start and monitor a session with the batch input management function (by choosing System - Services - Batch Input), or have the session run in the background processing session.
It offers management of sessions, support for playing back and correcting sessions that contain errors, and detailed logging. Your program prepares the data and stores it in a batch input session. A session is a collection of transaction data for one or more transactions. Batch input sessions are maintained by the system in the batch input queue. You can process batch input sessions in the background processing system.
Your program must open a session in the queue before transferring data to it, and must close it again afterwards. All of these operations are performed by making function modules calls from the ABAP program.
The most important aspects of the session interface are:
Asynchronous processing
Transfer data for multiple transactions
Synchronous database update. During processing, no transaction is started until the previous transaction has been written to the database.
A batch input processing log is generated for each session
Sessions cannot be generated in parallel. The batch input program must not open a session until it has closed the preceding session.
CALL TRANSACTION
In the second method, your program uses the ABAP statement CALL TRANSACTION USING to run an SAP transaction. External data doesnt have to be deposited in a session for later processing. Instead, the entire batch input process takes place inline in your program. With CALL TRANSACTION USING, the system process the data more quickly than with batch input sessions. Unlike batch input sessions, CALL TRANSACTION USING does not automatically support interactive correction or logging functions.
Your program prepares the data and then calls the corresponding transaction that is then processed immediately.
The most important features of CALL TRANSACTION USING are:
Synchronous processing
Transfer of data from an individual transaction each time the statement CALL TRANSACTION USING is called
You can update the database both synchronously and asynchronously. The program specifies the update type.
Separate LUW (Logical Units of Work) for the transaction. The system executes a database commit immediately before and after the CALL TRANSACTION USING statement.
No batch input processing log
Maybe you are looking for
-
Please send solution tips of my problem my another e-mail. [email protected]
-
I have implemented the below KM report in my local 2004s SP9 portal. I am able to get the report to run but it does not show the number of times each document has been accessed nor does it show who access the document. Is there a service that I need
-
Cfimage and non-english characters
I've been googling for hours and just can not find anything related to this, very strange, I am trying to use ImageDrawText draw Chinese onto an image but could never get it to work, tried so many things, setting the page encoding to UTF-8, cfcontent
-
Hot sync using a new name?
I bought a used z22 after mine was stolen and the HotSnyc comes up in the other persons name. How do I change it. I tried adding my name but when I sync it it didn't take the new name. Post relates to: Palm Z22
-
Error Message ( Error converting a selection internally )
Hello Experts , I have a question ...all the time i try to open a selection at planning book the following message appears Error converting a selection internally Message no. /SAPAPO/MCPSH_SEL029 Some one can help me with this issue PLEASE .... Than